]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix OSD critical confirmation modal errors 35766/head
authorKiefer Chang <kiefer.chang@suse.com>
Mon, 8 Jun 2020 07:42:01 +0000 (15:42 +0800)
committerLaura Paduano <lpaduano@suse.com>
Thu, 2 Jul 2020 09:54:00 +0000 (11:54 +0200)
- Fix OSD IDs are not displayed after submitting actions.
- Fix `OSD is` and `OSDs are` strings are missing in the unsafe
  operation warning panel.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
(cherry picked from commit 53401d7a54623e26cfcd538213fd0a7312bf3106)

 Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
- Changes in the i18n section line 71 - 73
- Removed new lines of "ng template osdUsageTpl" which came with the cherry-pick
  since the template is already in a tab and thus would be duplicated
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
- Match angular 8 line 59 ("ViewChild")

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-list/osd-list.component.ts

index ebb18a9e2de8a0a8f937591c9492c70862538153..48a051fa9b4f0252ec525209fe82bd6cea33279c 100644 (file)
 <ng-template #criticalConfirmationTpl
              let-safeToPerform="safeToPerform"
              let-message="message"
-             let-actionDescription="actionDescription">
+             let-actionDescription="actionDescription"
+             let-osdIds="osdIds">
   <div *ngIf="!safeToPerform"
        class="danger">
     <cd-alert-panel type="warning"
-                    i18n>The {selection.hasSingleSelection, select, 1 {OSD is} 0 {OSDs are}} not safe to be {{ actionDescription }}! {{ message }}</cd-alert-panel>
+                    i18n>The {selection.hasSingleSelection, select, true {OSD is} false {OSDs are}} not safe to be
+      {{ actionDescription }}! {{ message }}</cd-alert-panel>
   </div>
-  <ng-container i18n><strong>OSD {{ getSelectedOsdIds() | join }}</strong> will be
-<strong>{{ actionDescription }}</strong> if you proceed.</ng-container>
+  <ng-container i18n><strong>OSD {{ osdIds | join }}</strong> will be
+  <strong>{{ actionDescription }}</strong> if you proceed.</ng-container>
 </ng-template>
 
 <ng-template #deleteOsdExtraTpl
index 51082ab4d547ff456c98e4c1d0f0de237ae40370..1deb200343415f74e81540b39aba017e9c5029f1 100644 (file)
@@ -56,7 +56,7 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
   reweightBodyTpl: TemplateRef<any>;
   @ViewChild('safeToDestroyBodyTpl', { static: false })
   safeToDestroyBodyTpl: TemplateRef<any>;
-  @ViewChild('deleteOsdExtraTpl')
+  @ViewChild('deleteOsdExtraTpl', { static: false })
   deleteOsdExtraTpl: TemplateRef<any>;
 
   permissions: Permissions;
@@ -518,7 +518,8 @@ export class OsdListComponent extends ListWithDetails implements OnInit {
           bodyContext: {
             safeToPerform: result[checkKey],
             message: result.message,
-            actionDescription: templateItemDescription
+            actionDescription: templateItemDescription,
+            osdIds: this.getSelectedOsdIds()
           },
           childFormGroup: childFormGroup,
           childFormGroupTemplate: childFormGroupTemplate,