From 10cd53b40ba6065a83fdd2e1fef8bbf2a741ff61 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 25 Apr 2017 14:28:37 -0500 Subject: [PATCH 1/9] Only shows the Loading component when there is no search value --- client/coral-admin/src/containers/Community/People.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-admin/src/containers/Community/People.js b/client/coral-admin/src/containers/Community/People.js index 0011cd704..084e574fb 100644 --- a/client/coral-admin/src/containers/Community/People.js +++ b/client/coral-admin/src/containers/Community/People.js @@ -47,7 +47,7 @@ const People = ({isFetching, commenters, searchValue, onSearchChange, ...props})
- { isFetching && } + { isFetching && (searchValue === null) && } { hasResults ? Date: Tue, 25 Apr 2017 15:54:18 -0600 Subject: [PATCH 2/9] position the reporting popup in a more reliable way --- client/coral-embed-stream/style/default.css | 12 +----------- client/coral-plugin-flags/FlagButton.js | 13 +++++++++++-- client/coral-ui/components/PopupMenu.css | 6 ++++-- client/coral-ui/components/PopupMenu.js | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 087859e89..d1afed204 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -352,17 +352,6 @@ button.comment__action-button[disabled], /* Flag Styles */ -.coral-plugin-flags-container { - position: relative; -} - -.coral-plugin-flags-popup span { - min-width: 280px; - bottom: 36px; - position: absolute; - right: 10px; -} - .coral-plugin-flags-popup-form { margin-bottom: 10px; } @@ -399,6 +388,7 @@ button.comment__action-button[disabled], margin-top: 5px; width: 75%; font-size: 16px; + border: 1px solid #ccc; } /* Close comments */ diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js index 16e616379..e5daf72c9 100644 --- a/client/coral-plugin-flags/FlagButton.js +++ b/client/coral-plugin-flags/FlagButton.js @@ -19,6 +19,12 @@ class FlagButton extends Component { localDelete: false } + componentDidUpdate () { + if (this.popup) { // this will be defined when the reporting popup is opened + this.popup.firstChild.style.top = `${this.flagButton.offsetTop - this.popup.firstChild.clientHeight - 15}px`; + } + } + // When the "report" button is clicked expand the menu onReportClick = () => { const {currentUser, deleteAction, flaggedByCurrentUser, flag} = this.props; @@ -135,7 +141,10 @@ class FlagButton extends Component { const popupMenu = getPopupMenu[this.state.step](this.state.itemType); return
- { this.state.showMenu && -
+
this.popup = ref}>
{popupMenu.header}
{ diff --git a/client/coral-ui/components/PopupMenu.css b/client/coral-ui/components/PopupMenu.css index fe57ba8b2..e7e6416e9 100644 --- a/client/coral-ui/components/PopupMenu.css +++ b/client/coral-ui/components/PopupMenu.css @@ -1,6 +1,7 @@ .popupMenu { - display: inline-block; - width: inherit; + display: block; + position: absolute; + width: 100%; border: solid 1px #999; box-shadow: 3px 3px 5px 0 rgba(0, 0, 0, 0.3); box-sizing: border-box; @@ -8,6 +9,7 @@ border-radius: 3px; padding: 20px 10px; z-index: 3; + left: 0; } .popupMenu:before{ diff --git a/client/coral-ui/components/PopupMenu.js b/client/coral-ui/components/PopupMenu.js index dfc81c3a1..6d4381ffe 100644 --- a/client/coral-ui/components/PopupMenu.js +++ b/client/coral-ui/components/PopupMenu.js @@ -2,5 +2,5 @@ import React from 'react'; import styles from './PopupMenu.css'; export default ({children}) => ( - {children} +
{children}
); From f296fe2abd3898357cc123542000fc6f3a33a1c5 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 25 Apr 2017 16:22:31 -0600 Subject: [PATCH 3/9] update bad username copy --- errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors.js b/errors.js index 6cd8d8da0..67ae0693a 100644 --- a/errors.js +++ b/errors.js @@ -106,7 +106,7 @@ class ErrAuthentication extends APIError { // ErrContainsProfanity is returned in the event that the middleware detects // profanity/wordlisted words in the payload. -const ErrContainsProfanity = new APIError('Suspected profanity. If you think this in error, please let us know!', { +const ErrContainsProfanity = new APIError('This username contains elements which are not permitted in our community. If you think this is in error, please contact us or try again.', { translation_key: 'PROFANITY_ERROR', status: 400 }); From 080766396530b501e51973d51b2c19a60389bc87 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 25 Apr 2017 16:31:33 -0600 Subject: [PATCH 4/9] add z-index to popup --- client/coral-ui/components/PopupMenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-ui/components/PopupMenu.css b/client/coral-ui/components/PopupMenu.css index e7e6416e9..6e7c0f622 100644 --- a/client/coral-ui/components/PopupMenu.css +++ b/client/coral-ui/components/PopupMenu.css @@ -8,7 +8,7 @@ background: white; border-radius: 3px; padding: 20px 10px; - z-index: 3; + z-index: 300; left: 0; } From cea0b4942a6b8c9c51d108f81fc621323517bd80 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Wed, 26 Apr 2017 09:32:00 -0600 Subject: [PATCH 5/9] prevent text overflow --- client/coral-ui/components/PopupMenu.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/coral-ui/components/PopupMenu.css b/client/coral-ui/components/PopupMenu.css index 6e7c0f622..e622f7b2e 100644 --- a/client/coral-ui/components/PopupMenu.css +++ b/client/coral-ui/components/PopupMenu.css @@ -1,7 +1,8 @@ .popupMenu { + white-space: normal; display: block; position: absolute; - width: 100%; + width: 98%; border: solid 1px #999; box-shadow: 3px 3px 5px 0 rgba(0, 0, 0, 0.3); box-sizing: border-box; @@ -9,7 +10,7 @@ border-radius: 3px; padding: 20px 10px; z-index: 300; - left: 0; + left: 1%; } .popupMenu:before{ From ccc512cdddfd13ae27ecb4a407b5fe6ee6c42015 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Wed, 26 Apr 2017 11:43:34 -0600 Subject: [PATCH 6/9] if there is no available translation, do not show error.whatever in the UI --- client/coral-framework/actions/auth.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/actions/auth.js b/client/coral-framework/actions/auth.js index e112b2b6c..b3f374754 100644 --- a/client/coral-framework/actions/auth.js +++ b/client/coral-framework/actions/auth.js @@ -177,7 +177,13 @@ export const fetchSignUp = (formData, redirectUri) => (dispatch) => { dispatch(signUpSuccess(user)); }) .catch(error => { - dispatch(signUpFailure(lang.t(`error.${error.message}`))); + let errorMessage = lang.t(`error.${error.message}`); + + // if there is no translation defined, just show the error string + if (errorMessage === `error.${error.message}`) { + errorMessage = error.message; + } + dispatch(signUpFailure(errorMessage)); }); }; From 0df40c7e356962ef0d4fffdb94e96f2805e1783a Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Wed, 26 Apr 2017 11:50:17 -0600 Subject: [PATCH 7/9] make the popup not full width like before --- client/coral-ui/components/PopupMenu.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/coral-ui/components/PopupMenu.css b/client/coral-ui/components/PopupMenu.css index e622f7b2e..35544fbad 100644 --- a/client/coral-ui/components/PopupMenu.css +++ b/client/coral-ui/components/PopupMenu.css @@ -2,7 +2,8 @@ white-space: normal; display: block; position: absolute; - width: 98%; + max-width: 98%; + min-width: 50%; border: solid 1px #999; box-shadow: 3px 3px 5px 0 rgba(0, 0, 0, 0.3); box-sizing: border-box; @@ -10,7 +11,7 @@ border-radius: 3px; padding: 20px 10px; z-index: 300; - left: 1%; + right: 1%; } .popupMenu:before{ From 6f58754617eb67721dc260afabda1dfef6db06bf Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 26 Apr 2017 14:00:26 -0500 Subject: [PATCH 8/9] Removing the Loading all together. --- client/coral-admin/src/containers/Community/People.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/coral-admin/src/containers/Community/People.js b/client/coral-admin/src/containers/Community/People.js index 084e574fb..3fd486fb6 100644 --- a/client/coral-admin/src/containers/Community/People.js +++ b/client/coral-admin/src/containers/Community/People.js @@ -4,7 +4,6 @@ import translations from 'coral-admin/src/translations.json'; import styles from './Community.css'; import Table from './Table'; -import Loading from './Loading'; import {Pager, Icon} from 'coral-ui'; import EmptyCard from '../../components/EmptyCard'; @@ -47,7 +46,6 @@ const People = ({isFetching, commenters, searchValue, onSearchChange, ...props})
- { isFetching && (searchValue === null) && } { hasResults ?
Date: Wed, 26 Apr 2017 14:25:18 -0500 Subject: [PATCH 9/9] Remove isfetching all together. --- client/coral-admin/src/containers/Community/People.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-admin/src/containers/Community/People.js b/client/coral-admin/src/containers/Community/People.js index 3fd486fb6..e375bac38 100644 --- a/client/coral-admin/src/containers/Community/People.js +++ b/client/coral-admin/src/containers/Community/People.js @@ -28,8 +28,8 @@ const tableHeaders = [ } ]; -const People = ({isFetching, commenters, searchValue, onSearchChange, ...props}) => { - const hasResults = !isFetching && !!commenters.length; +const People = ({commenters, searchValue, onSearchChange, ...props}) => { + const hasResults = !!commenters.length; return (