Skip to content

Commit

Permalink
fix button
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandrik committed Mar 14, 2022
1 parent a934c6f commit a17e4dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
29 changes: 0 additions & 29 deletions runregistry_backend/cron/2.save_or_update_runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,35 +271,6 @@ exports.manually_update_a_run = async (
});
};

exports.manually_update_a_run_ongoing = async (
run_number,
{ email, comment, manually_significant, atomic_version }
) => {
// get rr_attributes:
const { data: saved_run } = await axios.get(`${API_URL}/runs/${run_number}`);
const previous_rr_attributes = saved_run.rr_attributes;

if (previous_rr_attributes.state !== 'OPEN') {
throw 'Run must be in state OPEN to be refreshed';
}
// get oms_attributes:
const endpoint = `${OMS_URL}/${OMS_SPECIFIC_RUN(run_number)}`;
const {
data: { data: fetched_run },
} = await instance.get(endpoint, {
headers: {
Authorization: `Bearer ${await getToken()}`,
},
});
const run_oms_attributes = fetched_run[0].attributes;
await exports.update_runs([run_oms_attributes], 0, {
previous_rr_attributes,
email,
comment,
manually_significant,
atomic_version,
});
};



Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,41 @@ class EditRunLumisections extends Component {
}
return (
<div>

<br />
<div
style={{
textAlign: 'center',
}}
>
<Button
onClick={async (evt) => {
const { value } = await Swal({
type: 'warning',
title: `If a status was previously edited by a shifter, it will not be updated, it will only change those untouched.`,
text: '',
showCancelButton: true,
confirmButtonText: 'Yes',
reverseButtons: true,
});
if (value) {
const updated_run = await this.props.refreshRun(
run.run_number
);
await Swal(`Run updated`, '', 'success');
await this.props.showManageRunModal(updated_run);
this.fetchLumisections();
}
}}
type="primary"
>
Manually refresh component's statuses
</Button>
</div>
<br />

{run.significant ? (
<div style={{ overflowX: 'scroll' }}>
<br />
<table className="edit_run_form">
<thead>
<tr className="table_header">
Expand Down Expand Up @@ -111,7 +143,7 @@ class EditRunLumisections extends Component {
<div>
In order to edit a run's lumisections the run{' '}
<i style={{ textDecoration: 'underline' }}>
must be marked significant first
must be marked significant first!
</i>
. <br /> <br />
You can mark a run significant by clicking 'make significant' in the
Expand Down

0 comments on commit a17e4dd

Please sign in to comment.