chore(validate.js): Replace validatejs Meteor package with direct npm import

This commit is contained in:
Bruno Alves de Faria 2018-08-17 11:11:15 -03:00 committed by Erik Ziegler
parent 4e17ac39eb
commit ea34f2db83
11 changed files with 45 additions and 1151 deletions

View File

@ -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

View File

@ -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

View File

@ -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/

View 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 };

View File

@ -2,6 +2,7 @@
import { Viewerbase } from 'meteor/ohif:viewerbase';
// Local imports
import { validate } from '../lib/validate.js';
import '../customAttributes';
/**

View File

@ -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');

View File

@ -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');

View File

@ -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

View File

@ -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');
});

View File

@ -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