refs #5666 test: fix e2e tests
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2023-12-05 12:00:31 +01:00
parent 7a63e527a5
commit 035b31d878
4 changed files with 15 additions and 7 deletions

View File

@ -23,7 +23,7 @@ export function directive($translate, $window) {
let rule = $attrs.rule.split('.'); let rule = $attrs.rule.split('.');
let modelName = rule.shift(); let modelName = rule.shift();
let fieldName = rule.shift(); let fieldName = rule.shift();
let modelAlias = $attrs.ruleAlias;
let split = $attrs.ngModel.split('.'); let split = $attrs.ngModel.split('.');
if (!fieldName) fieldName = split.pop() || null; if (!fieldName) fieldName = split.pop() || null;
if (!modelName) modelName = firstUpper(split.pop() || ''); if (!modelName) modelName = firstUpper(split.pop() || '');
@ -31,8 +31,12 @@ export function directive($translate, $window) {
if (!modelName || !fieldName) if (!modelName || !fieldName)
throw new Error(`rule: Cannot retrieve model or field attribute`); throw new Error(`rule: Cannot retrieve model or field attribute`);
let modelValidations = vnValidations[modelName]; let modelValidations = vnValidations[modelName];
if (!modelValidations)
modelValidations = vnValidations[modelAlias];
if (!modelValidations) if (!modelValidations)
throw new Error(`rule: Model '${modelName}' doesn't exist`); throw new Error(`rule: Model '${modelName}' doesn't exist`);

View File

@ -7,6 +7,7 @@
<form <form
name="form" name="form"
ng-submit="watcher.submit()" ng-submit="watcher.submit()"
class="vn-w-md"> class="vn-w-md">
<vn-card class="vn-pa-lg"> <vn-card class="vn-pa-lg">
<vn-vertical> <vn-vertical>
@ -14,12 +15,15 @@
label="Name" label="Name"
ng-model="$ctrl.role.name" ng-model="$ctrl.role.name"
rule rule
rule-alias="VnRole"
vn-focus> vn-focus>
</vn-textfield> </vn-textfield>
<vn-textfield <vn-textfield
label="Description" label="Description"
ng-model="$ctrl.role.description" ng-model="$ctrl.role.description"
rule> rule
rule-alias="VnRole"
>
</vn-textfield> </vn-textfield>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

@ -13,13 +13,13 @@
<vn-vertical> <vn-vertical>
<vn-textfield <vn-textfield
label="Name" label="Name"
ng-model="$ctrl.role.name" ng-model="$ctrl.VnRole.name"
rule rule
vn-focus> vn-focus>
</vn-textfield> </vn-textfield>
<vn-textfield <vn-textfield
label="Description" label="Description"
ng-model="$ctrl.role.description" ng-model="$ctrl.VnRole.description"
rule> rule>
</vn-textfield> </vn-textfield>
</vn-vertical> </vn-vertical>

View File

@ -24,4 +24,4 @@
on-accept="$ctrl.onDelete()" on-accept="$ctrl.onDelete()"
question="Are you sure you want to continue?" question="Are you sure you want to continue?"
message="Role will be removed"> message="Role will be removed">
</vn-confirm> </vn-confirm>