diff --git a/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts index 286b51639..dc3e7dc4e 100644 --- a/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts @@ -1,7 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FilterModel } from '../../../shared/components/filter/model/filter.model'; import { AppStateService } from '../../../../state/app-state.service'; -import { DEFAULT_RUL_SET_UUID } from '../../../../utils/rule-set-default'; @Component({ selector: 'redaction-type-filter', @@ -29,9 +28,6 @@ export class TypeFilterComponent implements OnInit { constructor(private readonly _appStateService: AppStateService) {} ngOnInit(): void { - this.dictionaryColor = this._appStateService.getDictionaryColor( - this.filter.key, - this._appStateService.activeProject?.ruleSetId || DEFAULT_RUL_SET_UUID - ); + this.dictionaryColor = this._appStateService.getDictionaryColor(this.filter.key); } } diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 71aa97227..b20209c81 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -1,7 +1,6 @@ import { EventEmitter, Injectable } from '@angular/core'; import { DictionaryControllerService, - FileAttributeConfig, FileAttributesConfig, FileAttributesControllerService, FileStatus, @@ -135,6 +134,12 @@ export class AppStateService { if (!ruleSetId && this.activeProject) { ruleSetId = this.activeProject.ruleSetId; } + if (!ruleSetId) { + ruleSetId = this.ruleSets.length > 0 ? this.ruleSets[0].ruleSetId : undefined; + } + if (!ruleSetId) { + return undefined; + } const color = this._dictionaryData[ruleSetId][type]?.hexColor; return color ? color : this._dictionaryData[ruleSetId]['default'].hexColor; } @@ -143,8 +148,13 @@ export class AppStateService { if (!ruleSetId && this.activeProject) { ruleSetId = this.activeProject.ruleSetId; } - - return this._dictionaryData[ruleSetId][type].label; + if (!ruleSetId) { + ruleSetId = this.ruleSets.length > 0 ? this.ruleSets[0].ruleSetId : undefined; + } + if (!ruleSetId) { + return undefined; + } + return this._dictionaryData[ruleSetId][type]?.label; } get aggregatedFiles(): FileStatusWrapper[] { @@ -190,6 +200,13 @@ export class AppStateService { ruleSetId = this.activeProject.ruleSetId; } + if (!ruleSetId) { + ruleSetId = this.ruleSets.length > 0 ? this.ruleSets[0].ruleSetId : undefined; + } + if (!ruleSetId) { + return undefined; + } + const data = this._dictionaryData[ruleSetId][key]; return data ? data : this._dictionaryData[ruleSetId]['default']; } diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 478b507aa..399935043 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,6 +1,6 @@ { - "OAUTH_URL": "https://redkc-staging.iqser.cloud/auth/realms/redaction", - "API_URL": "https://redapi-staging.iqser.cloud", + "OAUTH_URL": "https://redacto-seeds-auth.apps.prod.euc1.devops.syngentadigitalapps.com/auth/realms/redaction", + "API_URL": "https://redacto-seeds-api.apps.prod.euc1.devops.syngentadigitalapps.com", "OAUTH_CLIENT_ID": "redaction", "BACKEND_APP_VERSION": "4.4.40", "FRONTEND_APP_VERSION": "1.1",