RED-5908: remove primary key property
This commit is contained in:
parent
e69bb94f8f
commit
d6d3dabc21
@ -4,15 +4,8 @@ import { EntitiesMapService } from '@iqser/common-ui';
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class PermissionsConfigurationMapService extends EntitiesMapService<IPermissionsMapping, PermissionsMapping> {
|
export class PermissionsConfigurationMapService extends EntitiesMapService<IPermissionsMapping, PermissionsMapping> {
|
||||||
protected readonly _primaryKey = 'name';
|
|
||||||
|
|
||||||
getMappedPermissions(targetObject: string): string[] {
|
getMappedPermissions(targetObject: string): string[] {
|
||||||
return Array.from(
|
const mappedPermissions = this.get(targetObject).flatMap(p => p.mappedPermissions);
|
||||||
new Set(
|
return Array.from(new Set(mappedPermissions.map(p => p.name)));
|
||||||
this.get(targetObject)
|
|
||||||
.flatMap(p => p.mappedPermissions)
|
|
||||||
.map(p => p.name),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,4 @@ import { IPermissionsMapping, PermissionsMapping } from '@red/domain';
|
|||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class PermissionsMapService extends EntitiesMapService<IPermissionsMapping, PermissionsMapping> {
|
export class PermissionsMapService extends EntitiesMapService<IPermissionsMapping, PermissionsMapping> {}
|
||||||
protected readonly _primaryKey = 'name';
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Dictionary, DOSSIER_TEMPLATE_ID, IDictionary } from '@red/domain';
|
import { Dictionary, IDictionary } from '@red/domain';
|
||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DictionariesMapService extends EntitiesMapService<IDictionary, Dictionary> {
|
export class DictionariesMapService extends EntitiesMapService<IDictionary, Dictionary> {}
|
||||||
protected readonly _primaryKey = DOSSIER_TEMPLATE_ID;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Dictionary, DOSSIER_ID, IDictionary } from '@red/domain';
|
import { Dictionary, IDictionary } from '@red/domain';
|
||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DossierDictionariesMapService extends EntitiesMapService<IDictionary, Dictionary> {
|
export class DossierDictionariesMapService extends EntitiesMapService<IDictionary, Dictionary> {}
|
||||||
protected readonly _primaryKey = DOSSIER_ID;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { DonutChartConfig, DOSSIER_TEMPLATE_ID, DossierState, IDossierState } from '@red/domain';
|
import { DonutChartConfig, DossierState, IDossierState } from '@red/domain';
|
||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
import { flatMap } from 'lodash-es';
|
import { flatMap } from 'lodash-es';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DossierStatesMapService extends EntitiesMapService<IDossierState, DossierState> {
|
export class DossierStatesMapService extends EntitiesMapService<IDossierState, DossierState> {
|
||||||
protected readonly _primaryKey = DOSSIER_TEMPLATE_ID;
|
|
||||||
|
|
||||||
get stats(): DonutChartConfig[] {
|
get stats(): DonutChartConfig[] {
|
||||||
const allStates = flatMap(Array.from(this._map.values()).map(obs => obs.value));
|
const allStates = flatMap(Array.from(this._map.values()).map(obs => obs.value));
|
||||||
return Array.from(
|
return Array.from(
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { DOSSIER_TEMPLATE_ID, IWatermark, Watermark } from '@red/domain';
|
import { IWatermark, Watermark } from '@red/domain';
|
||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class WatermarksMapService extends EntitiesMapService<IWatermark, Watermark> {
|
export class WatermarksMapService extends EntitiesMapService<IWatermark, Watermark> {}
|
||||||
protected readonly _primaryKey = DOSSIER_TEMPLATE_ID;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { DOSSIER_ID, File, IFile } from '@red/domain';
|
import { File, IFile } from '@red/domain';
|
||||||
import { EntitiesMapService, NonFunctionKeys } from '@iqser/common-ui';
|
import { EntitiesMapService, NonFunctionKeys } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class FilesMapService extends EntitiesMapService<IFile, File> {
|
export class FilesMapService extends EntitiesMapService<IFile, File> {
|
||||||
protected readonly _primaryKey = DOSSIER_ID;
|
|
||||||
|
|
||||||
replaceFiles<T extends NonFunctionKeys<File>, T2 extends File[T]>(files: File[], property: T, generateValue: (value: T2) => T2) {
|
replaceFiles<T extends NonFunctionKeys<File>, T2 extends File[T]>(files: File[], property: T, generateValue: (value: T2) => T2) {
|
||||||
const newFiles = files.map(
|
const newFiles = files.map(
|
||||||
file =>
|
file =>
|
||||||
|
|||||||
@ -3,6 +3,4 @@ import { IViewedPage, ViewedPage } from '@red/domain';
|
|||||||
import { EntitiesMapService } from '@iqser/common-ui';
|
import { EntitiesMapService } from '@iqser/common-ui';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ViewedPagesMapService extends EntitiesMapService<IViewedPage, ViewedPage> {
|
export class ViewedPagesMapService extends EntitiesMapService<IViewedPage, ViewedPage> {}
|
||||||
protected readonly _primaryKey = 'id';
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user