wip on react transition 7

This commit is contained in:
Erik Ziegler committed 2018-12-02 08:23:43 +01:00
1 parent 765abfd572
commit 9ae5dd25ce
21 files changed
+74 -55

No files matched your search

@@ -1,5 +1,4 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { OHIF } from 'meteor/ohif:core';
// Local imports
@@ -19,7 +18,7 @@ HP.Protocol = class Protocol {
*/
constructor(name) {
// Create a new UUID for this Protocol
this.id = Random.id();
this.id = OHIF.utils.guid();
// Store a value which determines whether or not a Protocol is locked
// This is probably temporary, since we will eventually have role / user
@@ -133,7 +132,7 @@ HP.Protocol = class Protocol {
fromObject(input) {
// Check if the input already has an ID
// If so, keep it. It not, create a new UUID
this.id = input.id || Random.id();
this.id = input.id || OHIF.utils.guid();
// Assign the input name to the Protocol
this.name = input.name;
@@ -1,5 +1,4 @@
import { Random } from 'meteor/random';
import { OHIF } from 'meteor/ohif:core';
import { comparators } from '../lib/comparators';
const EQUALS_REGEXP = /^equals$/;
@@ -30,7 +29,7 @@ export class Rule {
*/
constructor(attribute, constraint, required, weight) {
// Create a new UUID for this Rule
this.id = Random.id();
this.id = OHIF.utils.guid();
// Set the Rule's weight (defaults to 1)
this.weight = weight || 1;
@@ -69,7 +68,7 @@ export class Rule {
fromObject(input) {
// Check if the input already has an ID
// If so, keep it. It not, create a new UUID
this.id = input.id || Random.id();
this.id = input.id || OHIF.utils.guid();
// Assign the specified input data to the Rule
this.required = input.required;
@@ -80,7 +79,7 @@ export class Rule {
/**
* Get the constraint info object for the current constraint
* @return {Object\undefined} Constraint object or undefined if current constraint
* @return {Object\undefined} Constraint object or undefined if current constraint
* is not valid or not found in comparators list
*/
getConstraintInfo() {
@@ -141,7 +140,7 @@ export class Rule {
*/
getConstraintValidatorAndValue() {
let validatorAndValue = this._validatorAndValue;
// Check if validator and value are cached already
if (validatorAndValue !== void 0) {
return validatorAndValue;
@@ -1,4 +1,4 @@
import { Random } from 'meteor/random';
import { OHIF } from 'meteor/ohif:core';
/**
* A Stage is one step in the Display Set Sequence for a Hanging Protocol
@@ -10,7 +10,7 @@ import { Random } from 'meteor/random';
HP.Stage = class Stage {
constructor(ViewportStructure, name) {
// Create a new UUID for this Stage
this.id = Random.id();
this.id = OHIF.utils.guid();
// Assign the name and ViewportStructure provided
this.name = name;
@@ -62,7 +62,7 @@ HP.Stage = class Stage {
fromObject(input) {
// Check if the input already has an ID
// If so, keep it. It not, create a new UUID
this.id = input.id || Random.id();
this.id = input.id || OHIF.utils.guid();
// Assign the input name to the Stage
this.name = input.name;
@@ -84,4 +84,4 @@ HP.Stage = class Stage {
});
}
}
};
};
@@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { Random } from 'meteor/random';
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
@@ -14,7 +13,7 @@ function updateProtocolSelect() {
if (!ProtocolEngine) {
return;
}
// Loop through the available hanging protocols
// to create an array with the protocols that includes
// a property labelled 'text', so that Select2 has something
@@ -85,7 +84,7 @@ Template.protocolEditor.helpers({
// Make sure that the number of referenced priors is correct
ProtocolEngine.protocol.updateNumberOfPriorsReferenced();
// Otherwise, return the active Hanging Protocol
return ProtocolEngine.protocol;
},
@@ -147,7 +146,7 @@ Template.protocolEditor.helpers({
stage.viewports.push(viewport);
}
}
// Return the current Stage model for the active Protocol
return ProtocolEngine.getCurrentStageModel();
},
@@ -169,7 +168,7 @@ Template.protocolEditor.events({
protocol.name = 'New (created ' + moment().format('h:mm:ss a') + ')';
// Change the Protocol ID from the default value
protocol.id = Random.id();
protocol.id = OHIF.utils.guid();
// Insert the protocol
HP.ProtocolStore.addProtocol(protocol);
@@ -321,7 +320,7 @@ Template.protocolEditor.events({
// and fire the callback function when finished.
openTextEntryDialog(title, instructions, currentValue, function(value) {
// Create a new ID for the protocol
protocol.id = Random.id();
protocol.id = OHIF.utils.guid();
// Update the name with the entered text
protocol.name = value;