Skip to content

Commit

Permalink
Merge pull request #1166 from axonivy-market/feature/IVYPORTAL-17912-…
Browse files Browse the repository at this point in the history
…Fix-invalid-function-startTaskFromNoti-in-NotificationFullPage-LE

IVYPORTAL-17912 Fix invalid function startTaskFromNoti in Notification Full Page
  • Loading branch information
chnam-axonivy authored Oct 29, 2024
2 parents d510e2d + c9348cc commit 32b73c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,31 @@ private boolean isWebChannelEnableByUser() {
return false;
}

public void startTask(NotificationDto dto) {
markAsRead(dto);
PortalNavigator.redirect(dto.getRunAction().getLink().getRelative());
}

public void startTaskFromNotification(NotificationDto dto, boolean isWorkingTask, ITask task) {
if (isWorkingTask && task.getState() != TaskState.DONE) {
PrimeFaces.current().executeScript(String.format("checkWarningLogForTaskStart('%s', '%s')", dto.getId(), task.getId()));
return;
}
markAsRead(dto);
PortalNavigator.redirect(dto.getRunAction().getLink().getRelative());
startTask(dto);
}

public void startTaskFromNotiId() {
String notificationId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("notificationId");
NotificationDto dto = dataModel.findById(notificationId);
markAsRead(dto);
PortalNavigator.redirect(dto.getRunAction().getLink().getRelative());
startTask(dto);
}

public void goToNotificationDetail(NotificationDto dto, boolean isWorkingTask, ITask task) {
if (isWorkingTask && task.getState() != TaskState.DONE) {
PrimeFaces.current().executeScript(String.format("checkWarningLogForTaskDetail('%s', '%s')", dto.getId(), task.getId()));
return;
}
markAsRead(dto);
PortalNavigator.redirect(dto.getInfoAction().getLink().getRelative());
goToTaskDetail(dto);
}

public void goToTaskDetail(NotificationDto dto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</div>
<div class="flex notification-action-block">
<p:commandLink id="notification-start-task" styleClass="notification-start-task"
actionListener="#{notificationBean.startTaskFromNoti(notification)}" rendered="#{notification.runAction != null}">
actionListener="#{notificationBean.startTask(notification)}" rendered="#{notification.runAction != null}">
<i class="fa fa-play notification-start-task-icon" />
</p:commandLink>
<p:tooltip for="notification-start-task" value="#{notification.runAction.title}" />
Expand Down

0 comments on commit 32b73c2

Please sign in to comment.