Skip to content

Commit

Permalink
Rename loadingState to userReadyState
Browse files Browse the repository at this point in the history
`loadingState` for the workflow selector doesn't really tell us what is being loaded from the API. `userReadyState` is more accurate and consistent with `subjectReadyState` used elsewhere in the code.
  • Loading branch information
eatyourgreens committed Jan 7, 2021
1 parent 3901a9f commit d78c1b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const markdownzComponents = {
}

function WorkflowSelector (props) {
const { loadingState, workflows } = props
const { userReadyState, workflows } = props
const loaderColor = props.theme.global.colors.brand
const workflowDescription = props.workflowDescription || counterpart('WorkflowSelector.message')

Expand All @@ -30,7 +30,7 @@ function WorkflowSelector (props) {
{workflowDescription}
</Markdownz>

{(loadingState === asyncStates.error) && (
{(userReadyState === asyncStates.error) && (
<Box
align='center'
justify='center'
Expand All @@ -40,7 +40,7 @@ function WorkflowSelector (props) {
</Box>
)}

{(loadingState === asyncStates.success) && (
{(userReadyState === asyncStates.success) && (
<Box
alignSelf='start'
fill='horizontal'
Expand All @@ -64,7 +64,7 @@ function WorkflowSelector (props) {
</Box>
)}

{(![asyncStates.success, asyncStates.error].includes(loadingState)) && (
{(![asyncStates.success, asyncStates.error].includes(userReadyState)) && (
<Box align='center' justify='center' margin={{ top: 'small' }}>
<Box height='xxsmall' width='xxsmall'>
<Bars
Expand All @@ -81,7 +81,7 @@ function WorkflowSelector (props) {
}

WorkflowSelector.propTypes = {
loadingState: string,
userReadyState: string,
workflowDescription: string,
workflows: arrayOf(shape({
id: string.isRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import WorkflowSelector from './WorkflowSelector'
function storeMapper(stores) {
const { project, user } = stores.store
return {
loadingState: user.loadingState,
userReadyState: user.loadingState,
workflowDescription: project.workflow_description
}
}
Expand All @@ -23,7 +23,7 @@ class WorkflowSelectorContainer extends Component {
}

WorkflowSelectorContainer.propTypes = {
loadingState: string,
userReadyState: string,
workflowDescription: string
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Component > Hero > WorkflowSelector > WorkflowSelectorContainer', func
before(function () {
wrapper = shallow(
<WorkflowSelectorContainer
loadingState='success'
userReadyState='success'
workflowDescription={WORKFLOW_DESCRIPTION}
/>
)
Expand All @@ -33,6 +33,6 @@ describe('Component > Hero > WorkflowSelector > WorkflowSelectorContainer', func
})

it('should pass down the user loading state', function () {
expect(componentWrapper.prop('loadingState')).to.equal('success')
expect(componentWrapper.prop('userReadyState')).to.equal('success')
})
})

0 comments on commit d78c1b7

Please sign in to comment.