Skip to content
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

[bot] Fast-forward for 23.11.7 #684

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion snprc_ehr/resources/data/id_type.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ value description sort_order objectid modified
35 Shave marker 0 3378404D-8210-4C2B-9FEF-C89FB3EBB52F 2017-09-25 10:30:13.153
36 UID Chip # 2 8C102167-10BF-4C0A-963D-D9A9DE3D6AFD 2018-02-01 11:05:01.503
37 Envigo 37 3395F06B-D1A7-40D2-8B14-B83A2DCE18AA 2019-08-21 08:37:13.650
38 Wake Forest 38 F6D430CE-9949-490B-97B9-54CADD78A4AE 2020-02-19 08:57:39.367
38 Wake Forest 38 F6D430CE-9949-490B-97B9-54CADD78A4AE 2020-02-19 08:57:39.367
40 TNPRC Id 40 A1ECF635-6E6F-4A2A-BF45-6134D5F57B24 2021-02-18 17:05:41.190
41 FDA CBER tattoo 41 18B78AFF-F732-479B-8664-CF9CF6CD6BB9 2021-07-19 09:04:28.713
42 Tri-Service Research 42 C1EFE5E5-7DAB-4999-B6F4-72E310654D4F 2021-11-17 14:41:02.723
43 WaNPRC Id 43 A95A5509-F649-4D5E-A9B1-B7B8B3B61FC3 2022-11-29 14:53:10.313
44 NIRC ID 44 96059563-146F-4AE1-AE00-4B01D792BC44 2022-12-02 11:17:26.057
45 Bioculture tattoo 45 DD21023B-B74A-4737-816E-38E4B3E76DD8 2023-04-26 09:13:45.140
29 changes: 17 additions & 12 deletions snprc_scheduler/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE snprc_scheduler.StudyDayNotes
DROP COLUMN QcState
GO
10 changes: 8 additions & 2 deletions snprc_scheduler/resources/schemas/snprc_scheduler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
<column columnName="LeadTech"/>
<column columnName="Notes"/>
<column columnName="SchedulerNotes"/>
<column columnName="QcState"/>
<column columnName="QcState">
<fk>
<fkDbSchema>core</fkDbSchema>
<fkTable>DataStates</fkTable>
<fkColumnName>RowId</fkColumnName>
<fkDisplayColumnName>Label</fkDisplayColumnName>
</fk>
</column>
<column columnName="Created"/>
<column columnName="CreatedBy"/>
<column columnName="Modified"/>
Expand Down Expand Up @@ -124,7 +131,6 @@
<column columnName="StudyDayNote">
<nullable>false</nullable>
</column>
<column columnName="QcState"/>
<column columnName="Created"/>
<column columnName="CreatedBy"/>
<column columnName="Modified"/>
Expand Down
8 changes: 3 additions & 5 deletions snprc_scheduler/src/client/components/ProjectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
*/
import React from 'react';
import PropTypes from 'prop-types'
import ReactDataGrid from 'react-data-grid';
import Glyphicon from 'react-bootstrap/lib/Glyphicon'
import {
selectProject,
filterProjects,
sortProjects,
createAction,
PROJECT_SELECTED,
selectTimeline, TAB_TIMELINES, TAB_PROJECTS, setForceRerender
selectTimeline,
TAB_PROJECTS,
setForceRerender
} from '../actions/dataActions';
import connect from "react-redux/es/connect/connect";
import {BootstrapTable, TableHeaderColumn} from "react-bootstrap-table";
Expand Down
6 changes: 3 additions & 3 deletions snprc_scheduler/src/client/components/TimelineDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TimelineDetails extends React.Component {

handleDraftCheck = (e) => {
this.props.onUpdateSelectedTimeline({
[e.target.id]: e.target.checked === true ? 4 : 1,
[e.target.id]: e.target.checked === true ? "In Progress" : "Completed",
IsDirty: true
}, true)
};
Expand Down Expand Up @@ -133,8 +133,8 @@ class TimelineDetails extends React.Component {
</div>
<div className='col-sm-6 zero-side-padding'>
<div className='col-sm-5 zero-side-padding'><ControlLabel ref='timeline-draft-state'>Draft</ControlLabel></div>
<div className='col-sm-7 zero-side-padding'><FormControl type='checkbox' id='QcState' style={{width: '20px', height: '20px'}}
checked={timeline.QcState ? (timeline.QcState === 4) : false}
<div className='col-sm-7 zero-side-padding'><FormControl type='checkbox' id='QcStateLabel' style={{width: '20px', height: '20px'}}
checked={timeline.QcStateLabel ? (timeline.QcStateLabel === "In Progress") : "Completed"}
onChange={this.handleDraftCheck}
disabled={!timeline.RowId || timeline.IsInUse}
/></div>
Expand Down
35 changes: 24 additions & 11 deletions snprc_scheduler/src/client/components/TimelineGrid.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import ReactDataGrid from "react-data-grid";
import {Button, Modal, OverlayTrigger, Tooltip} from "react-bootstrap";
// import DraggableContainer from "./dnd/DraggableContainer";
import { Button, Modal, OverlayTrigger, Tooltip } from "react-bootstrap";
import { DraggableContainer } from "./dnd/DraggableContainer";
import Moment from 'react-moment';
import {
addTimelineItem,
Expand Down Expand Up @@ -89,10 +89,15 @@ class TimelineGrid extends React.Component {
procNote: "",
rowId: undefined,
revisionNum: undefined,
day0: ""
day0: "",
key: 0
}
}

getGridKey = () => {
return Math.random();
};

CheckBoxFormatter = (colKey) => {

return ((props) => {
Expand Down Expand Up @@ -277,7 +282,8 @@ class TimelineGrid extends React.Component {
})

this.setState(Object.assign({}, this.state, {
rows: newRows
rows: newRows,
key: this.getGridKey()
}));

this.props.selectedTimeline.forceReload = false;
Expand Down Expand Up @@ -412,6 +418,7 @@ class TimelineGrid extends React.Component {
allRows = newState.rows;

newState.columns = sortedCols;
newState.key = this.getGridKey();
this.setState(Object.assign({}, this.state, newState));
}

Expand Down Expand Up @@ -488,6 +495,7 @@ class TimelineGrid extends React.Component {
stateCopy.showProcNote = false;
stateCopy.procNoteName = "";
stateCopy.rows = newRows;
stateCopy.key = this.getGridKey();

this.setState(stateCopy);

Expand Down Expand Up @@ -524,6 +532,7 @@ class TimelineGrid extends React.Component {

this.setState(state => {
state.rows = filteredRows;
state.key = this.getGridKey();
return state;
});

Expand Down Expand Up @@ -563,8 +572,9 @@ class TimelineGrid extends React.Component {
}

state.rows = newRows;
state.key = this.getGridKey();
return state;
})
});

this.props.onAssignTimelineProcedure({
Value: rowCopy[column.key],
Expand All @@ -590,7 +600,7 @@ class TimelineGrid extends React.Component {
this.props.onUpdateTimelineDayZero(selectedTimeline.StudyDay0, true, true);
}

const stateCopy = {rows: [...rows]};
const stateCopy = {rows: [...rows], key: this.getGridKey()};
this.setState(stateCopy);
};

Expand All @@ -614,6 +624,7 @@ class TimelineGrid extends React.Component {
this.props.onAddTimelineItem(newRow);

stateCopy.rows.push(newRow);
stateCopy.key = this.getGridKey();

this.setState(stateCopy);

Expand Down Expand Up @@ -645,7 +656,8 @@ class TimelineGrid extends React.Component {
this.setState(emptyColumns);

const reorderedColumns = Object.assign({}, this.state, {
columns: stateCopy.columns
columns: stateCopy.columns,
key: this.getGridKey()
});
this.setState(reorderedColumns);

Expand All @@ -668,7 +680,7 @@ class TimelineGrid extends React.Component {
};

setSort = (sortColumn, sortDirection) => {
this.sortRows(this.state.rows, sortColumn, sortDirection, true);
this.sortRows(this.state.rows, sortColumn, undefined, sortDirection, true);
};

sortRows = (initialRows, sortColumn, sortMinorColumn, sortDirection, setState) => {
Expand Down Expand Up @@ -724,7 +736,8 @@ class TimelineGrid extends React.Component {
this.setState(Object.assign({}, this.state, {
rows: sortedRows,
sortDirection: sortDirection,
sortColumn: sortColumn
sortColumn: sortColumn,
key: this.getGridKey()
}));
}

Expand Down Expand Up @@ -778,7 +791,7 @@ class TimelineGrid extends React.Component {
<div className='col-sm-10' />
</div>
<div className='col-sm-12 zero-side-padding'>
{/*<DraggableContainer onHeaderDrop={this.onHeaderDrop}>*/}
<DraggableContainer onHeaderDrop={this.onHeaderDrop} key={this.state.key}>
<ReactDataGrid
columns={columns}
rowGetter={i => rows[i]}
Expand All @@ -791,7 +804,7 @@ class TimelineGrid extends React.Component {
onRowClick={this.onRowClick}
emptyRowsView={this.EmptyRowsView}
/>
{/*</DraggableContainer>*/}
</DraggableContainer>
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions snprc_scheduler/src/client/components/TimelineList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class TimelineList extends React.Component {
}
})
}
else if (selectedTimeline.QcState !== 4) {
else if (selectedTimeline.QcStateLabel !== "In Progress") {
showAlert({
title: 'Delete Error',
msg: 'Cannot delete ' + selectedTimeline.Description + ', ' + selectedTimeline.RevisionNum + ', it is not in draft state. ' +
Expand Down Expand Up @@ -477,7 +477,7 @@ class TimelineList extends React.Component {

// Add keys for any rows not selected
for (const row of revTable.state.data) {
if (selections.length < 1 || selections[0] !== row.RevisionNum || me.props.selectedTimeline.QcState !== 4) {
if (selections.length < 1 || selections[0] !== row.RevisionNum || me.props.selectedTimeline.QcStateLabel !== "In Progress") {
nonEdit.push(row.RevisionNum)
}
}
Expand Down
24 changes: 14 additions & 10 deletions snprc_scheduler/src/client/components/dnd/DraggableContainer.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import React from 'react';
import PropTypes from 'prop-types';
import html5DragDropContext from './html5DragDropContext';
import { html5DragDropContext } from './html5DragDropContext';
import DraggableHeaderCell from './DraggableHeaderCell';

class DraggableContainer extends React.Component {
class DraggableContainerImpl extends React.Component {

child = React.Children.only(this.props.children);

render() {
return React.cloneElement(
React.Children.only(this.props.children), {
...this.props,
draggableHeaderCell: DraggableHeaderCell
}
);
return (
<>
{React.cloneElement(this.child, {...this.props, draggableHeaderCell: DraggableHeaderCell})}
</>
)
}
}

DraggableContainer.propTypes = {
DraggableContainerImpl.propTypes = {
children: PropTypes.element.isRequired
};

export default html5DragDropContext(DraggableContainer);
export const DraggableContainer = (props) => {
return html5DragDropContext(<DraggableContainerImpl {...props}/>);
}

This file was deleted.

11 changes: 11 additions & 0 deletions snprc_scheduler/src/client/components/dnd/html5DragDropContext.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';

export const html5DragDropContext = (Component) => {
return (
<DndProvider backend={HTML5Backend}>
{Component}
</DndProvider>
);
}
8 changes: 4 additions & 4 deletions snprc_scheduler/src/client/reducers/timelineReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const cloneTimeline = (source, revision) => {
RowId: revision ? source.RowId : 0,
RevisionNum: revision,
Description: source.Description + (revision ? '': ' Clone'),
QcState: 4,
QcStateLabel: "In Progress",
IsDirty: true,
ObjectId: undefined,
CreatedByName: undefined,
Expand Down Expand Up @@ -101,7 +101,7 @@ export default (state = { }, action) => {
// Add rowid, timelineitems, timelineprojectitems and timelineanimalitems for UI
for (const tl of nextState.timelines) {
tl.RowId = tl.TimelineId;
tl.savedDraft = (tl.QcState === 4);
tl.savedDraft = (tl.QcStateLabel === "In Progress");


if (!tl.TimelineItems) {
Expand Down Expand Up @@ -139,7 +139,7 @@ export default (state = { }, action) => {
Description: "New Timeline",
IsDeleted: false,
IsDirty: true,
QcState: 4,
QcStateLabel: "In Progress",
TimelineAnimalItems: [],
StudyDayNotes: [],
TimelineItems: [{RowIdx: 1, StudyDay: 0, ScheduleDate: null, IsDirty: true, IsDeleted: false}]
Expand Down Expand Up @@ -218,7 +218,7 @@ export default (state = { }, action) => {
// Set rowid for UI display
action.payload.RowId = action.payload.TimelineId;
action.payload.IsDirty = false;
action.payload.savedDraft = (action.payload.QcState === 4);
action.payload.savedDraft = (action.payload.QcStateLabel === "In Progress");

// Update list of timelines
let timelines = nextState.timelines.map((timeline) => {
Expand Down
Loading
Loading