Skip to content

Commit

Permalink
Merge pull request #73 from mendix/ufc/1017-schemaless-url
Browse files Browse the repository at this point in the history
Add schemaless application root URL support
  • Loading branch information
EnasAbdelrazek authored Jan 25, 2024
2 parents f02c243 + bbc4d88 commit dce9f57
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 23,354 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
src/DeepLinkModule/.classpath
src/DeepLinkModule/.project
src/DeepLinkModule/.settings
src/DeepLinkModule/[App Store] Deeplink.mpr.lock
src/DeepLinkModule/DeepLinkModule.launch
src/DeepLinkModule/deployment/
src/DeepLinkModule/javasource/administration/
src/DeepLinkModule/javasource/com/mendix/core/Core.java
src/DeepLinkModule/javasource/deeplink/proxies/
src/DeepLinkModule/javasource/system/
src/DeepLinkModule/javasource/test/proxies/
src/DeepLinkModule/[App Store] Deeplink.mpr.lock
src/DeepLinkModule/.settings
src/DeepLinkModule/project-settings.user.json
src/DeepLinkModule/theme-cache/web/theme.compiled.css
src/DeepLinkModule/theme-cache/web/theme.compiled.css.map
*.lock
.DS_Store
bin
Expand Down
Binary file modified src/DeepLinkModule/[App Store] Deeplink.mpr
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import "mx-global";
import { Big } from "big.js";

// BEGIN EXTRA CODE
Expand All @@ -16,6 +17,10 @@ import { Big } from "big.js";
*/
export async function Open_DeeplinkURL(deeplinkURL) {
// BEGIN USER CODE
window.open(deeplinkURL.get('URL'),'_blank');
const url = deeplinkURL.get('URL');

if(url.includes("://")) return window.open(url,'_blank');

window.open(window.location.protocol + "//" + url, '_blank')
// END USER CODE
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ private static String ensureNoStartingSlash(String s) {
private static String getRootUrl(IMxRuntimeRequest request)
{
String url = request.getRootUrl();
String path = ensureStartingSlash(java.net.URI.create(url).getPath());
//When the root URL does not contain a schema, add it anyways
String completeUrl = url.contains("://") ? url : "https://" + url;
String path = ensureStartingSlash(java.net.URI.create(completeUrl).getPath());
if(path.endsWith("/"))
return path.substring(0, path.length() - 1);
return path;
Expand Down
18 changes: 0 additions & 18 deletions src/DeepLinkModule/project-settings.user.json

This file was deleted.

Loading

0 comments on commit dce9f57

Please sign in to comment.