create FAQ page, add isDevelopmentGuard to it, change to new uoa-monitor-service duffy port
This commit is contained in:
parent
d9f72b77d0
commit
d5016fdf40
|
@ -1,6 +1,7 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
||||
import {isDevelopmentGuard} from './openaireLibrary/error/isDevelopmentGuard.guard';
|
||||
|
||||
const routes: Routes = [
|
||||
{path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule)},
|
||||
|
@ -29,6 +30,11 @@ const routes: Routes = [
|
|||
path: 'get-started',
|
||||
loadChildren: () => import('./get-started/get-started.module').then(m => m.GetStartedModule)
|
||||
},
|
||||
{
|
||||
path: 'faq',
|
||||
loadChildren: () => import('./faq/faq.module').then(m => m.FaqModule),
|
||||
canLoad: [isDevelopmentGuard]
|
||||
},
|
||||
{
|
||||
path: 'my-dashboards',
|
||||
loadChildren: () => import('./my-stakeholders/my-stakeholders.module').then(m => m.MyStakeholdersModule)},
|
||||
|
|
|
@ -19,6 +19,7 @@ import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service
|
|||
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
|
||||
import {SharedModule} from "./openaireLibrary/shared/shared.module";
|
||||
import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module";
|
||||
import {isDevelopmentGuard} from './openaireLibrary/error/isDevelopmentGuard.guard';
|
||||
|
||||
@NgModule({
|
||||
|
||||
|
@ -42,6 +43,7 @@ import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module"
|
|||
declarations: [AppComponent, OpenaireErrorPageComponent],
|
||||
exports: [AppComponent],
|
||||
providers: [
|
||||
isDevelopmentGuard,
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: HttpInterceptorService,
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {FaqComponent} from "./faq.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: FaqComponent, canDeactivate: [PreviousRouteRecorder] }
|
||||
])
|
||||
]
|
||||
})
|
||||
export class FaqRoutingModule { }
|
|
@ -0,0 +1,8 @@
|
|||
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
|
||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-container uk-container-large uk-section">
|
||||
<h1>Frequently asked questions<span class="uk-text-primary">.</span></h1>
|
||||
</div>
|
|
@ -0,0 +1,85 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
|
||||
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
|
||||
import {properties} from "../../environments/environment";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component';
|
||||
|
||||
@Component({
|
||||
selector: 'faq',
|
||||
templateUrl: 'faq.component.html'
|
||||
})
|
||||
export class FaqComponent {
|
||||
public pageContents = null;
|
||||
public divContents = null;
|
||||
|
||||
public url: string = null;
|
||||
public pageTitle: string = "OpenAIRE - Monitor | FAQ";
|
||||
public description: string = "OpenAIRE - Monitor | FAQ";
|
||||
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'FAQ'}];
|
||||
public properties: EnvProperties = properties;
|
||||
subscriptions = [];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
private _meta: Meta,
|
||||
private _title: Title,
|
||||
private seoService: SEOService,
|
||||
private _piwikService: PiwikService,
|
||||
private helper: HelperService) {
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
|
||||
}
|
||||
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
|
||||
this.seoService.createLinkForCanonicalURL(this.url);
|
||||
this.updateUrl(this.url);
|
||||
this.updateTitle(this.pageTitle);
|
||||
this.updateDescription(this.description);
|
||||
//this.getDivContents();
|
||||
//this.getPageContents();
|
||||
}
|
||||
|
||||
private getPageContents() {
|
||||
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
|
||||
this.pageContents = contents;
|
||||
}));
|
||||
}
|
||||
|
||||
private getDivContents() {
|
||||
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
|
||||
this.divContents = contents;
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscriptions.forEach(subscription => {
|
||||
if (subscription instanceof Subscriber) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private updateDescription(description: string) {
|
||||
this._meta.updateTag({content: description}, "name='description'");
|
||||
this._meta.updateTag({content: description}, "property='og:description'");
|
||||
}
|
||||
|
||||
private updateTitle(title: string) {
|
||||
var _title = ((title.length > 50) ? title.substring(0, 50) : title);
|
||||
this._title.setTitle(_title);
|
||||
this._meta.updateTag({content: _title}, "property='og:title'");
|
||||
}
|
||||
|
||||
private updateUrl(url: string) {
|
||||
this._meta.updateTag({content: url}, "property='og:url'");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule} from '@angular/router';
|
||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
|
||||
import {FaqComponent} from "./faq.component";
|
||||
import {FaqRoutingModule} from "./faq-routing.module";
|
||||
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
|
||||
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
|
||||
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
|
||||
import {BreadcrumbsModule} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.module';
|
||||
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, RouterModule, FaqRoutingModule, HelperModule,
|
||||
Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, IconsModule
|
||||
],
|
||||
declarations: [
|
||||
FaqComponent
|
||||
],
|
||||
exports: [
|
||||
FaqComponent
|
||||
],
|
||||
providers:[
|
||||
PreviousRouteRecorder, PiwikService
|
||||
]
|
||||
})
|
||||
export class FaqModule { }
|
|
@ -1 +1 @@
|
|||
Subproject commit ef977475968db020ec8b06146d67b36dc0ff7009
|
||||
Subproject commit d6c54949df4c0106ad0f290fcc1c245a9324015d
|
|
@ -45,8 +45,8 @@ export let properties: EnvProperties = {
|
|||
cookieDomain: ".di.uoa.gr",
|
||||
feedbackmail: "openaire.test@gmail.com",
|
||||
cacheUrl: "http://scoobydoo.di.uoa.gr:3000/get?url=",
|
||||
monitorServiceAPIURL: "http://duffy.di.uoa.gr:8080/uoa-monitor-service",
|
||||
adminToolsAPIURL: "http://duffy.di.uoa.gr:8080/uoa-monitor-service/",
|
||||
monitorServiceAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service",
|
||||
adminToolsAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service/",
|
||||
adminToolsPortalType: "monitor",
|
||||
adminToolsCommunity: "monitor",
|
||||
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/",
|
||||
|
|
Loading…
Reference in New Issue