Skip to content

Commit

Permalink
IVYPORTAL-17428 Check and remove deprecated features from portal - Co…
Browse files Browse the repository at this point in the history
…de + Docs

Removed warning releated to applicationHomeRef(), data class attribute start with Capital,
  • Loading branch information
lttung-axonivy committed Aug 29, 2024
1 parent a6037b7 commit a712a50
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public static void navigateToUrl(String url) {
PrimeFaces.current().executeScript(statement);
}

/**
* Navigate to portal home
*/
public static void navigateToPortalHome() {
navigateToUrl(Ivy.html().applicationHomeRef());
}
/**
* Navigate to portal home
*/
public static void navigateToPortalHome() {
navigateToUrl(Ivy.html().applicationHomeLink().getAbsoluteEncoded());
}

/**
* Navigate to PortalEndPage without finishing a task, e.g. clicking on Cancel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@
"call" : {
"map" : {
"param.isTaskFinished" : "in.isTaskFinished",
"param.iCase" : "in.caseSelected"
"param.caze" : "in.caseSelected"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public static <T> T jsonValueToEntity(String jsonValue, Class<T> classType) {
}

public static <T> T inputStreamToEntity(InputStream inputStream, Class<T> classType) {
try {
new InputStreamReader(inputStream, StandardCharsets.UTF_8);
try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
return getObjectMapper().readValue(inputStream, classType);
} catch (IOException e) {
throw new PortalException(e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package ch.ivy.addon.portalkit.service;
import java.util.List;

import ch.ivy.addon.portalkit.dto.dashboard.Dashboard;
import ch.ivy.addon.portalkit.enums.PortalVariable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UrlUtils {
public static String getServerUrl() {
URL url;
try {
url = new URL(Ivy.html().applicationHomeRef());
url = Ivy.html().applicationHomeLink().toAbsoluteUri().toURL();
} catch (MalformedURLException e) {
throw new PortalException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import ch.ivy.addon.portalkit.configuration.AbstractConfiguration;
import ch.ivy.addon.portalkit.dto.DisplayName;
import ch.ivy.addon.portalkit.service.DateTimeGlobalSettingService;
import ch.ivyteam.ivy.environment.Ivy;

public class ClientStatistic extends AbstractConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
</f:facet>

<p:outputLabel for="mitarbeiter" value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/employee')}" />
<p:inputText id="mitarbeiter" value="#{data.Mitarbeiter}"></p:inputText>
<p:inputText id="mitarbeiter" value="#{data.mitarbeiter}"></p:inputText>

<p:outputLabel for="von" value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/from')}" />
<p:datePicker id="von" value="#{data.Von}" locale="#{localeBean.locale}"
<p:datePicker id="von" value="#{data.von}" locale="#{localeBean.locale}"
showTime="#{!dateTimePatternBean.isTimeHidden}" size="10" />

<p:outputLabel for="bis" value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/to')}" />
<p:datePicker id="bis" value="#{data.Bis}" locale="#{localeBean.locale}"
<p:datePicker id="bis" value="#{data.bis}" locale="#{localeBean.locale}"
showTime="#{!dateTimePatternBean.isTimeHidden}" size="10" />

<p:outputLabel for="genehmigt" value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/approved')}" />
<p:selectBooleanCheckbox id="genehmigt" value="#{data.genehmigt}" />

<p:outputLabel for="ablehnungsgrund"
value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/rejectionReason')}" />
<p:inputText id="ablehnungsgrund" value="#{data.Ablehnungsgrund}"></p:inputText>
<p:inputText id="ablehnungsgrund" value="#{data.ablehnungsgrund}"></p:inputText>

<p:outputLabel for="vertretung"
value="#{ivy.cms.co('/ProcessPages/ProcessLeaves/ProcessLeave/representation')}" />
<p:inputText id="vertretung" value="#{data.Vertretung}"></p:inputText>
<p:inputText id="vertretung" value="#{data.vertretung}"></p:inputText>

<br />
</h:panelGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"namespace" : "internaltest.ui.approveLeave",
"isBusinessCaseData" : false,
"fields" : [ {
"name" : "Mitarbeiter",
"name" : "mitarbeiter",
"type" : "String"
}, {
"name" : "Von",
"name" : "von",
"type" : "java.util.Date"
}, {
"name" : "Bis",
"name" : "bis",
"type" : "java.util.Date"
}, {
"name" : "beantragt",
Expand All @@ -19,10 +19,10 @@
"name" : "genehmigt",
"type" : "Boolean"
}, {
"name" : "Ablehnungsgrund",
"name" : "ablehnungsgrund",
"type" : "String"
}, {
"name" : "Vertretung",
"name" : "vertretung",
"type" : "String"
}, {
"name" : "actualStepIndex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,34 @@
"signature" : "start",
"input" : {
"params" : [
{ "name" : "Mitarbeiter", "type" : "String", "desc" : "" },
{ "name" : "Von", "type" : "Date", "desc" : "" },
{ "name" : "Bis", "type" : "Date", "desc" : "" },
{ "name" : "mitarbeiter", "type" : "String", "desc" : "" },
{ "name" : "von", "type" : "Date", "desc" : "" },
{ "name" : "bis", "type" : "Date", "desc" : "" },
{ "name" : "beantragt", "type" : "Boolean", "desc" : "" },
{ "name" : "Vertretung", "type" : "String", "desc" : "" },
{ "name" : "vertretung", "type" : "String", "desc" : "" },
{ "name" : "processStatus", "type" : "internalPortal.ProcessStatus", "desc" : "" }
],
"map" : {
"out.actualStepIndex" : "param.processStatus.actualStepIndex",
"out.beantragt" : "param.beantragt",
"out.Bis" : "param.Bis",
"out.Mitarbeiter" : "param.Mitarbeiter",
"out.bis" : "param.bis",
"out.mitarbeiter" : "param.mitarbeiter",
"out.steps" : "param.processStatus.steps",
"out.Vertretung" : "param.Vertretung",
"out.Von" : "param.Von"
"out.vertretung" : "param.vertretung",
"out.von" : "param.von"
}
},
"result" : {
"params" : [
{ "name" : "Mitarbeiter", "type" : "String", "desc" : "" },
{ "name" : "mitarbeiter", "type" : "String", "desc" : "" },
{ "name" : "genehmigt", "type" : "Boolean", "desc" : "" },
{ "name" : "Ablehnungsgrund", "type" : "String", "desc" : "" },
{ "name" : "ablehnungsgrund", "type" : "String", "desc" : "" },
{ "name" : "processStatus", "type" : "internalPortal.ProcessStatus", "desc" : "" }
],
"map" : {
"result.Mitarbeiter" : "in.Mitarbeiter",
"result.mitarbeiter" : "in.mitarbeiter",
"result.genehmigt" : "in.genehmigt",
"result.Ablehnungsgrund" : "in.Ablehnungsgrund",
"result.ablehnungsgrund" : "in.ablehnungsgrund",
"result.processStatus.actualStepIndex" : "in.actualStepIndex",
"result.processStatus.steps" : "in.steps"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"name" : "Set logout page",
"config" : {
"output" : {
"code" : "in.logoutPage = ivy.html.applicationHomeRef();"
"code" : "in.logoutPage = ivy.html.applicationHomeLink().getAbsoluteEncoded();"
}
},
"visual" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UrlUtils {
public static String getServerUrl() {
URL url;
try {
url = new URL(Ivy.html().applicationHomeRef());
url = Ivy.html().applicationHomeLink().toAbsoluteUri().toURL();
} catch (MalformedURLException e) {
throw new PortalException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"code" : [
"import com.axonivy.portal.components.publicapi.PortalNavigatorInFrameAPI;",
"ivy.task.reset();",
"PortalNavigatorInFrameAPI.navigateToUrl(ivy.html.applicationHomeRef());"
"PortalNavigatorInFrameAPI.navigateToUrl(ivy.html.applicationHomeLink().getAbsoluteEncoded());"
]
},
"sudo" : true
Expand Down

0 comments on commit a712a50

Please sign in to comment.