]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Moving copyright into the app.constants 37965/head
authorNizamudeen A <nia@redhat.com>
Thu, 5 Nov 2020 16:27:00 +0000 (21:57 +0530)
committerNizamudeen A <nia@redhat.com>
Thu, 5 Nov 2020 16:27:00 +0000 (21:57 +0530)
Move the variable copyright from about.component.ts to the app.constants.ts

https://tracker.ceph.com/issues/48135
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/about/about.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts

index 9c285242f0c97bdca542e08f9ac37242eaf0c377..fdf4d95cfdd1e62cc69ddd5d19946cc68c49da24 100644 (file)
@@ -40,7 +40,7 @@
   </div>
   <div class="modal-footer">
     <div class="text-left">
-      {{ copyright }}
+      {{ projectConstants.copyright }}
       {{ projectConstants.license }}
     </div>
   </div>
index a636f7fbe10628e8bffd2df63496524e08c8638b..1803f297e509207cddc3c708001de1526a2b6363 100644 (file)
@@ -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);
+  });
 });
index 6f885a9e6e8169f5d7ba77a88f69409938a9dd05..baf5a7c2f278e51ad10f1099b1586d825bf13838 100644 (file)
@@ -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();
index 3ce91b55ee273457b3c128f145e0e79fa4891f8d..d8169423204f4402a6ec5c045e161edd7c51cd47 100644 (file)
@@ -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 {