diff --git a/ui/src/auth/Purgatory.js b/ui/src/auth/Purgatory.js index 67cf013406..020e61148f 100644 --- a/ui/src/auth/Purgatory.js +++ b/ui/src/auth/Purgatory.js @@ -5,7 +5,7 @@ import {withRouter} from 'react-router' import {meChangeOrganizationAsync} from 'shared/actions/auth' -import {MEMBER_ROLE} from 'src/auth/Authorized' +import PurgatoryAuthItem from 'src/auth/PurgatoryAuthItem' const getRoleNameByOrgID = (id, roles) => { const role = roles.find(r => r.organization === id) @@ -60,34 +60,12 @@ class Purgatory extends Component { {rolesAndOrgs.length ?
- {rolesAndOrgs.map(rag => -
-
-
- {rag.organization.name} -
-
- {rag.role} -
-
- {rag.role === MEMBER_ROLE - ? - Contact your Admin
for access -
- : } -
+ {rolesAndOrgs.map((rag, i) => + )}
:

You are a Lost Soul

} diff --git a/ui/src/auth/PurgatoryAuthItem.js b/ui/src/auth/PurgatoryAuthItem.js new file mode 100644 index 0000000000..260ff0582a --- /dev/null +++ b/ui/src/auth/PurgatoryAuthItem.js @@ -0,0 +1,47 @@ +import React, {PropTypes} from 'react' + +import {MEMBER_ROLE} from 'src/auth/Authorized' + +const PurgatoryAuthItem = ({roleAndOrg, onClickLogin}) => +
+
+
+ {roleAndOrg.organization.name} +
+
+ {roleAndOrg.role} +
+
+ {roleAndOrg.role === MEMBER_ROLE + ? + Contact your Admin
for access +
+ : } +
+ +const {bool, func, shape, string} = PropTypes + +PurgatoryAuthItem.propTypes = { + roleAndOrg: shape({ + organization: shape({ + name: string, + id: string, + }), + role: string, + currentOrganization: bool, + }).isRequired, + onClickLogin: func.isRequired, +} + +export default PurgatoryAuthItem