Skip to content

Commit

Permalink
feature/IVYPORTAL-17431-Remove-Express-from-Portal - Remove express f…
Browse files Browse the repository at this point in the history
…rom portal component
  • Loading branch information
ntloc-axonivy committed Sep 19, 2024
1 parent d294b41 commit 163bd26
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion AxonIvyPortal/portal-components/cms/cms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Dialogs:
ProcessIsHidden: The current process is hidden!
ProcessType:
CASE_MAP: Case Map
EXPRESS_PROCESS: Express Workflow
EXTERNAL_LINK: External Link
IVY_PROCESS: Business Process
Labels:
Expand Down
1 change: 0 additions & 1 deletion AxonIvyPortal/portal-components/cms/cms_de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Dialogs:
ProcessNotFound: Der definierte Process kann nicht gefunden werden.
ProcessType:
CASE_MAP: Fall Karte
EXPRESS_PROCESS: Express Workflow
EXTERNAL_LINK: External Link
IVY_PROCESS: Geschäftsprozess
ProcessViewerIFrameTitle: Prozessbetrachterrahmen
Expand Down
1 change: 0 additions & 1 deletion AxonIvyPortal/portal-components/cms/cms_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Dialogs:
ProcessNotFound: The defined process cannot be found.
ProcessType:
CASE_MAP: Case Map
EXPRESS_PROCESS: Express Workflow
EXTERNAL_LINK: External Link
IVY_PROCESS: Business Process
ProcessViewerIFrameTitle: Process viewer frame
Expand Down
1 change: 0 additions & 1 deletion AxonIvyPortal/portal-components/cms/cms_es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Dialogs:
ProcessNotFound: No se encuentra el proceso definido.
ProcessType:
CASE_MAP: Mapa del caso
EXPRESS_PROCESS: Flujo de trabajo exprés
EXTERNAL_LINK: Link externo
IVY_PROCESS: Proceso de negocio
ProcessViewerIFrameTitle: Marco del visor de procesos
Expand Down
1 change: 0 additions & 1 deletion AxonIvyPortal/portal-components/cms/cms_fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Dialogs:
ProcessNotFound: Le processus défini est introuvable.
ProcessType:
CASE_MAP: Carte de cas
EXPRESS_PROCESS: Flux de travail express
EXTERNAL_LINK: Lien externe
IVY_PROCESS: Processus d'entreprise
ProcessViewerIFrameTitle: Cadre de visualisation du processus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.axonivy.portal.components.constant;

public class CustomFields {
public static final String IS_EXPRESS_PROCESS = "isExpress";
public static final String IS_DASHBOARD_PROCESS = "isDashboardProcess";
public static final String BUSINESS_DETAILS = "businessDetails";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public enum PortalVariable {
STATISTIC_CHART("Portal.StatisticCharts"),
WIDGET_FILTER("Portal.Dashboard.WidgetFilters"),
EXTERNAL_LINK("Portal.Processes.ExternalLinks"),
EXPRESS_PROCESS("Portal.Processes.ExpressProcesses"),
TASK_DETAIL("Portal.TaskDetails"),
CASE_DETAIL("Portal.CaseDetails"),
DASHBOARD("Portal.Dashboard"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import ch.ivyteam.ivy.environment.Ivy;

public enum ProcessType {
EXPRESS_PROCESS("ExpressProcess"),
EXTERNAL_LINK("ExternalLink"),
CASE_MAP("casemap"),
IVY_PROCESS("process-start");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

public class CaseDocumentService {

public static final String EXPRESS_UPLOAD_FOLDER = "AxonIvyExpress";
private ICase iCase;

private CaseDocumentService(ICase iCase) {
Expand All @@ -51,15 +50,7 @@ public IDocument upload(String filename, InputStream content) {
}

public List<IDocument> getAll() {
List<IDocument> documents = new ArrayList<>(getAllDocumentsOf(iCase));
List<IDocument> expressDocs = new ArrayList<>();
for (IDocument doc : documents) {
if (doc.getPath().asString().contains(EXPRESS_UPLOAD_FOLDER)) {
expressDocs.add(doc);
}
}
documents.removeAll(expressDocs);
return new ArrayList<>(documents);
return new ArrayList<>(getAllDocumentsOf(iCase));
}

/**
Expand All @@ -74,7 +65,7 @@ public StreamedContent download(IvyDocument document) {

public boolean doesDocumentExist(String filename) {
IDocument document = documentsOf(iCase).get(new Path(filename));
return document != null && !document.getPath().asString().contains(EXPRESS_UPLOAD_FOLDER);
return document != null;
}

public static boolean isDocumentTypeValid(String filename, String allowedFileTypes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import java.util.function.Predicate;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;

import com.axonivy.portal.components.constant.CustomFields;
import com.axonivy.portal.components.dto.ProcessViewerDTO;
import com.axonivy.portal.components.service.impl.ProcessService;

Expand Down Expand Up @@ -132,11 +130,6 @@ private static List<IWebStartable> getWebStartables() {
return Optional.ofNullable(webStartables).orElse(new ArrayList<>());
}

public static boolean isExpressCase(ICase iCase) {
return iCase != null
&& BooleanUtils.toBoolean(iCase.customFields().stringField(CustomFields.IS_EXPRESS_PROCESS).getOrNull());
}

public static ICaseMap findCaseMapByCase(ICase caze) {
if (Objects.isNull(caze)) {
return null;
Expand All @@ -149,7 +142,7 @@ public static boolean hasCaseMap(IBusinessCase businessCase) {
}

public static boolean isViewerAllowed(ICase caze) {
if (caze == null || isExpressCase(caze) || !caze.isBusinessCase()) {
if (caze == null || !caze.isBusinessCase()) {
return false;
} else if (hasCaseMap(caze.getBusinessCase())) {
return true;
Expand Down

0 comments on commit 163bd26

Please sign in to comment.