mirror of https://github.com/rancher/dashboard.git
16 lines
554 B
JavaScript
16 lines
554 B
JavaScript
import isEmpty from 'lodash/isEmpty';
|
|
|
|
export function flowOutput(spec, getters, errors, validatorArgs) {
|
|
const verifyLocal = validatorArgs.includes('verifyLocal');
|
|
const localOutputRefs = spec.localOutputRefs || [];
|
|
const globalOutputRefs = spec.globalOutputRefs || [];
|
|
|
|
if (verifyLocal) {
|
|
if (isEmpty(localOutputRefs) && isEmpty(globalOutputRefs)) {
|
|
errors.push(getters['i18n/t']('validation.flowOutput.both'));
|
|
}
|
|
} else if (isEmpty(globalOutputRefs)) {
|
|
errors.push(getters['i18n/t']('validation.flowOutput.global'));
|
|
}
|
|
}
|