diff --git a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/WelcomeEditWidgetNewDashboardPage.java b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/WelcomeEditWidgetNewDashboardPage.java index c6b32d7adf..bf19a82fdc 100644 --- a/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/WelcomeEditWidgetNewDashboardPage.java +++ b/AxonIvyPortal/portal-selenium-test/src_test/com/axonivy/portal/selenium/page/WelcomeEditWidgetNewDashboardPage.java @@ -86,7 +86,7 @@ public SelenideElement getConfigurationDialog() { } public void waitForDialogLoaded() { - getConfigurationDialog().$("input[id$=':welcome-text-color']") + getConfigurationDialog().$("input[id$=':welcome-text-color-light-mode']") .shouldBe(getClickableCondition(), DEFAULT_TIMEOUT) .click(); getConfigurationDialog().$(".user-filter__header").shouldBe(appear, DEFAULT_TIMEOUT).click(); diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardDetailModificationBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardDetailModificationBean.java index bda96af488..25a2dac41c 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardDetailModificationBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardDetailModificationBean.java @@ -573,10 +573,6 @@ private void updateWelcomeWidget(DashboardWidget widget) { tempImageFileDarkMode.delete(); } } - if (!welcomeWidget.isGreeting()) { - welcomeWidget.setWelcomeTexts(new ArrayList<>()); - welcomeWidget.setWelcomeText(""); - } } private void updateCaseWidget(DashboardWidget widget) { diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/WelcomeWidgetConfiguration/WelcomeWidgetConfiguration.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/WelcomeWidgetConfiguration/WelcomeWidgetConfiguration.xhtml index 93c0713ac9..f082ac9b6c 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/WelcomeWidgetConfiguration/WelcomeWidgetConfiguration.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/WelcomeWidgetConfiguration/WelcomeWidgetConfiguration.xhtml @@ -14,6 +14,7 @@ +
@@ -48,7 +49,6 @@
-
-
- - - - - - - - + />
@@ -110,7 +98,6 @@
-
-
- - - - - - - - + />
@@ -212,27 +187,25 @@
- - -
- -
-
+
+ +
+ -
diff --git a/AxonIvyPortal/portal/webContent/resources/css/module.css b/AxonIvyPortal/portal/webContent/resources/css/module.css index 4cf37690dd..dccf8910a3 100644 --- a/AxonIvyPortal/portal/webContent/resources/css/module.css +++ b/AxonIvyPortal/portal/webContent/resources/css/module.css @@ -5633,18 +5633,7 @@ a.dashboard-action-container label { display: flex; } -.ui-welcome-upload-file-panel { - width: 100%; - border: 1px solid var(--process-list-item-border-color); - background-color: var(--ui-fileupload-buttonbar-background-color); - border-radius: 10px; - height: 8em; - align-items: center; - display: flex; - -} - -.ui-external-link-preview-image-panel > .ui-external-link-preview-image-label, .ui-dashboard-upload-file-panel > .ui-dashboard-upload-file-label, .ui-document-upload-file-panel > .ui-document-upload-file-label, .ui-welcome-upload-file-panel > .ui-document-upload-file-label { +.ui-external-link-preview-image-panel > .ui-external-link-preview-image-label, .ui-dashboard-upload-file-panel > .ui-dashboard-upload-file-label, .ui-document-upload-file-panel > .ui-document-upload-file-label { width: 42%; display: block; text-align: center; diff --git a/AxonIvyPortal/portal/webContent/resources/js/welcome-widget.js b/AxonIvyPortal/portal/webContent/resources/js/welcome-widget.js index 98e3843974..ac041cab39 100644 --- a/AxonIvyPortal/portal/webContent/resources/js/welcome-widget.js +++ b/AxonIvyPortal/portal/webContent/resources/js/welcome-widget.js @@ -23,16 +23,16 @@ WelcomeWidgetConfiguration = { updatePreviewText : function(isGreeting) { var previewDialog = $('#new-widget-configuration-dialog'); var welcomeText = ''; - var findWelcomeText = previewDialog.find('.js-welcome-text-input.language-to-preview'); - if (findWelcomeText != undefined && findWelcomeText.get(0) != undefined){ - welcomeText = findWelcomeText.get(0).value; - } + var findWelcomeText = previewDialog.find('.js-welcome-text-input.language-to-preview'); + if (findWelcomeText != undefined && findWelcomeText.get(0) != undefined){ + welcomeText = findWelcomeText.get(0).value; + } if (isGreeting == 'true' || (isGreeting == undefined && $('.js-greeting-text').length != 0)) { - var findGreeting = previewDialog.find('.js-greeting-text.language-to-preview') - if (findGreeting != undefined && findGreeting.get(0) != undefined){ - welcomeText = findGreeting.get(0).innerHTML + welcomeText; - } + var findGreeting = previewDialog.find('.js-greeting-text.language-to-preview') + if (findGreeting != undefined && findGreeting.get(0) != undefined){ + welcomeText = findGreeting.get(0).innerHTML + welcomeText; + } } var findPreviewText = $('#new-widget-configuration-dialog').find('.js-preview-text'); @@ -67,7 +67,7 @@ WelcomeWidgetConfiguration = { previewText.removeClass('bottom top left right').addClass('center'); } - var previewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); + var previewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); if (selectedPosition == 'BOTTOM_LEFT') { previewTextDarkMode.removeClass('top right center').addClass('bottom left'); } @@ -89,32 +89,32 @@ updatePreviewImageFit : function() { var previewDialog = $('#new-widget-configuration-dialog'); var selectedFit = previewDialog.find('input[id $="selected-welcome-image-fit"]').get(0).value; var images = previewDialog.find('.js-preview-image'); - for (var i = 0; i < images.length;i ++){ - var currentImage = images[i]; - $(currentImage).removeClass (function (index, className) { - return (className.match (/(^|\s)welcome-image-fit-\S+/g) || []).join(' '); - }); - if (selectedFit == 'COVER') { - $(currentImage).addClass('welcome-image-fit-cover'); - } else if (selectedFit == 'FILL') { - $(currentImage).addClass('welcome-image-fit-fill'); - } else if (selectedFit == 'NONE') { - $(currentImage).addClass('welcome-image-fit-none'); - } else if (selectedFit == 'CONTAIN') { - $(currentImage).addClass('welcome-image-fit-contain'); - } - } + for (var i = 0; i < images.length;i ++){ + var currentImage = images[i]; + $(currentImage).removeClass (function (index, className) { + return (className.match (/(^|\s)welcome-image-fit-\S+/g) || []).join(' '); + }); + if (selectedFit == 'COVER') { + $(currentImage).addClass('welcome-image-fit-cover'); + } else if (selectedFit == 'FILL') { + $(currentImage).addClass('welcome-image-fit-fill'); + } else if (selectedFit == 'NONE') { + $(currentImage).addClass('welcome-image-fit-none'); + } else if (selectedFit == 'CONTAIN') { + $(currentImage).addClass('welcome-image-fit-contain'); + } + } }, updatePreviewTextColor : function() { var previewDialog = $('#new-widget-configuration-dialog'); var findSelectedColor = previewDialog.find('.js-welcome-text-color'); if (findSelectedColor != undefined){ - var selectedColor = findSelectedColor.get(0).value; - var findPreviewText = previewDialog.find('.js-preview-text'); - if (findPreviewText != undefined){ - findPreviewText.css({'color': selectedColor}); - } + var selectedColor = findSelectedColor.get(0).value; + var findPreviewText = previewDialog.find('.js-preview-text'); + if (findPreviewText != undefined){ + findPreviewText.css({'color': selectedColor}); + } } }, @@ -122,11 +122,11 @@ updatePreviewImageFit : function() { var previewDialog = $('#new-widget-configuration-dialog'); var findSelectedColorDarkMode = previewDialog.find('.js-welcome-text-color-dark-mode'); if (findSelectedColorDarkMode != undefined){ - var selectedColorDarkMode = findSelectedColorDarkMode.get(0).value; - var findPreviewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); - if (findPreviewTextDarkMode != undefined){ - findPreviewTextDarkMode.css({'color': selectedColorDarkMode}); - } + var selectedColorDarkMode = findSelectedColorDarkMode.get(0).value; + var findPreviewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); + if (findPreviewTextDarkMode != undefined){ + findPreviewTextDarkMode.css({'color': selectedColorDarkMode}); + } } }, @@ -135,20 +135,20 @@ updatePreviewImageFit : function() { var previewDialog = $('#new-widget-configuration-dialog'); var selectedTextSize = previewDialog.find('input[id $="selected-welcome-text-size"]').get(0).value; var previewText = previewDialog.find('.js-preview-text'); - var previewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); + var previewTextDarkMode = previewDialog.find('.js-preview-text-dark-mode'); if (selectedTextSize == 'NORMAL_TEXT') { previewText.removeClass('HEADING_1 HEADING_2 HEADING_3').addClass('NORMAL_TEXT'); - previewTextDarkMode.removeClass('HEADING_1 HEADING_2 HEADING_3').addClass('NORMAL_TEXT'); + previewTextDarkMode.removeClass('HEADING_1 HEADING_2 HEADING_3').addClass('NORMAL_TEXT'); return; } if (selectedTextSize == 'HEADING_1') { previewText.removeClass('HEADING_2 HEADING_3 NORMAL_TEXT').addClass('HEADING_1'); - previewTextDarkMode.removeClass('HEADING_2 HEADING_3 NORMAL_TEXT').addClass('HEADING_1'); + previewTextDarkMode.removeClass('HEADING_2 HEADING_3 NORMAL_TEXT').addClass('HEADING_1'); return; } if (selectedTextSize == 'HEADING_2') { previewText.removeClass('HEADING_1 HEADING_3 NORMAL_TEXT').addClass('HEADING_2'); - previewTextDarkMode.removeClass('HEADING_1 HEADING_3 NORMAL_TEXT').addClass('HEADING_2'); + previewTextDarkMode.removeClass('HEADING_1 HEADING_3 NORMAL_TEXT').addClass('HEADING_2'); return; } if (selectedTextSize == 'HEADING_3') { @@ -156,7 +156,7 @@ updatePreviewImageFit : function() { previewTextDarkMode.removeClass('HEADING_1 HEADING_2 NORMAL_TEXT').addClass('HEADING_3'); return; } - + }, updateStyleClasses : function() { @@ -178,7 +178,7 @@ updatePreviewImageFit : function() { this.oldTextStyleClass = welcomeText.attr('class'); } welcomeText.attr('class', this.oldTextStyleClass + ' ' + textStyleClass); - welcomeTextDarkMode.attr('class', this.oldTextStyleClass + ' ' + textStyleClass); + welcomeTextDarkMode.attr('class', this.oldTextStyleClass + ' ' + textStyleClass); } } @@ -195,7 +195,7 @@ WelcomeWidget = { welcomeText.css({ 'color' : welcomeTextColor, }); - + switch(welcomeTextPosition) { case 'BOTTOM_LEFT': welcomeText.addClass('bottom').addClass('left'); @@ -217,8 +217,8 @@ WelcomeWidget = { } welcomeText.addClass(welcomeTextSize); - - var welcomeTextDarkMode = widget.find('[id $= "welcome-text-dark-mode"]'); + + var welcomeTextDarkMode = widget.find('[id $= "welcome-text-dark-mode"]'); welcomeTextDarkMode.css({ 'color' : welcomeTextColorDarkMode, }); @@ -249,24 +249,24 @@ WelcomeWidget = { updateImageFit: function(widgetId, welcomeImageFit) { var widget = $('div.grid-stack-item[gs-id = ' + widgetId + ']'); var images = widget.find('.js-welcome-image'); - - for (var i = 0; i < images.length; i++){ - var currentImage = images[i]; - $(currentImage).removeClass (function (index, className) { - return (className.match (/(^|\s)welcome-image-fit-\S+/g) || []).join(' '); - }); - if (welcomeImageFit == 'COVER') { - $(currentImage).addClass('welcome-image-fit-cover'); - } else if (welcomeImageFit == 'FILL') { - $(currentImage).addClass('welcome-image-fit-fill'); - } else if (welcomeImageFit == 'NONE') { - $(currentImage).addClass('welcome-image-fit-none'); - } else if (welcomeImageFit == 'CONTAIN') { - $(currentImage).addClass('welcome-image-fit-contain'); - } - } - + for (var i = 0; i < images.length; i++){ + var currentImage = images[i]; + $(currentImage).removeClass (function (index, className) { + return (className.match (/(^|\s)welcome-image-fit-\S+/g) || []).join(' '); + }); + if (welcomeImageFit == 'COVER') { + $(currentImage).addClass('welcome-image-fit-cover'); + } else if (welcomeImageFit == 'FILL') { + $(currentImage).addClass('welcome-image-fit-fill'); + } else if (welcomeImageFit == 'NONE') { + $(currentImage).addClass('welcome-image-fit-none'); + } else if (welcomeImageFit == 'CONTAIN') { + $(currentImage).addClass('welcome-image-fit-contain'); + } + } + + }, updateImageInlineStyle: function(widgetId, imageInlineStyle) { @@ -277,10 +277,3 @@ WelcomeWidget = { } } } - -function handleUploadFileFail() { - let errorMessageElement = document.getElementById('widget-configuration-form:new-widget-configuration-component:config-welcome-widget-message'); - let uploadErrorElement = document.getElementsByClassName('ui-messages ui-widget ui-helper-hidden ui-fileupload-messages')[0]; - errorMessageElement.style.display = 'block'; - errorMessageElement.appendChild(uploadErrorElement); -} \ No newline at end of file