Improve copy in Purgatory page

Signed-off-by: Alex Paxton <thealexpaxton@gmail.com>
pull/10616/head
Jared Scheib 2017-11-07 23:05:46 -08:00 committed by Alex Paxton
parent 1b52de3c6c
commit a658af21f5
1 changed files with 32 additions and 22 deletions

View File

@ -1,30 +1,38 @@
import React, {PropTypes} from 'react'
import {connect} from 'react-redux'
const Purgatory = ({currentOrganization}) => {
return (
<div>
<div className="auth-page">
<div className="auth-box">
<div className="auth-logo" />
<div className="auth--purgatory">
<h3>
Logged in to <strong>{currentOrganization.name}</strong>
</h3>
<p>
You have not been assigned a Role yet<br />Contact your
Administrator for assistance
</p>
</div>
import {MEMBER_ROLE} from 'src/auth/Authorized'
const memberCopy = (
<p>This role does not grant you sufficient permissions to view Chronograf.</p>
)
const viewerCopy = (
<p>
This organization does not have any configured sources<br />and your role
does not have permission to configure a source.
</p>
)
const Purgatory = ({currentOrganization, role}) =>
<div>
<div className="auth-page">
<div className="auth-box">
<div className="auth-logo" />
<div className="auth--purgatory">
<h3>
Logged in to <strong>{currentOrganization.name}</strong> as a{' '}
<em>{role}</em>.
</h3>
{role === MEMBER_ROLE ? memberCopy : viewerCopy}
<p>Contact your Administrator for assistance.</p>
</div>
<p className="auth-credits">
Made by <span className="icon cubo-uniform" />InfluxData
</p>
<div className="auth-image" />
</div>
<p className="auth-credits">
Made by <span className="icon cubo-uniform" />InfluxData
</p>
<div className="auth-image" />
</div>
)
}
</div>
const {shape, string} = PropTypes
@ -33,10 +41,12 @@ Purgatory.propTypes = {
id: string.isRequired,
name: string.isRequired,
}).isRequired,
role: string.isRequired,
}
const mapStateToProps = ({auth: {me: {currentOrganization}}}) => ({
const mapStateToProps = ({auth: {me: {currentOrganization, role}}}) => ({
currentOrganization,
role,
})
export default connect(mapStateToProps)(Purgatory)