-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Do not allow user to attempt to delete a running job #9758
Do not allow user to attempt to delete a running job #9758
Conversation
@@ -238,6 +238,13 @@ function JobList({ i18n, defaultParams, showTypeColumn = false }) { | |||
onDelete={handleJobDelete} | |||
itemsToDelete={selected} | |||
pluralizedItemName={i18n._(t`Jobs`)} | |||
cannotDelete={item => | |||
item.status === 'running' || |
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.
There's probably more than one status we'll need to check for. Let's use the isJobRunning
util: https://github.com/ansible/awx/blob/devel/awx/ui_next/src/util/jobs.js#L10
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 will also try to use the plural for the error message.
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.
@jakemcdermott, updated.
Build succeeded.
|
Build succeeded.
|
@@ -238,6 +240,19 @@ function JobList({ i18n, defaultParams, showTypeColumn = false }) { | |||
onDelete={handleJobDelete} | |||
itemsToDelete={selected} | |||
pluralizedItemName={i18n._(t`Jobs`)} | |||
cannotDelete={item => |
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.
Since pluralization can be complicated its best to use this syntax.
warningMessage={i18n._( |
Once we upgrade Lingui we will adopt <Plural/>
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.
@AlexSCorey, I saw this syntax. And I attempted to use it. But the string reported during unit-tests was not sane. I will take a better look if I missed something.
Build succeeded.
|
Do not allow user to attempt to delete a running job See: ansible#9187
Build succeeded.
|
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.
Worked as expected 👍🏽
Build succeeded (gate pipeline).
|
Do not allow user to attempt to delete a running job
See: #9187