From 66608434dcf7bd6bd9026b06175d2b670772b860 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Wed, 11 Dec 2024 16:04:42 +0700 Subject: [PATCH 01/36] feature/IVYPORTAL-18032-UI-facelift-conflict - Add border in Actions menu of Task widget --- .../addon/portalkit/component/SideStep/SideStep.xhtml | 11 ++++++----- .../portal/webContent/resources/css/portal.css | 9 ++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/SideStep/SideStep.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/SideStep/SideStep.xhtml index b3df89c0732..5c2f1981ede 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/SideStep/SideStep.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/SideStep/SideStep.xhtml @@ -113,14 +113,15 @@ #{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/destroy')} - + - - + - + + #{sideStep.name} + diff --git a/AxonIvyPortal/portal/webContent/resources/css/portal.css b/AxonIvyPortal/portal/webContent/resources/css/portal.css index 6b05e0d2411..939a756d941 100644 --- a/AxonIvyPortal/portal/webContent/resources/css/portal.css +++ b/AxonIvyPortal/portal/webContent/resources/css/portal.css @@ -1156,13 +1156,20 @@ ul.users-in-role { .options-panel .option-item:hover { text-decoration: none; color: var(--menu-action-hover-text-color); - background-color: var(--item-background-hover); +} + +.options-panel .option-item:not(:last-child) { + border-bottom: 1px solid var(--ivy-primary-color-grey-pale); } .options-panel .pointer-event-none { pointer-events: none; } +.task-additional-actions-panel { + border-top: 1px solid var(--ivy-primary-color-grey-medium); +} + .process-widget-action .name-sort-command, .process-widget-action .editing-switch-command, .process-widget-action .show-adding-dialog-commmand, From f65996d3d4fcc65b276dfa8a7f56e5c76a26f583 Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Wed, 11 Dec 2024 16:38:29 +0700 Subject: [PATCH 02/36] feature/IVYPORTAL-18032-UI-facelift-conflict - Add border in actions menu for case widget --- .../addon/portalkit/component/ActionStep/ActionStep.xhtml | 2 +- AxonIvyPortal/portal/webContent/resources/css/portal.css | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ActionStep/ActionStep.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ActionStep/ActionStep.xhtml index f91f3032968..7e008bc2554 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ActionStep/ActionStep.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ActionStep/ActionStep.xhtml @@ -74,7 +74,7 @@ - + diff --git a/AxonIvyPortal/portal/webContent/resources/css/portal.css b/AxonIvyPortal/portal/webContent/resources/css/portal.css index 939a756d941..80278a92b14 100644 --- a/AxonIvyPortal/portal/webContent/resources/css/portal.css +++ b/AxonIvyPortal/portal/webContent/resources/css/portal.css @@ -785,9 +785,12 @@ body .ui-inputfield.case-detail-name-input { color: var(--action-step-disabled-text-color); } .action-steps-panel a.action-step-item:hover { - background-color: var(--item-background-hover); color: var(--menu-action-hover-text-color); } +.action-steps-panel a.action-step-item:not(:last-child) { + border-bottom: 1px solid var(--ivy-primary-color-grey-pale); +} + .case-state-in-progress { color: var(--case-state-in-progress-color); } @@ -1166,7 +1169,7 @@ ul.users-in-role { pointer-events: none; } -.task-additional-actions-panel { +.task-additional-actions-panel, .case-side-steps-panel { border-top: 1px solid var(--ivy-primary-color-grey-medium); } From e2e26450aeba0e8bd3169d38f1b0cedcaa159640 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen <117440893+nhthinh-axonivy@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:45:36 +0700 Subject: [PATCH 03/36] =?UTF-8?q?bug/IVYPORTAL-18051-Portal-Dashboard-show?= =?UTF-8?q?s-no-permission-screen-when-=E2=80=A6=20(#1280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bug/IVYPORTAL-18051-Portal-Dashboard-shows-no-permission-screen-when-dashboards-is-empty _ adapt logic _ import default dashboard --- .../addon/portal/generic/menu/MenuView.java | 18 ++++--- .../portal/generic/bean/DashboardBean.java | 53 +++++++++++-------- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java b/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java index 668df5c4364..25dc3cf939d 100644 --- a/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java +++ b/AxonIvyPortal/portal/src/ch/addon/portal/generic/menu/MenuView.java @@ -91,8 +91,6 @@ public void buildPortalLeftMenu(ITask workingTask, boolean isWorkingOnATask) { mainMenuModel = new DefaultMenuModel(); mainMenuModel.getElements().add(buildDashboardItem()); // menuIndex = 0 - - List subMenuItems = PortalMenuNavigator.callSubMenuItemsProcess(); int menuIndex = 1; for (SubMenuItem subMenu : subMenuItems) { @@ -152,13 +150,17 @@ private MenuElement buildDashboardItem() { String mainMenuDisplayName = mainMenuEntryService.getNameInCurrentLocale(); String mainMenuIcon = mainMenuEntryService.getMenuIcon(); - var subItemDashboards = getSubItemDashboards(); + List subItemDashboards = getSubItemDashboards(); if (subItemDashboards.size() > 1) { return buildDashboardGroupMenu(subItemDashboards, dashboardTitle, mainMenuDisplayName, mainMenuIcon, currentLanguage, dashboardLink); + } else if (subItemDashboards.size() == 1) { + Dashboard dashboard = subItemDashboards.getFirst(); + String localizedTitle = getLocalizedTitle(dashboard, currentLanguage, dashboardTitle); + return buildSingleDashboardMenu(localizedTitle, dashboardId, dashboardLink, dashboard.getIcon()); } - - return buildSingleDashboardMenu(dashboardTitle, dashboardId, dashboardLink); + + return buildSingleDashboardMenu(dashboardTitle, "", dashboardLink, ""); } private String determineDashboardLink() { @@ -240,9 +242,11 @@ private void setMenuExpansion(DefaultSubMenu dashboardGroupMenu) { } } - private MenuElement buildSingleDashboardMenu(String dashboardTitle, String dashboardId, String dashboardLink) { + private MenuElement buildSingleDashboardMenu(String dashboardTitle, String dashboardId, String dashboardLink, + String dashboardIcon) { var dashboardMenu = new PortalMenuBuilder(dashboardTitle, MenuKind.DASHBOARD, this.isWorkingOnATask) - .icon(PortalMenuItem.DEFAULT_DASHBOARD_ICON).url(dashboardLink).workingTaskId(this.workingTaskId).build(); + .icon(StringUtils.isNoneEmpty(dashboardIcon) ? dashboardIcon : PortalMenuItem.DEFAULT_DASHBOARD_ICON) + .url(dashboardLink).workingTaskId(this.workingTaskId).build(); if (StringUtils.isBlank(dashboardId)) { dashboardId = dashboardMenu.getId(); diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardBean.java index b573ec9dde1..d4061a3be47 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardBean.java @@ -91,33 +91,17 @@ public void init() { currentDashboardIndex = 0; dashboards = collectDashboards(); - if (isReadOnlyMode) { MenuView menuView = (MenuView) ManagedBeans.get("menuView"); menuView.updateDashboardCache(dashboards); } - if (CollectionUtils.isNotEmpty(DashboardUtils.getDashboardsWithoutMenuItem())) { + if (CollectionUtils.isNotEmpty(DashboardUtils.getDashboardsWithoutMenuItem()) + || isRequestPathForMainOrDetailModification()) { updateSelectedDashboardIdFromSessionAttribute(); - currentDashboardIndex = findIndexOfDashboardById(selectedDashboardId); - selectedDashboard = dashboards.get(currentDashboardIndex); - - String selectedDashboardName = selectedDashboard.getTitles().stream() - .filter(displayName -> displayName.getLocale().equals(Ivy.session().getContentLocale())) - .findFirst() - .orElseGet(() -> selectedDashboard.getTitles().get(0)).getValue(); - setSelectedDashboardName(selectedDashboardName); - initShareDashboardLink(selectedDashboard); - // can not find dashboard by dashboard id session in view mode - if (StringUtils.isBlank(selectedDashboardId) - || (!selectedDashboardId.equalsIgnoreCase(selectedDashboard.getId()) - && DashboardUtils.getDashboardsWithoutMenuItem().size() > 1)) { - DashboardUtils.storeDashboardInSession(selectedDashboard.getId()); - } - if (isReadOnlyMode) { - DashboardUtils.highlightDashboardMenuItem(selectedDashboard.getId()); - } - } + updateSelectedDashboard(); + storeAndHighlightDashboardIfRequired(); + } buildWidgetModels(selectedDashboard); isRunningTaskWhenClickingOnTaskInList = GlobalSettingService.getInstance() .findGlobalSettingValue(GlobalVariable.DEFAULT_BEHAVIOUR_WHEN_CLICKING_ON_LINE_IN_TASK_LIST) @@ -131,6 +115,33 @@ private void buildClientStatisticApiUri() { .getExternalContext().getRequestContextPath() + "/api/statistics/data"; } + private boolean isRequestPathForMainOrDetailModification() { + String requestPath = Ivy.request().getRequestPath(); + return requestPath.endsWith("/PortalMainDashboard.xhtml") + || requestPath.endsWith("/PortalDashboardDetailModification.xhtml"); + } + + private void updateSelectedDashboard() { + currentDashboardIndex = findIndexOfDashboardById(selectedDashboardId); + selectedDashboard = dashboards.get(currentDashboardIndex); + + String selectedDashboardName = selectedDashboard.getTitles().stream() + .filter(displayName -> displayName.getLocale().equals(Ivy.session().getContentLocale())).findFirst() + .orElseGet(() -> selectedDashboard.getTitles().get(0)).getValue(); + setSelectedDashboardName(selectedDashboardName); + initShareDashboardLink(selectedDashboard); + } + + private void storeAndHighlightDashboardIfRequired() { + if (StringUtils.isBlank(selectedDashboardId) || (!selectedDashboardId.equalsIgnoreCase(selectedDashboard.getId()) + && DashboardUtils.getDashboardsWithoutMenuItem().size() > 1)) { + DashboardUtils.storeDashboardInSession(selectedDashboard.getId()); + } + if (isReadOnlyMode) { + DashboardUtils.highlightDashboardMenuItem(selectedDashboard.getId()); + } + } + protected List collectDashboards() { return DashboardUtils.collectDashboards(); } From d48f4b04c94a394c92c29c4637e2ead28ab8608d Mon Sep 17 00:00:00 2001 From: lmluat-axonivy Date: Thu, 12 Dec 2024 13:51:57 +0700 Subject: [PATCH 04/36] feature/IVYPORTAL-18032-UI-facelift-conflict - Update Edit external link UI --- .../admin/AdminSettings/AdminSettings.xhtml | 2 +- .../IconSelection/IconSelection.xhtml | 4 +-- .../ProcessWidget/ProcessWidgetDialogs.xhtml | 36 +++++++++++-------- .../webContent/resources/css/portal.css | 2 +- .../webContent/resources/js/process-widget.js | 7 ++++ 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/admin/AdminSettings/AdminSettings.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/admin/AdminSettings/AdminSettings.xhtml index 1accd261b13..d9b9818ad5f 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/admin/AdminSettings/AdminSettings.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/admin/AdminSettings/AdminSettings.xhtml @@ -230,7 +230,7 @@
- +
diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/IconSelection/IconSelection.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/IconSelection/IconSelection.xhtml index bd0ba3fd786..852e2fbb2e9 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/IconSelection/IconSelection.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/IconSelection/IconSelection.xhtml @@ -9,14 +9,14 @@ - + - + diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ProcessWidget/ProcessWidgetDialogs.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ProcessWidget/ProcessWidgetDialogs.xhtml index 2827e269108..c82e9674fc4 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ProcessWidget/ProcessWidgetDialogs.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portalkit/component/ProcessWidget/ProcessWidgetDialogs.xhtml @@ -28,7 +28,7 @@

#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/processwidget/editDialog/dialogCurrentIcon')}

-
@@ -151,27 +151,35 @@ -