-
Notifications
You must be signed in to change notification settings - Fork 8
Organizational flags #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Organizational flags #208
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f7dfd51
Small reorganization of GroupInfo page.
b7bf045
Fixing bug in EditGroupFrom (each instance must have its own redux-fo…
10b03db
Button that toggles between regular and organizational groups added t…
11ca192
Structure of GroupDetail page modified to better reflect the needs of…
5d0146d
Visibility switch moved to the bottom of EditAssignment form.
3afd5af
Fixing group links and icons (to reflect organizational flags) on var…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/components/buttons/OrganizationalGroupButton/OrganizationalGroupButton.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { FormattedMessage } from 'react-intl'; | ||
| import GroupIcon from '../../icons/GroupIcon'; | ||
| import LoadingIcon from '../../icons/LoadingIcon'; | ||
| import Button from '../../widgets/FlatButton'; | ||
|
|
||
| const OrganizationalGroupButton = ({ | ||
| organizational, | ||
| pending, | ||
| setOrganizational | ||
| }) => | ||
| <Button | ||
| bsStyle="info" | ||
| onClick={setOrganizational(!organizational)} | ||
| disabled={pending} | ||
| > | ||
| {pending | ||
| ? <LoadingIcon /> | ||
| : <GroupIcon organizational={!organizational} />} | ||
| {organizational === true | ||
| ? <FormattedMessage | ||
| id="app.organizationalGroupButton.unset" | ||
| defaultMessage="Change to Regular Group" | ||
| /> | ||
| : <FormattedMessage | ||
| id="app.organizationalGroupButton.set" | ||
| defaultMessage="Change to Organizational Group" | ||
| />} | ||
| </Button>; | ||
|
|
||
| OrganizationalGroupButton.propTypes = { | ||
| organizational: PropTypes.bool.isRequired, | ||
| pending: PropTypes.bool.isRequired, | ||
| setOrganizational: PropTypes.func.isRequired | ||
| }; | ||
|
|
||
| export default OrganizationalGroupButton; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export default from './OrganizationalGroupButton'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import Icon from 'react-fontawesome'; | ||
|
|
||
| const GroupIcon = props => <Icon {...props} name="users" />; | ||
| const GroupIcon = ({ organizational = false, ...props }) => | ||
| <Icon {...props} name={organizational ? 'sitemap' : 'users'} />; | ||
|
|
||
| GroupIcon.propTypes = { | ||
| organizational: PropTypes.bool | ||
| }; | ||
|
|
||
| export default GroupIcon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/containers/OrganizationalGroupButtonContainer/OrganizationalGroupButtonContainer.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import ImmutablePropTypes from 'react-immutable-proptypes'; | ||
| import { connect } from 'react-redux'; | ||
|
|
||
| import OrganizationalGroupButton from '../../components/buttons/OrganizationalGroupButton'; | ||
| import { setOrganizational } from '../../redux/modules/groups'; | ||
| import { | ||
| groupSelector, | ||
| groupOrganizationalPendingChange | ||
| } from '../../redux/selectors/groups'; | ||
| import ResourceRenderer from '../../components/helpers/ResourceRenderer'; | ||
|
|
||
| const OrganizationalGroupButtonContainer = ({ | ||
| group, | ||
| pending, | ||
| setOrganizational | ||
| }) => | ||
| <ResourceRenderer resource={group}> | ||
| {({ organizational }) => | ||
| <OrganizationalGroupButton | ||
| organizational={organizational} | ||
| pending={pending} | ||
| setOrganizational={setOrganizational} | ||
| />} | ||
| </ResourceRenderer>; | ||
|
|
||
| OrganizationalGroupButtonContainer.propTypes = { | ||
| id: PropTypes.string.isRequired, | ||
| group: ImmutablePropTypes.map, | ||
| pending: PropTypes.bool.isRequired, | ||
| setOrganizational: PropTypes.func.isRequired | ||
| }; | ||
|
|
||
| const mapStateToProps = (state, { id }) => ({ | ||
| group: groupSelector(id)(state), | ||
| pending: groupOrganizationalPendingChange(id)(state) | ||
| }); | ||
|
|
||
| const mapDispatchToProps = (dispatch, { id }) => ({ | ||
| setOrganizational: organizational => () => | ||
| dispatch(setOrganizational(id, organizational)) | ||
| }); | ||
|
|
||
| export default connect(mapStateToProps, mapDispatchToProps)( | ||
| OrganizationalGroupButtonContainer | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export default from './OrganizationalGroupButtonContainer'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any other
placement="bottom"? I'd prefer"top"if it will look decent.