Przeglądaj źródła

fix(admin-ui): Correctly display primitive value job queue results

Fixes #881
Michael Bromley 4 lat temu
rodzic
commit
d8c2195d4d

+ 3 - 3
packages/admin-ui/src/lib/core/src/shared/components/object-tree/object-tree.component.html

@@ -10,11 +10,11 @@
 >
     <li *ngFor="let entry of entries">
         <span class="key" *ngIf="entry.key">{{ entry.key }}:</span>
-        <ng-container *ngIf="isObject(entry.value)">
+        <ng-container *ngIf="isObject(entry.value); else primitive">
             <vdr-object-tree [value]="entry.value" [isArrayItem]="valueIsArray"></vdr-object-tree>
         </ng-container>
-        <ng-container *ngIf="!isObject(entry.value)">
+        <ng-template #primitive>
             {{ entry.value }}
-        </ng-container>
+        </ng-template>
     </li>
 </ul>

+ 1 - 1
packages/admin-ui/src/lib/core/src/shared/components/object-tree/object-tree.component.ts

@@ -35,7 +35,7 @@ export class ObjectTreeComponent implements OnInit {
     }
 
     private getEntries(inputValue: { [key: string]: any } | string): Array<{ key: string; value: any }> {
-        if (typeof inputValue === 'string') {
+        if (!this.isObject(inputValue)) {
             return [{ key: '', value: inputValue }];
         }
         return Object.entries(inputValue).map(([key, value]) => ({ key, value }));