mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
fix(pages): titles and discriptions
This commit is contained in:
parent
cca53006f4
commit
c38f01911b
5 changed files with 48 additions and 11 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
import { Component, Inject, NgZone, OnDestroy, OnInit } from '@angular/core';
|
import { Component, Inject, NgZone, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Title } from '@angular/platform-browser';
|
|
||||||
import {
|
import {
|
||||||
filter,
|
filter,
|
||||||
map,
|
map,
|
||||||
|
|
@ -21,6 +20,7 @@ import { fromEvent } from 'rxjs';
|
||||||
|
|
||||||
import { NgxStructureService } from '../../../@theme/services/structure.service';
|
import { NgxStructureService } from '../../../@theme/services/structure.service';
|
||||||
import { NgxTocStateService } from '../../../@theme/services/toc-state.service';
|
import { NgxTocStateService } from '../../../@theme/services/toc-state.service';
|
||||||
|
import {MetadataService} from '../../../../../src/app/@core/utils/metadata.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-admin-landing-page',
|
selector: 'ngx-admin-landing-page',
|
||||||
|
|
@ -38,7 +38,7 @@ export class NgxAdminLandingPageComponent implements OnDestroy, OnInit {
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private structureService: NgxStructureService,
|
private structureService: NgxStructureService,
|
||||||
private tocState: NgxTocStateService,
|
private tocState: NgxTocStateService,
|
||||||
private titleService: Title) {
|
private metaDataService: MetadataService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
get showSettings() {
|
get showSettings() {
|
||||||
|
|
@ -63,7 +63,8 @@ export class NgxAdminLandingPageComponent implements OnDestroy, OnInit {
|
||||||
}),
|
}),
|
||||||
filter(item => item),
|
filter(item => item),
|
||||||
tap((item: any) => {
|
tap((item: any) => {
|
||||||
this.titleService.setTitle(`Nebular - ${item.name}`);
|
this.metaDataService.updateTitle(`Nebular - ${item.name}`);
|
||||||
|
this.metaDataService.updateDescription(item.description);
|
||||||
}),
|
}),
|
||||||
publishReplay(),
|
publishReplay(),
|
||||||
refCount(),
|
refCount(),
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export const structure = [
|
||||||
{
|
{
|
||||||
type: 'page',
|
type: 'page',
|
||||||
name: 'Installation Guidelines',
|
name: 'Installation Guidelines',
|
||||||
|
description: 'A guideline to install ngx-admin on your machine: backend integration, tools you need to be installed.',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
|
|
@ -28,6 +29,7 @@ export const structure = [
|
||||||
{
|
{
|
||||||
type: 'page',
|
type: 'page',
|
||||||
name: 'Server deployment',
|
name: 'Server deployment',
|
||||||
|
description: 'How to set up your web-server to better serve the application on Angular.',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
|
|
@ -45,6 +47,7 @@ export const structure = [
|
||||||
{
|
{
|
||||||
type: 'page',
|
type: 'page',
|
||||||
name: 'Theme System',
|
name: 'Theme System',
|
||||||
|
description: 'Theme System in is a set of rules we put into how SCSS files and variables are organized. Theme Map | Component Variables | Built-in-Themes',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
|
|
@ -56,6 +59,7 @@ export const structure = [
|
||||||
{
|
{
|
||||||
type: 'page',
|
type: 'page',
|
||||||
name: 'Change Theme',
|
name: 'Change Theme',
|
||||||
|
description: 'How to change the current theme in ngx-admin. Switch from Cosmic to Default. Runtime Theme Switch.',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
|
|
@ -67,6 +71,7 @@ export const structure = [
|
||||||
{
|
{
|
||||||
type: 'page',
|
type: 'page',
|
||||||
name: 'Backend integration',
|
name: 'Backend integration',
|
||||||
|
description: 'Approaches of integration of ngx-admin application with backend API. Integration with JSON REST server, angular-cli/webpack-dev-server setup.',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
type: 'block',
|
type: 'block',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { NbThemeService } from '@nebular/theme';
|
||||||
import { takeWhile } from 'rxjs/operators' ;
|
import { takeWhile } from 'rxjs/operators' ;
|
||||||
import { SolarData } from '../../@core/data/solar';
|
import { SolarData } from '../../@core/data/solar';
|
||||||
import { AbService } from '../../@core/utils/ab.service';
|
import { AbService } from '../../@core/utils/ab.service';
|
||||||
|
import {MetadataService} from '../../@core/utils/metadata.service';
|
||||||
|
|
||||||
interface CardSettings {
|
interface CardSettings {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
@ -85,6 +86,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(private themeService: NbThemeService,
|
constructor(private themeService: NbThemeService,
|
||||||
|
private metaDataService: MetadataService,
|
||||||
private solarService: SolarData,
|
private solarService: SolarData,
|
||||||
private abService: AbService) {
|
private abService: AbService) {
|
||||||
this.themeService.getJsTheme()
|
this.themeService.getJsTheme()
|
||||||
|
|
@ -101,6 +103,8 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.metaDataService.updateTitle('Ngx-admin IoT dashboard on Angular 9+ and Nebular.');
|
||||||
|
|
||||||
this.abService.onAbEvent(AbService.VARIANT_HIDE_CALL_ACTION)
|
this.abService.onAbEvent(AbService.VARIANT_HIDE_CALL_ACTION)
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(() => this.showCallAction = false );
|
.subscribe(() => this.showCallAction = false );
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { takeWhile } from 'rxjs/operators';
|
import { takeWhile } from 'rxjs/operators';
|
||||||
import { AbService } from '../../@core/utils/ab.service';
|
import { AbService } from '../../@core/utils/ab.service';
|
||||||
|
import {MetadataService} from '../../@core/utils/metadata.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-ecommerce',
|
selector: 'ngx-ecommerce',
|
||||||
|
|
@ -11,9 +12,12 @@ export class ECommerceComponent implements OnInit, OnDestroy {
|
||||||
private alive = true;
|
private alive = true;
|
||||||
showCallAction = true;
|
showCallAction = true;
|
||||||
|
|
||||||
constructor (private abService: AbService) {}
|
constructor (private abService: AbService,
|
||||||
|
private metaDataService: MetadataService) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.metaDataService.updateTitle('Ngx-admin e-commerce dashboard on Angular 9+ and Nebular.');
|
||||||
|
|
||||||
this.abService.onAbEvent(AbService.VARIANT_HIDE_CALL_ACTION)
|
this.abService.onAbEvent(AbService.VARIANT_HIDE_CALL_ACTION)
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(() => this.showCallAction = false );
|
.subscribe(() => this.showCallAction = false );
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,27 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||||
|
|
||||||
import { MENU_ITEMS } from './pages-menu';
|
import {MENU_ITEMS} from './pages-menu';
|
||||||
|
import {NbMenuItem, NbMenuService} from '@nebular/theme';
|
||||||
|
import {takeUntil} from 'rxjs/operators';
|
||||||
|
import {Subject} from 'rxjs';
|
||||||
|
import {MetadataService} from '../@core/utils/metadata.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-pages',
|
selector: 'ngx-pages',
|
||||||
styleUrls: ['pages.component.scss'],
|
styleUrls: ['pages.component.scss'],
|
||||||
template: `
|
template: `
|
||||||
<ngx-sample-layout>
|
<ngx-sample-layout>
|
||||||
<nb-menu [items]="menu"></nb-menu>
|
<nb-menu [items]="menu"></nb-menu>
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</ngx-sample-layout>
|
</ngx-sample-layout>
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class PagesComponent implements OnInit {
|
export class PagesComponent implements OnInit, OnDestroy {
|
||||||
|
destroy$: Subject<boolean> = new Subject<boolean>();
|
||||||
|
|
||||||
|
constructor(private menuService: NbMenuService,
|
||||||
|
private metaDataService: MetadataService) {
|
||||||
|
}
|
||||||
|
|
||||||
menu = MENU_ITEMS;
|
menu = MENU_ITEMS;
|
||||||
|
|
||||||
|
|
@ -20,5 +29,19 @@ export class PagesComponent implements OnInit {
|
||||||
if (window['dataLayer']) {
|
if (window['dataLayer']) {
|
||||||
window['dataLayer'].push({'event': 'optimize.activate'});
|
window['dataLayer'].push({'event': 'optimize.activate'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.menuService
|
||||||
|
.onItemSelect()
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe((data: { tag: string; item: NbMenuItem }) => {
|
||||||
|
if (data.item.title !== 'E-commerce' && data.item.title !== 'IoT Dashboard')
|
||||||
|
this.metaDataService.updateTitle(`Ngx-admin dashboard by Akveo| ${data.item.title}`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.destroy$.next();
|
||||||
|
this.destroy$.complete();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue