Skip to content

Commit 84f8bf9

Browse files
committed
Define-XML 2.1 update
1 parent 3c04e3d commit 84f8bf9

24 files changed

Lines changed: 870 additions & 528 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ app/static/devExtensions
1717
.tern-project
1818
.eslintcache
1919
jest.config.js
20+
.vscode

app/.vscode/launch.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"name": "Debug Main Process",
6-
"type": "node",
7-
"request": "launch",
8-
"cwd": "${workspaceRoot}",
9-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
10-
"windows": {
11-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
12-
},
13-
"args" : ["."]
14-
}
15-
]
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug Main Process",
6+
"type": "node",
7+
"request": "launch",
8+
"cwd": "${workspaceFolder}",
9+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
10+
"windows": {
11+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
12+
},
13+
"args" : ["."],
14+
"outputCapture": "std"
15+
}
16+
]
1617
}

app/components/utils/redoUndo.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class RedoUndoConnected extends React.Component {
233233
className={classes.actionList}
234234
onClose={ (event) => { this.setState({ actionHistoryAnchor: null }); } }
235235
>
236-
{ this.state.currentActionHistory.map((step, index) => (
236+
{ this.state.currentActionHistory.slice(-1 * this.props.historyLength).map((step, index) => (
237237
<MenuItem
238238
key={index}
239239
onClick={() => { this.goToStep(index); }}
@@ -254,9 +254,9 @@ class RedoUndoConnected extends React.Component {
254254
>
255255
<SnackbarContent
256256
ContentProps={{
257-
'aria-describedby': 'message-id',
257+
'aria-describedby': 'history-id',
258258
}}
259-
message={<span id="message-id" className={classes.message}>Undo: {this.state.actionLabel}</span>}
259+
message={<span id="history-id" className={classes.message}>Undo: {this.state.actionLabel}</span>}
260260
className={classes.details}
261261
/>
262262
</Snackbar>

app/constants/help.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export const STD_MDV_LANG_ATTRIBUTES = {
300300
content: `
301301
* **Name (Required)**. Name of the described metadata. For example, <code>Study XXX, updated ADaM and ARM submission.</code>
302302
* **Description (Optional)**. Additional metadata description. For Define-XML 2.0 can be used to describe information about Controlled Terminology used or additional standards.
303+
* **Comment (Optional) (Define-XML 2.1)** - Additional comment describing specifics of the metadata version.
303304
* **Language (Optional)** - Language used for Define-XML text elements (TranslatedText). If left as blank, values from the original Define-XML are sed used. In this case for all new elements 'en' value is used.
304305
`
305306
};
@@ -319,6 +320,8 @@ export const STD_STANDARD = {
319320
content: `
320321
* **Name (Required)**. Name of a standard implementation guide.
321322
* **Version (Required)**. Version of the implementation guide.
323+
* **Status (Optional) (Define-XML 2.1)**. Publishing status of the standard..
324+
* **Comment (Optional) (Define-XML 2.1)**. Comment clarifying why the standard is used.
322325
* **Analysis Results Metadata (Optional)**. When using ADaM-IG, it is possible to enable ARM support for Define-XML.
323326
`
324327
};

app/constants/stdConstants.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ const standardNames = {
5757
],
5858
};
5959

60+
const standardStatuses = [
61+
'DRAFT',
62+
'FINAL',
63+
'PROVISIONAL'
64+
];
65+
6066
const originTypes = {
6167
'ADaM': [
6268
'Derived',
@@ -157,6 +163,7 @@ const stdConstants = {
157163
dataTypes,
158164
codeListTypes,
159165
standardNames,
166+
standardStatuses,
160167
documentTypes,
161168
columns,
162169
originTypes,

app/core/defineStructure.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ class Comment extends BasicFunctions {
440440
codeLists: [],
441441
metaDataVersion: [],
442442
analysisResults: [],
443+
standards: [],
443444
};
444445
}
445446
}
@@ -636,6 +637,7 @@ class Standard {
636637
this.publishingSet = publishingSet;
637638
this.version = version;
638639
this.isDefault = isDefault;
640+
this.status = status;
639641
this.commentOid = commentOid;
640642
}
641643
}
@@ -754,8 +756,8 @@ class ItemGroup extends BasicFunctions {
754756
this.archiveLocationId = archiveLocationId;
755757
this.commentOid = commentOid;
756758
this.isNonStandard = isNonStandard;
757-
this.hasNoData = hasNoData;
758-
this.standardOid = standardOid;
759+
this.hasNoData = hasNoData; // 2.1D
760+
this.standardOid = standardOid; // 2.1D
759761
this.descriptions = descriptions;
760762
this.itemRefs = itemRefs;
761763
this.itemRefOrder = itemRefOrder;

app/core/navigationBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ConnectedNavigationBar extends React.Component {
5151
const { classes } = this.props;
5252
return (
5353
<AppBar position="fixed" color='default'>
54-
<Grid container justify='flex-start' alignItems='center'>
54+
<Grid container justifyContent='flex-start' alignItems='center'>
5555
<Grid item className={classes.menu}>
5656
<IconButton
5757
color='default'
@@ -63,7 +63,7 @@ class ConnectedNavigationBar extends React.Component {
6363
</Grid>
6464
{this.props.children !== undefined && (
6565
<Grid item xs={10}>
66-
<Grid container justify='flex-start' alignItems='center'>
66+
<Grid container justifyContent='flex-start' alignItems='center'>
6767
{this.renderChildElements()}
6868
</Grid>
6969
</Grid>

app/editors/descriptionEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class ConnectedDescriptionEditor extends React.Component {
153153
<Grid item xs={12} className={classes.gridItem}>
154154
<Divider/>
155155
</Grid>
156-
{ (this.props.enableProgrammingNote || this.state.noteState !== undefined) && [(
156+
{ ((this.props.enableProgrammingNote || this.state.noteState !== undefined) && this.props.type !== 'metaDataVersion') && [(
157157
<Grid item xs={12} className={classes.gridItem} key='note'>
158158
<NoteEditor noteState={this.state.noteState} onUpdate={this.handleChange('noteState')}/>
159159
</Grid>

app/editors/metaDataVersionEditor.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ import Typography from '@material-ui/core/Typography';
1919
import Paper from '@material-ui/core/Paper';
2020
import List from '@material-ui/core/List';
2121
import ListItem from '@material-ui/core/ListItem';
22-
import ListItemText from '@material-ui/core/ListItemText';
2322
import TextField from '@material-ui/core/TextField';
2423
import EditingControlIcons from 'editors/editingControlIcons.js';
25-
import { getDescription } from 'utils/defineStructureUtils.js';
24+
import CommentEditor from 'editors/commentEditor.js';
2625

2726
const styles = theme => ({
2827
metaDataVersion: {
@@ -46,6 +45,8 @@ class MetaDataVersionEditor extends React.Component {
4645
handleChange = (name) => (event) => {
4746
if (name === 'description' && event.target.value === '') {
4847
this.setState({ [name]: undefined });
48+
} else if (name === 'comment') {
49+
this.setState({ [name]: event });
4950
} else {
5051
this.setState({ [name]: event.target.value });
5152
}
@@ -80,7 +81,7 @@ class MetaDataVersionEditor extends React.Component {
8081
/>
8182
</Typography>
8283
<List>
83-
<ListItem dense>
84+
<ListItem>
8485
<TextField
8586
label='Name'
8687
value={this.state.name}
@@ -101,6 +102,14 @@ class MetaDataVersionEditor extends React.Component {
101102
className={classes.inputField}
102103
/>
103104
</ListItem>
105+
{ defineVersion === '2.1.0' &&
106+
<ListItem>
107+
<CommentEditor
108+
onUpdate={this.handleChange('comment')}
109+
comment={this.state.comment}
110+
/>
111+
</ListItem>
112+
}
104113
<ListItem dense>
105114
<TextField
106115
label='Language'
@@ -111,11 +120,6 @@ class MetaDataVersionEditor extends React.Component {
111120
className={classes.inputField}
112121
/>
113122
</ListItem>
114-
{ defineVersion === '2.1.0' &&
115-
<ListItem>
116-
<ListItemText primary='Comment' secondary={getDescription(this.state.comment)}/>
117-
</ListItem>
118-
}
119123
</List>
120124
</Paper>
121125
);

app/editors/simpleInputEditor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class SimpleInputEditor extends React.Component {
4949
}
5050

5151
this.props.onUpdate(value);
52+
this.setState({ value });
5253
}
5354

5455
render () {
@@ -76,7 +77,7 @@ class SimpleInputEditor extends React.Component {
7677

7778
if (lengthLimit !== undefined && this.state.value !== undefined) {
7879
if (this.state.value.length > lengthLimit.maxLength) {
79-
let issueText = `Value length is ${this.state.value.length}, which exceeds ${lengthLimit.maxLength} characters.`;
80+
let issueText = `Text length is ${this.state.value.length}, the maximum length is ${lengthLimit.maxLength}.`;
8081
issues.push(issueText);
8182
lengthLimitReached = true;
8283
}

0 commit comments

Comments
 (0)