Valeriia Ruban 663a5642c2
[UI]: update Ember to 3.27 (#16227)
* Upgrade to 3.25 via ember-cli-update

* v3.25.3...v3.26.1

* v3.26.1...v3.27.0


Co-authored-by: Michael Klein <michael@firstiwaslike.com>
2023-02-10 13:32:19 -08:00

22 lines
751 B
JavaScript

import { validatePresence, validateLength } from 'ember-changeset-validations/validators';
import validateSometimes from 'consul-ui/validations/sometimes';
export default {
'*': [
validateSometimes(validatePresence(true), function () {
const action = this.get('Action') || '';
const permissions = this.get('Permissions') || [];
if (action === '' && permissions.length === 0) {
return true;
}
return false;
}),
],
SourceName: [validatePresence(true), validateLength({ min: 1 })],
DestinationName: [validatePresence(true), validateLength({ min: 1 })],
Permissions: [
validateSometimes(validateLength({ min: 1 }), function (changes, content) {
return !this.get('Action');
}),
],
};