chore(validate.js): Replace validatejs Meteor package with direct npm import
This commit is contained in:
parent
4e17ac39eb
commit
ea34f2db83
@ -142,7 +142,6 @@ tracker@1.2.0
|
||||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.2.0
|
||||
validatejs@0.0.1
|
||||
webapp@1.6.2
|
||||
webapp-hashing@1.0.9
|
||||
zuuk:stale-session@1.0.8
|
||||
|
||||
@ -128,6 +128,5 @@ tracker@1.2.0
|
||||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.2.0
|
||||
validatejs@0.0.1
|
||||
webapp@1.6.2
|
||||
webapp-hashing@1.0.9
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
active-entry
|
||||
hipaa-audit-log
|
||||
meteor-stale-session
|
||||
validatejs
|
||||
orthanc-remote
|
||||
ohif-cornerstone
|
||||
ohif-viewerbase/client/compatibility
|
||||
ohif-core/client/lib/third-party/
|
||||
ohif-core/client/lib/third-party/
|
||||
|
||||
78
Packages/validatejs/load.js → Packages/ohif-hanging-protocols/client/lib/validate.js
Executable file → Normal file
78
Packages/validatejs/load.js → Packages/ohif-hanging-protocols/client/lib/validate.js
Executable file → Normal file
@ -1,39 +1,39 @@
|
||||
import {validate as v} from './lib/validate.js';
|
||||
|
||||
v.validators.equals = function(value, options, key, attributes) {
|
||||
if (options && value !== options.value) {
|
||||
return key + 'must equal ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
v.validators.doesNotEqual = function(value, options, key) {
|
||||
if (options && value === options.value) {
|
||||
return key + 'cannot equal ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
v.validators.contains = function(value, options, key) {
|
||||
if (options && value.indexOf && value.indexOf(options.value) === -1) {
|
||||
return key + 'must contain ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
v.validators.doesNotContain = function(value, options, key) {
|
||||
if (options && value.indexOf && value.indexOf(options.value) !== -1) {
|
||||
return key + 'cannot contain ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
v.validators.startsWith = function(value, options, key) {
|
||||
if (options && value.startsWith && !value.startsWith(options.value)) {
|
||||
return key + 'must start with ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
v.validators.endsWith = function(value, options, key) {
|
||||
if (options && value.endsWith && !value.endsWith(options.value)) {
|
||||
return key + 'must end with ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate = v;
|
||||
import { validate } from 'validate.js';
|
||||
|
||||
validate.validators.equals = function(value, options, key, attributes) {
|
||||
if (options && value !== options.value) {
|
||||
return key + 'must equal ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.doesNotEqual = function(value, options, key) {
|
||||
if (options && value === options.value) {
|
||||
return key + 'cannot equal ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.contains = function(value, options, key) {
|
||||
if (options && value.indexOf && value.indexOf(options.value) === -1) {
|
||||
return key + 'must contain ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.doesNotContain = function(value, options, key) {
|
||||
if (options && value.indexOf && value.indexOf(options.value) !== -1) {
|
||||
return key + 'cannot contain ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.startsWith = function(value, options, key) {
|
||||
if (options && value.startsWith && !value.startsWith(options.value)) {
|
||||
return key + 'must start with ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
validate.validators.endsWith = function(value, options, key) {
|
||||
if (options && value.endsWith && !value.endsWith(options.value)) {
|
||||
return key + 'must end with ' + options.value;
|
||||
}
|
||||
};
|
||||
|
||||
export { validate };
|
||||
@ -2,6 +2,7 @@
|
||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||
|
||||
// Local imports
|
||||
import { validate } from '../lib/validate.js';
|
||||
import '../customAttributes';
|
||||
|
||||
/**
|
||||
|
||||
@ -4,6 +4,10 @@ Package.describe({
|
||||
version: '0.0.1'
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
'validate.js': '0.9.0'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.versionsFrom('1.4');
|
||||
|
||||
@ -16,7 +20,6 @@ Package.onUse(function(api) {
|
||||
api.use('natestrauser:select2@4.0.1', 'client');
|
||||
api.use('clinical:router@2.0.19');
|
||||
api.use('momentjs:moment');
|
||||
api.use('validatejs');
|
||||
|
||||
// Our custom packages
|
||||
api.use('ohif:core');
|
||||
|
||||
@ -13,8 +13,6 @@ Package.onUse(function(api) {
|
||||
api.use('stylus');
|
||||
api.use('random');
|
||||
|
||||
api.use('validatejs');
|
||||
|
||||
// Template overriding
|
||||
api.use('aldeed:template-extension@4.0.0');
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ Package.onUse(function(api) {
|
||||
'jquery',
|
||||
'stylus',
|
||||
'momentjs:moment',
|
||||
'validatejs',
|
||||
'cultofcoders:persistent-session'
|
||||
]);
|
||||
|
||||
@ -230,7 +229,6 @@ Package.onTest(function(api) {
|
||||
'jquery',
|
||||
'mongo',
|
||||
'momentjs:moment',
|
||||
'validatejs',
|
||||
'cultofcoders:persistent-session'
|
||||
], 'client');
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,16 +0,0 @@
|
||||
Package.describe({
|
||||
name: 'validatejs',
|
||||
summary: 'OHIF Validatejs temporary',
|
||||
version: '0.0.1'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.versionsFrom('1.3.5.1');
|
||||
|
||||
api.use('ecmascript');
|
||||
|
||||
api.addFiles('lib/validate.js', 'client');
|
||||
api.addFiles('load.js', 'client');
|
||||
|
||||
api.export('validate', 'client');
|
||||
});
|
||||
@ -127,6 +127,5 @@ tracker@1.2.0
|
||||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.2.0
|
||||
validatejs@0.0.1
|
||||
webapp@1.6.2
|
||||
webapp-hashing@1.0.9
|
||||
|
||||
Loading…
Reference in New Issue
Block a user