Change manage profiles to the new Back Item for sidebar. Change back in topics in order to be the same with the back of sidebar

This commit is contained in:
Konstantinos Triantafyllou 2023-03-01 15:22:49 +02:00
parent f76bf6091d
commit b2bda20498
6 changed files with 42 additions and 34 deletions

View File

@ -10,7 +10,7 @@
<div> <div>
<dashboard-sidebar *ngIf="stakeholder && isFrontPage && hasSidebar && !hasInternalSidebar" queryParamsHandling="merge" [items]="sideBarItems" <dashboard-sidebar *ngIf="stakeholder && isFrontPage && hasSidebar && !hasInternalSidebar" queryParamsHandling="merge" [items]="sideBarItems"
[activeItem]="activeTopic?activeTopic.alias:null" [activeSubItem]="activeCategory?activeCategory.alias:null"></dashboard-sidebar> [activeItem]="activeTopic?activeTopic.alias:null" [activeSubItem]="activeCategory?activeCategory.alias:null"></dashboard-sidebar>
<dashboard-sidebar *ngIf="hasAdminMenu && !hasInternalSidebar" [items]="adminMenuItems" [specialMenuItem]="specialSideBarMenuItem"></dashboard-sidebar> <dashboard-sidebar *ngIf="hasAdminMenu && !hasInternalSidebar" [items]="adminMenuItems" [backItem]="backItem"></dashboard-sidebar>
<main> <main>
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>

View File

@ -43,7 +43,7 @@ export class AppComponent implements OnInit, OnDestroy {
isFrontPage: boolean = false; isFrontPage: boolean = false;
view: Visibility; view: Visibility;
sideBarItems: MenuItem[] = []; sideBarItems: MenuItem[] = [];
specialSideBarMenuItem: MenuItem = null; backItem: MenuItem = null;
menuItems: MenuItem[] = []; menuItems: MenuItem[] = [];
notificationGroups: Option[] = []; notificationGroups: Option[] = [];
entities: string[]; entities: string[];
@ -314,7 +314,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, null, "/admin/" + this.stakeholder.alias + "/admin-tools")); this.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, null, "/admin/" + this.stakeholder.alias + "/admin-tools"));
} }
} }
this.specialSideBarMenuItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'}); this.backItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'west'});
this.sideBarItems = items; this.sideBarItems = items;
this.hasSidebar = this.hasSidebar && this.sideBarItems.length > 0; this.hasSidebar = this.hasSidebar && this.sideBarItems.length > 0;
} }
@ -414,7 +414,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.menuItems.push(about); this.menuItems.push(about);
if (this.hasAdminMenu) { if (this.hasAdminMenu) {
this.adminMenuItems = []; this.adminMenuItems = [];
this.specialSideBarMenuItem = null; this.backItem = null;
this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'})); this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
if (Session.isPortalAdministrator(this.user)) { if (Session.isPortalAdministrator(this.user)) {
this.adminMenuItems.push(new MenuItem("super_admin", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, '/admin/admin-tools')); this.adminMenuItems.push(new MenuItem("super_admin", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, '/admin/admin-tools'));

@ -1 +1 @@
Subproject commit 679cae51f2435a97faf1cc019de854c922e93d14 Subproject commit 886b50a52c93163113ed6583faf8b054d9390731

View File

@ -1,35 +1,36 @@
<aside *ngIf="stakeholder" id="sidebar_main"> <aside *ngIf="stakeholder" id="sidebar_main">
<div sidebar-content> <div sidebar-content>
<div class="menu_section uk-margin-large-top"> <div class="back">
<a [routerLink]="'/admin/' + stakeholder.alias" class="uk-button uk-button-link uk-margin-left"> <a [routerLink]="'/admin/' + stakeholder.alias" class="uk-flex uk-flex-middle uk-flex-center">
<h6 class="uk-flex uk-flex-middle uk-flex-center uk-margin-remove-bottom"> <div class="uk-width-auto">
<div class="uk-width-auto"> <icon name="west" [flex]="true" ratio="1.3"></icon>
<icon class="menu-icon" name="west" [flex]="true" ratio="1.5"></icon> </div>
</div> <span class="uk-width-expand uk-text-truncate uk-margin-left hide-on-close">Indicators</span>
<span class="uk-width-expand uk-text-truncate uk-margin-small-left hide-on-close">Indicators</span>
</h6>
</a> </a>
</div> </div>
<div class="menu_section uk-margin-large-top"> <div class="menu_section uk-margin-large-top">
<ul class="uk-list uk-nav uk-nav-default uk-nav-parent-icon" transition-group [id]="'topics'" uk-nav="duration: 400"> <ul class="uk-list uk-nav uk-nav-default uk-nav-parent-icon" transition-group [id]="'topics'"
<li *ngFor="let topic of stakeholder.topics; let i=index" class="uk-parent" [class.uk-active]="topicIndex === i" transition-group-item> uk-nav="duration: 400">
<li *ngFor="let topic of stakeholder.topics; let i=index" class="uk-parent" [class.uk-active]="topicIndex === i"
transition-group-item>
<a [routerLink]="'/admin/'+stakeholder.alias + '/indicators/' + topic.alias" <a [routerLink]="'/admin/'+stakeholder.alias + '/indicators/' + topic.alias"
[title]="topic.name" class="uk-visible-toggle uk-flex uk-flex-middle"> [title]="topic.name" class="uk-visible-toggle uk-flex uk-flex-middle">
<div *ngIf="topic.icon" class="uk-width-auto"> <div *ngIf="topic.icon" class="uk-width-auto">
<icon class="menu-icon" [svg]="topic.icon" ratio="0.9" [flex]="true"></icon> <icon class="menu-icon" [svg]="topic.icon" ratio="0.9" [flex]="true"></icon>
</div> </div>
<span [class.hide-on-close]="topic.icon" <span [class.hide-on-close]="topic.icon"
class="uk-width-expand uk-text-truncate uk-margin-small-left"> class="uk-width-expand uk-text-truncate uk-margin-small-left">
{{topic.name}} {{topic.name}}
</span> </span>
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="topicIndex !== i" <span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="topicIndex !== i"
(click)="$event.stopPropagation();$event.preventDefault()"> (click)="$event.stopPropagation();$event.preventDefault()">
<a class="uk-link-reset uk-flex uk-flex-middle"> <a class="uk-link-reset uk-flex uk-flex-middle">
<icon [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(topic.visibility)" <icon [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(topic.visibility)"
ratio="0.6"></icon> ratio="0.6"></icon>
<icon [flex]="true" name="more_vert"></icon> <icon [flex]="true" name="more_vert"></icon>
</a> </a>
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body"> <div #element
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
<ul class="uk-nav uk-dropdown-nav"> <ul class="uk-nav uk-dropdown-nav">
<ng-container *ngIf="isCurator"> <ng-container *ngIf="isCurator">
<li> <li>
@ -90,19 +91,22 @@
</div> </div>
</span> </span>
</a> </a>
<ul *ngIf="isBrowser || topicIndex === i" class="uk-nav-sub" [id]="'categories-' + i.toString()" transition-group> <ul *ngIf="isBrowser || topicIndex === i" class="uk-nav-sub" [id]="'categories-' + i.toString()"
<li *ngFor="let category of topic.categories; let j=index" transition-group-item class="uk-visible-toggle" [class.uk-active]="categoryIndex == j"> transition-group>
<li *ngFor="let category of topic.categories; let j=index" transition-group-item class="uk-visible-toggle"
[class.uk-active]="categoryIndex == j">
<a (click)="chooseCategory(j)" [title]="category.name"> <a (click)="chooseCategory(j)" [title]="category.name">
<div class="uk-flex uk-flex-middle uk-width-1-1"> <div class="uk-flex uk-flex-middle uk-width-1-1">
<span class="uk-width-expand uk-text-truncate">{{category.name}}</span> <span class="uk-width-expand uk-text-truncate">{{category.name}}</span>
<span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="categoryIndex !== j" <span class="uk-margin-xsmall-left hide-on-close" [class.uk-invisible-hover]="categoryIndex !== j"
(click)="$event.stopPropagation();$event.preventDefault()"> (click)="$event.stopPropagation();$event.preventDefault()">
<a class="uk-link-reset uk-flex uk-flex-middle"> <a class="uk-link-reset uk-flex uk-flex-middle">
<icon [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(category.visibility)" <icon [flex]="true" [name]="stakeholderUtils.visibilityIcon.get(category.visibility)"
ratio="0.6"></icon> ratio="0.6"></icon>
<icon [flex]="true" name="more_vert"></icon> <icon [flex]="true" name="more_vert"></icon>
</a> </a>
<div #element uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body"> <div #element
uk-dropdown="mode: click; pos: bottom-left; offset: 5; delay-hide: 0; flip: false; container: body">
<ul class="uk-nav uk-dropdown-nav"> <ul class="uk-nav uk-dropdown-nav">
<ng-container *ngIf="isCurator"> <ng-container *ngIf="isCurator">
<li> <li>
@ -113,7 +117,8 @@
</div> </div>
</a> </a>
</li> </li>
<li *ngIf="j > 0 || j < stakeholder.topics[topicIndex].categories.length - 1" class="uk-nav-divider"></li> <li *ngIf="j > 0 || j < stakeholder.topics[topicIndex].categories.length - 1"
class="uk-nav-divider"></li>
<li *ngIf="j > 0"> <li *ngIf="j > 0">
<a (click)="hide(element);moveCategory(j)"> <a (click)="hide(element);moveCategory(j)">
<div class="uk-flex uk-flex-middle"> <div class="uk-flex uk-flex-middle">
@ -222,7 +227,8 @@
</div> </div>
<div actions> <div actions>
<div class="uk-grid uk-flex-middle" uk-grid> <div class="uk-grid uk-flex-middle" uk-grid>
<div *ngIf="stakeholder.topics.length > 0 && pageContent.isStickyActive" class="uk-width-auto@m uk-margin-small-bottom uk-flex-last@m uk-width-1-1"> <div *ngIf="stakeholder.topics.length > 0 && pageContent.isStickyActive"
class="uk-width-auto@m uk-margin-small-bottom uk-flex-last@m uk-width-1-1">
<div class="uk-flex uk-flex-center"> <div class="uk-flex uk-flex-center">
<button class="uk-button uk-button-primary uk-flex uk-flex-middle"> <button class="uk-button uk-button-primary uk-flex uk-flex-middle">
<icon name="visibility" [flex]="true"></icon> <icon name="visibility" [flex]="true"></icon>
@ -252,7 +258,8 @@
<div class="uk-margin-medium-top uk-width-expand"> <div class="uk-margin-medium-top uk-width-expand">
<ul *ngIf="stakeholder.topics.length > 0 && stakeholder.topics[topicIndex].categories.length > 0 && stakeholder.topics[topicIndex].categories[categoryIndex]" <ul *ngIf="stakeholder.topics.length > 0 && stakeholder.topics[topicIndex].categories.length > 0 && stakeholder.topics[topicIndex].categories[categoryIndex]"
transition-group class="uk-tab" [id]="'subCategories'"> transition-group class="uk-tab" [id]="'subCategories'">
<ng-template ngFor [ngForOf]=" stakeholder.topics[topicIndex].categories[categoryIndex].subCategories" let-subCategory let-i="index"> <ng-template ngFor [ngForOf]=" stakeholder.topics[topicIndex].categories[categoryIndex].subCategories"
let-subCategory let-i="index">
<li class="uk-visible-toggle uk-flex" [class.uk-active]="subCategoryIndex === i" transition-group-item> <li class="uk-visible-toggle uk-flex" [class.uk-active]="subCategoryIndex === i" transition-group-item>
<a (click)="chooseSubcategory(i)"> <a (click)="chooseSubcategory(i)">
<span class="uk-text-uppercase">{{subCategory.name}}</span> <span class="uk-text-uppercase">{{subCategory.name}}</span>
@ -362,7 +369,7 @@
<modal-alert #deleteModal classTitle="uk-background-primary uk-light" (alertOutput)="deleteElement()" <modal-alert #deleteModal classTitle="uk-background-primary uk-light" (alertOutput)="deleteElement()"
[overflowBody]="false"> [overflowBody]="false">
<div [class.uk-invisible]="loading" class="uk-position-relative"> <div [class.uk-invisible]="loading" class="uk-position-relative">
<div *ngIf="loading" > <div *ngIf="loading">
<loading class="uk-position-center"></loading> <loading class="uk-position-center"></loading>
</div> </div>
You are about to delete <span class="uk-text-bold" *ngIf="element">"{{element.name}}"</span> {{type}} permanently. You are about to delete <span class="uk-text-bold" *ngIf="element">"{{element.name}}"</span> {{type}} permanently.
@ -380,7 +387,8 @@
<div *ngIf="form" [class.uk-hidden]="loading" <div *ngIf="form" [class.uk-hidden]="loading"
class="uk-grid uk-padding uk-padding-remove-horizontal uk-child-width-1-1" [formGroup]="form" uk-grid> class="uk-grid uk-padding uk-padding-remove-horizontal uk-child-width-1-1" [formGroup]="form" uk-grid>
<div input [formInput]="form.get('name')" class="uk-width-1-2@m" placeholder="Title"></div> <div input [formInput]="form.get('name')" class="uk-width-1-2@m" placeholder="Title"></div>
<div input [formInput]="form.get('visibility')" class="uk-width-1-2@m" placeholder="Status" [options]="stakeholderUtils.visibility" type="select"></div> <div input [formInput]="form.get('visibility')" class="uk-width-1-2@m" placeholder="Status"
[options]="stakeholderUtils.visibility" type="select"></div>
<div input [formInput]="form.get('description')" placeholder="Description" type="textarea" rows="4"></div> <div input [formInput]="form.get('description')" placeholder="Description" type="textarea" rows="4"></div>
<div *ngIf="form.get('icon')" input [formInput]="form.get('icon')" placeholder="Icon(SVG)" type="textarea"></div> <div *ngIf="form.get('icon')" input [formInput]="form.get('icon')" placeholder="Icon(SVG)" type="textarea"></div>
</div> </div>

@ -1 +1 @@
Subproject commit 540ba93c0fc9a4be88b2102033fc18ee16ea8673 Subproject commit 071385b36c9b9c65d6d081d6468aeea2bf01ffbf

@ -1 +1 @@
Subproject commit 3b10e32e0df3103a23b36d58b2c6656396b18428 Subproject commit ee657bbddcf3b56c00d93f38e91290900cb616bc