[Monitor Dashboard | Trunk]: Manage stakeholders: Add fragment for tabs
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60289 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
f560a56c5b
commit
e3d9aa4852
|
@ -1,10 +1,10 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<ul *ngIf="isCurator()" class="uk-tab customTabs admin" uk-tab>
|
<ul *ngIf="isCurator()" class="uk-tab customTabs admin" uk-tab>
|
||||||
<li [class.uk-active]="tab === 'all'"><a (click)="changeTab('all')"><span class="title">All</span></a></li>
|
<li [class.uk-active]="tab === 'all'"><a routerLink="./"><span class="title">All</span></a></li>
|
||||||
<li [class.uk-active]="tab === 'templates'"><a (click)="changeTab('templates')"><span class="title">Profile templates</span></a>
|
<li [class.uk-active]="tab === 'templates'"><a routerLink="./" fragment="templates"><span class="title">Profile templates</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li [class.uk-active]="tab === 'profiles'"><a (click)="changeTab('profiles')"><span
|
<li [class.uk-active]="tab === 'profiles'"><a routerLink="./" fragment="profiles"><span
|
||||||
class="title">Profiles</span></a></li>
|
class="title">Profiles</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<!--<div class="uk-grid uk-margin-medium" uk-grid>
|
<!--<div class="uk-grid uk-margin-medium" uk-grid>
|
||||||
|
|
|
@ -13,6 +13,9 @@ import {UserManagementService} from "../openaireLibrary/services/user-management
|
||||||
import {Session} from "../openaireLibrary/login/utils/helper.class";
|
import {Session} from "../openaireLibrary/login/utils/helper.class";
|
||||||
import {EditStakeholderComponent} from "../general/edit-stakeholder/edit-stakeholder.component";
|
import {EditStakeholderComponent} from "../general/edit-stakeholder/edit-stakeholder.component";
|
||||||
import {properties} from "../../environments/environment";
|
import {properties} from "../../environments/environment";
|
||||||
|
import {ActivatedRoute} from "@angular/router";
|
||||||
|
|
||||||
|
type Tab = 'all' | 'templates'| 'profiles';
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
@ -56,16 +59,24 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy {
|
||||||
@ViewChild('deleteStakeholderModal') deleteStakeholderModal: AlertModal;
|
@ViewChild('deleteStakeholderModal') deleteStakeholderModal: AlertModal;
|
||||||
@ViewChild('editStakeholderComponent') editStakeholderComponent: EditStakeholderComponent;
|
@ViewChild('editStakeholderComponent') editStakeholderComponent: EditStakeholderComponent;
|
||||||
|
|
||||||
tab: "all" | "templates" | "profiles" = "all";
|
tab: Tab = 'all';
|
||||||
|
|
||||||
constructor(private stakeholderService: StakeholderService,
|
constructor(private stakeholderService: StakeholderService,
|
||||||
private userManagementService: UserManagementService,
|
private userManagementService: UserManagementService,
|
||||||
private propertiesService: EnvironmentSpecificService,
|
private propertiesService: EnvironmentSpecificService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
private title: Title,
|
private title: Title,
|
||||||
private fb: FormBuilder) {
|
private fb: FormBuilder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.subscriptions.push(this.route.fragment.subscribe((fragment: Tab) => {
|
||||||
|
if (this.isTab(fragment)) {
|
||||||
|
this.tab = fragment;
|
||||||
|
} else {
|
||||||
|
this.tab = 'all';
|
||||||
|
}
|
||||||
|
}));
|
||||||
this.buildFilters();
|
this.buildFilters();
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
this.title.setTitle('Manage profiles');
|
this.title.setTitle('Manage profiles');
|
||||||
|
@ -112,7 +123,6 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy {
|
||||||
keyword: this.fb.control('')
|
keyword: this.fb.control('')
|
||||||
});
|
});
|
||||||
this.subscriptions.push(this.filters.get('status').valueChanges.subscribe(value => {
|
this.subscriptions.push(this.filters.get('status').valueChanges.subscribe(value => {
|
||||||
console.debug(value);
|
|
||||||
this.onStatusChange(value);
|
this.onStatusChange(value);
|
||||||
}));
|
}));
|
||||||
this.subscriptions.push(this.filters.get('keyword').valueChanges.subscribe(value => {
|
this.subscriptions.push(this.filters.get('keyword').valueChanges.subscribe(value => {
|
||||||
|
@ -261,7 +271,16 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy {
|
||||||
return Session.isPortalAdministrator(this.user);
|
return Session.isPortalAdministrator(this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeTab(tab: "all" | "templates" | "profiles") {
|
private isTab(tab: Tab): boolean {
|
||||||
this.tab = tab;
|
switch (tab) {
|
||||||
|
case "all":
|
||||||
|
return true;
|
||||||
|
case "profiles":
|
||||||
|
return true;
|
||||||
|
case "templates":
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue