RED-8342 - Component Editor not showing all values for a multi-value-component
This commit is contained in:
parent
c411676c6c
commit
98f6fbc132
@ -13,24 +13,27 @@
|
|||||||
<div class="bold">{{ entry.name }}</div>
|
<div class="bold">{{ entry.name }}</div>
|
||||||
<div [id]="getValueCellId(index)">
|
<div [id]="getValueCellId(index)">
|
||||||
<iqser-editable-input
|
<iqser-editable-input
|
||||||
|
*ngFor="let componentValue of entry.componentValues; let componentValueIndex = index"
|
||||||
(save)="saveEdit($event, entry.originalKey)"
|
(save)="saveEdit($event, entry.originalKey)"
|
||||||
[canEdit]="canEdit"
|
[canEdit]="canEdit"
|
||||||
[cancelTooltip]="'component-log-dialog.actions.cancel-edit' | translate"
|
[cancelTooltip]="'component-log-dialog.actions.cancel-edit' | translate"
|
||||||
[editTooltip]="'component-log-dialog.actions.edit' | translate"
|
[editTooltip]="'component-log-dialog.actions.edit' | translate"
|
||||||
[id]="'value-' + index"
|
[attr.id]="getValueId(index, componentValueIndex)"
|
||||||
|
[id]="getValueId(index, componentValueIndex)"
|
||||||
[parentId]="getValueCellId(index)"
|
[parentId]="getValueCellId(index)"
|
||||||
[saveTooltip]="'component-log-dialog.actions.save' | translate"
|
[saveTooltip]="'component-log-dialog.actions.save' | translate"
|
||||||
[value]="entry.componentValues[0].value ?? entry.componentValues[0].originalValue"
|
[value]="componentValue.value ?? componentValue.originalValue"
|
||||||
|
[lastChild]="componentValueIndex === entry.componentValues.length - 1"
|
||||||
[attr.helpModeKey]="'scm_edit_DIALOG'"
|
[attr.helpModeKey]="'scm_edit_DIALOG'"
|
||||||
>
|
>
|
||||||
<ng-container slot="editing">
|
<ng-container slot="editing">
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="undo(entry.originalKey)"
|
(action)="undo(entry.originalKey)"
|
||||||
*ngIf="entry.componentValues[0].value !== entry.componentValues[0].originalValue && canEdit"
|
*ngIf="componentValue.value !== componentValue.originalValue && canEdit"
|
||||||
[showDot]="true"
|
[showDot]="true"
|
||||||
[tooltip]="
|
[tooltip]="
|
||||||
'component-log-dialog.actions.undo'
|
'component-log-dialog.actions.undo'
|
||||||
| translate: { value: entry.componentValues[0].originalValue }
|
| translate: { value: componentValue.originalValue }
|
||||||
| replaceNbsp
|
| replaceNbsp
|
||||||
"
|
"
|
||||||
[attr.help-mode-key]="'scm_undo_DIALOG'"
|
[attr.help-mode-key]="'scm_undo_DIALOG'"
|
||||||
@ -42,23 +45,25 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>{{ entry.componentValues[0].valueDescription }}</div>
|
<div>{{ entry.componentValues[0].valueDescription }}</div>
|
||||||
<div>
|
<div>
|
||||||
<ul *ngIf="entry.componentValues[0].entityReferences; else noReferences" class="pl-0">
|
<ng-container *ngFor="let componentValue of entry.componentValues; let index = index">
|
||||||
<li
|
<ul *ngIf="componentValue.entityReferences; else noReferences" class="pl-0">
|
||||||
*ngFor="let reference of entry.componentValues[0].entityReferences"
|
<li
|
||||||
[innerHTML]="
|
*ngFor="let reference of componentValue.entityReferences"
|
||||||
'component-log-dialog.annotations'
|
[innerHTML]="
|
||||||
| translate
|
'component-log-dialog.annotations'
|
||||||
: {
|
| translate
|
||||||
type: parseType(reference.displayValue),
|
: {
|
||||||
page: reference.page,
|
type: parseType(reference.displayValue),
|
||||||
ruleNumber: reference.entityRuleId
|
page: reference.page,
|
||||||
}
|
ruleNumber: reference.entityRuleId
|
||||||
"
|
}
|
||||||
class="mb-8"
|
"
|
||||||
></li>
|
class="mb-8"
|
||||||
</ul>
|
></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<ng-template #noReferences>-</ng-template>
|
<ng-template #noReferences>-</ng-template>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -60,6 +60,10 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
|||||||
return `value-cell-${index}`;
|
return `value-cell-${index}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getValueId(index: number, componentValueIndex: number) {
|
||||||
|
return `value-${index}-${componentValueIndex}`;
|
||||||
|
}
|
||||||
|
|
||||||
originalOrder = (): number => 0;
|
originalOrder = (): number => 0;
|
||||||
|
|
||||||
exportJSON() {
|
exportJSON() {
|
||||||
@ -87,7 +91,7 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
|||||||
}
|
}
|
||||||
|
|
||||||
parseType(type: string) {
|
parseType(type: string) {
|
||||||
return type.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase());
|
return type?.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleOpenScmDialogByDefault() {
|
async toggleOpenScmDialogByDefault() {
|
||||||
@ -126,14 +130,16 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
|||||||
const dictionaries = this.data.dictionaries;
|
const dictionaries = this.data.dictionaries;
|
||||||
for (const componentLog of componentLogs) {
|
for (const componentLog of componentLogs) {
|
||||||
let foundDictionary: Dictionary;
|
let foundDictionary: Dictionary;
|
||||||
for (const reference of componentLog.componentValues[0].entityReferences) {
|
for (const componentLogValue of componentLog.componentValues) {
|
||||||
if (foundDictionary) {
|
for (const reference of componentLogValue.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;
|
reference.displayValue = foundDictionary.label;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
foundDictionary = dictionaries.find(dict => dict.type === reference.type);
|
|
||||||
foundDictionary = foundDictionary ?? ({ label: reference.type } as Dictionary);
|
|
||||||
reference.displayValue = foundDictionary.label;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 42cc494e2f3ff18182198bced1320b40c8b41d5e
|
Subproject commit 82b11d2ebad8d49a2b784e830c8da511b1e7dc3e
|
||||||
Loading…
x
Reference in New Issue
Block a user