diff --git a/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.html b/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.html index 930d45452f..4d417ceb1f 100644 --- a/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.html +++ b/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.html @@ -1,46 +1,43 @@ - - -
- - - - - - - - - - +
+
{{ group.label }}{{ group.value }} - -
+ + + + + + + + + - - - - - - -
{{ group.label }}{{ group.value }} + +
-
-
-
+ + Center + Count of children + Link + + + + + diff --git a/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.ts b/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.ts index 7ce332b2d9..39aa60894c 100644 --- a/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.ts +++ b/src/app/child-dev-project/children/dashboard-widgets/entity-count-dashboard/entity-count-dashboard.component.ts @@ -11,9 +11,8 @@ import { IconName } from "@fortawesome/fontawesome-svg-core"; import { MatTableModule } from "@angular/material/table"; import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"; import { Angulartics2Module } from "angulartics2"; -import { DashboardWidgetComponent } from "../../../../core/dashboard/dashboard-widget/dashboard-widget.component"; -import { WidgetContentComponent } from "../../../../core/dashboard/dashboard-widget/widget-content/widget-content.component"; import { groupBy } from "../../../../utils/utils"; +import { DashboardListWidgetComponent } from "../../../../core/dashboard/dashboard-list-widget/dashboard-list-widget.component"; @DynamicComponent("ChildrenCountDashboard") @DynamicComponent("EntityCountDashboard") @@ -25,8 +24,7 @@ import { groupBy } from "../../../../utils/utils"; MatTableModule, FontAwesomeModule, Angulartics2Module, - DashboardWidgetComponent, - WidgetContentComponent, + DashboardListWidgetComponent, ], standalone: true, }) @@ -43,7 +41,6 @@ export class EntityCountDashboardComponent totalEntities: number; entityGroupCounts: { label: string; value: number; id: string }[] = []; - loading = true; label = Child.labelPlural; entityIcon: IconName = Child.icon; @@ -85,7 +82,6 @@ export class EntityCountDashboardComponent id: group?.["id"] || label, }; }); - this.loading = false; } } diff --git a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.html b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.html index 6edfe0d7ea..64931cd0f2 100644 --- a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.html +++ b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.html @@ -1,15 +1,12 @@ - - - +
+
@@ -32,5 +29,5 @@ [routerLink]="row.link" >
-
-
+ + diff --git a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.scss b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.scss index a2f255f437..c432cdfd65 100644 --- a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.scss +++ b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.scss @@ -1 +1,6 @@ @use "../../dashboard/dashboard-widget-base"; + +.table-container { + margin-left: 10px; + margin-right: 10px; +} diff --git a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.spec.ts b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.spec.ts index 70f30aec0d..316ea2425f 100644 --- a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.spec.ts +++ b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.spec.ts @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { DashboardShortcutWidgetComponent } from "./dashboard-shortcut-widget.component"; import { FontAwesomeTestingModule } from "@fortawesome/angular-fontawesome/testing"; +import { EntityMapperService } from "../../entity/entity-mapper.service"; describe("ShortcutDashboardWidgetComponent", () => { let component: DashboardShortcutWidgetComponent; @@ -9,6 +10,7 @@ describe("ShortcutDashboardWidgetComponent", () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [DashboardShortcutWidgetComponent, FontAwesomeTestingModule], + providers: [{ provide: EntityMapperService, useValue: undefined }], }).compileComponents(); }); diff --git a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.ts b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.ts index 1494317836..61e6865995 100644 --- a/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.ts +++ b/src/app/core/dashboard-shortcut-widget/dashboard-shortcut-widget/dashboard-shortcut-widget.component.ts @@ -1,12 +1,11 @@ -import { Component, Input, OnInit } from "@angular/core"; +import { Component, Input } from "@angular/core"; import { MenuItem } from "../../navigation/menu-item"; import { OnInitDynamicComponent } from "../../view/dynamic-components/on-init-dynamic-component.interface"; -import { MatTableDataSource, MatTableModule } from "@angular/material/table"; +import { MatTableModule } from "@angular/material/table"; import { DynamicComponent } from "../../view/dynamic-components/dynamic-component.decorator"; import { FaDynamicIconComponent } from "../../view/fa-dynamic-icon/fa-dynamic-icon.component"; import { RouterLink } from "@angular/router"; -import { DashboardWidgetComponent } from "../../dashboard/dashboard-widget/dashboard-widget.component"; -import { WidgetContentComponent } from "../../dashboard/dashboard-widget/widget-content/widget-content.component"; +import { DashboardListWidgetComponent } from "../../dashboard/dashboard-list-widget/dashboard-list-widget.component"; /** * A simple list of shortcuts displayed as a dashboard widget for easy access to important navigation. @@ -17,28 +16,20 @@ import { WidgetContentComponent } from "../../dashboard/dashboard-widget/widget- templateUrl: "./dashboard-shortcut-widget.component.html", styleUrls: ["./dashboard-shortcut-widget.component.scss"], imports: [ + DashboardListWidgetComponent, MatTableModule, FaDynamicIconComponent, RouterLink, - DashboardWidgetComponent, - WidgetContentComponent, ], standalone: true, }) export class DashboardShortcutWidgetComponent - implements OnInitDynamicComponent, OnInit + implements OnInitDynamicComponent { /** displayed entries, each representing one line displayed as a shortcut */ @Input() shortcuts: MenuItem[] = []; - tableDataSource = new MatTableDataSource(); - onInitFromDynamicConfig(config: any) { this.shortcuts = config.shortcuts; - this.tableDataSource.data = config.shortcuts; - } - - ngOnInit(): void { - this.tableDataSource.data = this.shortcuts; } } diff --git a/src/app/core/dashboard/dashboard-list-widget/dashboard-list-widget.component.html b/src/app/core/dashboard/dashboard-list-widget/dashboard-list-widget.component.html index 4bfa7e8559..ddb721d21f 100644 --- a/src/app/core/dashboard/dashboard-list-widget/dashboard-list-widget.component.html +++ b/src/app/core/dashboard/dashboard-list-widget/dashboard-list-widget.component.html @@ -9,7 +9,7 @@ > - +
@@ -22,7 +22,7 @@