Skip to content
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

fixes #5557: modify status button to show the current status #5574

Merged
merged 5 commits into from
Jul 7, 2021

Conversation

pcanof
Copy link
Contributor

@pcanof pcanof commented Jul 2, 2021

Summary
The set status dropdown is confusing for users becuase they cannot see what the current status is without opening the dropdown. To solve this issue I take the option two that mention in issue #5557 because add another component to the toolbar would cause a mess. To do this I only change the way that Status Menu Button shows the current status of the post and I add a text that says "Current Status:", that maybe it needs to be added to the file where is all the words for translate to another language.

Test plan
well, I add some if conditionals to evaluate the status of the post and depending of that status is the name that will be appear in the dropdown button with an addition of the sentence "Current Status:" And the result you can see it in the following picture.

A picture of a cute animal (not mandatory but encouraged)
Screen Shot 2021-07-02 at 1 16 16 PM

@pcanof pcanof requested a review from a team July 2, 2021 19:36
@erezrokah erezrokah added the type: bug code to address defects in shipped code label Jul 5, 2021
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pchorus! Great progress.

I've added some comments and commits to address them. I've also fixed a bug that caused isUpdatingStatus and isPublishing to always be undefined

Please let me know what you think, cc @bradystroud

} else if ( currentStatus === status.get('PENDING_PUBLISH')) {
buttonText = t('editor.editorToolbar.ready');
} else {
buttonText = isUpdatingStatus ? t('editor.editorToolbar.updating') : t('editor.editorToolbar.setStatus');
Copy link
Contributor

@erezrokah erezrokah Jul 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will be dead code after this PR. Have you managed to reach the block inside this else?

Also, setStatus can probably be removed

? t('editor.editorToolbar.updating')
: t('editor.editorToolbar.setStatus')}
</StatusButton>
<StatusButton>{`Current Stauts: ${buttonText}`}</StatusButton>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not use hard coded strings. Instead add a translation message and key to:
https://github.com/netlify/netlify-cms/blob/574025fd649d49f70650a6112617642a6cb24f07/packages/netlify-cms-locales/src/en/index.js

and use the t to get the translation (see other usages in this file).

@bradystroud
Copy link
Contributor

Hi @erezrokah @pcanof,

This is looking really good. 😄

@erezrokah erezrokah merged commit fbc3728 into decaporg:master Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants