From d1f0557923efb2fa1e774ad1b6a3a590fb94f27d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Dec 2023 12:40:16 +0100 Subject: [PATCH] refs #5666 perf: remove ruleAlias property --- front/core/directives/rule.js | 5 ----- modules/account/front/role/basic-data/index.html | 6 ++---- modules/account/front/role/card/index.spec.js | 4 ++-- modules/account/front/role/descriptor/index.spec.js | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/front/core/directives/rule.js b/front/core/directives/rule.js index d944e13ed..34781c2aa 100644 --- a/front/core/directives/rule.js +++ b/front/core/directives/rule.js @@ -23,7 +23,6 @@ export function directive($translate, $window) { let rule = $attrs.rule.split('.'); let modelName = rule.shift(); let fieldName = rule.shift(); - let modelAlias = $attrs.ruleAlias; let split = $attrs.ngModel.split('.'); if (!fieldName) fieldName = split.pop() || null; if (!modelName) modelName = firstUpper(split.pop() || ''); @@ -31,12 +30,8 @@ export function directive($translate, $window) { if (!modelName || !fieldName) throw new Error(`rule: Cannot retrieve model or field attribute`); - let modelValidations = vnValidations[modelName]; - if (!modelValidations) - modelValidations = vnValidations[modelAlias]; - if (!modelValidations) throw new Error(`rule: Model '${modelName}' doesn't exist`); diff --git a/modules/account/front/role/basic-data/index.html b/modules/account/front/role/basic-data/index.html index 46cb080b7..846f8b455 100644 --- a/modules/account/front/role/basic-data/index.html +++ b/modules/account/front/role/basic-data/index.html @@ -14,15 +14,13 @@ diff --git a/modules/account/front/role/card/index.spec.js b/modules/account/front/role/card/index.spec.js index f39840e5f..f02c08f28 100644 --- a/modules/account/front/role/card/index.spec.js +++ b/modules/account/front/role/card/index.spec.js @@ -1,6 +1,6 @@ import './index'; -describe('component vnRoleCard', () => { +fdescribe('component vnRoleCard', () => { let controller; let $httpBackend; @@ -15,7 +15,7 @@ describe('component vnRoleCard', () => { it('should reload the controller data', () => { controller.$params.id = 1; - $httpBackend.expectGET('Roles/1').respond('foo'); + $httpBackend.expectGET('VnRoles/1').respond('foo'); controller.reload(); $httpBackend.flush(); diff --git a/modules/account/front/role/descriptor/index.spec.js b/modules/account/front/role/descriptor/index.spec.js index e2761c639..eafb96727 100644 --- a/modules/account/front/role/descriptor/index.spec.js +++ b/modules/account/front/role/descriptor/index.spec.js @@ -1,6 +1,6 @@ import './index'; -describe('component vnRoleDescriptor', () => { +fdescribe('component vnRoleDescriptor', () => { let controller; let $httpBackend; @@ -18,7 +18,7 @@ describe('component vnRoleDescriptor', () => { controller.$state.go = jest.fn(); jest.spyOn(controller.vnApp, 'showSuccess'); - $httpBackend.expectDELETE('Roles/1').respond(); + $httpBackend.expectDELETE('VnRoles/1').respond(); controller.onDelete(); $httpBackend.flush();