[Monitor Dashboard]: Add super class dashboard on body to implement custom dashboard theme. Adding new category, adds also a new subcategory with the same name.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57600 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
64c7195ab2
commit
6b6f8c11c1
|
@ -1,4 +1,4 @@
|
||||||
import {ChangeDetectorRef, Component} from '@angular/core';
|
import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
|
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
|
||||||
|
|
||||||
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
||||||
|
@ -7,16 +7,18 @@ import {User} from './openaireLibrary/login/utils/helper.class';
|
||||||
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
|
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
|
||||||
import {SideBarService} from "./library/sharedComponents/sidebar/sideBar.service";
|
import {SideBarService} from "./library/sharedComponents/sidebar/sideBar.service";
|
||||||
import {StakeholderService} from "./services/stakeholder.service";
|
import {StakeholderService} from "./services/stakeholder.service";
|
||||||
|
import {Subscriber} from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html'
|
templateUrl: './app.component.html'
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent implements OnInit, OnDestroy{
|
||||||
properties: EnvProperties;
|
properties: EnvProperties;
|
||||||
user: User;
|
user: User;
|
||||||
loginCheck: boolean = false;
|
loginCheck: boolean = false;
|
||||||
hasSidebar: boolean = false;
|
hasSidebar: boolean = false;
|
||||||
|
public subscriptions: any[] = [];
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private propertiesService: EnvironmentSpecificService,
|
private propertiesService: EnvironmentSpecificService,
|
||||||
|
@ -60,9 +62,17 @@ export class AppComponent {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.sidebarService.hasSidebar.subscribe(hasSidebar => {
|
this.subscriptions.push(this.sidebarService.hasSidebar.subscribe(hasSidebar => {
|
||||||
this.hasSidebar = hasSidebar;
|
this.hasSidebar = hasSidebar;
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ngOnDestroy() {
|
||||||
|
this.subscriptions.forEach( value => {
|
||||||
|
if(value instanceof Subscriber) {
|
||||||
|
value.unsubscribe();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +80,6 @@ export class AppComponent {
|
||||||
return this.sidebarService.open;
|
return this.sidebarService.open;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public toggleOpen(event = null) {
|
public toggleOpen(event = null) {
|
||||||
if(!event) {
|
if(!event) {
|
||||||
this.sidebarService.setOpen(!this.open);
|
this.sidebarService.setOpen(!this.open);
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li [class.current_section]="analysisOpen"
|
<li [class.current_section]="analysisOpen"
|
||||||
[class.act_section]="analysisOpen"
|
[class.act_section]="analysisOpen"
|
||||||
title="Analysis Indicators"
|
|
||||||
class="submenu_trigger">
|
class="submenu_trigger">
|
||||||
<a [routerLink]="" (click)="analysisOpen = !analysisOpen">
|
<a [routerLink]="" (click)="analysisOpen = !analysisOpen">
|
||||||
<span class="menu_icon"><i class="material-icons">donut_large</i></span>
|
<span class="menu_icon"><i class="material-icons">donut_large</i></span>
|
||||||
|
@ -35,20 +34,19 @@
|
||||||
<div *ngIf="copyTopic">
|
<div *ngIf="copyTopic">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(editTopic)" class="material-icons">close</i>
|
<i (click)="hide(editTopic)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label class="uk-text-bold">Topic Settings</label>
|
<label class="uk-text-bold">Topic Settings</label>
|
||||||
<input class="uk-input uk-form-small" [(ngModel)]="copyTopic.name"
|
<input class="uk-input uk-form-small" [(ngModel)]="copyTopic.name"
|
||||||
[class.uk-form-danger]="!valid" type="text">
|
[class.uk-form-danger]="!valid && (!copyTopic.name || copyTopic.name === '')" type="text">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label>Description</label>
|
<label>Description</label>
|
||||||
<textarea class="uk-textarea" [(ngModel)]="copyTopic.description"
|
<textarea class="uk-textarea" [(ngModel)]="copyTopic.description"
|
||||||
rows="3"
|
rows="3" type="text"></textarea>
|
||||||
[class.uk-form-danger]="!valid" type="text"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2">
|
<div class="uk-width-1-2">
|
||||||
<select class="uk-select uk-form-small" [(ngModel)]="copyTopic.isPublic">
|
<select class="uk-select uk-form-small" [(ngModel)]="copyTopic.isPublic">
|
||||||
|
@ -81,7 +79,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<li>
|
<li>
|
||||||
<a [routerLink]="" (click)="saveTopicOpen(newTopic)">
|
<a (click)="saveTopicOpen(newTopic)">
|
||||||
<span class="menu_icon"><i class="material-icons">add</i></span>
|
<span class="menu_icon"><i class="material-icons">add</i></span>
|
||||||
<span class="menu_title">Create new Topic</span>
|
<span class="menu_title">Create new Topic</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -90,20 +88,19 @@
|
||||||
<div *ngIf="copyTopic">
|
<div *ngIf="copyTopic">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(newTopic)" class="material-icons">close</i>
|
<i (click)="hide(newTopic)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label class="uk-text-bold">New Topic</label>
|
<label class="uk-text-bold">New Topic</label>
|
||||||
<input class="uk-input uk-form-small" [(ngModel)]="copyTopic.name"
|
<input class="uk-input uk-form-small" [(ngModel)]="copyTopic.name"
|
||||||
[class.uk-form-danger]="!valid" type="text">
|
[class.uk-form-danger]="!valid && (!copyTopic.name || copyTopic.name === '')" type="text">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label>Description</label>
|
<label>Description</label>
|
||||||
<textarea class="uk-textarea" [(ngModel)]="copyTopic.description"
|
<textarea class="uk-textarea" [(ngModel)]="copyTopic.description"
|
||||||
rows="3"
|
rows="3" type="text"></textarea>
|
||||||
[class.uk-form-danger]="!valid" type="text"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2">
|
<div class="uk-width-1-2">
|
||||||
<select class="uk-select uk-form-small" [(ngModel)]="copyTopic.isPublic">
|
<select class="uk-select uk-form-small" [(ngModel)]="copyTopic.isPublic">
|
||||||
|
@ -167,7 +164,7 @@
|
||||||
Select one of the <span class="md-color-blue-900">topics below</span>!
|
Select one of the <span class="md-color-blue-900">topics below</span>!
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="stakeholder" class="uk-child-width-1-3@m uk-child-width-1-1@s uk-grid-medium" uk-grid
|
<div *ngIf="stakeholder" class="uk-child-width-1-3@m uk-child-width-1-1@s uk-grid-medium uk-grid uk-grid-match" uk-grid
|
||||||
uk-height-match="target: .md-card; row: true">
|
uk-height-match="target: .md-card; row: true">
|
||||||
<ng-template ngFor [ngForOf]="stakeholder.topics" let-topic>
|
<ng-template ngFor [ngForOf]="stakeholder.topics" let-topic>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.servic
|
||||||
import {StakeholderService} from "../services/stakeholder.service";
|
import {StakeholderService} from "../services/stakeholder.service";
|
||||||
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
|
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
|
||||||
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
|
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
|
||||||
|
import {Subscriber} from "rxjs";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
@ -18,7 +19,7 @@ declare var UIkit;
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
})
|
})
|
||||||
export class HomeComponent implements OnInit, OnDestroy {
|
export class HomeComponent implements OnInit, OnDestroy {
|
||||||
public status: number;
|
public subscriptions: any[] = [];
|
||||||
public loading: boolean = true;
|
public loading: boolean = true;
|
||||||
public errorCodes: ErrorCodes;
|
public errorCodes: ErrorCodes;
|
||||||
public stakeholder: Stakeholder;
|
public stakeholder: Stakeholder;
|
||||||
|
@ -40,24 +41,28 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||||
private stakeholderService: StakeholderService) {
|
private stakeholderService: StakeholderService) {
|
||||||
this.errorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.errorMessages = new ErrorMessagesComponent();
|
this.errorMessages = new ErrorMessagesComponent();
|
||||||
this.status = this.errorCodes.LOADING;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.route.data
|
this.route.data
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
this.properties = data.envSpecific;
|
this.properties = data.envSpecific;
|
||||||
this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
if (stakeholder) {
|
if (stakeholder) {
|
||||||
this.stakeholder = HelperFunctions.copy(stakeholder);
|
this.stakeholder = HelperFunctions.copy(stakeholder);
|
||||||
this.copyTopic = null;
|
this.copyTopic = null;
|
||||||
this.title.setTitle(stakeholder.index_name);
|
this.title.setTitle(stakeholder.index_name);
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnDestroy() {
|
public ngOnDestroy() {
|
||||||
|
this.subscriptions.forEach( value => {
|
||||||
|
if(value instanceof Subscriber) {
|
||||||
|
value.unsubscribe();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public show(element) {
|
public show(element) {
|
||||||
|
@ -81,18 +86,21 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveTopicOpen(element, index = -1) {
|
public saveTopicOpen(element, index = -1) {
|
||||||
if(index === -1) {
|
if(element.className.indexOf('uk-open') !== -1) {
|
||||||
this.copyTopic = new Topic(null, null, null,true, true);
|
this.hide(element);
|
||||||
} else {
|
} else {
|
||||||
this.copyTopic = HelperFunctions.copy(this.stakeholder.topics[index]);
|
if (index === -1) {
|
||||||
|
this.copyTopic = new Topic(null, null, null, true, true);
|
||||||
|
} else {
|
||||||
|
this.copyTopic = HelperFunctions.copy(this.stakeholder.topics[index]);
|
||||||
|
}
|
||||||
|
this.show(element);
|
||||||
|
this.valid = true;
|
||||||
}
|
}
|
||||||
this.show(element);
|
|
||||||
this.valid = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveTopic(element, index = -1) {
|
public saveTopic(element, index = -1) {
|
||||||
if(this.copyTopic.name && this.copyTopic.name !== ''
|
if(this.copyTopic.name && this.copyTopic.name !== '') {
|
||||||
&& this.copyTopic.description && this.copyTopic.description !== '') {
|
|
||||||
if(!this.copyTopic.alias) {
|
if(!this.copyTopic.alias) {
|
||||||
this.copyTopic.alias = this.copyTopic.name.toLowerCase().trim();
|
this.copyTopic.alias = this.copyTopic.name.toLowerCase().trim();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,20 +24,19 @@
|
||||||
<div *ngIf="topic">
|
<div *ngIf="topic">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(editTopic)" class="material-icons">close</i>
|
<i (click)="hide(editTopic)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label class="uk-text-bold">Topic Settings</label>
|
<label class="uk-text-bold">Topic Settings</label>
|
||||||
<input class="uk-input uk-form-small" [(ngModel)]="topic.name"
|
<input class="uk-input uk-form-small" [(ngModel)]="topic.name"
|
||||||
[class.uk-form-danger]="!valid" type="text">
|
[class.uk-form-danger]="!valid && (!topic.name || topic.name === '')" type="text">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<label>Description</label>
|
<label>Description</label>
|
||||||
<textarea class="uk-textarea" [(ngModel)]="topic.description"
|
<textarea class="uk-textarea" [(ngModel)]="topic.description"
|
||||||
rows="3"
|
rows="3" type="text"></textarea>
|
||||||
[class.uk-form-danger]="!valid" type="text"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2">
|
<div class="uk-width-1-2">
|
||||||
<select class="uk-select uk-form-small" [(ngModel)]="topic.isPublic">
|
<select class="uk-select uk-form-small" [(ngModel)]="topic.isPublic">
|
||||||
|
@ -89,7 +88,7 @@
|
||||||
<div *ngIf="copyCategory">
|
<div *ngIf="copyCategory">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(editCategory)" class="material-icons">close</i>
|
<i (click)="hide(editCategory)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
|
@ -146,7 +145,7 @@
|
||||||
<div *ngIf="copySubCategory">
|
<div *ngIf="copySubCategory">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(editSubCategory)" class="material-icons">close</i>
|
<i (click)="hide(editSubCategory)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
|
@ -186,7 +185,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<li>
|
<li>
|
||||||
<a [routerLink]="" (click)="editSubCategoryOpen()">
|
<a (click)="editSubCategoryOpen()">
|
||||||
<span class="menu_icon"><i class="material-icons">add</i></span>
|
<span class="menu_icon"><i class="material-icons">add</i></span>
|
||||||
<span class="menu_title">Create new Subcategory</span>
|
<span class="menu_title">Create new Subcategory</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -195,7 +194,7 @@
|
||||||
<div *ngIf="copySubCategory">
|
<div *ngIf="copySubCategory">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(newSubCategory)" class="material-icons">close</i>
|
<i (click)="hide(newSubCategory)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
|
@ -237,7 +236,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<li>
|
<li>
|
||||||
<a [routerLink]="" (click)="editCategoryOpen()">
|
<a (click)="editCategoryOpen()">
|
||||||
<span class="menu_icon"><i class="material-icons">add</i></span>
|
<span class="menu_icon"><i class="material-icons">add</i></span>
|
||||||
<span class="menu_title">Create new Category</span>
|
<span class="menu_title">Create new Category</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -246,7 +245,7 @@
|
||||||
<div *ngIf="copyCategory">
|
<div *ngIf="copyCategory">
|
||||||
<div class="md-card">
|
<div class="md-card">
|
||||||
<div class="md-card-content uk-position-relative">
|
<div class="md-card-content uk-position-relative">
|
||||||
<a [routerLink]="" class="uk-position-top-right">
|
<a class="uk-position-top-right">
|
||||||
<i (click)="hide(newCategory)" class="material-icons">close</i>
|
<i (click)="hide(newCategory)" class="material-icons">close</i>
|
||||||
</a>
|
</a>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.servic
|
||||||
import {StakeholderService} from "../services/stakeholder.service";
|
import {StakeholderService} from "../services/stakeholder.service";
|
||||||
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
|
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
|
||||||
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
|
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
|
||||||
|
import {Subscriber} from "rxjs";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
@ -15,25 +16,26 @@ declare var UIkit;
|
||||||
templateUrl: './topic.component.html',
|
templateUrl: './topic.component.html',
|
||||||
})
|
})
|
||||||
export class TopicComponent implements OnInit, OnDestroy {
|
export class TopicComponent implements OnInit, OnDestroy {
|
||||||
|
public subscriptions: any[] = [];
|
||||||
public properties: EnvProperties;
|
public properties: EnvProperties;
|
||||||
public loading: boolean = true;
|
public loading: boolean = true;
|
||||||
public stakeholder: Stakeholder;
|
public stakeholder: Stakeholder;
|
||||||
/**
|
/**
|
||||||
* Current topic
|
* Current topic
|
||||||
**/
|
**/
|
||||||
public topicIndex: number = -1;
|
public topicIndex: number = 0;
|
||||||
public topic: Topic = null;
|
public topic: Topic = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* categoryIndex: Current category to be edited, selectedCategoryIndex: selected on menu(opened)
|
* categoryIndex: Current category to be edited, selectedCategoryIndex: selected on menu(opened)
|
||||||
*/
|
*/
|
||||||
public categoryIndex: number = -1;
|
public categoryIndex: number = 0;
|
||||||
public selectedCategoryIndex: number = -1;
|
public selectedCategoryIndex: number = 0;
|
||||||
public copyCategory: Category = null;
|
public copyCategory: Category = null;
|
||||||
/**
|
/**
|
||||||
* Current Subcategory to be edited
|
* Current Subcategory to be edited
|
||||||
*/
|
*/
|
||||||
public subCategoryIndex: number = -1;
|
public subCategoryIndex: number = 0;
|
||||||
public copySubCategory: SubCategory = null;
|
public copySubCategory: SubCategory = null;
|
||||||
/**
|
/**
|
||||||
* Current drop element and index of topic, category or subcategory to be deleted.
|
* Current drop element and index of topic, category or subcategory to be deleted.
|
||||||
|
@ -63,7 +65,7 @@ export class TopicComponent implements OnInit, OnDestroy {
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
this.properties = data.envSpecific;
|
this.properties = data.envSpecific;
|
||||||
this.route.params.subscribe( params => {
|
this.route.params.subscribe( params => {
|
||||||
this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
|
||||||
if (stakeholder) {
|
if (stakeholder) {
|
||||||
this.stakeholder = HelperFunctions.copy(stakeholder);
|
this.stakeholder = HelperFunctions.copy(stakeholder);
|
||||||
this.topicIndex = this.stakeholder.topics.findIndex(topic => topic.alias === params['topic']);
|
this.topicIndex = this.stakeholder.topics.findIndex(topic => topic.alias === params['topic']);
|
||||||
|
@ -71,18 +73,20 @@ export class TopicComponent implements OnInit, OnDestroy {
|
||||||
this.navigateToError();
|
this.navigateToError();
|
||||||
} else {
|
} else {
|
||||||
this.title.setTitle(stakeholder.index_name);
|
this.title.setTitle(stakeholder.index_name);
|
||||||
this.categoryIndex = 0;
|
|
||||||
this.selectedCategoryIndex = 0;
|
|
||||||
this.subCategoryIndex = 0;
|
|
||||||
this.toggle = true;
|
this.toggle = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnDestroy() {
|
public ngOnDestroy() {
|
||||||
|
this.subscriptions.forEach( value => {
|
||||||
|
if(value instanceof Subscriber) {
|
||||||
|
value.unsubscribe();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public hide(element) {
|
public hide(element) {
|
||||||
|
@ -104,8 +108,7 @@ export class TopicComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveTopic(element) {
|
public saveTopic(element) {
|
||||||
if(this.topic.name && this.topic.name !== ''
|
if(this.topic.name && this.topic.name !== '') {
|
||||||
&& this.topic.description && this.topic.description !== '') {
|
|
||||||
if(!this.topic.alias) {
|
if(!this.topic.alias) {
|
||||||
this.topic.alias = this.topic.name.toLowerCase().trim();
|
this.topic.alias = this.topic.name.toLowerCase().trim();
|
||||||
}
|
}
|
||||||
|
@ -157,6 +160,13 @@ export class TopicComponent implements OnInit, OnDestroy {
|
||||||
this.copyCategory.alias = this.copyCategory.name.toLowerCase();
|
this.copyCategory.alias = this.copyCategory.name.toLowerCase();
|
||||||
}
|
}
|
||||||
if(index === -1) {
|
if(index === -1) {
|
||||||
|
this.copyCategory.subCategories.push(
|
||||||
|
new SubCategory(this.copyCategory.name,
|
||||||
|
this.copyCategory.description,
|
||||||
|
this.copyCategory.alias,
|
||||||
|
this.copyCategory.isPublic,
|
||||||
|
this.copyCategory.isActive)
|
||||||
|
);
|
||||||
this.stakeholder.topics[this.topicIndex].categories.push(this.copyCategory);
|
this.stakeholder.topics[this.topicIndex].categories.push(this.copyCategory);
|
||||||
this.save('Category has been successfully created', element);
|
this.save('Category has been successfully created', element);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -9,71 +9,74 @@
|
||||||
|
|
||||||
|
|
||||||
/* On link hover, his items with this class will be displayed*/
|
/* On link hover, his items with this class will be displayed*/
|
||||||
li>a .onHover {
|
.dashboard li>a .onHover {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
li>a:hover .onHover {
|
.dashboard li>a:hover .onHover {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
/*---*/
|
/*---*/
|
||||||
|
|
||||||
|
|
||||||
/* Custom width of sidebar, change var: sidebar-width*/
|
/* Custom width of sidebar, change var: sidebar-width*/
|
||||||
#sidebar_main {
|
.dashboard #sidebar_main {
|
||||||
width: var(--sidebar-width) !important;
|
width: var(--sidebar-width);
|
||||||
-webkit-transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important;
|
-webkit-transform: translate3d(calc(-1 * var(--sidebar-width)),0,0);
|
||||||
transform: translate3d(calc(-1 * var(--sidebar-width)),0,0) !important;
|
transform: translate3d(calc(-1 * var(--sidebar-width)),0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar_main_active #sidebar_main {
|
.dashboard .sidebar_main_active #sidebar_main {
|
||||||
-webkit-transform: translate3d(0,0,0) !important;
|
-webkit-transform: translate3d(0,0,0);
|
||||||
transform: translate3d(0,0,0) !important;
|
transform: translate3d(0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar_main .menu_section > ul > li > a {
|
.dashboard #sidebar_main .menu_section > ul > li > a {
|
||||||
font-weight: 700 !important;
|
font-weight: 700;
|
||||||
font-size: var(--sidebar-font-size) !important;
|
font-size: var(--sidebar-font-size);
|
||||||
|
color: rgba(0, 0, 0, 0.70);
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar_main .menu_section > ul > li ul a {
|
.dashboard #sidebar_main .menu_section > ul > li ul a {
|
||||||
font-size: var(--sidebar-font-size) !important;
|
font-size: var(--sidebar-font-size);
|
||||||
|
color: rgba(0, 0, 0, 0.70);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 1220px) {
|
@media only screen and (min-width: 1220px) {
|
||||||
.sidebar_main_active #header_main, .sidebar_main_active #page_content, .sidebar_main_active #top_bar {
|
.dashboard .sidebar_main_active #header_main,
|
||||||
margin-left: var(--sidebar-width) !important;
|
.dashboard .sidebar_main_active #page_content,
|
||||||
|
.dashboard .sidebar_main_active #top_bar {
|
||||||
|
margin-left: var(--sidebar-width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Custom height of header, change var: header-height*/
|
/* Custom height of header, change var: header-height*/
|
||||||
body {
|
body.dashboard {
|
||||||
padding-top: var(--header-height) !important;
|
padding-top: var(--header-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
#header_main {
|
.dashboard #header_main {
|
||||||
padding: calc((var(--header-height) - 48px)/2) 25px !important;
|
padding: calc((var(--header-height) - 48px)/2) 25px;
|
||||||
}
|
}
|
||||||
/*---*/
|
/*---*/
|
||||||
|
|
||||||
/* Custom card*/
|
/* Custom card*/
|
||||||
.md-card .md-card-toolbar-heading-text {
|
.dashboard .md-card .md-card-toolbar-heading-text {
|
||||||
font-weight: 700 !important;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
/*---*/
|
/*---*/
|
||||||
|
|
||||||
/* Breadcrumb*/
|
/* Breadcrumb*/
|
||||||
#breadcrumbs {
|
.dashboard #breadcrumbs {
|
||||||
background: inherit !important;
|
background: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Notification */
|
/* Notification */
|
||||||
|
|
||||||
/*Remove the second close added by theme because it was used uikit 2*/
|
/*Remove the second close added by theme because it was used uikit 2*/
|
||||||
.uk-close::after {content: '' !important;}
|
.dashboard .uk-close::after {content: '';}
|
||||||
|
|
||||||
/* Change z-index, because of sidebar and header z-index is larger that default */
|
/* Change z-index, because of sidebar and header z-index is larger that default */
|
||||||
.uk-notification {
|
.dashboard .uk-notification {
|
||||||
z-index: 2000 !important;
|
z-index: 2000;
|
||||||
}
|
}
|
||||||
/*---*/
|
/*---*/
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<!-- themes -->
|
<!-- themes -->
|
||||||
<link rel="stylesheet" href="assets/theme-assets/css/themes/my_theme.min.css" media="all">
|
<link rel="stylesheet" href="assets/theme-assets/css/themes/my_theme.min.css" media="all">
|
||||||
</head>
|
</head>
|
||||||
<body class="app_my_theme">
|
<body class="app_my_theme dashboard">
|
||||||
<div>
|
<div>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue