-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
c0a77f8
to
038be86
Compare
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.
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'); |
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.
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> |
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.
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).
Hi @erezrokah @pcanof, This is looking really good. 😄 |
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)