Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<ion-grid>
<ion-row>
<ion-col size="auto">
<img class="thumbnail" alt="" src="https://ionicframework.com/docs/img/demos/card-media.png">
<img *ngIf="item.coverImage" class="thumbnail" alt="" [src]="item.coverImage">
</ion-col>
<ion-col class="title-col">
<ion-card-title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ <h1>{{ parentItem.title }}</h1>
<app-knowledge-base-card
*ngFor="let item of knowledgeBases"
[item]="item"
[displayMode]="(knowledgeBaseParentItem$ | async)?.childDisplay ?? (item.type===Type.content && item.display ? item.display : Display.list)"
></app-knowledge-base-card>
[displayMode]="item.display">
</app-knowledge-base-card>
</ion-list>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ export class KnowledgeBaseRepository {

private updateDisplayFromParent(knowledgeBaseItems: KnowledgeBaseItem[]) {
knowledgeBaseItems.forEach(item => {
if (!item.parentId)
const children = knowledgeBaseItems.filter(child => child.parentId === item.id);
item.display = (item.type===Type.content && children.length === 0) ? Display.card : undefined;

if (!item.parentId || item.display)
return

const parent = knowledgeBaseItems.find((parent) => parent.id === item.parentId);
Expand Down