diff --git a/frontend/app/components/api/api-v3/api-v3.config.ts b/frontend/app/components/api/api-v3/api-v3.config.ts index 210137f6f9..adbfe9ae11 100644 --- a/frontend/app/components/api/api-v3/api-v3.config.ts +++ b/frontend/app/components/api/api-v3/api-v3.config.ts @@ -26,7 +26,7 @@ // See doc/COPYRIGHT.rdoc for more details. // ++ -import {opApiModule} from "../../../angular-modules"; +import {opApiModule} from '../../../angular-modules'; function apiV3Config(apiV3, HalResource) { apiV3.addResponseInterceptor((data, operation, what) => { diff --git a/frontend/app/components/api/api-v3/hal-link/hal-link.service.test.ts b/frontend/app/components/api/api-v3/hal-link/hal-link.service.test.ts index 4076bdd3c4..7a1c61b5d2 100644 --- a/frontend/app/components/api/api-v3/hal-link/hal-link.service.test.ts +++ b/frontend/app/components/api/api-v3/hal-link/hal-link.service.test.ts @@ -26,8 +26,8 @@ // See doc/COPYRIGHT.rdoc for more details. //++ -import {opApiModule, opServicesModule} from "../../../../angular-modules"; -import {HalLink} from "./hal-link.service"; +import {opApiModule, opServicesModule} from '../../../../angular-modules'; +import {HalLink} from './hal-link.service'; const expect = chai.expect; @@ -91,7 +91,7 @@ describe('HalLink service', () => { hello: 'world' }; }); - + it('should return a promise that returns the given value', () => { apiRequest(); @@ -106,7 +106,6 @@ describe('HalLink service', () => { apiRequest(); promise.should.be.fulfilled.then(value => { - console.log('VAAAAAAAAAAAAAAAAL', value); expect(value.restangularized).to.not.be.ok; }); }); diff --git a/frontend/app/components/api/api-v3/hal-resource-types/hal-resource-types-storage.value.ts b/frontend/app/components/api/api-v3/hal-resource-types/hal-resource-types-storage.value.ts index 8a08108401..be780ca60d 100644 --- a/frontend/app/components/api/api-v3/hal-resource-types/hal-resource-types-storage.value.ts +++ b/frontend/app/components/api/api-v3/hal-resource-types/hal-resource-types-storage.value.ts @@ -30,8 +30,12 @@ import {opApiModule} from '../../../../angular-modules'; opApiModule.value('halResourceTypesStorage', { - getResourceClassOfType(type?:string){ - type = this[type] ? type : '__default__'; + getType(type:string): string { + return type = this[type] ? type : '__default__'; + }, + + getResourceClassOfType(type?:string) { + type = this.getType(type); const typeConfig = this[type]; const resourceClass = typeConfig.cls; @@ -41,7 +45,7 @@ opApiModule.value('halResourceTypesStorage', { }, getResourceClassOfAttribute(type:string, attribute:string) { - const typeConfig = this[type]; + const typeConfig = this[this.getType(type)]; const resourceClass = typeConfig.attrCls[attribute]; if (typeConfig && resourceClass) {