From: Nizamudeen A Date: Thu, 5 Nov 2020 16:27:00 +0000 (+0530) Subject: mgr/dashboard: Moving copyright into the app.constants X-Git-Tag: v16.1.0~654^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff7ea2950dca14fe9e6d8bc9f25f52d0c3721dc8;p=ceph.git mgr/dashboard: Moving copyright into the app.constants Move the variable copyright from about.component.ts to the app.constants.ts https://tracker.ceph.com/issues/48135 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.html index 9c285242f0c9..fdf4d95cfdd1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.html @@ -40,7 +40,7 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.spec.ts index a636f7fbe106..1803f297e509 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.spec.ts @@ -4,6 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { BehaviorSubject } from 'rxjs'; +import { environment } from '../../../../environments/environment'; import { configureTestBed } from '../../../../testing/unit-test-helper'; import { SummaryService } from '../../../shared/services/summary.service'; import { SharedModule } from '../../../shared/shared.module'; @@ -52,4 +53,8 @@ describe('AboutComponent', () => { it('should get host', () => { expect(component.hostAddr).toBe('localhost:11000'); }); + + it('should display copyright', () => { + expect(component.projectConstants.copyright).toContain(environment.year); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.ts index 6f885a9e6e81..baf5a7c2f278 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.ts @@ -4,7 +4,6 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { detect } from 'detect-browser'; import { Subscription } from 'rxjs'; -import { environment } from '../../../../environments/environment'; import { UserService } from '../../../shared/api/user.service'; import { AppConstants } from '../../../shared/constants/app.constants'; import { Permission } from '../../../shared/models/permissions'; @@ -37,7 +36,6 @@ export class AboutComponent implements OnInit, OnDestroy { } ngOnInit() { - this.copyright = 'Copyright(c) ' + environment.year + ' Ceph contributors.'; this.projectConstants = AppConstants; this.hostAddr = window.location.hostname; this.modalVariables = this.setVariables(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts index 3ce91b55ee27..d8169423204f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts @@ -1,9 +1,12 @@ import { Injectable } from '@angular/core'; +import { environment } from '../../../environments/environment'; + export class AppConstants { public static readonly organization = 'ceph'; public static readonly projectName = 'Ceph Dashboard'; public static readonly license = 'Free software (LGPL 2.1).'; + public static readonly copyright = 'Copyright(c) ' + environment.year + ' Ceph contributors.'; } export enum URLVerbs {