Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into feature/IVYPORTAL-17540-Impleme…
Browse files Browse the repository at this point in the history
…nt-column-width-changing-for-portal-widgets-LE

# Conflicts:
#	AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/StartCell.xhtml
#	AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml
  • Loading branch information
lndanh-axonivy committed Oct 28, 2024
2 parents fcc7176 + eb71c5f commit f62d605
Show file tree
Hide file tree
Showing 86 changed files with 1,049 additions and 719 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:cc="http://xmlns.jcp.org/jsf/composite" xmlns:ic="http://ivyteam.ch/jsf/component"
xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions">
<cc:interface componentType="IvyComponent">
<cc:attribute name="taskName" shortDescription="Custom text for task name" />
<cc:attribute name="taskIcon" shortDescription="Task icon to be displayed, using Streamline or Awesome font, e.g., `si si-arrow-right`" />
<cc:attribute name="isHideTaskName" shortDescription="Hide task name, false (default) or true" />
<cc:attribute name="caseId" shortDescription="ID of case to be displayed in case information dialog" />
<cc:attribute name="isHideCaseInfo" shortDescription="Hide `Show Information` button, false (default) or true" />
<cc:attribute name="currentProcessStep" shortDescription="Current process step, could be the index of the step or the step name" />
<cc:attribute name="processSteps" shortDescription="List of process steps, e.g., `[&quot;Create Investment Request&quot;, &quot;Approve Investment Reques&quot;]`
or `# {portalComponentUtilsBean.convertToJSON(data.steps)}`" />
<cc:attribute name="isShowAllSteps" shortDescription="Shows all steps on large screens, false (default) or true" />
<cc:attribute name="processChainDirection" shortDescription="HORIZONTAL (default) or VERTICAL" />
<cc:attribute name="processChainShape" shortDescription="CIRCLE (default) or LINE" />
<cc:attribute name="isHideTaskAction" shortDescription="Hide task action button, false (default) or true" />
<cc:attribute name="isWorkingOnATask" shortDescription="Working on a task in order to display warning when leaving page, true (default) or false" />
<cc:attribute name="announcementInvisible" shortDescription="Make announcement invisible, true (default) or false" />
<cc:attribute name="isCardFrame" shortDescription="Display content of the IFrame inside a card style" />
<cc:attribute name="viewName" shortDescription="Custom breadcrum, value could be HOME, PROCESS, TASK, TASK_DETAIL, CASE_DETAIL, CASE, TECHNICAL_CASE, RELATED_TASK, USER_PROFILE,
ABSENCES_MANAGEMENT, DASHBOARD_CONFIGURATION, EDIT_DASHBOARD_DETAILS, PROCESS_VIEWER, PORTAL_MANAGEMENT, NOTIFICATION" />
</cc:interface>

<cc:implementation>
<ui:fragment rendered="#{not empty cc.attrs.taskName}"><script>window.taskName = `#{cc.attrs.taskName}`;</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.taskIcon}"><script>window.taskIcon = `#{cc.attrs.taskIcon}`;</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isHideTaskName}"><script>
window.isHideTaskName = (`#{cc.attrs.isHideTaskName}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.caseId}"><script>window.caseId = `#{cc.attrs.caseId}`;</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isHideCaseInfo}"><script>
window.isHideCaseInfo = (`#{cc.attrs.isHideCaseInfo}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.currentProcessStep}"><script>
window.currentProcessStep = `#{cc.attrs.currentProcessStep}`;
if (!isNaN(Number(window.currentProcessStep))) {
window.currentProcessStep = Number(window.currentProcessStep);
}
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.processSteps}"><script>
try {
window.processSteps = JSON.parse(`#{cc.attrs.processSteps}`);
} catch (error) {
// Just ignore parsing JSON processSteps
}
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isShowAllSteps}"><script>
window.isShowAllSteps = (`#{cc.attrs.isShowAllSteps}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.processChainDirection}"><script>window.processChainDirection = `#{cc.attrs.processChainDirection}`;</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.processChainShape}"><script>window.processChainShape = `#{cc.attrs.processChainShape}`;</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isHideTaskAction}"><script>
window.isHideTaskAction = (`#{cc.attrs.isHideTaskAction}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isWorkingOnATask}"><script>
window.isWorkingOnATask = (`#{cc.attrs.isWorkingOnATask}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.announcementInvisible}"><script>
window.announcementInvisible = (`#{cc.attrs.announcementInvisible}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.isCardFrame}"><script>
window.isCardFrame = (`#{cc.attrs.isCardFrame}`.toLowerCase() === "true");
</script></ui:fragment>
<ui:fragment rendered="#{not empty cc.attrs.viewName}"><script>window.viewName = `#{cc.attrs.viewName}`;</script></ui:fragment>
</cc:implementation>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "IFrameTaskConfigData",
"namespace" : "com.axonivy.portal.components.IFrameTaskConfig",
"isBusinessCaseData" : false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "19274BA8B8973F00",
"kind" : "HTML_DIALOG",
"config" : {
"data" : "com.axonivy.portal.components.IFrameTaskConfig.IFrameTaskConfigData"
},
"elements" : [ {
"id" : "f0",
"type" : "HtmlDialogStart",
"name" : "start()",
"config" : {
"signature" : "start",
"guid" : "19274BA8B8C633D4"
},
"visual" : {
"at" : { "x" : 96, "y" : 64 }
},
"connect" : [
{ "id" : "f2", "to" : "f1" }
]
}, {
"id" : "f1",
"type" : "HtmlDialogEnd",
"visual" : {
"at" : { "x" : 224, "y" : 64 },
"labelOffset" : { "x" : 10, "y" : 30 }
}
}, {
"id" : "f3",
"type" : "HtmlDialogEventStart",
"name" : "close",
"config" : {
"guid" : "19274BA8B8F47AD0"
},
"visual" : {
"at" : { "x" : 96, "y" : 160 }
},
"connect" : [
{ "id" : "f5", "to" : "f4" }
]
}, {
"id" : "f4",
"type" : "HtmlDialogExit",
"visual" : {
"at" : { "x" : 224, "y" : 160 },
"labelOffset" : { "x" : 10, "y" : 30 }
}
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,12 @@ public void removeAllFilterItems() {
}

public void openManageFiltersDialog() {
$("a[id*='case-case_1:filter-form-1']").shouldBe(appear, DEFAULT_TIMEOUT).click();
$("div#manage-filter").shouldBe(appear, DEFAULT_TIMEOUT).$("button").shouldBe(getClickableCondition()).click();
}

public void closeManageFilterDialog() {
$("a[id*='delete-saved-filter-form']").shouldBe(appear, DEFAULT_TIMEOUT).click();
$("div[id$='manage-filter-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).$("a.ui-dialog-titlebar-close")
.shouldBe(appear, DEFAULT_TIMEOUT).click();
}

public ElementsCollection getSavedFilterItemsByFilterNameOnWidgetManagement() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.axonivy.portal.selenium.common.FileHelper;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.DragAndDropOptions;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;

public class DashboardConfigurationPage extends TemplatePage {
Expand Down Expand Up @@ -40,12 +41,11 @@ public SelenideElement getPublicDashboardConfigurationTypeSelection() {
waitForDashboardConfigurationTypeSelectionAppear();
return $("a[id$='public-dashboard-type']");
}

public DashboardModificationPage openEditPublicDashboardsPage() {
selectPublicDashboardType();
$("button[id$='dashboard-modification-component:dashboard-table:0:edit']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition());
return new DashboardModificationPage();

public SelenideElement getDashboardConfigurationActionMenu() {
$("button[id*='dashboard-modification-component:dashboard-table:0:dashboard-configuration-action-button']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition()).click();
return $$("div[id$='dashboard-configuration-action-menu']").filter(Condition.appear).first();
}

public void selectPublicDashboardType() {
Expand All @@ -62,10 +62,29 @@ public void selectPrivateDashboardType() {

public DashboardModificationPage openEditPrivateDashboardsPage() {
selectPrivateDashboardType();
$("button[id$='dashboard-modification-component:dashboard-table:0:edit']").shouldBe(appear, DEFAULT_TIMEOUT)
.shouldBe(getClickableCondition()).click();
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPrivateDashboardPage(String buttonName) {
selectPrivateDashboardType();
clickButtonOnDashboardConfigurationActionMenu(buttonName);
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPublicDashboardsPage(String buttonName) {
selectPublicDashboardType();
clickButtonOnDashboardConfigurationActionMenu(buttonName);
return new DashboardModificationPage();
}

public DashboardModificationPage openEditPublicDashboardsPage() {
selectPublicDashboardType();
return new DashboardModificationPage();
}

public void clickButtonOnDashboardConfigurationActionMenu(String buttonName) {
getDashboardConfigurationActionMenu().$$("span").filter(Condition.text(buttonName)).first().shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
}

public void openCreatePublicDashboardMenu() {
selectPublicDashboardType();
Expand Down Expand Up @@ -236,12 +255,12 @@ private void selectDashboardIcon(String icon) {
}

public NewDashboardPage backToHomePage() {
$("[id$='back-to-home-button']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
$("span[class*='si si-house-chimney-2']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
return new NewDashboardPage();
}

public NewDashboardPage backToHomePageBottom() {
$("[id$='back-to-home-button']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
$("span[class*='si si-house-chimney-2']").shouldBe(appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
return new NewDashboardPage();
}

Expand Down Expand Up @@ -317,8 +336,8 @@ private SelenideElement findPrivateDashboardRowByName(String dashboardName) {
}

public void reorderPrivateDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPrivateDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPrivateDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand All @@ -328,8 +347,8 @@ private void dragAndDropTo(SelenideElement toRow, SelenideElement fromRow) {
}

public void reorderPublicDashboard(String fromDashboardName, String toDashboardName) {
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-move-expand-vertical");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-move-expand-vertical");
var toRow = findPublicDashboardRowByName(toDashboardName).$("i.si-navigation-menu");
var fromRow = findPublicDashboardRowByName(fromDashboardName).$("i.si-navigation-menu");
dragAndDropTo(toRow, fromRow);
}

Expand Down Expand Up @@ -367,7 +386,8 @@ public void cancelMultiLanguageDialog() {
}

public void cancelCreateDashboard() {
$("a[id$='dashboard-creation-component:dashboard-detail-close-button']").shouldBe(getClickableCondition()).click();
$("div[id$='dashboard-creation-details-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).
$("div[class*='ui-corner-top']").shouldBe(appear, DEFAULT_TIMEOUT).$$("a").filter(Condition.attribute("aria-label", "Close")).first().click();
closeAddDashboardDialog();
}

Expand Down Expand Up @@ -398,13 +418,13 @@ public void openImportPrivateDashboards() {
}

public SelenideElement getShareDashboardDialog() {
$("button[id$=':share-dashboard']").click();
$("div[id$=':share-dashboard-dialog']").shouldBe(appear, DEFAULT_TIMEOUT);
clickButtonOnDashboardConfigurationActionMenu("Share");
return $("div[id$=':share-dashboard-dialog']");
}

public void cancelImportDashboard() {
$("a[id$=':dashboard-import-close-button']").shouldBe(getClickableCondition()).click();
$("div[id$='dashboard-import-dialog']").shouldBe(appear, DEFAULT_TIMEOUT).
$("div[class*='ui-corner-top']").shouldBe(appear, DEFAULT_TIMEOUT).$$("a").filter(Condition.attribute("aria-label", "Close")).first().click();
closeAddDashboardDialog();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.codeborne.selenide.CollectionCondition;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.ElementsCollection.SelenideElementIterable;
import com.codeborne.selenide.SelenideElement;

public class DashboardModificationPage extends TemplatePage {
Expand Down Expand Up @@ -41,23 +42,32 @@ private SelenideElement getEditDashboardDialog() {
public NewDashboardDetailsEditPage navigateToEditDashboardDetailsByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
if (dashboardRow != null) {
dashboardRow.$("button[id$='dashboard-modification-component:dashboard-table:0:configure-dashboard']")
.shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
clickButtonOnDashboardConfigurationActionMenu("Configuration", dashboardRow);
NewDashboardDetailsEditPage newDashboardDetailsEditPage = new NewDashboardDetailsEditPage();
return newDashboardDetailsEditPage;
}
return null;
}

private SelenideElement getDashboardConfigurationActionMenu(SelenideElement dashboardRow) {
dashboardRow.$("div#dashboard-configuration-action-group").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("button[id$='dashboard-configuration-action-button']").shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
return $$("div[id$='dashboard-configuration-action-menu']").filter(Condition.appear).first();
}

private void clickButtonOnDashboardConfigurationActionMenu(String buttonName, SelenideElement dashboardRow) {
getDashboardConfigurationActionMenu(dashboardRow).$$("span").filter(Condition.text(buttonName)).first().shouldBe(getClickableCondition(), DEFAULT_TIMEOUT).click();
}

public void clickEditDashboardByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
dashboardRow.$("[id$=':edit']").click();
clickButtonOnDashboardConfigurationActionMenu("Edit", dashboardRow);
getEditDashboardDialog().shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public void clickDeleteDashboardByName(String dashboardName) {
SelenideElement dashboardRow = getDashboardRowByName(dashboardName);
dashboardRow.$("[id$=':delete-dashboard']").click();
clickButtonOnDashboardConfigurationActionMenu("Delete", dashboardRow);
SelenideElement deleteConfirmDialog = $("[id$=':remove-dashboard-dialog']").shouldBe(Condition.appear,
DEFAULT_TIMEOUT);
deleteConfirmDialog.$("button[id$=':remove-dashboard-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
Expand Down Expand Up @@ -126,15 +136,18 @@ public SelenideElement getDashboardCellByNameAndPosition(String dashboardName, i
public SelenideElement getDashboardExportButtonOfDashboard(String dashboardName) {
SelenideElement dashboard = getDashboardRowByName(dashboardName);
dashboard.shouldBe(Condition.appear);
return dashboard.$("td:last-child button[id $=':export-dashboard']");
return getDashboardConfigurationActionMenu(dashboard)
.$$("ul > li > a").filter(Condition.attribute("title", "Export dashboard")).first();
}

public SelenideElement getDashboardShareLinkButton() {
return $("button[id$='share-dashboard']");
SelenideElement dashboardRow = getDashboardRowByName("Dashboard");
return getDashboardConfigurationActionMenu(dashboardRow).$$("span").filter(Condition.text("Share")).first();
}

public void getDashboardShareLinkDialog() {
getDashboardShareLinkButton().shouldBe(Condition.appear, DEFAULT_TIMEOUT).shouldBe(getClickableCondition()).click();
SelenideElement dashboard = getDashboardRowByName("Dashboard");
clickButtonOnDashboardConfigurationActionMenu("Share", dashboard);
$("div[id$=':share-dashboard-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,20 @@ public void deleteCompactModeProcess() {
}

public void deleteImageModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
$("[id$=':process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT).$("span.si-bin-1")
getProcessActionMenu().shouldBe(Condition.appear, DEFAULT_TIMEOUT).$("span.si-bin-1")
.shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
getRemoveWidgetDialog().shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
getRemoveWidgetButton().click();
getRemoveWidgetDialog().shouldBe(Condition.disappear, DEFAULT_TIMEOUT);
}

private SelenideElement getProcessActionMenu() {
if (!$("[id$=':process-action-menu']").isDisplayed()) {
$("button[id$=':process-action-button']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.click();
}
return $("div[id$='process-action-menu']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
}

public void deleteFullModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear).click();
Expand Down Expand Up @@ -140,7 +147,7 @@ private void openDeleteCombinedModeProcessDialog() {
}

public ProcessEditWidgetNewDashBoardPage editFullModeProcess() {
$("button[id$=':process-action-button']").shouldBe(Condition.appear).click();
getProcessActionMenu();
$("[id$=':process-item:grid-process-action-component:edit-process']").shouldBe(Condition.appear, DEFAULT_TIMEOUT)
.$("span.si-graphic-tablet-drawing-pen").shouldBe(Condition.appear, DEFAULT_TIMEOUT).click();
$("div[id='new-widget-configuration-dialog']").shouldBe(Condition.appear, DEFAULT_TIMEOUT);
Expand Down
Loading

0 comments on commit f62d605

Please sign in to comment.