diff --git a/AxonIvyPortal/portal-components/config/variables/Assistants.json b/AxonIvyPortal/portal-components/config/variables/Assistants.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/AxonIvyPortal/portal-components/config/variables/Collections.json b/AxonIvyPortal/portal-components/config/variables/Collections.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/AxonIvyPortal/portal-components/config/variables/IvyTools.json b/AxonIvyPortal/portal-components/config/variables/IvyTools.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/AxonIvyPortal/portal-components/config/variables/RetrievalTools.json b/AxonIvyPortal/portal-components/config/variables/RetrievalTools.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/PortalVariable.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/PortalVariable.java index 6432a077a7a..d3fcb1cbc05 100644 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/PortalVariable.java +++ b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/PortalVariable.java @@ -13,8 +13,7 @@ public enum PortalVariable { DASHBOARD("Portal.Dashboard"), DASHBOARD_ORDER("Portal.Dashboard.Order"), DASHBOARD_TEMPLATES("Portal.DashboardTemplates"), - USER_MENU("Portal.UserMenu"), - CHATBOT_ENDPOINT("PortalAiUrl"); + USER_MENU("Portal.UserMenu"); public String key; diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/IvyToolResultType.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/IvyToolResultType.java deleted file mode 100644 index 3305caed83a..00000000000 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/IvyToolResultType.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.axonivy.portal.components.enums.ai; - -public enum IvyToolResultType { - - JSON("%s"), IFRAME(""), ERROR("%s"); - - private IvyToolResultType(String resultPattern) { - this.resultPattern = resultPattern; - } - - private String resultPattern; - - public String getResultPattern() { - return resultPattern; - } - - public void setResultPattern(String resultPattern) { - this.resultPattern = resultPattern; - } - - public String format(String content) { - return String.format(this.resultPattern, content); - } -} diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/RunState.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/RunState.java deleted file mode 100644 index 977dfa9f835..00000000000 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/enums/ai/RunState.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.axonivy.portal.components.enums.ai; - -public enum RunState { - OPEN, IN_PROGRESS, DONE, ERROR; -} diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/util/AssistantUtils.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/publicapi/AiAssistantAPI.java similarity index 62% rename from AxonIvyPortal/portal-components/src/com/axonivy/portal/components/util/AssistantUtils.java rename to AxonIvyPortal/portal-components/src/com/axonivy/portal/components/publicapi/AiAssistantAPI.java index 8ef6372a50d..18cf3415d99 100644 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/util/AssistantUtils.java +++ b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/publicapi/AiAssistantAPI.java @@ -1,26 +1,27 @@ -package com.axonivy.portal.components.util; +package com.axonivy.portal.components.publicapi; import java.util.Map; import org.apache.commons.lang3.StringUtils; -import com.axonivy.portal.components.enums.ai.IvyToolResultType; import com.axonivy.portal.components.service.impl.ProcessService; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.workflow.start.IWebStartable; -public class AssistantUtils { +public class AiAssistantAPI { + private static final String IFRAME_RESULT_PATTERN = ""; + private static final String ERROR_RESULT_PATTERN = "%s"; public static String generateLinkToIvyProcess(String link, Map params) { try { IWebStartable process = initWebStartable(link); - return IvyToolResultType.IFRAME - .format(process.getLink().queryParams(params).getRelative()); + return String.format(IFRAME_RESULT_PATTERN, + process.getLink().queryParams(params).getRelative()); } catch (Exception e) { - return IvyToolResultType.ERROR - .format(Ivy.cms().co("/Labels/AI/Error/ErrorWhenProceedRequest")); + return String.format(ERROR_RESULT_PATTERN, + Ivy.cms().co("/Labels/AI/Error/ErrorWhenProceedRequest")); } } @@ -38,6 +39,6 @@ public static String generateErrorResult(String error) { if (StringUtils.isBlank(error)) { return ""; } - return IvyToolResultType.ERROR.format(error); + return String.format(ERROR_RESULT_PATTERN, error); } } diff --git a/AxonIvyPortal/portal/config/variables.yaml b/AxonIvyPortal/portal/config/variables.yaml index 44af0c087d0..4db3de34879 100644 --- a/AxonIvyPortal/portal/config/variables.yaml +++ b/AxonIvyPortal/portal/config/variables.yaml @@ -200,9 +200,6 @@ Variables: # [enum: 1, 2, 3, 4, 5] MaxConnection: 3 - # Endpoint URL for the RESTful service of Portal chatbot - ChatBotEndpoint: localhost:8018 - Histories: # If true, case note does not display any system tasks for non-administrator users. HideSystemTasks: true @@ -302,17 +299,6 @@ Variables: # Set this property to true to enable the DeepL translation support Enable: false - # You can define AI assistants here - # [file: json] - Assistant: - - # You can define AI Tools - # [file: json] - AiTool: - - #URL to the REST service endpoint of Portal AI - PortalAiUrl: 'http://localhost:8018' - # You can define the application name via this JSON file. # It will be shown with the page title ApplicationName: Axon Ivy diff --git a/AxonIvyPortal/portal/config/variables/Portal/AiTool.json b/AxonIvyPortal/portal/config/variables/Portal/AiTool.json deleted file mode 100644 index 47ebb9892cb..00000000000 --- a/AxonIvyPortal/portal/config/variables/Portal/AiTool.json +++ /dev/null @@ -1,71 +0,0 @@ -[ - { - "id" : "find-tasks", - "name" : "Find tasks", - "type" : "IVY", - "signature" : "findTasks(String,String,String,String)", - "permissions" : ["Everybody"], - "description" : "This tool is helpful when user want to find tasks by attributes. ONLY useful for task", - "attributes" : [ - { - "name" : "taskName", - "description" : "Name of the task" - } , { - "name" : "taskDescription", - "description" : "Description of the task" - } , { - "name" : "taskPriority", - "description" : "Priority of a task. Valid values for this attribute: low, normal, high, exception" - } , { - "name" : "taskState", - "description" : "State of the task. Valid values for this attribute: open, in progress, done" - } - - ] - } , { - "id" : "find-cases", - "name" : "Find cases", - "type" : "IVY", - "signature" : "findCases(String,String,String)", - "permissions" : ["Everybody"], - "description" : "This tool is helpful when user want to find cases by attributes. ONLY useful for case", - "attributes" : [ - { - "name" : "caseName", - "description" : "Name of the case" - } , { - "name" : "caseDescription", - "description" : "Description of the case" - } , { - "name" : "caseState", - "description" : "State of the case. Valid values for this attribute: open, done, destroyed" - } - - ] - } , { - "id" : "portal-support", - "name" : "Portal support", - "type" : "RETRIEVAL_QA", - "default" : true, - "description" : "Helpful when user ask questions.", - "permissions" : ["Everybody"], - "collection" : "portal-user-guide" - } , { - "id" : "find-users", - "name" : "Find users", - "type" : "IVY", - "signature" : "findUsers(String,String)", - "permissions" : ["Everybody"], - "description" : "This is a tool to find information of users.", - "attributes" : [ - { - "name" : "username", - "description" : "Name of user" - } , { - "name" : "role", - "description" : "Role of user" - } - ], - "postAction" : "ONLY use data from the from the result, show as list these informations: name, display name, email, status (field enabled), if any field is null or empty, show blank space instead. Format: \nName: name\nDisplay Name: displayname\n Email: email\n... and so on" - } -] \ No newline at end of file diff --git a/AxonIvyPortal/portal/config/variables/Portal/Assistant.json b/AxonIvyPortal/portal/config/variables/Portal/Assistant.json deleted file mode 100644 index 803275bb37f..00000000000 --- a/AxonIvyPortal/portal/config/variables/Portal/Assistant.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "id" : "assistant-1", - "name" : "Portal Assistant", - "tools" : ["find-tasks", "portal-support"] - } -] \ No newline at end of file diff --git a/AxonIvyPortal/portal/dataclasses/portalkit/PortalToolsData.ivyClass b/AxonIvyPortal/portal/dataclasses/portalkit/PortalToolsData.ivyClass index db9943cc304..a4da3493fb3 100644 --- a/AxonIvyPortal/portal/dataclasses/portalkit/PortalToolsData.ivyClass +++ b/AxonIvyPortal/portal/dataclasses/portalkit/PortalToolsData.ivyClass @@ -1,6 +1,5 @@ PortalToolsData #class portalkit #namespace -tool ch.ivy.addon.portalkit.dto.ai.IvyTool #field taskDashboardWidget ch.ivy.addon.portalkit.dto.dashboard.TaskDashboardWidget #field name String #field description String #field diff --git a/AxonIvyPortal/portal/processes/AI Tool Processes/PortalCallableTools.p.json b/AxonIvyPortal/portal/processes/AI Tool Processes/PortalCallableTools.p.json index 23851d582fa..fd3828fd9d5 100644 --- a/AxonIvyPortal/portal/processes/AI Tool Processes/PortalCallableTools.p.json +++ b/AxonIvyPortal/portal/processes/AI Tool Processes/PortalCallableTools.p.json @@ -49,7 +49,7 @@ "config" : { "output" : { "code" : [ - "import com.axonivy.portal.components.util.AssistantUtils;", + "import com.axonivy.portal.components.publicapi.AiAssistantAPI;", "import org.apache.commons.collections4.CollectionUtils;", "import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter;", "import org.apache.commons.lang3.StringUtils;", @@ -65,7 +65,7 @@ "if (CollectionUtils.isNotEmpty(in.users)) {", " in.result = BusinessEntityConverter.entityToJsonValue(in.users);", "} else {", - " in.result = AssistantUtils.generateErrorResult(ivy.cms.co(\"/Labels/AI/Error/CannotFindUser\"));", + " in.result = AiAssistantAPI.generateErrorResult(ivy.cms.co(\"/Labels/AI/Error/CannotFindUser\"));", "}" ] }, @@ -126,8 +126,8 @@ "config" : { "output" : { "code" : [ + "import com.axonivy.portal.components.publicapi.AiAssistantAPI;", "import ch.ivyteam.ivy.application.IApplication;", - "import com.axonivy.portal.components.util.AssistantUtils;", "import java.util.HashMap;", "import java.util.Map;", "", @@ -137,7 +137,7 @@ "params.put(\"taskState\", in.taskState);", "params.put(\"taskPriority\", in.taskPriority);", "", - "in.result = AssistantUtils.generateLinkToIvyProcess(IApplication.current().getName() + \"/portal/AI Tool Processes/PortalTools/findTasksTool.ivp\", params);" + "in.result = AiAssistantAPI.generateLinkToIvyProcess(IApplication.current().getName() + \"/portal/AI Tool Processes/PortalTools/findTasksTool.ivp\", params);" ] } }, @@ -154,8 +154,8 @@ "config" : { "output" : { "code" : [ + "import com.axonivy.portal.components.publicapi.AiAssistantAPI;", "import org.apache.commons.lang3.StringUtils;", - "import com.axonivy.portal.components.util.AssistantUtils;", "import com.axonivy.portal.util.AiToolUtils;", "", "in.validationError = AiToolUtils.validateTaskState(in.taskState);", @@ -164,7 +164,7 @@ "}", "", "if(StringUtils.isNotBlank(in.validationError)) {", - " in.result = AssistantUtils.generateErrorResult(in.validationError);", + " in.result = AiAssistantAPI.generateErrorResult(in.validationError);", "}" ] } @@ -247,13 +247,13 @@ "config" : { "output" : { "code" : [ + "import com.axonivy.portal.components.publicapi.AiAssistantAPI;", "import org.apache.commons.lang3.StringUtils;", "import com.axonivy.portal.util.AiToolUtils;", - "import com.axonivy.portal.components.util.AssistantUtils;", "", "in.validationError = AiToolUtils.validateCaseState(in.taskState);", "if(StringUtils.isNotBlank(in.validationError)) {", - " in.result = AssistantUtils.generateErrorResult(in.validationError);", + " in.result = AiAssistantAPI.generateErrorResult(in.validationError);", "}" ] } @@ -293,8 +293,8 @@ "config" : { "output" : { "code" : [ + "import com.axonivy.portal.components.publicapi.AiAssistantAPI;", "import ch.ivyteam.ivy.application.IApplication;", - "import com.axonivy.portal.components.util.AssistantUtils;", "import java.util.HashMap;", "import java.util.Map;", "", @@ -303,7 +303,7 @@ "params.put(\"caseDescription\", in.taskDescription);", "params.put(\"caseState\", in.taskState);", "", - "in.result = AssistantUtils.generateLinkToIvyProcess(IApplication.current().getName() + \"/portal/AI Tool Processes/PortalTools/findCasesTool.ivp\", params);" + "in.result = AiAssistantAPI.generateLinkToIvyProcess(IApplication.current().getName() + \"/portal/AI Tool Processes/PortalTools/findCasesTool.ivp\", params);" ] } }, diff --git a/AxonIvyPortal/portal/processes/Start Processes/PortalStart.p.json b/AxonIvyPortal/portal/processes/Start Processes/PortalStart.p.json index 430df54cf49..ffe639b03aa 100644 --- a/AxonIvyPortal/portal/processes/Start Processes/PortalStart.p.json +++ b/AxonIvyPortal/portal/processes/Start Processes/PortalStart.p.json @@ -4906,37 +4906,5 @@ "connect" : [ { "id" : "f294", "to" : "f271" } ] - }, { - "id" : "f282", - "type" : "RequestStart", - "name" : "PortalChatDashboard", - "config" : { - "signature" : "PortalChatDashboard" - }, - "visual" : { - "at" : { "x" : 96, "y" : 4192 } - }, - "connect" : [ - { "id" : "f287", "to" : "f285" } - ] - }, { - "id" : "f285", - "type" : "DialogCall", - "name" : "ChatDashboard", - "config" : { - "dialog" : "com.axonivy.portal.component.ChatDashboard:start()" - }, - "visual" : { - "at" : { "x" : 280, "y" : 4192 } - }, - "connect" : [ - { "id" : "f290", "to" : "f286" } - ] - }, { - "id" : "f286", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 464, "y" : 4192 } - } } ] } \ No newline at end of file diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/ChatRendererBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/ChatRendererBean.java index 944b83c4161..b276595f8d2 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/ChatRendererBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/ChatRendererBean.java @@ -2,6 +2,7 @@ import java.io.Serializable; import java.util.Map; +import java.util.Optional; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @@ -12,9 +13,11 @@ import com.axonivy.portal.components.service.IvyAdapterService; import ch.ivy.addon.portalkit.enums.GlobalVariable; -import ch.ivy.addon.portalkit.enums.PortalVariable; +import ch.ivy.addon.portalkit.service.AiProcessService; import ch.ivy.addon.portalkit.service.GlobalSettingService; import ch.ivyteam.ivy.environment.Ivy; +import ch.ivyteam.ivy.model.value.WebLink; +import ch.ivyteam.ivy.workflow.IProcessStart; @ManagedBean @ViewScoped @@ -25,6 +28,7 @@ public class ChatRendererBean implements Serializable { private Boolean isGroupChatRendered; private Boolean isPrivateChatRendered; + private IProcessStart assistantDashboardProcess; public boolean getIsChatRendered() { return getIsGroupChatRendered() || getIsPrivateChatRendered(); @@ -62,7 +66,14 @@ public boolean isExpressCreationTask() { return Ivy.wfTask().customFields().stringField(EXPRESS_CREATION_TASK).get().isPresent(); } - public boolean getIsChatbotRendered() { - return !StringUtils.isBlank(Ivy.var().get(PortalVariable.CHATBOT_ENDPOINT.key)); + public boolean getIsAssistantDashboardRendered() { + if (this.assistantDashboardProcess == null) { + this.assistantDashboardProcess = AiProcessService.getInstance() + .findAssistantDashboardProcess(); + } + return StringUtils.isNotBlank(Optional.ofNullable(assistantDashboardProcess) + .map(IProcessStart::getLinkEmbedded).map(WebLink::getRelative) + .orElse("")); } + } 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 107d1b85e80..e6261363352 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 @@ -1,12 +1,8 @@ package ch.ivy.addon.portal.generic.bean; -import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import java.util.Random; -import java.util.stream.Collectors; -import java.util.stream.Stream; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; @@ -17,13 +13,11 @@ import org.apache.commons.lang3.StringUtils; import org.primefaces.event.SelectEvent; -import com.axonivy.portal.components.util.HtmlUtils; import com.axonivy.portal.dto.dashboard.filter.DashboardFilter; import com.axonivy.portal.service.DeepLTranslationService; import ch.addon.portal.generic.menu.MenuView; import ch.ivy.addon.portal.generic.navigation.PortalNavigator; -import ch.ivy.addon.portalkit.constant.PortalConstants; import ch.ivy.addon.portalkit.dto.DisplayName; import ch.ivy.addon.portalkit.dto.dashboard.CaseDashboardWidget; import ch.ivy.addon.portalkit.dto.dashboard.ColumnModel; @@ -34,31 +28,23 @@ import ch.ivy.addon.portalkit.dto.dashboard.SingleProcessDashboardWidget; import ch.ivy.addon.portalkit.dto.dashboard.TaskDashboardWidget; import ch.ivy.addon.portalkit.dto.dashboard.WidgetFilterModel; -import ch.ivy.addon.portalkit.enums.BehaviourWhenClickingOnLineInTaskList; -import ch.ivy.addon.portalkit.enums.CaseEmptyMessage; import ch.ivy.addon.portalkit.enums.DashboardWidgetType; -import ch.ivy.addon.portalkit.enums.GlobalVariable; -import ch.ivy.addon.portalkit.enums.PortalPage; import ch.ivy.addon.portalkit.enums.PortalVariable; import ch.ivy.addon.portalkit.enums.SessionAttribute; -import ch.ivy.addon.portalkit.enums.TaskEmptyMessage; import ch.ivy.addon.portalkit.exporter.Exporter; import ch.ivy.addon.portalkit.ivydata.service.impl.LanguageService; import ch.ivy.addon.portalkit.jsf.ManagedBeans; import ch.ivy.addon.portalkit.persistence.converter.BusinessEntityConverter; -import ch.ivy.addon.portalkit.service.GlobalSettingService; import ch.ivy.addon.portalkit.service.WidgetFilterService; import ch.ivy.addon.portalkit.support.HtmlParser; import ch.ivy.addon.portalkit.util.DashboardUtils; import ch.ivy.addon.portalkit.util.DashboardWidgetUtils; import ch.ivy.addon.portalkit.util.PermissionUtils; -import ch.ivy.addon.portalkit.util.TaskUtils; import ch.ivy.addon.portalkit.util.UrlUtils; import ch.ivy.addon.portalkit.util.UserUtils; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.security.ISecurityConstants; import ch.ivyteam.ivy.security.IUser; -import ch.ivyteam.ivy.workflow.ICase; import ch.ivyteam.ivy.workflow.ITask; @ViewScoped @@ -75,10 +61,6 @@ public class DashboardBean implements Serializable { private int currentDashboardIndex; private List widgetFilters; private List deleteFilters; - private ITask selectedTask; - private boolean isRunningTaskWhenClickingOnTaskInList; - private CaseEmptyMessage noCasesMessage; - private TaskEmptyMessage noTasksMessage; private List dashboardTemplates; protected String translatedText; protected String warningText; @@ -116,9 +98,6 @@ public void init() { } } buildWidgetModels(selectedDashboard); - isRunningTaskWhenClickingOnTaskInList = GlobalSettingService.getInstance() - .findGlobalSettingValue(GlobalVariable.DEFAULT_BEHAVIOUR_WHEN_CLICKING_ON_LINE_IN_TASK_LIST) - .equals(BehaviourWhenClickingOnLineInTaskList.RUN_TASK.name()); buildClientStatisticApiUri(); } @@ -185,38 +164,6 @@ public void navigateToSelectedTaskDetails(SelectEvent event) { PortalNavigator.navigateToPortalTaskDetails(uuid); } - public void handleRowSelectEventOnTaskWidget(SelectEvent event) throws IOException { - ITask task = ((ITask) event.getObject()); - handleSelectedTask(task); - } - - private void handleSelectedTask(ITask task) throws IOException { - if (isRunningTaskWhenClickingOnTaskInList) { - handleStartTask(task); - } else { - navigateToSelectedTaskDetails(task); - } - } - - public void handleStartTask(ITask task) throws IOException { - selectedTask = task; - TaskUtils.handleStartTask(task, PortalPage.HOME_PAGE, PortalConstants.RESET_TASK_CONFIRMATION_DIALOG); - } - - public void navigateToSelectedTaskDetails(ITask task) { - PortalNavigator.navigateToPortalTaskDetails(task.uuid()); - } - - public void navigateToSelectedCaseDetails(SelectEvent event) { - String uuid = ((ICase) event.getObject()).uuid(); - PortalNavigator.navigateToPortalCaseDetails(uuid); - } - - public void resetAndOpenTask() throws IOException { - TaskUtils.resetTask(selectedTask); - FacesContext.getCurrentInstance().getExternalContext().redirect(selectedTask.getStartLinkEmbedded().getRelative()); - } - protected IUser currentUser() { return Ivy.session().getSessionUser(); } @@ -231,10 +178,6 @@ public String createExtractedTextFromHtml(String text) { return HtmlParser.extractTextFromHtml(text); } - public String createParseTextFromHtml (String text) { - return HtmlUtils.parseTextFromHtml(text); - } - public int getCurrentTabIndex() { return dashboards.indexOf(getSelectedDashboard()); } @@ -379,26 +322,6 @@ public void setDeleteFilters(List deleteFilters) { this.deleteFilters = deleteFilters; } - public CaseEmptyMessage getNoCasesMessage() { - if (noCasesMessage == null) { - List messages = Stream.of(CaseEmptyMessage.values()).collect(Collectors.toList()); - Random random = new Random(); - int index = random.ints(0, messages.size()).findFirst().getAsInt(); - noCasesMessage = messages.get(index); - } - return noCasesMessage; - } - - public TaskEmptyMessage getNoTasksMessage() { - if (noTasksMessage == null) { - List messages = Stream.of(TaskEmptyMessage.values()).collect(Collectors.toList()); - Random random = new Random(); - int index = random.ints(0, messages.size()).findFirst().getAsInt(); - noTasksMessage = messages.get(index); - } - return noTasksMessage; - } - public List getDashboardTemplates() { if (CollectionUtils.isEmpty(dashboardTemplates)) { loadDashboardTemplate(); diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardCaseWidgetBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardCaseWidgetBean.java new file mode 100644 index 00000000000..5d29f326499 --- /dev/null +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardCaseWidgetBean.java @@ -0,0 +1,46 @@ +package ch.ivy.addon.portal.generic.bean; + +import java.io.Serializable; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ViewScoped; + +import org.primefaces.event.SelectEvent; + +import ch.ivy.addon.portal.generic.navigation.PortalNavigator; +import ch.ivy.addon.portalkit.enums.CaseEmptyMessage; +import ch.ivy.addon.portalkit.support.HtmlParser; +import ch.ivyteam.ivy.workflow.ICase; + +@ViewScoped +@ManagedBean +public class DashboardCaseWidgetBean implements Serializable { + + private static final long serialVersionUID = 4733478835925712413L; + + private CaseEmptyMessage noCasesMessage; + + public void navigateToSelectedCaseDetails(SelectEvent event) { + String uuid = ((ICase) event.getObject()).uuid(); + PortalNavigator.navigateToPortalCaseDetails(uuid); + } + + public CaseEmptyMessage getNoCasesMessage() { + if (noCasesMessage == null) { + List messages = Stream.of(CaseEmptyMessage.values()) + .collect(Collectors.toList()); + Random random = new Random(); + int index = random.ints(0, messages.size()).findFirst().getAsInt(); + noCasesMessage = messages.get(index); + } + return noCasesMessage; + } + + public String createExtractedTextFromHtml(String text) { + return HtmlParser.extractTextFromHtml(text); + } +} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardTaskWidgetBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardTaskWidgetBean.java new file mode 100644 index 00000000000..3a44be8bdc9 --- /dev/null +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/DashboardTaskWidgetBean.java @@ -0,0 +1,101 @@ +package ch.ivy.addon.portal.generic.bean; + +import java.io.IOException; +import java.io.Serializable; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.annotation.PostConstruct; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.ViewScoped; +import javax.faces.context.FacesContext; + +import org.primefaces.event.SelectEvent; + +import com.axonivy.portal.components.util.HtmlUtils; + +import ch.ivy.addon.portal.generic.navigation.PortalNavigator; +import ch.ivy.addon.portalkit.constant.PortalConstants; +import ch.ivy.addon.portalkit.enums.BehaviourWhenClickingOnLineInTaskList; +import ch.ivy.addon.portalkit.enums.GlobalVariable; +import ch.ivy.addon.portalkit.enums.PortalPage; +import ch.ivy.addon.portalkit.enums.TaskEmptyMessage; +import ch.ivy.addon.portalkit.service.GlobalSettingService; +import ch.ivy.addon.portalkit.support.HtmlParser; +import ch.ivy.addon.portalkit.util.TaskUtils; +import ch.ivyteam.ivy.workflow.ITask; + +@ViewScoped +@ManagedBean +public class DashboardTaskWidgetBean implements Serializable { + + private static final long serialVersionUID = 1098133393632524689L; + + private ITask selectedTask; + private boolean isRunningTaskWhenClickingOnTaskInList; + private TaskEmptyMessage noTasksMessage; + + @PostConstruct + public void init() { + isRunningTaskWhenClickingOnTaskInList = GlobalSettingService.getInstance() + .findGlobalSettingValue( + GlobalVariable.DEFAULT_BEHAVIOUR_WHEN_CLICKING_ON_LINE_IN_TASK_LIST) + .equals(BehaviourWhenClickingOnLineInTaskList.RUN_TASK.name()); + } + + public void resetAndOpenTask() throws IOException { + TaskUtils.resetTask(selectedTask); + FacesContext.getCurrentInstance().getExternalContext() + .redirect(selectedTask.getStartLinkEmbedded().getRelative()); + } + + public void handleRowSelectEventOnTaskWidget(SelectEvent event) + throws IOException { + ITask task = ((ITask) event.getObject()); + handleSelectedTask(task); + } + + private void handleSelectedTask(ITask task) throws IOException { + if (isRunningTaskWhenClickingOnTaskInList) { + handleStartTask(task); + } else { + navigateToSelectedTaskDetails(task); + } + } + + public void handleStartTask(ITask task) throws IOException { + selectedTask = task; + TaskUtils.handleStartTask(task, PortalPage.HOME_PAGE, + PortalConstants.RESET_TASK_CONFIRMATION_DIALOG); + } + + public void navigateToSelectedTaskDetails(SelectEvent event) { + String uuid = ((ITask) event.getObject()).uuid(); + PortalNavigator.navigateToPortalTaskDetails(uuid); + } + + public void navigateToSelectedTaskDetails(ITask task) { + PortalNavigator.navigateToPortalTaskDetails(task.uuid()); + } + + public String createParseTextFromHtml(String text) { + return HtmlUtils.parseTextFromHtml(text); + } + + public TaskEmptyMessage getNoTasksMessage() { + if (noTasksMessage == null) { + List messages = Stream.of(TaskEmptyMessage.values()) + .collect(Collectors.toList()); + Random random = new Random(); + int index = random.ints(0, messages.size()).findFirst().getAsInt(); + noTasksMessage = messages.get(index); + } + return noTasksMessage; + } + + public String createExtractedTextFromHtml(String text) { + return HtmlParser.extractTextFromHtml(text); + } +} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/UserMenuBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/UserMenuBean.java index 3b74f8e0421..d7f3d48815f 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/UserMenuBean.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/bean/UserMenuBean.java @@ -273,8 +273,8 @@ public void navigateToUserProfile() throws IOException { getExternalContext().redirect(getUserProfileUrl()); } - public void navigateToChatbotDashboard() throws IOException { - getExternalContext().redirect(getChatbotUrl()); + public void navigateToAssistantDashboard() throws IOException { + getExternalContext().redirect(getAssistantDashboardUrl()); } private void navigateToTargetPage() throws IOException { @@ -285,8 +285,8 @@ private String getUserProfileUrl() { return PortalNavigator.buildUserProfileUrl(); } - private String getChatbotUrl() { - return PortalNavigator.buildChatbotUrl(); + private String getAssistantDashboardUrl() { + return PortalNavigator.buildAssistantDashboardUrl(); } private void navigateToPortalManagement() throws IOException { @@ -409,10 +409,10 @@ public String getGooglePlayImageLink() { public void navigateToChatBotOrDisplayWorkingTaskWarning(boolean isWorkingOnATask, ITask task) throws IOException { if (isWorkingOnATask && task.getState() != TaskState.DONE) { openTaskLosingConfirmationDialog(); - targetPage = getChatbotUrl(); + targetPage = getAssistantDashboardUrl(); } else { executeJSResetPortalMenuState(); - navigateToChatbotDashboard(); + navigateToAssistantDashboard(); } } } diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/navigation/PortalNavigator.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/navigation/PortalNavigator.java index 96be93a568a..e4b9bb7f0ff 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/navigation/PortalNavigator.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portal/generic/navigation/PortalNavigator.java @@ -4,6 +4,7 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; @@ -14,9 +15,12 @@ import ch.ivy.addon.portalkit.enums.MenuKind; import ch.ivy.addon.portalkit.enums.SessionAttribute; +import ch.ivy.addon.portalkit.service.AiProcessService; import ch.ivy.addon.portalkit.util.RequestUtils; import ch.ivyteam.ivy.environment.Ivy; +import ch.ivyteam.ivy.model.value.WebLink; import ch.ivyteam.ivy.request.IHttpRequest; +import ch.ivyteam.ivy.workflow.IProcessStart; import ch.ivyteam.ivy.workflow.StandardProcessType; public final class PortalNavigator extends BaseNavigator{ @@ -40,7 +44,6 @@ public final class PortalNavigator extends BaseNavigator{ private static final String PORTAL_NEW_DASHBOARD_CONFIGURATION = "Start Processes/PortalStart/PortalDashboardConfiguration.ivp"; private static final String PORTAL_PROCESS_INFO = "Start Processes/PortalStart/ProcessInformation.ivp"; private static final String PORTAL_DASHBOARD_DETAILS = "Start Processes/PortalStart/DashboardDetails.ivp"; - private static final String PORTAL_CHATBOT = "Start Processes/PortalStart/PortalChatDashboard.ivp"; public static final String PORTAL_DASHBOARD_START = "/DefaultDashboardPage.ivp"; public static final String PORTAL_PROCESS_START = "/DefaultProcessStartListPage.ivp"; @@ -279,7 +282,10 @@ public static String buildNotificationFullPageUrl() { return buildUrlByKeyword(PORTAL_NOTIFICATION_FULLPAGE_START, PORTAL_NOTIFICATION_FULLPAGE, new HashMap<>()); } - public static String buildChatbotUrl() { - return buildUrlByKeyword("PortalChatDashboard.ivp", PORTAL_CHATBOT, new HashMap<>()); + public static String buildAssistantDashboardUrl() { + IProcessStart process = AiProcessService.getInstance() + .findAssistantDashboardProcess(); + return Optional.ofNullable(process).map(IProcessStart::getLinkEmbedded) + .map(WebLink::getRelative).orElse(""); } } diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/AssistantModificationBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/AssistantModificationBean.java deleted file mode 100644 index e641d733011..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/AssistantModificationBean.java +++ /dev/null @@ -1,90 +0,0 @@ -package ch.ivy.addon.portalkit.bean; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ViewScoped; - -import org.apache.commons.collections4.CollectionUtils; - -import com.axonivy.portal.bean.ai.AssistantBean; -import com.axonivy.portal.components.util.SecurityMemberDisplayNameUtils; - -import ch.ivy.addon.portalkit.enums.ChatbotCandidateQuestion; -import ch.ivy.addon.portalkit.service.AssistantService; -import ch.ivyteam.ivy.environment.Ivy; -import ch.ivyteam.ivy.security.ISecurityMember; - -@ManagedBean -@ViewScoped -public class AssistantModificationBean extends AssistantBean - implements Serializable { - - private static final long serialVersionUID = -894113970760912023L; - - private boolean isAddTool; - - private ChatbotCandidateQuestion[] candidateQuestions = ChatbotCandidateQuestion - .values(); - - @PostConstruct - public void init() { - super.initBean(); - isAddTool = false; - } - - public ChatbotCandidateQuestion[] getCandidateQuestions() { - return candidateQuestions; - } - - public String renderPermissions(List permissions) { - String result = ""; - - if (CollectionUtils.isEmpty(permissions)) { - return result; - } - - for (String permission : permissions) { - if (permissions.indexOf(permission) != 0) { - result += ", "; - } - ISecurityMember mem = Ivy.security().members().find(permission); - result += SecurityMemberDisplayNameUtils - .generateBriefDisplayNameForSecurityMember(mem, permission); - } - return result; - } - - public boolean isAddTool() { - return isAddTool; - } - - public void setAddTool(boolean isAddTool) { - this.isAddTool = isAddTool; - } - - public void onAddTool() { - setAddTool(true); - } - - public void onBack() { - setAddTool(false); - } - - @Override - public void save() { - AssistantService.getInstance() - .saveAllPublicConfig(Arrays.asList(getAssistant())); - setAssistantJson(getAssistant().buildDetailsJson()); - onCancel(); - } - - @Override - public void onCancel() { - setAddTool(false); - init(); - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/ChatDashboardBean.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/ChatDashboardBean.java deleted file mode 100644 index 43acb785e42..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/bean/ChatDashboardBean.java +++ /dev/null @@ -1,37 +0,0 @@ -package ch.ivy.addon.portalkit.bean; - -import java.io.Serializable; - -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ViewScoped; - -import org.apache.commons.lang3.StringUtils; - -import ch.ivy.addon.portalkit.enums.ChatbotCandidateQuestion; -import ch.ivy.addon.portalkit.enums.PortalVariable; -import ch.ivyteam.ivy.environment.Ivy; - -@ManagedBean -@ViewScoped -public class ChatDashboardBean implements Serializable { - - private static final long serialVersionUID = -894113970760912023L; - - private static ChatbotCandidateQuestion[] candidateQuestions = ChatbotCandidateQuestion.values(); - private String chatbotEndpoint; - - public ChatbotCandidateQuestion[] getCandidateQuestions() { - return candidateQuestions; - } - - public String getChatbotEndpoint() { - if (StringUtils.isBlank(chatbotEndpoint)) { - chatbotEndpoint = Ivy.var().get(PortalVariable.CHATBOT_ENDPOINT.key); - } - return chatbotEndpoint; - } - - public void setChatbotEndpoint(String chatbotEndpoint) { - this.chatbotEndpoint = chatbotEndpoint; - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/AiTool.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/AiTool.java deleted file mode 100644 index c2aa18610ad..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/AiTool.java +++ /dev/null @@ -1,112 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import java.io.Serializable; -import java.util.List; - -import com.axonivy.portal.enums.ai.ToolType; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.databind.JsonNode; - -import ch.ivy.addon.portalkit.configuration.AbstractConfiguration; - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @Type(value = IvyTool.class, name = "IVY"), - @Type(value = RetrievalQATool.class, name = "RETRIEVAL_QA") }) -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public abstract class AiTool extends AbstractConfiguration - implements Serializable { - - private static final long serialVersionUID = -4652001849527628818L; - - private String name; - private String description; - private List permissions; - private boolean isDefault; - private List steps; - private int workingStepNo; - - public AiTool() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getPermissions() { - return permissions; - } - - public void setPermissions(List permissions) { - this.permissions = permissions; - } - - public abstract void init(); - - public boolean isDefault() { - return isDefault; - } - - public void setDefault(boolean isDefault) { - this.isDefault = isDefault; - } - - public abstract ToolType getType(); - - public List getSteps() { - return steps; - } - - public void setSteps(List steps) { - this.steps = steps; - } - - public int getWorkingStepNo() { - return workingStepNo; - } - - public void setWorkingStepNo(int workingStepNo) { - this.workingStepNo = workingStepNo; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - AiTool other = (AiTool) obj; - if (getId() == null) { - if (other.getId() != null) - return false; - } else if (!getId().equals(other.getId())) - return false; - return true; - } - - public abstract JsonNode buildJsonNode(); -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/Assistant.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/Assistant.java deleted file mode 100644 index 18561d5b2b2..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/Assistant.java +++ /dev/null @@ -1,178 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import java.util.stream.Collectors; - -import org.apache.commons.collections4.CollectionUtils; - -import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter; -import com.axonivy.portal.components.service.exception.PortalException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import ch.ivy.addon.portalkit.configuration.AbstractConfiguration; -import ch.ivy.addon.portalkit.service.AiToolService; - -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class Assistant extends AbstractConfiguration implements Serializable { - - private static final long serialVersionUID = 7885313923903511903L; - - @JsonIgnore - private List toolkit; - - private String name; - private List tools; - - public Assistant() { - this.setIsPublic(true); - } - - public void init(String id, String name) { - setId(id); - this.name = name; - } - - @JsonIgnore - public List getToolkit() { - return toolkit; - } - - @JsonIgnore - public void setToolkit(List toolkit) { - this.toolkit = toolkit; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String toJson() { - return BusinessEntityConverter.entityToJsonValue(this); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Assistant other = (Assistant) obj; - if (getId() == null) { - if (other.getId() != null) - return false; - } else if (!getId().equals(other.getId())) - return false; - return true; - } - - public List getTools() { - return tools; - } - - public void setTools(List tools) { - this.tools = tools; - } - - public void initToolkit() { - if (CollectionUtils.isEmpty(tools)) { - this.toolkit = new ArrayList<>(); - this.tools = new ArrayList<>(); - } - - List allTools = AiToolService.getInstance().getPublicConfig(); - this.toolkit = allTools.stream() - .filter(tool -> this.tools.contains(tool.getId())) - .collect(Collectors.toList()); - } - - public static Assistant addNewAssistant() { - Assistant result = new Assistant(); - result.setId(UUID.randomUUID().toString()); - result.setName(""); - result.setTools(new ArrayList<>()); - result.setToolkit(new ArrayList<>()); - return result; - } - - public String buildDetailsJson() { - ObjectMapper mapper = BusinessEntityConverter.getObjectMapper(); - ObjectNode result; - try { - result = (ObjectNode) mapper - .readTree(BusinessEntityConverter.entityToJsonValue(this)); - } catch (JsonMappingException e) { - throw new PortalException(e); - } catch (JsonProcessingException e) { - throw new PortalException(e); - } - - if (CollectionUtils.isNotEmpty(this.toolkit)) { - ArrayNode toolkitNode = mapper.createArrayNode(); - for (AiTool tool : this.toolkit) { - JsonNode node = tool.buildJsonNode(); - if (node != null) { - toolkitNode.add(node); - } - } - result.set("toolkit", toolkitNode); - } - - result.remove("tools"); - - try { - return mapper.writeValueAsString(result); - } catch (JsonProcessingException e) { - throw new PortalException(e); - } - } - - public void addTool(AiTool tool) { - this.toolkit.add(tool); - this.tools.add(Optional.ofNullable(tool).map(AiTool::getId).orElse("")); - } - - public void removeTool(AiTool toolToRemove) { - if (Optional.ofNullable(toolToRemove).map(AiTool::getId).isEmpty()) { - return; - } - - for (AiTool tool : toolkit) { - if (tool.getId().contentEquals(toolToRemove.getId())) { - toolkit.remove(tool); - break; - } - } - - for (String toolId : tools) { - if (toolId.contentEquals(toolToRemove.getId())) { - tools.remove(toolId); - break; - } - } - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyTool.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyTool.java deleted file mode 100644 index 78071f59d01..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyTool.java +++ /dev/null @@ -1,133 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.collections4.CollectionUtils; - -import com.axonivy.portal.components.enums.ai.RunState; -import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter; -import com.axonivy.portal.components.service.IvyAdapterService; -import com.axonivy.portal.enums.ai.ToolType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.JsonNode; - -import ch.ivyteam.ivy.environment.Ivy; - -public class IvyTool extends AiTool { - - private static final long serialVersionUID = -5362479525475837795L; - - private List attributes; - private String signature; - private String postAction; - - public List getAttributes() { - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override - public void init() { - } - - @Override - public ToolType getType() { - return ToolType.IVY; - } - - @JsonIgnore - public String getResult() { - if (!hasPermision()) { - setSteps(Arrays.asList(createNoPermisisonStep())); - setWorkingStepNo(0); - return BusinessEntityConverter - .entityToJsonValue(getSteps().get(getWorkingStepNo())); - } - - Map params = new HashMap<>(); - getAttributes().forEach(attr -> { - params.put(attr.getName(), attr.getValue()); - }); - Map result = IvyAdapterService - .startSubProcessInProjectAndAllRequired(getSignature(), params); - - if (CollectionUtils.isEmpty(getSteps())) { - IvyToolStep step = new IvyToolStep(); - step.setStepNo(0); - setWorkingStepNo(0); - step.setToolId(getId()); - step.setPostAction(getPostAction()); - - if (result != null && !result.isEmpty()) { - step.setResult((String) result.get("result")); - step.setDescription(getDescription()); - step.setState(RunState.DONE); - } else { - step.setResult( - "Error happened when proceed your request, please try again."); - step.setState(RunState.ERROR); - } - - setSteps(Arrays.asList(step)); - } - return BusinessEntityConverter - .entityToJsonValue(getSteps().get(getWorkingStepNo())); - } - - @Override - public JsonNode buildJsonNode() { - return BusinessEntityConverter.entityToJsonNode(this); - } - - public String getPostAction() { - return postAction; - } - - public void setPostAction(String postAction) { - this.postAction = postAction; - } - - private boolean hasPermision() { - boolean hasPermission = false; - for (String permission : getPermissions()) { - - // Check if username of login user equals to the permission. - if (permission.startsWith("#")) { - hasPermission = Ivy.session().getSessionUserName() - .contentEquals(permission.substring(1)); - } else { - // Check if the permission is existing in the role list of login user. - hasPermission = Ivy.session().getSessionUser().getAllRoles().stream() - .anyMatch(role -> role.getName().contentEquals(permission)); - } - - if (hasPermission) { - break; - } - } - return hasPermission; - } - - private IvyToolStep createNoPermisisonStep() { - IvyToolStep step = new IvyToolStep(); - step.setStepNo(0); - step.setResult("Sorry, you don't have permission to proceed this request."); - step.setState(RunState.ERROR); - step.setToolId(getId()); - return step; - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolAttribute.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolAttribute.java deleted file mode 100644 index 0c0f9c1c37b..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolAttribute.java +++ /dev/null @@ -1,64 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import java.io.Serializable; - -import com.fasterxml.jackson.annotation.JsonInclude; - -@JsonInclude(JsonInclude.Include.ALWAYS) -public class IvyToolAttribute implements Serializable { - - private static final long serialVersionUID = -2291917200620175108L; - - private String name; - private String value; - private String description; - private boolean isRequired; - - public IvyToolAttribute() { - } - - public IvyToolAttribute(String name, String value, String description) { - this.name = name; - this.value = value; - this.description = description; - } - - public IvyToolAttribute(String name, String description, boolean isRequired) { - this.name = name; - this.description = description; - this.isRequired = isRequired; - this.value = ""; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public boolean isRequired() { - return isRequired; - } - - public void setRequired(boolean isRequired) { - this.isRequired = isRequired; - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolStep.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolStep.java deleted file mode 100644 index af781fa0129..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/IvyToolStep.java +++ /dev/null @@ -1,62 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import com.axonivy.portal.components.enums.ai.RunState; -import com.axonivy.portal.enums.ai.StepType; - -public class IvyToolStep { - private int stepNo; - private StepType type; - private String description; - private String result; - private RunState state; - private String toolId; - private String postAction; - - public int getStepNo() { - return stepNo; - } - public void setStepNo(int stepNo) { - this.stepNo = stepNo; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public String getResult() { - return result; - } - public void setResult(String result) { - this.result = result; - } - public RunState getState() { - return state; - } - public void setState(RunState state) { - this.state = state; - } - - public String getToolId() { - return toolId; - } - - public void setToolId(String toolId) { - this.toolId = toolId; - } - - public String getPostAction() { - return postAction; - } - - public void setPostAction(String postAction) { - this.postAction = postAction; - } - - public StepType getType() { - return type; - } - public void setType(StepType type) { - this.type = type; - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/RetrievalQATool.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/RetrievalQATool.java deleted file mode 100644 index 83a30b47d09..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/dto/ai/RetrievalQATool.java +++ /dev/null @@ -1,34 +0,0 @@ -package ch.ivy.addon.portalkit.dto.ai; - -import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter; -import com.axonivy.portal.enums.ai.ToolType; -import com.fasterxml.jackson.databind.JsonNode; - -public class RetrievalQATool extends AiTool { - - private static final long serialVersionUID = -6486736943933821211L; - - private String collection; - - public String getCollection() { - return collection; - } - - public void setCollection(String collection) { - this.collection = collection; - } - - @Override - public void init() { - } - - @Override - public ToolType getType() { - return ToolType.RETRIEVAL_QA; - } - - @Override - public JsonNode buildJsonNode() { - return BusinessEntityConverter.entityToJsonNode(this); - } -} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/enums/PortalVariable.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/enums/PortalVariable.java index db296adf969..d6fc73f7a29 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/enums/PortalVariable.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/enums/PortalVariable.java @@ -17,7 +17,6 @@ public enum PortalVariable { CUSTOM_MENU_ITEMS("Portal.CustomMenuItems"), STATISTIC_DATA("Portal.StatisticData"), CHATBOT_ENDPOINT("PortalAiUrl"), - AI_ASSISTANT("Portal.Assistant"), AI_TOOL("Portal.AiTool"), DASHBOARD_MAIN_MENU_ENTRY("Portal.Dashboard.MainMenuEntry"), CLIENT_STATISTIC("Portal.ClientStatistic"); diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiProcessService.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiProcessService.java new file mode 100644 index 00000000000..9d679c542a8 --- /dev/null +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiProcessService.java @@ -0,0 +1,24 @@ +package ch.ivy.addon.portalkit.service; + +import com.axonivy.portal.components.util.ProcessStartUtils; + +import ch.ivyteam.ivy.workflow.IProcessStart; + +public class AiProcessService { + + private static final String AI_DASHBOARD_FRIENDLY_REQUEST_PATH = "Start Processes/AiStart/AssistantDashboard.ivp"; + + private static AiProcessService instance; + + public static AiProcessService getInstance() { + if (instance == null) { + instance = new AiProcessService(); + } + return instance; + } + + public IProcessStart findAssistantDashboardProcess() { + return ProcessStartUtils.findProcessStartByUserFriendlyRequestPath( + AI_DASHBOARD_FRIENDLY_REQUEST_PATH); + } +} diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiToolService.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiToolService.java deleted file mode 100644 index eb01a9185c2..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AiToolService.java +++ /dev/null @@ -1,43 +0,0 @@ -package ch.ivy.addon.portalkit.service; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; - -import ch.ivy.addon.portalkit.dto.ai.AiTool; -import ch.ivy.addon.portalkit.enums.PortalVariable; -import ch.ivy.addon.portalkit.persistence.converter.BusinessEntityConverter; -import ch.ivyteam.ivy.environment.Ivy; - -public class AiToolService extends JsonConfigurationService { - - private static AiToolService instance; - - public static AiToolService getInstance() { - if (instance == null) { - instance = new AiToolService(); - } - return instance; - } - - @Override - public Class getType() { - return AiTool.class; - } - - @Override - public String getConfigKey() { - return PortalVariable.AI_TOOL.key; - } - - @Override - public List getPublicConfig() { - String jsonValue = Ivy.var().get(getConfigKey()); - if (StringUtils.isBlank(jsonValue)) { - return new ArrayList<>(); - } - - return BusinessEntityConverter.jsonValueToEntities(jsonValue, getType()); - } -} \ No newline at end of file diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AssistantService.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AssistantService.java deleted file mode 100644 index 5b222de5483..00000000000 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/service/AssistantService.java +++ /dev/null @@ -1,43 +0,0 @@ -package ch.ivy.addon.portalkit.service; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; - -import ch.ivy.addon.portalkit.dto.ai.Assistant; -import ch.ivy.addon.portalkit.enums.PortalVariable; -import ch.ivy.addon.portalkit.persistence.converter.BusinessEntityConverter; -import ch.ivyteam.ivy.environment.Ivy; - -public class AssistantService extends JsonConfigurationService { - - private static AssistantService instance; - - public static AssistantService getInstance() { - if (instance == null) { - instance = new AssistantService(); - } - return instance; - } - - @Override - public Class getType() { - return Assistant.class; - } - - @Override - public String getConfigKey() { - return PortalVariable.AI_ASSISTANT.key; - } - - @Override - public List getPublicConfig() { - String jsonValue = Ivy.var().get(getConfigKey()); - if (StringUtils.isBlank(jsonValue)) { - return new ArrayList<>(); - } - - return BusinessEntityConverter.jsonValueToEntities(jsonValue, getType()); - } -} diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantBean.java b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantBean.java deleted file mode 100644 index c4e6e8dcc72..00000000000 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantBean.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.axonivy.portal.bean.ai; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; - -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; - -import com.axonivy.portal.components.enums.PortalVariable; - -import ch.ivy.addon.portalkit.dto.ai.AiTool; -import ch.ivy.addon.portalkit.dto.ai.Assistant; -import ch.ivy.addon.portalkit.service.AiToolService; -import ch.ivy.addon.portalkit.service.AssistantService; -import ch.ivyteam.ivy.environment.Ivy; - -public abstract class AssistantBean implements Serializable { - - private static final long serialVersionUID = 1683098437048122830L; - - private Assistant assistant; - private String assistantEndPoint; - private String assistantJson; - private List availableTools; - - public void initBean() { - this.assistantEndPoint = getEndpoint(); - this.assistant = AssistantService.getInstance().getPublicConfig().get(0); - this.assistant.initToolkit(); - this.assistantJson = StringEscapeUtils - .escapeJava(this.assistant.buildDetailsJson()); - - this.setAvailableTools(CollectionUtils - .disjunction(AiToolService.getInstance().getPublicConfig(), - this.assistant.getToolkit()) - .stream().collect(Collectors.toList())); - - } - - public String getEndpoint() { - return Ivy.var().get(PortalVariable.CHATBOT_ENDPOINT.key) - .concat("/assistant/"); - } - - public Assistant getAssistant() { - return assistant; - } - - public void setAssistant(Assistant assistant) { - this.assistant = assistant; - } - - public String getAssistantEndPoint() { - return assistantEndPoint; - } - - public void setAssistantEndPoint(String assistantEndPoint) { - this.assistantEndPoint = assistantEndPoint; - } - - public String getAssistantJson() { - return assistantJson; - } - - public void setAssistantJson(String assistantJson) { - this.assistantJson = assistantJson; - } - - public void addTool(String toolId) { - if (StringUtils.isBlank(toolId)) { - return; - } - - AiTool tool = getAvailableTools().stream() - .filter(t -> t.getId().contentEquals(toolId)).findFirst().get(); - this.assistant.addTool(tool); - getAvailableTools().remove(tool); - } - - public void removeTool(String toolId) { - if (StringUtils.isBlank(toolId)) { - return; - } - AiTool tool = this.assistant.getToolkit().stream() - .filter(t -> t.getId().contentEquals(toolId)).findFirst().get(); - this.assistant.removeTool(tool); - getAvailableTools().add(tool); - } - - public abstract void save(); - - public List getAvailableTools() { - return availableTools; - } - - public void setAvailableTools(List availableTools) { - this.availableTools = availableTools; - } - - public abstract void onCancel(); -} diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantManagementBean.java b/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantManagementBean.java deleted file mode 100644 index 3b76b0b9cc0..00000000000 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/bean/ai/AssistantManagementBean.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.axonivy.portal.bean.ai; - -import java.util.ArrayList; -import java.util.List; - -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ViewScoped; - -import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter; -import com.axonivy.portal.enums.ai.ToolType; - -import ch.ivy.addon.portalkit.dto.ai.AiTool; -import ch.ivy.addon.portalkit.dto.ai.Assistant; -import ch.ivy.addon.portalkit.dto.ai.IvyTool; -import ch.ivyteam.ivy.environment.Ivy; - -@ManagedBean -@ViewScoped -public class AssistantManagementBean { - - private ToolType[] toolTypes = ToolType.values(); - - private List assistants; - private List ivyTools; - - private Assistant selectedAssistant; - private AiTool selectedTool; - private boolean isAddNewTool; - - public void init() { - setAssistants(BusinessEntityConverter.jsonValueToEntities(Ivy.var().get("Assistants"), Assistant.class)); - setIvyTools(BusinessEntityConverter.jsonValueToEntities(Ivy.var().get("IvyTools"), IvyTool.class)); - this.isAddNewTool = false; - } - - public List getAssistants() { - return assistants; - } - - public void setAssistants(List assistants) { - this.assistants = assistants; - } - - public Assistant getSelectedAssistant() { - return selectedAssistant; - } - - public void setSelectedAssistant(Assistant selectedAssistant) { - this.selectedAssistant = selectedAssistant; - } - - public AiTool getSelectedTool() { - return selectedTool; - } - - public void setSelectedTool(AiTool selectedTool) { - this.selectedTool = selectedTool; - } - - public boolean isAddNewTool() { - return isAddNewTool; - } - - public void addTool() { - this.isAddNewTool = true; - } - - public void finishAddTool() { - this.isAddNewTool = false; - } - - public ToolType[] getToolTypes() { - return toolTypes; - } - - public void setToolTypes(ToolType[] toolTypes) { - this.toolTypes = toolTypes; - } - - public void onAddNewAssistant() { - this.selectedAssistant = new Assistant(); - this.selectedAssistant.setToolkit(new ArrayList<>()); - } - - public List getIvyTools() { - return ivyTools; - } - - public void setIvyTools(List ivyTools) { - this.ivyTools = ivyTools; - } -} diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/StepType.java b/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/StepType.java deleted file mode 100644 index 05aee4b310f..00000000000 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/StepType.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.axonivy.portal.enums.ai; - -public enum StepType { - USE_TOOL, CUSTOM; -} diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/ToolType.java b/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/ToolType.java deleted file mode 100644 index c958dd2b807..00000000000 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/enums/ai/ToolType.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.axonivy.portal.enums.ai; - -public enum ToolType { - - IVY("Ivy", "success"), RETRIEVAL_QA("Q&A", "info"), - COMPOSITE("Composite", "warning"); - - private String label; - private String tagSeverity; - - ToolType(String label, String tagSeverity) { - this.label = label; - this.tagSeverity = tagSeverity; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getTagSeverity() { - return tagSeverity; - } - - public void setTagSeverity(String tagSeverity) { - this.tagSeverity = tagSeverity; - } -} diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/rest/AssistantRestService.java b/AxonIvyPortal/portal/src/com/axonivy/portal/rest/AssistantRestService.java deleted file mode 100644 index b4e0142ee89..00000000000 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/rest/AssistantRestService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.axonivy.portal.rest; - -import javax.annotation.security.RolesAllowed; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import com.axonivy.portal.components.persistence.converter.BusinessEntityConverter; -import com.axonivy.portal.payload.IvyToolPayload; - -import ch.ivy.addon.portalkit.dto.ai.IvyTool; -import ch.ivyteam.ivy.security.ISecurityConstants; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; - -@Path(value = "assistant") -@RolesAllowed(value = { ISecurityConstants.TOP_LEVEL_ROLE_NAME }) -public class AssistantRestService { - - @POST - @Path(value = "/ivyTool") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", content = { @Content(mediaType = MediaType.APPLICATION_JSON) }) }) - public Response proceedIvyTool(IvyToolPayload payload) { - IvyTool tool = BusinessEntityConverter.jsonValueToEntity(payload.getToolJson(), IvyTool.class); - return Response.ok(tool.getResult()).build(); - } -} diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml index 664316625ad..44511fbea8e 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/CaseWidget.xhtml @@ -55,7 +55,7 @@ rowStyleClass="dashboard-table--row-style" emptyMessage="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/noRecordsFound')}" disabledSelection="#{isPreviewMode}"> - + - +
-
diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/NameCell.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/NameCell.xhtml index fd6607f118d..9edacc096ab 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/NameCell.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/CaseWidget/NameCell.xhtml @@ -10,6 +10,6 @@ - + \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessCaseWidget/ProcessCaseWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessCaseWidget/ProcessCaseWidget.xhtml index 55ebb741956..11d904c2428 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessCaseWidget/ProcessCaseWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessCaseWidget/ProcessCaseWidget.xhtml @@ -31,7 +31,7 @@ sortBy="#{widget.sortByName}" rowIndexVar="rowIndex" rowHover="#{isReadOnlyMode}" selectionMode="single" styleClass="dashboard-cases--table #{isReadOnlyMode ? '' : 'dashboard__table--edit'} #{isPreviewMode ? 'dashboard__table--preview' : ''}"> - + diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessTaskWidget/ProcessTaskWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessTaskWidget/ProcessTaskWidget.xhtml index ea6da8955d0..c2336e5e469 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessTaskWidget/ProcessTaskWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/ProcessTaskWidget/ProcessTaskWidget.xhtml @@ -32,7 +32,7 @@ pageLinks="5" sortBy="#{widget.sortByName}" rowIndexVar="rowIndex" rowHover="#{isReadOnlyMode}" selectionMode="single" styleClass="dashboard-tasks--table #{isReadOnlyMode ? '' : 'dashboard__table--edit'} #{isPreviewMode ? 'dashboard__table--preview' : ''}"> - + @@ -57,7 +57,7 @@
+ onstart="event.stopPropagation();" styleClass="task-action-item start-task-action" actionListener="#{dashboardTaskWidgetBean.handleStartTask(task)}"> diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/NameCell.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/NameCell.xhtml index 948f2fbb059..fff1bd4d23e 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/NameCell.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/NameCell.xhtml @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/StartCell.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/StartCell.xhtml index 2937fd09805..cf8642aed02 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/StartCell.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/StartCell.xhtml @@ -3,7 +3,7 @@ xmlns:ic="http://ivyteam.ch/jsf/component" xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions" xmlns:jsf="http://xmlns.jcp.org/jsf"> - diff --git a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml index 45cc166cd3a..5f6b2800401 100644 --- a/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml +++ b/AxonIvyPortal/portal/src_hd/ch/ivy/addon/portal/generic/dashboard/component/TaskWidget/TaskWidget.xhtml @@ -55,7 +55,7 @@ styleClass="dashboard-tasks--table #{isReadOnlyMode ? '' : 'dashboard__table--edit'} #{isPreviewMode ? 'dashboard__table--preview' : ''} #{!isPreviewMode and taskWidget.taskCount lt 1 ? 'u-display-none' : ''}" rowStyleClass="dashboard-table--row-style" emptyMessage="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/noRecordsFound')}"> - + - + @@ -129,9 +129,9 @@ - +
-
@@ -150,7 +150,7 @@ - diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.rddescriptor b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.rddescriptor deleted file mode 100644 index ae605f0d9ad..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.rddescriptor +++ /dev/null @@ -1,7 +0,0 @@ - - - - viewTechnology - JSF - - diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.xhtml deleted file mode 100644 index 66c76062be7..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagement.xhtml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Assistant Management - - - - - - - - - - - - - - \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementData.ivyClass b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementData.ivyClass deleted file mode 100644 index ce00be2efd7..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementData.ivyClass +++ /dev/null @@ -1,2 +0,0 @@ -AssistantManagementData #class -com.axonivy.portal.component.AssistantManagement #namespace diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementProcess.p.json b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementProcess.p.json deleted file mode 100644 index 11f4418a027..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantManagementProcess.p.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", - "id" : "18DCB2410701CFF6", - "kind" : "HTML_DIALOG", - "config" : { - "data" : "com.axonivy.portal.component.AssistantManagement.AssistantManagementData" - }, - "elements" : [ { - "id" : "f0", - "type" : "HtmlDialogStart", - "name" : "start()", - "config" : { - "signature" : "start", - "guid" : "18DCB2410736AFA4" - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 } - }, - "connect" : [ - { "id" : "f2", "to" : "f1" } - ] - }, { - "id" : "f1", - "type" : "HtmlDialogEnd", - "visual" : { - "at" : { "x" : 224, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "HtmlDialogEventStart", - "name" : "close", - "config" : { - "guid" : "18DCB2410783F2BC" - }, - "visual" : { - "at" : { "x" : 96, "y" : 160 } - }, - "connect" : [ - { "id" : "f5", "to" : "f4" } - ] - }, { - "id" : "f4", - "type" : "HtmlDialogExit", - "visual" : { - "at" : { "x" : 224, "y" : 160 } - } - } ] -} \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantTab.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantTab.xhtml deleted file mode 100644 index aca342744ad..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/AssistantTab.xhtml +++ /dev/null @@ -1,27 +0,0 @@ - - -
- - - - - - - - -
    - - - -
-
-
-
-
-
- \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/ToolTab.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/ToolTab.xhtml deleted file mode 100644 index 3462b6eb861..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/AssistantManagement/ToolTab.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - -
- - - - - - -
-
- \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.rddescriptor b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.rddescriptor deleted file mode 100644 index ae605f0d9ad..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.rddescriptor +++ /dev/null @@ -1,7 +0,0 @@ - - - - viewTechnology - JSF - - diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.xhtml deleted file mode 100644 index 7731324607e..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboard.xhtml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - -
- - - - - - -
- - - - - - -
-
- - -
-

#{ivy.cms.co('/Dialogs/com/axonivy/portal/component/ChatDashboard/WelcomeHeaderText')}

-

#{ivy.cms.co('/Dialogs/com/axonivy/portal/component/ChatDashboard/WelcomeText')}

-
- -
- -
-
-
- #{question.headerText} -
-
-

#{question.question}

-
-
-
-
-
-
-
-
- - diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardData.ivyClass b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardData.ivyClass deleted file mode 100644 index 5844577d66f..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardData.ivyClass +++ /dev/null @@ -1,2 +0,0 @@ -ChatDashboardData #class -com.axonivy.portal.component.ChatDashboard #namespace diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardProcess.p.json b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardProcess.p.json deleted file mode 100644 index 9cffd8bb779..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ChatDashboard/ChatDashboardProcess.p.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", - "id" : "18CE74C696F6F830", - "kind" : "HTML_DIALOG", - "config" : { - "data" : "com.axonivy.portal.component.ChatDashboard.ChatDashboardData" - }, - "elements" : [ { - "id" : "f0", - "type" : "HtmlDialogStart", - "name" : "start()", - "config" : { - "signature" : "start", - "guid" : "18CE74C69708A7D2" - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 } - }, - "connect" : [ - { "id" : "f2", "to" : "f1" } - ] - }, { - "id" : "f1", - "type" : "HtmlDialogEnd", - "visual" : { - "at" : { "x" : 224, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "HtmlDialogEventStart", - "name" : "close", - "config" : { - "guid" : "18CE74C6971D6A38" - }, - "visual" : { - "at" : { "x" : 96, "y" : 160 } - }, - "connect" : [ - { "id" : "f5", "to" : "f4" } - ] - }, { - "id" : "f4", - "type" : "HtmlDialogExit", - "visual" : { - "at" : { "x" : 224, "y" : 160 } - } - } ] -} \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.rddescriptor b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.rddescriptor deleted file mode 100644 index ae605f0d9ad..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.rddescriptor +++ /dev/null @@ -1,7 +0,0 @@ - - - - viewTechnology - JSF - - diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.xhtml b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.xhtml deleted file mode 100644 index 304e921bdd3..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolList.xhtml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - #{ivy.cms.co('/Dialogs/com/axonivy/portal/component/ToolList/NoAvailableTools')} - - - - -
-
-
- - - -
- -
- - -
-
-
- -
- - - -
- - - -
- - - - - - - - - -
    - -
  • - - - -
  • -
    -
- -
-
-
-
-
-
- \ No newline at end of file diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListData.ivyClass b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListData.ivyClass deleted file mode 100644 index 7302c690ee9..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListData.ivyClass +++ /dev/null @@ -1,2 +0,0 @@ -ToolListData #class -com.axonivy.portal.component.ToolList #namespace diff --git a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListProcess.p.json b/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListProcess.p.json deleted file mode 100644 index fccadea22e0..00000000000 --- a/AxonIvyPortal/portal/src_hd/com/axonivy/portal/component/ToolList/ToolListProcess.p.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json", - "id" : "18E38E3B04F37BF5", - "kind" : "HTML_DIALOG", - "config" : { - "data" : "com.axonivy.portal.component.ToolList.ToolListData" - }, - "elements" : [ { - "id" : "f0", - "type" : "HtmlDialogStart", - "name" : "start()", - "config" : { - "signature" : "start", - "guid" : "18E38E3B054BD378" - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 } - }, - "connect" : [ - { "id" : "f2", "to" : "f1" } - ] - }, { - "id" : "f1", - "type" : "HtmlDialogEnd", - "visual" : { - "at" : { "x" : 224, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "HtmlDialogEventStart", - "name" : "close", - "config" : { - "guid" : "18E38E3B056852A0" - }, - "visual" : { - "at" : { "x" : 96, "y" : 160 } - }, - "connect" : [ - { "id" : "f5", "to" : "f4" } - ] - }, { - "id" : "f4", - "type" : "HtmlDialogExit", - "visual" : { - "at" : { "x" : 224, "y" : 160 } - } - } ] -} \ No newline at end of file diff --git a/AxonIvyPortal/portal/webContent/layouts/includes/ChatDashboardTemplate.xhtml b/AxonIvyPortal/portal/webContent/layouts/includes/ChatDashboardTemplate.xhtml deleted file mode 100644 index a3afd31ae17..00000000000 --- a/AxonIvyPortal/portal/webContent/layouts/includes/ChatDashboardTemplate.xhtml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - Portal Chat - - - - - - - - - - - - - - -
- - - -
-
-
-
-
- -
-
- - -
- -
- - -
-
-
-
- - - - - - - -
-
- -
-