From cf73fdaddac65c27c5eeb05d5b768037768ce5f8 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 31 Oct 2022 14:29:11 -0500 Subject: [PATCH 1/2] Improve formatting on k8s domain status dialog --- .../src/js/viewModels/domain-status-dialog.js | 16 ++++---- webui/src/js/views/domain-status-dialog.html | 41 ++++++++----------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/webui/src/js/viewModels/domain-status-dialog.js b/webui/src/js/viewModels/domain-status-dialog.js index 220111b2c..83d39de72 100644 --- a/webui/src/js/viewModels/domain-status-dialog.js +++ b/webui/src/js/viewModels/domain-status-dialog.js @@ -1,13 +1,13 @@ /** * @license - * Copyright (c) 2021, Oracle and/or its affiliates. + * Copyright (c) 2021, 2022, Oracle and/or its affiliates. * Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/ */ 'use strict'; -define(['accUtils', 'knockout', 'js-yaml', 'utils/i18n', 'models/wkt-project', 'ojs/ojinputtext', +define(['accUtils', 'knockout', 'js-yaml', 'utils/i18n', 'models/wkt-project', 'utils/view-helper', 'ojs/ojinputtext', 'ojs/ojlabel', 'ojs/ojbutton', 'ojs/ojdialog', 'ojs/ojformlayout', 'ojs/ojvalidationgroup'], -function(accUtils, ko, jsyaml, i18n, project) { +function(accUtils, ko, jsyaml, i18n, project, viewHelper) { function DomainStatusDialogModel(args) { const DIALOG_SELECTOR = '#domainStatusDialog'; @@ -20,11 +20,13 @@ function(accUtils, ko, jsyaml, i18n, project) { this.connected = () => { accUtils.announce('Show domain status dialog loaded.', 'assertive'); + this.dialogContainer = $(DIALOG_SELECTOR)[0]; + // open the dialog after the current thread, which is loading this view model. // using oj-dialog initial-visibility="show" causes vertical centering issues. - setTimeout(function() { - $(DIALOG_SELECTOR)[0].open(); - }, 1); + viewHelper.componentReady(this.dialogContainer).then(() => { + this.dialogContainer.open(); + }); }; this.labelMapper = (labelId) => { @@ -36,7 +38,7 @@ function(accUtils, ko, jsyaml, i18n, project) { }; this.okInput = () => { - $(DIALOG_SELECTOR)[0].close(); + this.dialogContainer.close(); }; this.makeYamlOutput = (data) => { diff --git a/webui/src/js/views/domain-status-dialog.html b/webui/src/js/views/domain-status-dialog.html index 0e994fb42..6703e4375 100644 --- a/webui/src/js/views/domain-status-dialog.html +++ b/webui/src/js/views/domain-status-dialog.html @@ -1,5 +1,5 @@ @@ -13,16 +13,18 @@ -
- +

+ +

-
+
-
- +

+ +

@@ -30,10 +32,8 @@ -
- - +

@@ -41,34 +41,25 @@ -
- - +

- -
- - - +

-
- - +

-
From d82cde7179b2433c0e49d7544d6c8c9b387cb4e2 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 31 Oct 2022 14:47:21 -0500 Subject: [PATCH 2/2] Update secret username correctly --- webui/src/js/models/k8s-domain-definition.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webui/src/js/models/k8s-domain-definition.js b/webui/src/js/models/k8s-domain-definition.js index 71bc37340..ae44051ae 100644 --- a/webui/src/js/models/k8s-domain-definition.js +++ b/webui/src/js/models/k8s-domain-definition.js @@ -235,9 +235,9 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut }; this.handlePrepareModelSecrets = (secrets) => { - if (secrets && secrets.secrets && secrets.secrets.length) { - wktLogger.debug('handlePrepareModelSecrets() working on %d secrets', secrets.secrets.length); - for (const secret of secrets.secrets) { + if (secrets && secrets.length) { + wktLogger.debug('handlePrepareModelSecrets() working on %d secrets', secrets.length); + for (const secret of secrets) { wktLogger.debug('working on secret %s', secret.name); // The secret should always exist already because prepare model updated the model first,