Skip to content

Commit d6a7dfa

Browse files
Copilotrenemadsen
andcommitted
Add icon property to backend and frontend models and UI
Co-authored-by: renemadsen <[email protected]>
1 parent 9adc2f9 commit d6a7dfa

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

eFormAPI/eFormAPI.Web/Services/NavigationMenu/NavigationMenuItemModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ public class NavigationMenuItemModel
4747
= new List<NavigationMenuTranslationModel>();
4848

4949
public bool IsInternalLink { get; set; }
50+
public string Icon { get; set; }
5051
}

eFormAPI/eFormAPI.Web/Services/NavigationMenu/NavigationMenuTemplateItemModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ public class NavigationMenuTemplateItemModel
3535
public int? RelatedTemplateItemId { get; set; }
3636
public List<NavigationMenuTranslationModel> Translations { get; set; }
3737
= new List<NavigationMenuTranslationModel>();
38+
public string Icon { get; set; }
3839
}

eform-client/src/app/common/models/navigation-menu/navigation-menu.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class NavigationMenuTemplateItemModel {
1818
link: string;
1919
collapsed: boolean;
2020
translations: NavigationMenuTranslationModel[];
21+
icon: string;
2122
}
2223

2324
export class NavigationMenuItemModel {
@@ -34,6 +35,7 @@ export class NavigationMenuItemModel {
3435
securityGroupsIds: number[];
3536
translations: NavigationMenuTranslationModel[];
3637
isInternalLink: boolean = true;
38+
icon: string;
3739
}
3840

3941
export class NavigationMenuTranslationModel {

eform-client/src/app/components/navigation/navigation.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
[id]="node.e2EId"
1616
(click)="onClickOnNode()"
1717
>
18+
<mat-icon *ngIf="node.icon" class="menu-icon">{{ node.icon }}</mat-icon>
1819
{{ node.name }}
1920
</a>
2021
<a mat-button
@@ -24,6 +25,7 @@
2425
[href]="node.link"
2526
(click)="onClickOnNode()"
2627
>
28+
<mat-icon *ngIf="node.icon" class="menu-icon">{{ node.icon }}</mat-icon>
2729
{{node.name }}
2830
</a>
2931
</ng-container>
@@ -37,6 +39,7 @@
3739
matTreeNodeToggle
3840
[id]="node.e2EId"
3941
>
42+
<mat-icon *ngIf="node.icon" class="menu-icon" style="vertical-align: middle; margin-right: 8px;">{{ node.icon }}</mat-icon>
4043
<span style="">{{node.name}}</span>
4144
</a>
4245
</mat-expansion-panel-header>

eform-client/src/app/components/navigation/navigation.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface MenuNode {
1717
position: number;
1818
isInternalLink: boolean;
1919
guards: Array<string>;
20+
icon?: string;
2021
}
2122

2223
@AutoUnsubscribe()

eform-client/src/app/modules/advanced/modules/navigation-menu/components/menu-item/navigation-menu-item-edit/navigation-menu-item-edit.component.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ <h3 mat-dialog-title>{{'Edit menu entry' | translate}}</h3>
1313
[multiple]="true" >
1414
</mtx-select>
1515
</mat-form-field>
16+
<mat-form-field>
17+
<mat-label>{{ 'Icon' | translate }}</mat-label>
18+
<input
19+
matInput
20+
type="text"
21+
id="editIconInput"
22+
name="editIconInput"
23+
[(ngModel)]="item.icon"
24+
placeholder="e.g., home, settings, dashboard"
25+
>
26+
</mat-form-field>
1627
<div class="d-flex flex-row align-items-center need-wrapper"
1728
*ngIf="item.type === menuItemType.CustomLink || item.type === menuItemType.Link">
1829
<mat-form-field>

0 commit comments

Comments
 (0)