Skip to content

Commit

Permalink
[mri_violations] Remove mri violation module tabs (#8399)
Browse files Browse the repository at this point in the history
This simplifies the MRI violation module to only one table instead of having two tabs. It also allows users to edit the MRI violation resolution instead of having to ask a developer every time a resolution needs to be changed.
  • Loading branch information
cmadjar authored Mar 14, 2023
1 parent f2a7808 commit 506b920
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 561 deletions.
6 changes: 3 additions & 3 deletions modules/mri_violations/help/mri_violations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This module displays scans that have been flagged for significant variance from the study protocol. Use the *Selection Filter* section to narrow down your search in the data results table below.

The table contains two tabs: **Not Resolved** and **Resolved**. When a scan is updated to any status other than *Unresolved*, it will move to the **Resolved** tab. You must manually update the status of each *Unresolved* scan, when relevant.

You can click the link in the *Image File* column to view the scan in BrainBrowser. Click **Protocol Violation** in the *Problem* column to view details of the protocol violations issue.
You can click the link in the *Image File* column to view the scan in BrainBrowser.

If you click on the link for any scan of problem type "Could not identify scan type" or "Protocol violation" the module will
display a popup with the details of any problems for that SeriesUID.

Selecting an option in the *Select Resolution* column drop down will set the *Resolution Status* for the violation.
3 changes: 0 additions & 3 deletions modules/mri_violations/help/resolved_violations.md

This file was deleted.

57 changes: 15 additions & 42 deletions modules/mri_violations/jsx/mriViolationsIndex.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {Tabs, TabPane} from 'Tabs';
import Loader from 'Loader';
import FilterableDataTable from 'FilterableDataTable';
import React, {useEffect, useState} from 'react';

import {formatColumnUnresolved, unresolvedFilters}
from './unresolvedViolations.js';
import {formatColumnResolved, resolvedFilters}
from './resolvedViolations.js';
import {formatColumn, violationFilters} from './violations.js';

import ProtocolModal from './protocolModal.js';

Expand All @@ -20,10 +16,6 @@ import ProtocolModal from './protocolModal.js';
function MRIViolationsIndex(props) {
const [fieldOptions, setFieldOptions] = useState({});
const [violationModal, setViolationModal] = useState(false);
const tabs = [
{id: 'notresolved', label: 'Not Resolved'},
{id: 'resolved', label: 'Resolved'},
];

const mapper = columnMapper(fieldOptions);

Expand All @@ -35,33 +27,18 @@ function MRIViolationsIndex(props) {

return <div>
{violationsModal}
<Tabs tabs={tabs} defaultTab="notresolved" updateURL={true}>
<TabPane TabId={tabs[0].id}>
<ViolationsTable
URL={props.unresolvedURL}
name="notresolved"
mapper={mapper}
formatter={formatColumnUnresolved(
mapper,
setViolationModal,
props.ModuleURL + '/resolve'
)}
fields={unresolvedFilters(fieldOptions)}
setFieldOptions={setFieldOptions}
noDynamicTable={true}
/>
</TabPane>
<TabPane TabId={tabs[1].id}>
<ViolationsTable
URL={props.resolvedURL}
name="resolved"
formatter={formatColumnResolved(mapper, setViolationModal)}
fields={resolvedFilters(fieldOptions)}
mapper={mapper}
noDynamicTable={true}
/>
</TabPane>
</Tabs>
<ViolationsTable
URL={props.dataURL}
name="violations"
mapper={mapper}
formatter={formatColumn(
mapper,
setViolationModal,
props.ModuleURL + '/resolve'
)}
fields={violationFilters(fieldOptions)}
setFieldOptions={setFieldOptions}
/>
</div>;
}

Expand Down Expand Up @@ -106,7 +83,6 @@ function ViolationsTable(props) {
fields={props.fields}
getFormattedCell={props.formatter}
getMappedCell={props.mapper}
noDynamicTable={props.noDynamicTable}
/>;
}

Expand Down Expand Up @@ -142,11 +118,8 @@ window.addEventListener('load', () => {
root.render(
<MRIViolationsIndex
ModuleURL={`${loris.BaseURL}/mri_violations/`}
unresolvedURL={`${loris.BaseURL}/mri_violations/?format=json`}
resolvedURL={
`${loris.BaseURL}/mri_violations/resolved_violations?format=json`
}
/>
dataURL={`${loris.BaseURL}/mri_violations/?format=json`}
/>,
);
});

190 changes: 0 additions & 190 deletions modules/mri_violations/jsx/resolvedViolations.js

This file was deleted.

Loading

0 comments on commit 506b920

Please # to comment.