Skip to content

Commit

Permalink
ui: rename the run button
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova committed Feb 11, 2025
1 parent 662e4b8 commit c3e1c93
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
3 changes: 2 additions & 1 deletion invenio_jobs/administration/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class JobsAdminMixin:
"icon": "calendar",
},
"runs": {
"text": "Run now",
"text": "Configure and run",
"modal_text": "Run now",
"payload_schema": RunSchema,
"order": 2,
"icon": "play",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class JobActions extends Component {
labelPosition={labelPos}
>
{!_isEmpty(icon) && <Icon name={icon} />}
{actionConfig.text}
{actionConfig.text}...
</Element>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ export class RunActionForm extends Component {
const jsonData = JSON.parse(resource.default_args);
const { activeIndex } = this.state;
return (
<>
<Formik initialValues={formData} onSubmit={onSubmit}>
{(props) => (
<Formik initialValues={formData} onSubmit={onSubmit}>
{(props) => {
const actions_errors = props?.errors
return (
<>
<Modal.Content>
<SemanticForm
Expand Down Expand Up @@ -128,8 +129,8 @@ export class RunActionForm extends Component {
<Divider />
<Message info>
<Trans>
<b>Custom args:</b> when provided, the input below will
override any arguments specified above.
<b>Custom args:</b> when provided, the input below
will override any arguments specified above.
</Trans>
</Message>
<TextArea
Expand All @@ -151,6 +152,11 @@ export class RunActionForm extends Component {
{!isEmpty(error) && (
<ErrorMessage
{...error}
content={
actions_errors && Object.keys(actions_errors).length > 0
? Object.values(actions_errors)[0]
: error.content
}
removeNotification={this.resetErrorState}
/>
)}
Expand All @@ -163,7 +169,7 @@ export class RunActionForm extends Component {
form="action-form"
loading={loading}
>
{i18next.t(actionConfig.text)}
{i18next.t(actionConfig.modal_text) || i18next.t(actionConfig.text)}
</Button>
<Button
onClick={actionCancelCallback}
Expand All @@ -174,9 +180,9 @@ export class RunActionForm extends Component {
/>
</Modal.Actions>
</>
)}
</Formik>
</>
);
}}
</Formik>
);
}
}
Expand Down

0 comments on commit c3e1c93

Please sign in to comment.