Merge branch 'VM/DM-545' into 'master'
DM-535 - Components without references not displayed in Component View Closes DM-545 See merge request redactmanager/red-ui!159
This commit is contained in:
commit
604c7bdff9
@ -49,7 +49,7 @@
|
|||||||
'component-log-dialog.annotations'
|
'component-log-dialog.annotations'
|
||||||
| translate
|
| translate
|
||||||
: {
|
: {
|
||||||
type: parseType(reference.type),
|
type: parseType(reference.displayValue),
|
||||||
page: reference.page,
|
page: reference.page,
|
||||||
ruleNumber: reference.entityRuleId
|
ruleNumber: reference.entityRuleId
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/materia
|
|||||||
import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe';
|
import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe';
|
||||||
import { BaseDialogComponent, CircleButtonComponent, EditableInputComponent, IconButtonComponent } from '@iqser/common-ui';
|
import { BaseDialogComponent, CircleButtonComponent, EditableInputComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { ComponentLogEntry, IFile, WorkflowFileStatuses } from '@red/domain';
|
import { ComponentLogEntry, Dictionary, IFile, WorkflowFileStatuses } from '@red/domain';
|
||||||
import { FilesMapService } from '@services/files/files-map.service';
|
import { FilesMapService } from '@services/files/files-map.service';
|
||||||
import { UserPreferenceService } from '@users/user-preference.service';
|
import { UserPreferenceService } from '@users/user-preference.service';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
@ -13,6 +13,7 @@ import { ComponentLogService } from '@services/files/component-log.service';
|
|||||||
|
|
||||||
interface ScmData {
|
interface ScmData {
|
||||||
file: IFile;
|
file: IFile;
|
||||||
|
dictionaries: Dictionary[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -130,7 +131,24 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
|||||||
this.data.file.fileId,
|
this.data.file.fileId,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
this.#updateDisplayValue(componentLogData);
|
||||||
this.componentLogData.set(componentLogData);
|
this.componentLogData.set(componentLogData);
|
||||||
this._loadingService.stop();
|
this._loadingService.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#updateDisplayValue(componentLogs: ComponentLogEntry[]) {
|
||||||
|
const dictionaries = this.data.dictionaries;
|
||||||
|
for (const componentLog of componentLogs) {
|
||||||
|
let foundDictionary: Dictionary;
|
||||||
|
for (const reference of componentLog.componentValues[0].entityReferences) {
|
||||||
|
if (foundDictionary) {
|
||||||
|
reference.displayValue = foundDictionary.label;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
foundDictionary = dictionaries.find(dict => dict.type === reference.type);
|
||||||
|
foundDictionary = foundDictionary ?? ({ label: reference.type } as Dictionary);
|
||||||
|
reference.displayValue = foundDictionary.label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<!-- TODO: mode these actions to a separate component -->
|
<!-- TODO: mode these actions to a separate component -->
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="openRSSView()"
|
(action)="openComponentLogView()"
|
||||||
*allow="roles.getRss"
|
*allow="roles.getRss"
|
||||||
[tooltip]="'file-preview.open-rss-view' | translate"
|
[tooltip]="'file-preview.open-rss-view' | translate"
|
||||||
class="ml-8"
|
class="ml-8"
|
||||||
|
|||||||
@ -338,7 +338,7 @@ export class FilePreviewScreenComponent
|
|||||||
this.#restoreOldFilters();
|
this.#restoreOldFilters();
|
||||||
document.documentElement.addEventListener('fullscreenchange', this.fullscreenListener);
|
document.documentElement.addEventListener('fullscreenchange', this.fullscreenListener);
|
||||||
|
|
||||||
this.#openRssDialogIfDefault();
|
this.#openComponentLogDialogIfDefault();
|
||||||
this._viewerHeaderService.resetLayers();
|
this._viewerHeaderService.resetLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,8 +453,8 @@ export class FilePreviewScreenComponent
|
|||||||
download(await firstValueFrom(originalFile), filename);
|
download(await firstValueFrom(originalFile), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
openRSSView() {
|
openComponentLogView() {
|
||||||
this._dialogService.openDialog('rss', { file: this.state.file() });
|
this._dialogService.openDialog('componentLog', { file: this.state.file(), dictionaries: this.state.dictionaries });
|
||||||
}
|
}
|
||||||
|
|
||||||
loadAnnotations$() {
|
loadAnnotations$() {
|
||||||
@ -870,9 +870,9 @@ export class FilePreviewScreenComponent
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#openRssDialogIfDefault() {
|
#openComponentLogDialogIfDefault() {
|
||||||
if (this.permissionsService.canViewRssDialog() && this.userPreferenceService.getOpenScmDialogByDefault()) {
|
if (this.permissionsService.canViewRssDialog() && this.userPreferenceService.getOpenScmDialogByDefault()) {
|
||||||
this.openRSSView();
|
this.openComponentLogView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,14 @@ import { HighlightActionDialogComponent } from '../dialogs/highlight-action-dial
|
|||||||
import { ManualAnnotationDialogComponent } from '../dialogs/manual-redaction-dialog/manual-annotation-dialog.component';
|
import { ManualAnnotationDialogComponent } from '../dialogs/manual-redaction-dialog/manual-annotation-dialog.component';
|
||||||
import { StructuredComponentManagementDialogComponent } from '../dialogs/structured-component-management-dialog/structured-component-management-dialog.component';
|
import { StructuredComponentManagementDialogComponent } from '../dialogs/structured-component-management-dialog/structured-component-management-dialog.component';
|
||||||
|
|
||||||
type DialogType = 'confirm' | 'documentInfo' | 'rss' | 'changeLegalBasis' | 'forceAnnotation' | 'manualAnnotation' | 'highlightAction';
|
type DialogType =
|
||||||
|
| 'confirm'
|
||||||
|
| 'documentInfo'
|
||||||
|
| 'componentLog'
|
||||||
|
| 'changeLegalBasis'
|
||||||
|
| 'forceAnnotation'
|
||||||
|
| 'manualAnnotation'
|
||||||
|
| 'highlightAction';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FilePreviewDialogService extends DialogService<DialogType> {
|
export class FilePreviewDialogService extends DialogService<DialogType> {
|
||||||
@ -34,7 +41,7 @@ export class FilePreviewDialogService extends DialogService<DialogType> {
|
|||||||
highlightAction: {
|
highlightAction: {
|
||||||
component: HighlightActionDialogComponent,
|
component: HighlightActionDialogComponent,
|
||||||
},
|
},
|
||||||
rss: {
|
componentLog: {
|
||||||
component: StructuredComponentManagementDialogComponent,
|
component: StructuredComponentManagementDialogComponent,
|
||||||
dialogConfig: { width: '90vw' },
|
dialogConfig: { width: '90vw' },
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,6 +3,7 @@ export interface EntityReference {
|
|||||||
readonly type: string;
|
readonly type: string;
|
||||||
readonly entityRuleId: string;
|
readonly entityRuleId: string;
|
||||||
readonly page: number;
|
readonly page: number;
|
||||||
|
displayValue?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IComponentValue {
|
export interface IComponentValue {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user