Skip to content

Commit

Permalink
Merge pull request #1431 from axonivy-market/bug/IVYPORTAL-18309-Erro…
Browse files Browse the repository at this point in the history
…r-when-try-to-run-a-restricted-process-from-the-Process-Overview-page-10

IVYPORTAL-18309 Error when try to run a restricted process from the Process Overview page
  • Loading branch information
mnhnam-axonivy authored Jan 15, 2025
2 parents b30c85a + 3a01f98 commit e902ed3
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 1 deletion.
3 changes: 3 additions & 0 deletions AxonIvyPortal/portal/cms/cms_de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,9 @@ Dialogs:
expressNoItemDescription: Hier werden die Ergebnisse der abgeschlossenen Aufgaben angezeigt
expressWorkflowName: 'Business Details des Vorgangs: #{0}'
portal:
component:
ProcessInformation:
ProcessUnavailableTooltip: Dieser Prozess ist nicht verfügbar oder du hast keine Berechtigung, ihn zu starten.
generic:
dashboard:
component:
Expand Down
3 changes: 3 additions & 0 deletions AxonIvyPortal/portal/cms/cms_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,9 @@ Dialogs:
expressNoItemDescription: The results of completed tasks are displayed here
expressWorkflowName: 'Business Details of Case #{0}'
portal:
component:
ProcessInformation:
ProcessUnavailableTooltip: This process is unavailable or you don't have the permission to start it.
generic:
dashboard:
component:
Expand Down
3 changes: 3 additions & 0 deletions AxonIvyPortal/portal/cms/cms_es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,9 @@ Dialogs:
expressNoItemDescription: Aquí se mostrarán los resultados de las tareas completadas
expressWorkflowName: 'Detalles de negocio del caso #{0}'
portal:
component:
ProcessInformation:
ProcessUnavailableTooltip: Este proceso no está disponible o no tienes permiso para iniciarlo.
generic:
dashboard:
component:
Expand Down
3 changes: 3 additions & 0 deletions AxonIvyPortal/portal/cms/cms_fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,9 @@ Dialogs:
expressNoItemDescription: Les résultats des tâches terminées sont affichés ici
expressWorkflowName: 'Détails de cas #{0}'
portal:
component:
ProcessInformation:
ProcessUnavailableTooltip: Ce processus est indisponible ou vous n'avez pas la permission de le démarrer.
generic:
dashboard:
component:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ public void startProcess(UserProcess userProcess) throws IOException {
FacesContext.getCurrentInstance().getExternalContext().redirect(link + "embedInFrame");
}

public boolean canStartProcess(UserProcess userProcess) {
return StringUtils.isNotBlank(
Optional.ofNullable(userProcess).map(UserProcess::getLink).orElse(""));
}

private boolean isUserProcess(UserProcess processToAdd) {
return userProcesses.stream().anyMatch(userProcess -> !isExternalLink(processToAdd)
&& StringUtils.equalsIgnoreCase(userProcess.getLink(), processToAdd.getLink()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@
</ui:define>

<ui:define name="actionButtons">
<div class="flex flex-row justify-content-end align-items-center">
<p:link id="back-link" value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/back')}" onclick="goBack();" href="#"/>
<p:spacer width="20px" />
<p:commandButton value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/start')} #{data.selectedProcess.processName}"
<h:panelGroup id="start-process-button-container" layout="block">
<p:commandButton value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/start')} #{data.selectedProcess.processName}"
id="start-process-button"
disabled="#{!compactProcessWidgetBean.canStartProcess(data.selectedProcess)}"
actionListener="#{compactProcessWidgetBean.startProcess(data.selectedProcess)}" />
</h:panelGroup>
<p:tooltip for="start-process-button-container" value="#{ivy.cms.co('/Dialogs/ch/ivy/addon/portal/component/ProcessInformation/ProcessUnavailableTooltip')}"
rendered="#{!compactProcessWidgetBean.canStartProcess(data.selectedProcess)}" trackMouse="true" />
</div>

<script>
function goBack() {
window.history.back();
Expand Down
17 changes: 17 additions & 0 deletions AxonIvyPortal/portal/webContent/resources/css/utility.css
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,20 @@
.w-min {
width: min-content !important;
}

/* From Primeflex 3 */
.flex {
display: flex !important
}

.flex-row {
flex-direction: row !important
}

.justify-content-end {
justify-content: flex-end !important
}

.align-items-center {
align-items: center !important
}

0 comments on commit e902ed3

Please sign in to comment.