DM-535 - Components without references not displayed in Component View
This commit is contained in:
parent
a8e116e167
commit
3a0b5f415b
@ -10,7 +10,7 @@
|
||||
<div class="table-header">{{ 'component-log-dialog.table-header.annotation-references' | translate }}</div>
|
||||
|
||||
<ng-container *ngFor="let entry of componentLogEntries; let index = index">
|
||||
<div class="bold">{{ entry.name.replaceAll('_', ' ').toLowerCase() }}</div>
|
||||
<div class="bold">{{ entry.name }}</div>
|
||||
<div [id]="getValueCellId(index)">
|
||||
<iqser-editable-input
|
||||
(save)="saveEdit($event, entry.name)"
|
||||
@ -49,7 +49,7 @@
|
||||
'component-log-dialog.annotations'
|
||||
| translate
|
||||
: {
|
||||
type: entry.name,
|
||||
type: parseType(reference.type),
|
||||
page: reference.page,
|
||||
ruleNumber: reference.entityRuleId
|
||||
}
|
||||
|
||||
@ -99,6 +99,10 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
||||
return this.exportJSON();
|
||||
}
|
||||
|
||||
parseType(type: string) {
|
||||
return type.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase());
|
||||
}
|
||||
|
||||
async toggleOpenScmDialogByDefault() {
|
||||
await this.userPreferences.toggleOpenScmDialogByDefault();
|
||||
await this.userPreferences.reload();
|
||||
|
||||
@ -19,7 +19,7 @@ export class ComponentLogService extends GenericService<void> {
|
||||
.pipe(
|
||||
map(data => data.componentDetails),
|
||||
catchError(() => of({} as ComponentDetails)),
|
||||
map(componentDetails => this.#filterComponentDetails(componentDetails)),
|
||||
map(componentDetails => this.#mapComponentDetails(componentDetails)),
|
||||
mapEach(log => new ComponentLogEntry(log)),
|
||||
);
|
||||
}
|
||||
@ -61,12 +61,7 @@ export class ComponentLogService extends GenericService<void> {
|
||||
});
|
||||
}
|
||||
|
||||
#filterComponentDetails(componentDetails: ComponentDetails): IComponentLogEntry[] {
|
||||
return Object.keys(componentDetails)
|
||||
.filter(function (key) {
|
||||
const component = componentDetails[key];
|
||||
return !!component.componentValues[0].entityReferences.length;
|
||||
})
|
||||
.reduce((res, key) => (res.push(componentDetails[key]), res), []);
|
||||
#mapComponentDetails(componentDetails: ComponentDetails): IComponentLogEntry[] {
|
||||
return Object.keys(componentDetails).reduce((res, key) => (res.push(componentDetails[key]), res), []);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ export class ComponentLogEntry implements IComponentLogEntry {
|
||||
readonly componentValues: ComponentValue[];
|
||||
|
||||
constructor(entry: IComponentLogEntry) {
|
||||
this.name = entry.name;
|
||||
this.name = entry.name.replaceAll('_', ' ');
|
||||
this.componentValues = entry.componentValues;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user