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';
FormatterService,
RelativeDatePipe,
IscsiBackstorePipe,
- ListPipe,
{ provide: IscsiService, useValue: fakeService },
i18nProviders
]
<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>
<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>
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">
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';
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
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({
private osdService: OsdService,
private notificationService: NotificationService,
private i18n: I18n,
- private listPipe: ListPipe
+ private joinPipe: JoinPipe
) {}
ngOnInit() {
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)
})
);
--- /dev/null
+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');
+ });
+});
--- /dev/null
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'join'
+})
+export class JoinPipe implements PipeTransform {
+ transform(value: Array<any>): string {
+ return value.join(', ');
+ }
+}
+++ /dev/null
-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');
- });
-});
+++ /dev/null
-import { Pipe, PipeTransform } from '@angular/core';
-
-@Pipe({
- name: 'list'
-})
-export class ListPipe implements PipeTransform {
- transform(value: any): any {
- return value.join(', ');
- }
-}
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';
CephReleaseNamePipe,
RelativeDatePipe,
IscsiBackstorePipe,
- ListPipe,
+ JoinPipe,
LogPriorityPipe,
FilterPipe,
CdDatePipe,
CephReleaseNamePipe,
RelativeDatePipe,
IscsiBackstorePipe,
- ListPipe,
+ JoinPipe,
LogPriorityPipe,
FilterPipe,
CdDatePipe,
DimlessPipe,
RelativeDatePipe,
IscsiBackstorePipe,
- ListPipe,
+ JoinPipe,
LogPriorityPipe,
CdDatePipe,
EmptyPipe,