]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Rename pipe list -> join 31843/head
authorVolker Theile <vtheile@suse.com>
Mon, 25 Nov 2019 09:30:07 +0000 (10:30 +0100)
committerVolker Theile <vtheile@suse.com>
Wed, 27 Nov 2019 10:33:33 +0000 (11:33 +0100)
Signed-off-by: Volker Theile <vtheile@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.spec.ts [deleted file]
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.ts [deleted file]
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/pipes.module.ts

index c7d533c186ddf3c022d2aeb0eb49cb24c29e2a00..528f0a77a4f8a1c93d349967ccf2280361fd64f9 100644 (file)
@@ -8,7 +8,6 @@ import { IscsiService } from '../../../shared/api/iscsi.service';
 import { CephShortVersionPipe } from '../../../shared/pipes/ceph-short-version.pipe';
 import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
 import { IscsiBackstorePipe } from '../../../shared/pipes/iscsi-backstore.pipe';
-import { ListPipe } from '../../../shared/pipes/list.pipe';
 import { RelativeDatePipe } from '../../../shared/pipes/relative-date.pipe';
 import { FormatterService } from '../../../shared/services/formatter.service';
 import { SharedModule } from '../../../shared/shared.module';
@@ -38,7 +37,6 @@ describe('IscsiComponent', () => {
       FormatterService,
       RelativeDatePipe,
       IscsiBackstorePipe,
-      ListPipe,
       { provide: IscsiService, useValue: fakeService },
       i18nProviders
     ]
index 2d5d8c426d7c8964d131eca7bd0128cf9300f566..45c488fb1bff814720c4750c72fc210d29a0f898 100644 (file)
@@ -59,7 +59,7 @@
 
 <ng-template #markOsdConfirmationTpl
              let-markActionDescription="markActionDescription">
-  <ng-container i18n><strong>OSD(s) {{  getSelectedOsdIds() | list }}</strong> will be marked
+  <ng-container i18n><strong>OSD(s) {{  getSelectedOsdIds() | join }}</strong> will be marked
 <strong>{{ markActionDescription }}</strong> if you proceed.</ng-container>
 </ng-template>
 
@@ -71,6 +71,6 @@
     <cd-alert-panel type="warning"
                     i18n>The {selection.hasSingleSelection, select, 1 {OSD is} 0 {OSDs are}} not safe to destroy!</cd-alert-panel>
   </div>
-  <ng-container i18n><strong>OSD {{ getSelectedOsdIds() | list }}</strong> will be
+  <ng-container i18n><strong>OSD {{ getSelectedOsdIds() | join }}</strong> will be
 <strong>{{ actionDescription }}</strong> if you proceed.</ng-container>
 </ng-template>
index f02a04afd0dc0d9bb0d77b4b4a526ee039c0ffb4..f5a5bb2f1ced3423c1e081276525315e0487d282 100644 (file)
@@ -9,7 +9,7 @@
           novalidate>
       <div class="modal-body">
         <p i18n>You are about to apply a {deep, select, 1 {deep }}scrub to
-          the OSD(s): <strong>{{ selected | list }}</strong>.</p>
+          the OSD(s): <strong>{{ selected | join }}</strong>.</p>
       </div>
 
       <div class="modal-footer">
index bf8a553ba50b0b6b15e9fdd2eff86a145edc75e9..319e86645694e72b05050258b6f007db33dc7bbe 100644 (file)
@@ -5,7 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms';
 import { BsModalRef } from 'ngx-bootstrap/modal';
 import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
 import { OsdService } from '../../../../shared/api/osd.service';
-import { ListPipe } from '../../../../shared/pipes/list.pipe';
+import { JoinPipe } from '../../../../shared/pipes/join.pipe';
 import { NotificationService } from '../../../../shared/services/notification.service';
 import { OsdScrubModalComponent } from './osd-scrub-modal.component';
 
@@ -27,11 +27,11 @@ describe('OsdScrubModalComponent', () => {
 
   configureTestBed({
     imports: [ReactiveFormsModule],
-    declarations: [OsdScrubModalComponent, ListPipe],
+    declarations: [OsdScrubModalComponent, JoinPipe],
     schemas: [NO_ERRORS_SCHEMA],
     providers: [
       BsModalRef,
-      ListPipe,
+      JoinPipe,
       { provide: OsdService, useValue: fakeService },
       { provide: NotificationService, useValue: fakeService },
       i18nProviders
index 7b859b7398f1ee2e9de793c1fe7b651bd4277473..340dff9e615c1e3ab9a569a7b255e5b4e9b6e494 100644 (file)
@@ -7,7 +7,7 @@ import { forkJoin } from 'rxjs';
 
 import { OsdService } from '../../../../shared/api/osd.service';
 import { NotificationType } from '../../../../shared/enum/notification-type.enum';
-import { ListPipe } from '../../../../shared/pipes/list.pipe';
+import { JoinPipe } from '../../../../shared/pipes/join.pipe';
 import { NotificationService } from '../../../../shared/services/notification.service';
 
 @Component({
@@ -25,7 +25,7 @@ export class OsdScrubModalComponent implements OnInit {
     private osdService: OsdService,
     private notificationService: NotificationService,
     private i18n: I18n,
-    private listPipe: ListPipe
+    private joinPipe: JoinPipe
   ) {}
 
   ngOnInit() {
@@ -41,7 +41,7 @@ export class OsdScrubModalComponent implements OnInit {
           NotificationType.success,
           this.i18n('{{operation}} was initialized in the following OSD(s): {{id}}', {
             operation: operation,
-            id: this.listPipe.transform(this.selected)
+            id: this.joinPipe.transform(this.selected)
           })
         );
 
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.spec.ts
new file mode 100644 (file)
index 0000000..01bccbc
--- /dev/null
@@ -0,0 +1,13 @@
+import { JoinPipe } from './join.pipe';
+
+describe('ListPipe', () => {
+  const pipe = new JoinPipe();
+
+  it('create an instance', () => {
+    expect(pipe).toBeTruthy();
+  });
+
+  it('transforms "[1,2,3]"', () => {
+    expect(pipe.transform([1, 2, 3])).toBe('1, 2, 3');
+  });
+});
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/join.pipe.ts
new file mode 100644 (file)
index 0000000..6861084
--- /dev/null
@@ -0,0 +1,10 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+  name: 'join'
+})
+export class JoinPipe implements PipeTransform {
+  transform(value: Array<any>): string {
+    return value.join(', ');
+  }
+}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.spec.ts
deleted file mode 100644 (file)
index d26fd65..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-import { ListPipe } from './list.pipe';
-
-describe('ListPipe', () => {
-  const pipe = new ListPipe();
-
-  it('create an instance', () => {
-    expect(pipe).toBeTruthy();
-  });
-
-  it('transforms "[1,2,3]"', () => {
-    expect(pipe.transform([1, 2, 3])).toBe('1, 2, 3');
-  });
-});
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.ts
deleted file mode 100644 (file)
index 9a044c1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Pipe, PipeTransform } from '@angular/core';
-
-@Pipe({
-  name: 'list'
-})
-export class ListPipe implements PipeTransform {
-  transform(value: any): any {
-    return value.join(', ');
-  }
-}
index 89e68489dc171b87cb5840531903e2a46557a543..898316892d065f7b63f3b5c234d4c66c8e73bbd9 100644 (file)
@@ -15,7 +15,7 @@ import { FilterPipe } from './filter.pipe';
 import { HealthColorPipe } from './health-color.pipe';
 import { IopsPipe } from './iops.pipe';
 import { IscsiBackstorePipe } from './iscsi-backstore.pipe';
-import { ListPipe } from './list.pipe';
+import { JoinPipe } from './join.pipe';
 import { LogPriorityPipe } from './log-priority.pipe';
 import { MillisecondsPipe } from './milliseconds.pipe';
 import { OrdinalPipe } from './ordinal.pipe';
@@ -36,7 +36,7 @@ import { UpperFirstPipe } from './upper-first.pipe';
     CephReleaseNamePipe,
     RelativeDatePipe,
     IscsiBackstorePipe,
-    ListPipe,
+    JoinPipe,
     LogPriorityPipe,
     FilterPipe,
     CdDatePipe,
@@ -60,7 +60,7 @@ import { UpperFirstPipe } from './upper-first.pipe';
     CephReleaseNamePipe,
     RelativeDatePipe,
     IscsiBackstorePipe,
-    ListPipe,
+    JoinPipe,
     LogPriorityPipe,
     FilterPipe,
     CdDatePipe,
@@ -84,7 +84,7 @@ import { UpperFirstPipe } from './upper-first.pipe';
     DimlessPipe,
     RelativeDatePipe,
     IscsiBackstorePipe,
-    ListPipe,
+    JoinPipe,
     LogPriorityPipe,
     CdDatePipe,
     EmptyPipe,