Merge branch 'RED-8684' into 'master'
RED-8684: fixed missing type warning bug. See merge request redactmanager/red-ui!342
This commit is contained in:
commit
5923084bb5
@ -213,7 +213,7 @@ export class FileDataService extends EntitiesService<AnnotationWrapper, Annotati
|
||||
|
||||
let dictionary = dictionaries.find(dict => dict.type === entry.type);
|
||||
if (!dictionary && checkDictionary) {
|
||||
const dictionaryRequest = this._dictionaryService.loadDictionaryDataForDossierTemplate(
|
||||
const dictionaryRequest = this._dictionaryService.loadTemporaryDictionaryData(
|
||||
this._state.dossierTemplateId,
|
||||
this._state.isReadonly(),
|
||||
);
|
||||
|
||||
@ -56,7 +56,9 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
if (readOnly) {
|
||||
queryParams.push({ key: 'includeDeleted', value: true });
|
||||
}
|
||||
return this._getOne<{ types: IDictionary[] }>(['type', dossierTemplateId], this._defaultModelPath, queryParams);
|
||||
return this._getOne<{ types: IDictionary[] }>(['type', dossierTemplateId], this._defaultModelPath, queryParams).pipe(
|
||||
map(typesResponse => typesResponse.types.map(type => new Dictionary(type))),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,35 +245,16 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
return forkJoin(observables);
|
||||
}
|
||||
|
||||
loadDictionaryDataForDossierTemplate(dossierTemplateId: string, readOnlyFile = false): Observable<Dictionary[]> {
|
||||
return this.getAllDictionaries(dossierTemplateId, readOnlyFile).pipe(
|
||||
map(typesResponse => typesResponse.types.map(type => new Dictionary(type))),
|
||||
map(dictionaries => {
|
||||
let manualTypeExists = false;
|
||||
for (const dictionary of dictionaries) {
|
||||
if (dictionary.type === SuperTypes.ManualRedaction) {
|
||||
manualTypeExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!manualTypeExists) {
|
||||
dictionaries.push(
|
||||
new Dictionary(
|
||||
{
|
||||
hexColor: FALLBACK_COLOR,
|
||||
type: SuperTypes.ManualRedaction,
|
||||
},
|
||||
true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return dictionaries;
|
||||
}),
|
||||
loadDictionaryDataForDossierTemplate(dossierTemplateId: string): Observable<Dictionary[]> {
|
||||
return this.getAllDictionaries(dossierTemplateId).pipe(
|
||||
tap(dictionaries => this._dictionariesMapService.set(dossierTemplateId, dictionaries)),
|
||||
);
|
||||
}
|
||||
|
||||
loadTemporaryDictionaryData(dossierTemplateId: string, readOnlyFile = true): Observable<Dictionary[]> {
|
||||
return this.getAllDictionaries(dossierTemplateId, readOnlyFile);
|
||||
}
|
||||
|
||||
loadDictionaryEntriesByType(types: string[], dossierTemplateId: string, dossierId: string): Observable<Dictionary[]> {
|
||||
const queryParams = [{ key: 'dossierId', value: dossierId }];
|
||||
const requests = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user