From 82833bcf11e2a4a9ed9e24c6b54a2a3750a681e0 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 25 Jul 2022 15:39:29 +0300 Subject: [PATCH 1/3] admin - edit form - 'notify managers' is now false by default --- notifications/notify-form/notify-form.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications/notify-form/notify-form.component.ts b/notifications/notify-form/notify-form.component.ts index de00d6e9..96ac4481 100644 --- a/notifications/notify-form/notify-form.component.ts +++ b/notifications/notify-form/notify-form.component.ts @@ -83,7 +83,7 @@ export class NotifyFormComponent implements OnInit, OnDestroy { reset(message: string = null) { if (!this.availableGroups) { this.form = this.fb.group({ - notify: this.fb.control(true), + notify: this.fb.control(false), message: this.fb.control(message) }); this.subscriptions.push(this.form.get('notify').valueChanges.subscribe(value => { From 3eba03889355b91f4e335d1997e689ca379b4572 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 26 Jul 2022 14:32:52 +0300 Subject: [PATCH 2/3] Allow create group for curators too. --- dashboard/users/role-users/role-users.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/users/role-users/role-users.component.html b/dashboard/users/role-users/role-users.component.html index a652f231..5058e734 100644 --- a/dashboard/users/role-users/role-users.component.html +++ b/dashboard/users/role-users/role-users.component.html @@ -29,9 +29,9 @@ Invite {{role}} - From e04d825c03fbb3114a88cd7b4de426b4976238bf Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 27 Jul 2022 12:34:10 +0300 Subject: [PATCH 3/3] Add indicators page for monitor. Add tooltip in page/class content form and change container size. Add parentClass parame in theme page in order to view a specific style. Change admin login guard in order to allow curators to have access in some pages. Enable isPageEnabled method in configuration page in order to check if a specific page in specific portal isEnabled. --- .../class-help-content-form.component.html | 23 +- .../class-help-content-form.component.ts | 8 +- .../page-help-content-form.component.html | 22 +- .../page-help-content-form.component.ts | 69 +- dashboard/page/pages.component.ts | 2 - login/adminLoginGuard.guard.ts | 12 +- monitor/indicators/indicators.component.ts | 60 + monitor/indicators/indicators.module.ts | 19 + utils/configuration/configuration.service.ts | 224 ++- utils/helper/helper.service.ts | 14 +- utils/theme/theme.component.html | 1475 ++++++++--------- utils/theme/theme.component.ts | 27 +- 12 files changed, 1005 insertions(+), 950 deletions(-) create mode 100644 monitor/indicators/indicators.component.ts create mode 100644 monitor/indicators/indicators.module.ts diff --git a/dashboard/divhelpcontent/class-help-content-form.component.html b/dashboard/divhelpcontent/class-help-content-form.component.html index 91a04021..6c2ca115 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.html +++ b/dashboard/divhelpcontent/class-help-content-form.component.html @@ -13,7 +13,7 @@
-
+
-
+
@@ -38,28 +38,35 @@ Select Status (Enable/ disable)
-
Content
-
+
+ Content + +
+ OpenAIRE style guide is based on UIKit. + You can find some usage examples here + in order to style your content. +
+
+
+ extraPlugins: 'divarea', height: 500}">
-
diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index 0b75bca4..d598ee09 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -18,6 +18,7 @@ export class ClassContentFormComponent implements OnInit { myForm: FormGroup; portal: string; + parentClass: string; pageId: string; pageContentId: string; page: Page; @@ -32,9 +33,9 @@ export class ClassContentFormComponent implements OnInit { } ngOnInit() { - this.subs.push(this.route.params.subscribe(params => { - this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; - this.subs.push(this.route.queryParams.subscribe(params => { + this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; + this.parentClass = this.route.snapshot.data.parentClass; + this.subs.push(this.route.queryParams.subscribe(params => { this.pageId = params['pageId']; this.myForm = this.form; this.pageContentId = params['pageContentId']; @@ -43,7 +44,6 @@ export class ClassContentFormComponent implements OnInit { } this.getInfo(this.pageId); })); - })); } ngOnDestroy() { diff --git a/dashboard/helpTexts/page-help-content-form.component.html b/dashboard/helpTexts/page-help-content-form.component.html index aed98fbf..e5b8e716 100644 --- a/dashboard/helpTexts/page-help-content-form.component.html +++ b/dashboard/helpTexts/page-help-content-form.component.html @@ -13,7 +13,7 @@
-
+
-
+
@@ -48,23 +48,29 @@
-
Content
-
+
+ Content + +
+ OpenAIRE style guide is based on UIKit. + You can find some usage examples here + in order to style your content. +
+
+
+ extraPlugins: 'divarea', height: 500}">
-
-
diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index e3b0cea4..b66b4b94 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -19,6 +19,7 @@ export class PageContentFormComponent implements OnInit { myForm: FormGroup; portal: string; + parentClass: string; pageId: string; pageContentId: string; page: Page; @@ -34,18 +35,17 @@ export class PageContentFormComponent implements OnInit { } ngOnInit() { - this.subs.push(this.route.params.subscribe(params => { - this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; - this.subs.push(this.route.queryParams.subscribe(params => { - HelperFunctions.scroll(); - this.pageId = params['pageId']; - this.myForm = this.form; - this.pageContentId = params['pageContentId']; - if (!this.pageId) { - this._router.navigate(['../'], {relativeTo: this.route}); - } - this.getInfo(this.pageId); - })); + this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; + this.parentClass = this.route.snapshot.data.parentClass; + this.subs.push(this.route.queryParams.subscribe(params => { + HelperFunctions.scroll(); + this.pageId = params['pageId']; + this.myForm = this.form; + this.pageContentId = params['pageContentId']; + if (!this.pageId) { + this._router.navigate(['../'], {relativeTo: this.route}); + } + this.getInfo(this.pageId); })); } @@ -85,48 +85,7 @@ export class PageContentFormComponent implements OnInit { )); } - - /*private getPage(pageId: string) { - this.subs.push(this._helpContentService.getPageByPortal(pageId,this.properties.adminToolsAPIURL, this.communityPid).subscribe( - page => { - if(this.properties.adminToolsPortalType != page.portalType) { - this._router.navigate(['../'], {relativeTo: this.route}); - } else { - this.page = page; - this.getPageContents(pageId); - } - }, - error => this.handleError('System error retrieving page with id: '+pageId, error) - )); - } - private getPageContents(pageId: string) { - this.subs.push(this._helpContentService.getCommunityPageHelpContents(this.communityPid, this.properties.adminToolsAPIURL).subscribe( - pageHelpContents => { - let countPageContents = 1; - for (let content of (pageHelpContents as Array)) { - if(content.page['_id'] == pageId){ - countPageContents++; - } - } - this.setOptions(this.page, countPageContents); - if(!this.pageContentId) { - this.showLoading = false; - this.initFormWithSelectOptions(); - } - }, - error => this.handleError('System error retrieving page contents with id: ', error) - )); - } - private getPageHelpContent(pageContentId: string) { - this.showLoading = true; - this.subs.push(this._helpContentService.getPageHelpContent(pageContentId as string, this.properties.adminToolsAPIURL, this.communityPid).subscribe( - pageHelpContent => { - this.updateForm(pageHelpContent); - this.showLoading = false; - }, - error => this.handleError('System error retrieving page help content', error))); - }*/ private updateForm(pageHelpContent: PageHelpContent) { this.pageHelpContent = pageHelpContent; this.myForm = this.form; @@ -228,10 +187,6 @@ export class PageContentFormComponent implements OnInit { } } - public cancelCustom() { - this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); - } - public resetCustom() { this.showLoading = true; this.updateForm(this.pageHelpContent); diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index d5d2b520..4e328d18 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -6,14 +6,12 @@ import {CheckPage, Page} from '../../utils/entities/adminTool/page'; import {Entity} from '../../utils/entities/adminTool/entity'; import {EnvProperties} from '../../utils/properties/env-properties'; import {Session} from '../../login/utils/helper.class'; -import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {UserManagementService} from '../../services/user-management.service'; import {Subscriber} from 'rxjs'; import {PortalUtils} from '../portal/portalHelper'; import {properties} from '../../../../environments/environment'; import {Option} from '../../sharedComponents/input/input.component'; import {AlertModal} from '../../utils/modal/alert'; -import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component'; import {Title} from '@angular/platform-browser'; import {StringUtils} from '../../utils/string-utils.class'; import {StakeholderService} from '../../monitor/services/stakeholder.service'; diff --git a/login/adminLoginGuard.guard.ts b/login/adminLoginGuard.guard.ts index 3d29fbb6..6c01ac49 100644 --- a/login/adminLoginGuard.guard.ts +++ b/login/adminLoginGuard.guard.ts @@ -2,7 +2,7 @@ import {Injectable} from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, - CanActivateChild, + CanActivateChild, Data, Router, RouterStateSnapshot, UrlTree @@ -20,13 +20,15 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild { private userManagementService: UserManagementService) { } - check(path: string): Observable { + check(data: Data, path: string): Observable { let errorCode = LoginErrorCodes.NOT_LOGIN; return this.userManagementService.getUserInfo(false).pipe(map(user => { if (user) { errorCode = LoginErrorCodes.NOT_ADMIN; } - return Session.isPortalAdministrator(user); + return Session.isPortalAdministrator(user) || + (data.monitorCurator && Session.isMonitorCurator(user)) || + (data.communityCurator && Session.isCommunityCurator(user)) }),tap(isAdmin => { if(!isAdmin) { this.router.navigate(['/user-info'], { @@ -41,11 +43,11 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - return this.check(state.url); + return this.check(route.data, state.url); } canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - return this.check(state.url); + return this.check(childRoute.data, state.url); } } diff --git a/monitor/indicators/indicators.component.ts b/monitor/indicators/indicators.component.ts new file mode 100644 index 00000000..b5cd56a2 --- /dev/null +++ b/monitor/indicators/indicators.component.ts @@ -0,0 +1,60 @@ +import {Component, OnDestroy, OnInit} from "@angular/core"; +import {Subscriber} from "rxjs"; +import {properties} from "../../../../environments/environment"; +import {ActivatedRoute, Router} from "@angular/router"; +import {HelperService} from "../../utils/helper/helper.service"; +import {StakeholderService} from "../services/stakeholder.service"; +import {ConfigurationService} from "../../utils/configuration/configuration.service"; + +@Component({ + selector: 'indicators-page', + template: `` +}) +export class IndicatorsComponent implements OnInit, OnDestroy { + private subscriptions: any[] = []; + public properties = properties; + public pageContents; + + constructor(private helper: HelperService, + private configurationService: ConfigurationService, + private router: Router, + private stakeholderService: StakeholderService, + private route: ActivatedRoute) { + } + + ngOnInit() { + this.subscriptions.push(this.route.params.subscribe(params => { + if(params['stakeholder']) { + this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { + this.getPageContents(stakeholder.type); + })); + } else if(params['type']){ + this.getPageContents(params['type']); + } + })) + } + + ngOnDestroy() { + this.subscriptions.forEach(subscription => { + if (subscription instanceof Subscriber) { + subscription.unsubscribe(); + } + }); + } + + public getPageContents(type: string) { + this.subscriptions.push(this.configurationService.isPageEnabled('monitor', '/indicators/' + type, 'monitor').subscribe(isEnabled => { + if(isEnabled) { + this.subscriptions.push(this.helper.getPageHelpContents(this.properties, 'monitor', '/indicators/' + type, 'monitor').subscribe(contents => { + this.pageContents = contents; + })); + } else { + this.navigateToError(); + } + })); + } + + private navigateToError() { + this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.properties.baseLink + this.router.url}}); + } +} diff --git a/monitor/indicators/indicators.module.ts b/monitor/indicators/indicators.module.ts new file mode 100644 index 00000000..b2c0bfd2 --- /dev/null +++ b/monitor/indicators/indicators.module.ts @@ -0,0 +1,19 @@ +import {NgModule} from "@angular/core"; +import {CommonModule} from "@angular/common"; +import {RouterModule} from "@angular/router"; +import {IndicatorsComponent} from "./indicators.component"; +import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; +import {HelperModule} from "../../utils/helper/helper.module"; + +@NgModule({ + imports: [CommonModule, RouterModule.forChild([ + { + path: '', + component: IndicatorsComponent, + canDeactivate: [PreviousRouteRecorder] + }, + ]), HelperModule], + declarations: [IndicatorsComponent], + exports: [IndicatorsComponent] +}) +export class IndicatorsModule {} diff --git a/utils/configuration/configuration.service.ts b/utils/configuration/configuration.service.ts index be482b53..dcfea1dd 100644 --- a/utils/configuration/configuration.service.ts +++ b/utils/configuration/configuration.service.ts @@ -5,158 +5,150 @@ import {map} from 'rxjs/operators'; import {EnvProperties} from "../properties/env-properties"; import {Portal} from "../entities/adminTool/portal"; import {Page} from "../entities/adminTool/page"; +import {properties} from "../../../../environments/environment"; -@Injectable({ providedIn: 'root' }) -export class ConfigurationService{ +@Injectable({providedIn: 'root'}) +export class ConfigurationService { private communityInformation: BehaviorSubject = new BehaviorSubject(null); private sub: Subscription = null; - private source: Observable = null; private promise: Promise = null; - - constructor(private http: HttpClient ) {} - - ngOnDestroy() { - this.clearSubscriptions(); - } - + + constructor(private http: HttpClient) { + } + + ngOnDestroy() { + this.clearSubscriptions(); + } + clearSubscriptions() { - if(this.sub) { - this.sub.unsubscribe(); - } - } - + if (this.sub) { + this.sub.unsubscribe(); + } + } + /** * @deprecated */ - getCommunityInformation(properties:EnvProperties, community:string){ - let url = properties.adminToolsAPIURL +"/"+properties.adminToolsPortalType+"/" + community + '/full'; - return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); - //.map(res => res.json()); - } - + getCommunityInformation(properties: EnvProperties, community: string) { + let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + community + '/full'; + return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + //.map(res => res.json()); + } + public initStaticCommunityInformation(communityInformation: Portal) { this.promise = new Promise((resolve => { - this.communityInformation.next(communityInformation); - resolve(); + this.communityInformation.next(communityInformation); + resolve(); })); } - public initCommunityInformation(properties:EnvProperties, community:string) { - if(community == null) return; - - let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full"; + + public initCommunityInformation(properties: EnvProperties, community: string) { + if (community == null) return; + let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + community + "/full"; this.promise = new Promise((resolve => { - this.source = this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); - - this.sub = this.source - .subscribe( - (communityInformation: Portal) => { - this.communityInformation.next(communityInformation); - resolve(); - }, - error => { - this.communityInformation.error(error); - resolve(); - }); + this.sub = this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url).subscribe( + (communityInformation: Portal) => { + this.communityInformation.next(communityInformation); + resolve(); + }, + error => { + this.communityInformation.error(error); + resolve(); + }); })); - + } - + public get communityInformationState(): Observable { return this.communityInformation.asObservable(); } - + /** * @deprecated */ - isEntityEnabled(APIUrl:string, community:string,entity: string){ - //console.log("isEntityEnabled: "+entity); - let url = "isEntityEnabled-"+entity; - + isEntityEnabled(APIUrl: string, community: string, entity: string) { + //console.log("isEntityEnabled: "+entity); + let url = "isEntityEnabled-" + entity; + // if(entity == "publication" || entity == "dataset" || entity == "datasource"){ // return Observable.of(new Object()).mapTo(false); // } // return Observable.of(new Object()).mapTo(true); - return this.http.get(APIUrl + "/page") - .pipe(map(res => true)); - } - - /** - * @deprecated - */ - isPageEnabled(properties:EnvProperties, community:string,router: string){ - let page_route: string = router.split('?')[0].substring(1); - - let url = properties.adminToolsAPIURL + "/"+properties.adminToolsPortalType+"/" + community+"/pages?page_route="+page_route; - return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) - //.map(res => res.json()) - .pipe(map(res => { - let result = false; - if(res['length'] >0 && res[0].route == page_route){ - result = res[0].isEnabled; - } - - return result; - }));//.do(res => {console.log("Route "+page_route +" is "+res)}); - } - - async isPageEnabledByStateAsync(properties: EnvProperties, community:string, page_route: string) { - if(!this.promise) { - this.initCommunityInformation(properties, community); - } - - await this.promise; - if(this.sub){ - this.sub.unsubscribe(); - } - return this.filtering(page_route); + return this.http.get(APIUrl + "/page") + .pipe(map(res => true)); } - - isPageEnabledByState(properties: EnvProperties, community:string, router: string): Observable { - let page_route: string = router.split('?')[0].substring(1); - return from(this.isPageEnabledByStateAsync(properties, community, page_route)); + + isPageEnabled(portal: string, route: string, portalType = properties.adminToolsPortalType) { + let url = properties.adminToolsAPIURL + "/" + portalType + "/" + portal + "/pages?page_route=" + route; + return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + .pipe(map(res => { + let result = false; + if (res['length'] > 0 && res[0].route == route) { + result = res[0].isEnabled; + } + return result; + })); } - + + async isPageEnabledByStateAsync(properties: EnvProperties, portal: string, page_route: string) { + if (!this.promise || portal !== this.communityInformation.getValue().pid) { + this.initCommunityInformation(properties, portal); + } + + await this.promise; + if (this.sub) { + this.sub.unsubscribe(); + } + return this.filtering(page_route); + } + + isPageEnabledByState(properties: EnvProperties, portal: string, router: string): Observable { + let page_route: string = router.split('?')[0].substring(1); + return from(this.isPageEnabledByStateAsync(properties, portal, page_route)); + } + filtering(page_route: string) { - let community: Portal = this.communityInformation.getValue(); - let pages: Page[] = community.pages; - if (pages) { - let page = pages.find((page: Page) => page.route == page_route); - return page && page.isEnabled; - } else { - return false; - } + let community: Portal = this.communityInformation.getValue(); + let pages: Page[] = community.pages; + if (pages) { + let page = pages.find((page: Page) => page.route == page_route); + return page && page.isEnabled; + } else { + return false; + } } - + /** * @deprecated */ - getMainPageContent(APIUrl:string, community:string,){ - return this.http.get(APIUrl + "/page") - .pipe(map(res => true)); - } - + getMainPageContent(APIUrl: string, community: string,) { + return this.http.get(APIUrl + "/page") + .pipe(map(res => true)); + } + /** * @deprecated */ - getSpecialAnouncementContent(APIUrl:string, community:string,){ - return this.http.get(APIUrl + "/page") - .pipe(map(res => "")); - } - + getSpecialAnouncementContent(APIUrl: string, community: string,) { + return this.http.get(APIUrl + "/page") + .pipe(map(res => "")); + } + /** * @deprecated */ - getHelpPageContent(APIUrl:string, community:string, router:string){ - return this.http.get(APIUrl + "/page") - .pipe(map(res => true)); - } - // private handleError (error: Response) { - // // in a real world app, we may send the error to some remote logging infrastructure - // // instead of just logging it to the console - // console.log(error); - // return this.http.get(this.APIUrl + "/page") - // .map(res => true); - // } - - + getHelpPageContent(APIUrl: string, community: string, router: string) { + return this.http.get(APIUrl + "/page") + .pipe(map(res => true)); + } + + // private handleError (error: Response) { + // // in a real world app, we may send the error to some remote logging infrastructure + // // instead of just logging it to the console + // console.log(error); + // return this.http.get(this.APIUrl + "/page") + // .map(res => true); + // } + + } diff --git a/utils/helper/helper.service.ts b/utils/helper/helper.service.ts index df1d2866..f263aed1 100644 --- a/utils/helper/helper.service.ts +++ b/utils/helper/helper.service.ts @@ -30,18 +30,18 @@ export class HelperService { } - getPageHelpContents(properties:EnvProperties, communityId:string, router: string):any { - if(!communityId) { - communityId = properties.adminToolsCommunity; + getPageHelpContents(properties:EnvProperties, portal:string, router: string, portalType = properties.adminToolsPortalType):any { + if(!portal) { + portal = properties.adminToolsCommunity; } - if(!communityId) { - communityId = 'openaire'; + if(!portal) { + portal = 'openaire'; } if(typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/' + properties.adminToolsPortalType + '/' + communityId + '/pagehelpcontent/grouped?active=true&page=' + - ((page_route.indexOf("/"+communityId+"/")!=-1 ) ? ("/" + page_route.split("/"+communityId+"/")[1]) : page_route); + url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + + ((page_route.indexOf("/"+portal+"/")!=-1 ) ? ("/" + page_route.split("/"+portal+"/")[1]) : page_route); return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); }else { return of(null); diff --git a/utils/theme/theme.component.html b/utils/theme/theme.component.html index f1e5a32f..168f72fb 100644 --- a/utils/theme/theme.component.html +++ b/utils/theme/theme.component.html @@ -1,80 +1,18 @@ -
+
+
+ +
+
-
+
+
-
-
+ -
-
+
-
-
-
+

Article Title

-
-
-
+
-
-
-
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

-
-
-
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-
-
-
+ -
-
-
+
-
-
-
- -
+
- + +
+ +
- + +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+
    +
  • em element
  • +
  • ins element
  • +
  • mark element
  • +
  • q inside a q
  • +
  • strong element
  • +
  • Link Reset
  • +
+
+
+
    +
  • Text Muted
  • +
  • Text Emphasis
  • +
  • Text Background
  • +
  • Text Primary
  • +
  • Text Secondary
  • +
  • Text Success
  • +
  • Text Warning
  • +
  • Text Danger
  • +
  • Text Meta
  • +
+
+
+
    +
  • Default
  • +
  • Success
  • +
  • Warning
  • +
  • Danger
  • +
  • 1
  • +
  • + + + +
  • +
-
- +
<div class="myclass">...<div>
+ +
+

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element.

+ +
+ +
+ +
+
+ +
+ +
    +
  • +
    +
    +
    +
    + +
    + +
    + +
    +
    +

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

    +
    +
    +
  • +
+ + + +
+
+ +
+ + + + +
+ + + +
+
+

Default

+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+ +
+ +
+

Primary

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+ +
+

Secondary

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+ +
+

Hover

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table HeadingTable HeadingTable Heading
Table DataTable DataTable Data
Table DataTable DataTable Data
Table DataTable DataTable Data
Table DataTable DataTable Data
+
+ +
+ + + +

Default

+
+ +
+ + + +

Primary

+
+ +
+ + + +

Success

+
+ +
+ + + +

Warning

+
+ +
+ + + +

Danger

+
+ +
+
+
06
+
+
:
+
+
23
+
+
:
+
+
59
+
+
:
+
+
50
+
+
+ + + +
+
+ +

2XL

+

XLarge

+

Heading L

+

Heading M

+

Heading S

+ +

Heading H1

+

Heading H2

+

Heading H3

+

Heading H4

+
Heading H5
+
Heading H6
+ +

Heading Divider

+

Heading Bullet

+

Heading Line

+ +
+
+ +
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ +
+

Default Lorem ipsum dolor sit amet, consectetur.

+
+
+ +
+
+ +
+ +
+

Primary Lorem ipsum dolor sit amet, consectetur.

+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+
+ + + +
+
+ + + + + + + +
+ +
+ +
Tooltip
+ +
+
+ + 45% + +
+
+ + + +
+
+ + + +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
    +
  • List item 1
  • +
  • List item 2
  • +
  • List item 3
  • +
+ +
    +
  • List item 1
  • +
  • List item 2
  • +
  • List item 3
  • +
+ +
+
+ +
    +
  • List item 1
  • +
  • List item 2
  • +
  • List item 3
  • +
+ +
+
Description lists
+
A description text
+
Description lists
+
A description text
+
+ +
+
+ +
    +
  • + + Item 1 +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.

    +
    + +
  • +
  • + + Item 2 + + +
  • +
  • + + Item 3 + + +
  • +
+ +
+
+ +
+
+
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
+
+
+
+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

+
+
+ Button +
+
+ +
+
+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

+
+
+ Button +
+
+ +
+
+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

+
+
+ Button +
+
+ +
+
+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

+
+
+ Button +
+
+ +
+
+ + -
- -
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
-
-
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- -
-
- -
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.

-
-
- Button -
-
- -
-
- - - -
diff --git a/utils/theme/theme.component.ts b/utils/theme/theme.component.ts index 9f1c07ed..37bba193 100644 --- a/utils/theme/theme.component.ts +++ b/utils/theme/theme.component.ts @@ -1,6 +1,8 @@ -import {Component} from '@angular/core'; +import {Component, OnDestroy, OnInit} from '@angular/core'; import {ValidatorFn, Validators} from "@angular/forms"; import {StringUtils} from "../string-utils.class"; +import {ActivatedRoute} from "@angular/router"; +import {Subscriber} from "rxjs"; @Component({ @@ -8,9 +10,30 @@ import {StringUtils} from "../string-utils.class"; templateUrl: 'theme.component.html', }) -export class ThemeComponent { +export class ThemeComponent implements OnInit, OnDestroy { url: string = 'https://example.com'; logoURL: string = 'https://example.com/test.png'; + parentClass: string; + private subscriptions: any[] = []; required: ValidatorFn = Validators.required; urlValidator: ValidatorFn = StringUtils.urlValidator; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.subscriptions.push(this.route.queryParams.subscribe(params => { + if(params['parentClass']) { + this.parentClass = params['parentClass']; + } + })); + } + + ngOnDestroy() { + this.subscriptions.forEach(value => { + if (value instanceof Subscriber) { + value.unsubscribe(); + } + }); + } }