From: Kanika Murarka
Date: Thu, 4 Apr 2019 11:42:37 +0000 (+0530)
Subject: mgr/dashboard: Separate file for icons for refering and reusing
X-Git-Tag: v15.1.0~2323^2
X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4d7bb29a30800db18fe51eb868a5dd5eaafa6ef;p=ceph.git
mgr/dashboard: Separate file for icons for refering and reusing
Fixes: http://tracker.ceph.com/issues/39032
Signed-off-by: Kanika Murarka
---
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts
index 339a3c94e330..bc7a106e7126 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts
@@ -7,6 +7,9 @@ import { CdTableSelection } from '../../../shared/models/cd-table-selection';
import { SharedModule } from '../../../shared/shared.module';
import { IscsiTargetDetailsComponent } from './iscsi-target-details.component';
+import * as _ from 'lodash';
+import { Icons } from '../../../shared/enum/icons.enum';
+
describe('IscsiTargetDetailsComponent', () => {
let component: IscsiTargetDetailsComponent;
let fixture: ComponentFixture;
@@ -97,7 +100,10 @@ describe('IscsiTargetDetailsComponent', () => {
{
children: [{ id: 'disk_rbd_disk_1', value: 'rbd/disk_1' }],
settings: {
- cssClasses: { expanded: 'fa fa-fw fa-hdd-o fa-lg', leaf: 'fa fa-fw fa-hdd-o' },
+ cssClasses: {
+ expanded: _.join([Icons.width, Icons.large, Icons.disk], ' '),
+ leaf: _.join([Icons.width, Icons.disk], ' ')
+ },
selectionAllowed: false
},
value: 'Disks'
@@ -105,7 +111,10 @@ describe('IscsiTargetDetailsComponent', () => {
{
children: [{ value: 'node1:192.168.100.201' }],
settings: {
- cssClasses: { expanded: 'fa fa-fw fa-server fa-lg', leaf: 'fa fa-fw fa-server fa-lg' },
+ cssClasses: {
+ expanded: _.join([Icons.width, Icons.large, Icons.server], ' '),
+ leaf: _.join([Icons.width, Icons.large, Icons.server], ' ')
+ },
selectionAllowed: false
},
value: 'Portals'
@@ -117,7 +126,10 @@ describe('IscsiTargetDetailsComponent', () => {
{
id: 'disk_rbd_disk_1',
settings: {
- cssClasses: { expanded: 'fa fa-fw fa-hdd-o fa-lg', leaf: 'fa fa-fw fa-hdd-o' }
+ cssClasses: {
+ expanded: _.join([Icons.width, Icons.large, Icons.disk], ' '),
+ leaf: _.join([Icons.width, Icons.disk], ' ')
+ }
},
value: 'rbd/disk_1'
}
@@ -127,7 +139,10 @@ describe('IscsiTargetDetailsComponent', () => {
}
],
settings: {
- cssClasses: { expanded: 'fa fa-fw fa-user fa-lg', leaf: 'fa fa-fw fa-user' },
+ cssClasses: {
+ expanded: _.join([Icons.width, Icons.large, Icons.user], ' '),
+ leaf: _.join([Icons.width, Icons.user], ' ')
+ },
selectionAllowed: false
},
value: 'Initiators'
@@ -135,14 +150,20 @@ describe('IscsiTargetDetailsComponent', () => {
{
children: [],
settings: {
- cssClasses: { expanded: 'fa fa-fw fa-users fa-lg', leaf: 'fa fa-fw fa-users' },
+ cssClasses: {
+ expanded: _.join([Icons.width, Icons.large, Icons.user], ' '),
+ leaf: _.join([Icons.width, Icons.user], ' ')
+ },
selectionAllowed: false
},
value: 'Groups'
}
],
id: 'root',
- settings: { cssClasses: { expanded: 'fa fa-fw fa-bullseye fa-lg' }, static: true },
+ settings: {
+ cssClasses: { expanded: _.join([Icons.width, Icons.large, Icons.bullseye], ' ') },
+ static: true
+ },
value: 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw'
});
});
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts
index 588c24b5c248..03a172f0f5fa 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts
@@ -5,6 +5,7 @@ import * as _ from 'lodash';
import { NodeEvent, TreeModel } from 'ng2-tree';
import { TableComponent } from '../../../shared/datatable/table/table.component';
+import { Icons } from '../../../shared/enum/icons.enum';
import { CdTableColumn } from '../../../shared/models/cd-table-column';
import { CdTableSelection } from '../../../shared/models/cd-table-selection';
import { IscsiBackstorePipe } from '../../../shared/pipes/iscsi-backstore.pipe';
@@ -75,26 +76,25 @@ export class IscsiTargetDetailsComponent implements OnChanges, OnInit {
private generateTree() {
this.metadata = { root: this.selectedItem.target_controls };
-
const cssClasses = {
target: {
- expanded: 'fa fa-fw fa-bullseye fa-lg'
+ expanded: _.join([Icons.width, Icons.large, Icons.bullseye], ' ')
},
initiators: {
- expanded: 'fa fa-fw fa-user fa-lg',
- leaf: 'fa fa-fw fa-user'
+ expanded: _.join([Icons.width, Icons.large, Icons.user], ' '),
+ leaf: _.join([Icons.width, Icons.user], ' ')
},
groups: {
- expanded: 'fa fa-fw fa-users fa-lg',
- leaf: 'fa fa-fw fa-users'
+ expanded: _.join([Icons.width, Icons.large, Icons.user], ' '),
+ leaf: _.join([Icons.width, Icons.user], ' ')
},
disks: {
- expanded: 'fa fa-fw fa-hdd-o fa-lg',
- leaf: 'fa fa-fw fa-hdd-o'
+ expanded: _.join([Icons.width, Icons.large, Icons.disk], ' '),
+ leaf: _.join([Icons.width, Icons.disk], ' ')
},
portals: {
- expanded: 'fa fa-fw fa-server fa-lg',
- leaf: 'fa fa-fw fa-server fa-lg'
+ expanded: _.join([Icons.width, Icons.large, Icons.server], ' '),
+ leaf: _.join([Icons.width, Icons.large, Icons.server], ' ')
}
};
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html
index 5a7031dd4c0d..e3d56d301a60 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html
@@ -32,7 +32,7 @@
id="ecp-info-button"
type="button"
(click)="targetSettingsModal()">
-
@@ -84,7 +84,7 @@
@@ -102,7 +102,7 @@
[messages]="messages.portals"
(selection)="onPortalSelection($event)"
elemClass="btn btn-default pull-right">
-
+
Add portal
@@ -129,13 +129,13 @@
@@ -162,7 +162,7 @@
[messages]="messages.images"
(selection)="onImageSelection($event)"
elemClass="btn btn-default pull-right">
-
+
Add image
@@ -204,7 +204,7 @@
@@ -372,7 +372,7 @@
@@ -389,7 +389,7 @@
[options]="imagesInitiatorSelections[ii]"
[messages]="messages.initiatorImage"
elemClass="btn btn-default pull-right">
-
+
Add image
@@ -407,7 +407,7 @@
@@ -434,7 +434,7 @@
@@ -470,7 +470,7 @@
@@ -484,7 +484,7 @@
[messages]="messages.groupInitiator"
(selection)="onGroupMemberSelection($event)"
elemClass="btn btn-default pull-right">
-
+
Add initiator
@@ -512,7 +512,7 @@
@@ -525,7 +525,7 @@
[options]="groupDiskSelections[gi]"
[messages]="messages.initiatorImage"
elemClass="btn btn-default pull-right">
-
+
Add image
@@ -545,7 +545,7 @@
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts
index 0703e2e7bc4e..1092c7c49d52 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts
@@ -12,6 +12,7 @@ import { RbdService } from '../../../shared/api/rbd.service';
import { SelectMessages } from '../../../shared/components/select/select-messages.model';
import { SelectOption } from '../../../shared/components/select/select-option.model';
import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
+import { Icons } from '../../../shared/enum/icons.enum';
import { CdFormGroup } from '../../../shared/forms/cd-form-group';
import { CdValidators } from '../../../shared/forms/cd-validators';
import { FinishedTask } from '../../../shared/models/finished-task';
@@ -35,6 +36,8 @@ export class IscsiTargetFormComponent implements OnInit {
unsupported_rbd_features: any;
required_rbd_features: any;
+ icons = Icons;
+
isEdit = false;
target_iqn: string;
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html
index 084182df963c..a99424c6408a 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.html
@@ -33,7 +33,7 @@
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
index 6cca3b5cac49..2aa7886d6e04 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
@@ -5,6 +5,7 @@ import * as _ from 'lodash';
import { Subscription } from 'rxjs/Subscription';
import { HealthService } from '../../../shared/api/health.service';
+import { Icons } from '../../../shared/enum/icons.enum';
import { Permissions } from '../../../shared/models/permissions';
import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe';
import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
@@ -27,6 +28,7 @@ export class HealthComponent implements OnInit, OnDestroy {
interval = new Subscription();
permissions: Permissions;
enabledFeature$: FeatureTogglesMap$;
+ icons = Icons;
rawCapacityChartConfig = {
options: {
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
index b5a05c75f1c8..bce451316053 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
@@ -95,7 +95,7 @@
-
+
Add clients
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
index a549deb0445c..5067f5a2ba74 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
@@ -5,6 +5,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill';
import * as _ from 'lodash';
import { NfsService } from '../../../shared/api/nfs.service';
+import { Icons } from '../../../shared/enum/icons.enum';
import { CdFormGroup } from '../../../shared/forms/cd-form-group';
@Component({
@@ -18,6 +19,7 @@ export class NfsFormClientComponent {
nfsSquash: any[] = this.nfsService.nfsSquash;
nfsAccessType: any[] = this.nfsService.nfsAccessType;
+ icons = Icons;
constructor(private nfsService: NfsService, private i18n: I18n) {}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
index d1300cb3d417..5057a1faf1d7 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
@@ -63,7 +63,7 @@
-
@@ -77,7 +77,7 @@
[messages]="daemonsMessages"
(selection)="onDaemonSelection()"
elemClass="btn btn-default pull-right">
-
+
Add daemon
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
index 8916d1b7da00..0545e33e44d7 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
@@ -12,6 +12,7 @@ import { RgwUserService } from '../../../shared/api/rgw-user.service';
import { SelectMessages } from '../../../shared/components/select/select-messages.model';
import { SelectOption } from '../../../shared/components/select/select-option.model';
import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
+import { Icons } from '../../../shared/enum/icons.enum';
import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
import { CdFormGroup } from '../../../shared/forms/cd-form-group';
import { CdValidators } from '../../../shared/forms/cd-validators';
@@ -43,6 +44,7 @@ export class NfsFormComponent implements OnInit {
allClusters: string[] = null;
allDaemons = {};
+ icons = Icons;
allFsals: any[] = [];
allRgwUsers: any[] = [];
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
index 14cbe2d664b9..3ea15378760d 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
@@ -10,6 +10,7 @@ import { CriticalConfirmationModalComponent } from '../../../shared/components/c
import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
import { TableComponent } from '../../../shared/datatable/table/table.component';
import { CellTemplate } from '../../../shared/enum/cell-template.enum';
+import { Icons } from '../../../shared/enum/icons.enum';
import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';
import { CdTableAction } from '../../../shared/models/cd-table-action';
import { CdTableColumn } from '../../../shared/models/cd-table-column';
@@ -74,7 +75,7 @@ export class NfsListComponent implements OnInit, OnDestroy {
const createAction: CdTableAction = {
permission: 'create',
- icon: 'fa-plus',
+ icon: Icons.add,
routerLink: () => '/nfs/create',
canBePrimary: (selection: CdTableSelection) => !selection.hasSingleSelection,
name: this.actionLabels.CREATE
@@ -82,14 +83,14 @@ export class NfsListComponent implements OnInit, OnDestroy {
const editAction: CdTableAction = {
permission: 'update',
- icon: 'fa-pencil',
+ icon: Icons.edit,
routerLink: () => `/nfs/edit/${getNfsUri()}`,
name: this.actionLabels.EDIT
};
const deleteAction: CdTableAction = {
permission: 'delete',
- icon: 'fa-times',
+ icon: Icons.destroy,
click: () => this.deleteNfsModal(),
name: this.actionLabels.DELETE
};
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html
index ad9dca78e350..f958aaa2a4ea 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.html
@@ -1,7 +1,7 @@
-
+
Loading...
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts
index daa2ff74eaae..767ddeb6e5d8 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts
@@ -5,6 +5,7 @@ import * as _ from 'lodash';
import { BsModalService } from 'ngx-bootstrap/modal';
import { RgwUserService } from '../../../shared/api/rgw-user.service';
+import { Icons } from '../../../shared/enum/icons.enum';
import { CdTableColumn } from '../../../shared/models/cd-table-column';
import { CdTableSelection } from '../../../shared/models/cd-table-selection';
import { RgwUserS3Key } from '../models/rgw-user-s3-key';
@@ -34,6 +35,8 @@ export class RgwUserDetailsComponent implements OnChanges, OnInit {
keysColumns: CdTableColumn[] = [];
keysSelection: CdTableSelection = new CdTableSelection();
+ icons = Icons;
+
constructor(
private rgwUserService: RgwUserService,
private bsModalService: BsModalService,
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html
index 12dd06c55941..b7dda481c515 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html
@@ -215,7 +215,7 @@
-
+
-
+
-
+
-
+
@@ -253,7 +253,7 @@
-
+
{{ actionLabels.CREATE | titlecase }} {{ subuserLabel | upperFirst }}
@@ -277,7 +277,7 @@
-
+
-
+
-
+
@@ -307,7 +307,7 @@
-
+
{{ actionLabels.CREATE | titlecase }} {{ s3keyLabel | upperFirst }}
@@ -327,7 +327,7 @@
-
+
-
+
@@ -362,7 +362,7 @@
-
+
-
+
-
+
@@ -392,7 +392,7 @@
-
+
{{ actionLabels.ADD | titlecase }} {{ capabilityLabel | upperFirst }}
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
index 9ecf7eccedc3..aa973270a202 100644
--- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
@@ -9,6 +9,7 @@ import { concat as observableConcat, forkJoin as observableForkJoin, Observable
import { RgwUserService } from '../../../shared/api/rgw-user.service';
import { ActionLabelsI18n, URLVerbs } from '../../../shared/constants/app.constants';
+import { Icons } from '../../../shared/enum/icons.enum';
import { NotificationType } from '../../../shared/enum/notification-type.enum';
import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
import { CdFormGroup } from '../../../shared/forms/cd-form-group';
@@ -35,7 +36,7 @@ export class RgwUserFormComponent implements OnInit {
error = false;
loading = false;
submitObservables: Observable