Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanPospisil committed Dec 6, 2022
1 parent fc5b9d9 commit 4c51ee4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 51 deletions.
49 changes: 24 additions & 25 deletions src/containers/execution-environment-detail/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,32 +222,31 @@ export function withContainerRepo(WrappedComponent) {
description={this.state.repo.description}
permissions={permissions}
onSave={(promise) => {
promise
.then((results) => {
const task = results.find((x) => x.data && x.data.task);
this.setState({
editing: false,
loading: true,
alerts: alerts.concat({
variant: 'success',
title: (
<Trans>
Saved changes to execution environment &quot;
{this.state.repo.name}&quot;.
</Trans>
),
}),
});
if (task) {
waitForTask(
task.data.task.split('tasks/')[1].replace('/', ''),
).then(() => {
this.loadRepo();
});
} else {
this.loadRepo();
}
promise.then((results) => {
const task = results.find((x) => x.data && x.data.task);
this.setState({
editing: false,
loading: true,
alerts: alerts.concat({
variant: 'success',
title: (
<Trans>
Saved changes to execution environment &quot;
{this.state.repo.name}&quot;.
</Trans>
),
}),
});
if (task) {
waitForTask(
task.data.task.split('tasks/')[1].replace('/', ''),
).then(() => {
this.loadRepo();
});
} else {
this.loadRepo();
}
});
}}
onCancel={() => this.setState({ editing: false })}
distributionPulpId={this.state.repo.pulp.distribution.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,30 +449,29 @@ class ExecutionEnvironmentList extends React.Component<
remotePulpId={remoteId}
distributionPulpId={distributionPulpId}
onSave={(promise, form) => {
promise
.then(() => {
this.setState(
{
showRemoteModal: false,
itemToEdit: null,
alerts: alerts.concat({
variant: 'success',
title: isNew ? (
<Trans>
Execution environment &quot;{form.name}&quot; has been
added successfully.
</Trans>
) : (
<Trans>
Saved changes to execution environment &quot;{form.name}
&quot;.
</Trans>
),
}),
},
() => this.queryEnvironments(),
);
});
promise.then(() => {
this.setState(
{
showRemoteModal: false,
itemToEdit: null,
alerts: alerts.concat({
variant: 'success',
title: isNew ? (
<Trans>
Execution environment &quot;{form.name}&quot; has been
added successfully.
</Trans>
) : (
<Trans>
Saved changes to execution environment &quot;{form.name}
&quot;.
</Trans>
),
}),
},
() => this.queryEnvironments(),
);
});
}}
onCancel={() =>
this.setState({
Expand Down
8 changes: 6 additions & 2 deletions src/utilities/map-error-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ export function alertErrorsWithoutFields(
const errors = Object.keys(errorMessages)
.filter((field) => !fields.includes(field))
.map((field) => errorMessages[field]);

if (errors.length) {
addAlert({ variant: 'danger', title: title, description: errors.join("\n") });
addAlert({
variant: 'danger',
title: title,
description: errors.join('\n'),
});
}
return;
}

0 comments on commit 4c51ee4

Please sign in to comment.