Skip to content

Commit

Permalink
[ACA-4715] reduce env variables and provide defaults (#3311)
Browse files Browse the repository at this point in the history
* use default "sessionTimeForOpenAppDialogDisplay"

* improve iPhone prefix url api

* improve android prefix url api

* session timeout

* app store url defaults

* enable mobile redirect by default

* enable AOS by default

* enable content plugins by default

* enable folder rules by default

* remove obsolete AI flag

* remove obsolete APA flag

* auto download defaults

* cleanup auth vars
  • Loading branch information
DenysVuika authored Jul 5, 2023
1 parent 4aee82c commit 46ed7a8
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 156 deletions.
11 changes: 0 additions & 11 deletions .github/actions/run-e2e-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,9 @@ runs:
{
echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}"
echo "APP_CONFIG_PLUGIN_FOLDER_RULES=true"
echo "APP_CONFIG_PLUGIN_AOS=true"
echo "APP_CONFIG_PLUGIN_CONTENT_SERVICE=true"
echo "APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=false"
echo "APP_CONFIG_PROVIDER=ECM"
echo "APP_CONFIG_AUTH_TYPE=BASIC"
echo "APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco"
echo "APP_CONFIG_OAUTH2_CLIENTID=alfresco"
echo "APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS=12"
echo "APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true"
echo "APP_CONFIG_OAUTH2_SILENT_LOGIN=true"
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGOUT=/"
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGIN=/"
echo "APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI={protocol}//{hostname}{:port}/assets/silent-refresh.html"
} >> .env
npm start > /dev/null &\
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/run-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,9 @@ runs:
{
echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}"
echo "APP_CONFIG_PLUGIN_FOLDER_RULES=true"
echo "APP_CONFIG_PLUGIN_AOS=true"
echo "APP_CONFIG_PLUGIN_CONTENT_SERVICE=true"
echo "APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=false"
echo "APP_CONFIG_PROVIDER=ECM"
echo "APP_CONFIG_AUTH_TYPE=BASIC"
echo "APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco"
echo "APP_CONFIG_OAUTH2_CLIENTID=alfresco"
echo "APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS=12"
echo "APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true"
echo "APP_CONFIG_OAUTH2_SILENT_LOGIN=true"
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGOUT=/"
echo "APP_CONFIG_OAUTH2_REDIRECT_LOGIN=/"
echo "APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI={protocol}//{hostname}{:port}/assets/silent-refresh.html"
} >> .env
npm start > /dev/null &\
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@ env:
APP_CONFIG_AUTH_TYPE: BASIC
APP_CONFIG_OAUTH2_HOST: http://localhost:4200/auth/realms/alfresco
PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }}
APP_CONFIG_OAUTH2_CLIENTID: alfresco
APP_CONFIG_PLUGIN_AOS: true
APP_CONFIG_PLUGIN_CONTENT_SERVICE: true
APP_CONFIG_PLUGIN_FOLDER_RULES: true
APP_CONFIG_ENABLE_MOBILE_APP_SWITCH: true
APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS: "12"
APP_CONFIG_OAUTH2_IMPLICIT_FLOW: true
APP_CONFIG_OAUTH2_SILENT_LOGIN: true
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: /
APP_CONFIG_OAUTH2_REDIRECT_LOGIN: /
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: "{protocol}//{hostname}{:port}/assets/silent-refresh.html"
APP_CONFIG_ENABLE_DOWNLOAD_PROMPT: true
APP_CONFIG_ENABLE_DOWNLOAD_PROMPT_REMINDERS: true
APP_CONFIG_DOWNLOAD_PROMPT_DELAY: 50
APP_CONFIG_DOWNLOAD_PROMPT_REMINDER_DELAY: 30
APP_CONFIG_ENABLE_FILE_AUTO_DOWNLOAD: true
APP_CONFIG_FILE_AUTO_DOWNLOAD_SIZE_THRESHOLD_IN_MB: 15
GH_BUILD_NUMBER: ${{ github.run_id }}
MAXINSTANCES: 2
RETRY_COUNT: 2
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ env:
APP_CONFIG_AUTH_TYPE: BASIC
APP_CONFIG_OAUTH2_HOST: http://localhost:4200/auth/realms/alfresco
PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }}
APP_CONFIG_OAUTH2_CLIENTID: alfresco
APP_CONFIG_PLUGIN_AOS: true
APP_CONFIG_PLUGIN_CONTENT_SERVICE: true
APP_CONFIG_PLUGIN_FOLDER_RULES: true
APP_CONFIG_ENABLE_MOBILE_APP_SWITCH: true
APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS: "12"
APP_CONFIG_OAUTH2_IMPLICIT_FLOW: true
APP_CONFIG_OAUTH2_SILENT_LOGIN: true
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: /
APP_CONFIG_OAUTH2_REDIRECT_LOGIN: /
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: "{protocol}//{hostname}{:port}/assets/silent-refresh.html"
NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }}


Expand Down
18 changes: 0 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ ENV APP_CONFIG_OAUTH2_HOST="{protocol}//{hostname}{:port}/auth/realms/alfresco"
ENV APP_CONFIG_BPM_HOST="{protocol}//{hostname}{:port}"
ENV APP_CONFIG_ECM_HOST="{protocol}//{hostname}{:port}"

ENV APP_CONFIG_OAUTH2_CLIENTID="alfresco"
ENV APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true
ENV APP_CONFIG_OAUTH2_SILENT_LOGIN=true
ENV APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="{protocol}//{hostname}{:port}/assets/silent-refresh.html"
ENV APP_CONFIG_OAUTH2_REDIRECT_LOGIN="/"
ENV APP_CONFIG_OAUTH2_REDIRECT_LOGOUT="/"
ENV APP_CONFIG_PLUGIN_AOS=true
ENV APP_CONFIG_PLUGIN_FOLDER_RULES=true
ENV APP_CONFIG_PLUGIN_CONTENT_SERVICE=true
ENV APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=true
ENV APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS="12"
ENV APP_CONFIG_ENABLE_DOWNLOAD_PROMPT=true
ENV APP_CONFIG_ENABLE_DOWNLOAD_PROMPT_REMINDERS=true
ENV APP_CONFIG_DOWNLOAD_PROMPT_DELAY=50
ENV APP_CONFIG_DOWNLOAD_PROMPT_REMINDER_DELAY=30
ENV APP_CONFIG_ENABLE_FILE_AUTO_DOWNLOAD=true
ENV APP_CONFIG_FILE_AUTO_DOWNLOAD_SIZE_THRESHOLD_IN_MB=15

COPY docker/default.conf.template /etc/nginx/templates/

COPY dist/$PROJECT_NAME /usr/share/nginx/html/
Expand Down
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,9 @@ Create an `.env` file in the project root folder with the following content

```yml
APP_CONFIG_ECM_HOST="<URL>"
APP_CONFIG_PLUGIN_AOS=false
APP_CONFIG_PLUGIN_CONTENT_SERVICE=true
APP_CONFIG_PLUGIN_FOLDER_RULES=true
APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=false
APP_CONFIG_PROVIDER=ECM
APP_CONFIG_AUTH_TYPE=BASIC
APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco
APP_CONFIG_OAUTH2_CLIENTID=alfresco
APP_CONFIG_PLUGIN_AOS=true
APP_CONFIG_PLUGIN_CONTENT_SERVICE=true
APP_CONFIG_PLUGIN_FOLDER_RULES=true
APP_CONFIG_ENABLE_MOBILE_APP_SWITCH=true
APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS="12"
APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true
APP_CONFIG_OAUTH2_SILENT_LOGIN=true
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT=/
APP_CONFIG_OAUTH2_REDIRECT_LOGIN=/
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="{protocol}//{hostname}{:port}/assets/silent-refresh.html"

# Download Prompt configurations
APP_CONFIG_ENABLE_DOWNLOAD_PROMPT=true
APP_CONFIG_ENABLE_DOWNLOAD_PROMPT_REMINDERS=true
APP_CONFIG_DOWNLOAD_PROMPT_DELAY=<time>
APP_CONFIG_DOWNLOAD_PROMPT_REMINDER_DELAY=<time>
APP_CONFIG_ENABLE_FILE_AUTO_DOWNLOAD=true
APP_CONFIG_FILE_AUTO_DOWNLOAD_SIZE_THRESHOLD_IN_MB=<file-size>
```

Where `<URL>` is the address of the ACS.
Expand Down
37 changes: 16 additions & 21 deletions app/src/app.config.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@
"authType": "${APP_CONFIG_AUTH_TYPE}",
"loginRoute": "login",
"mobileAppSwitch": {
"enabled" : ${APP_CONFIG_ENABLE_MOBILE_APP_SWITCH},
"iphoneUrl": "iosamw://",
"androidUrlPart1": "intent:///",
"androidUrlPart2": "#Intent;scheme=androidamw;package=com.alfresco.content.app;end",
"sessionTimeForOpenAppDialogDisplay": "${APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS}",
"appStoreUrl": "https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480"
"enabled": true
},
"plugins": {
"aosPlugin": ${APP_CONFIG_PLUGIN_AOS},
"contentService": ${APP_CONFIG_PLUGIN_CONTENT_SERVICE},
"folderRules": ${APP_CONFIG_PLUGIN_FOLDER_RULES}
"aosPlugin": true,
"contentService": true,
"folderRules": true
},
"oauth2": {
"host": "${APP_CONFIG_OAUTH2_HOST}",
"clientId": "${APP_CONFIG_OAUTH2_CLIENTID}",
"clientId": "alfresco",
"scope": "openid",
"secret": "",
"implicitFlow": ${APP_CONFIG_OAUTH2_IMPLICIT_FLOW},
"silentLogin": ${APP_CONFIG_OAUTH2_SILENT_LOGIN},
"implicitFlow": true,
"silentLogin": true,
"publicUrls": ["**/preview/s/*", "**/settings", "**/blank"],
"redirectSilentIframeUri": "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}",
"redirectUri": "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}",
"redirectUriLogout": "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}"
"redirectSilentIframeUri": "{protocol}//{hostname}{:port}/assets/silent-refresh.html",
"redirectUri": "/",
"redirectUriLogout": "/"
},
"locale": "en",
"application": {
Expand Down Expand Up @@ -1128,11 +1123,11 @@
"ai": ["ai:products", "ai:dates", "ai:places", "ai:events", "ai:organizations", "ai:people", "ai:things", "ai:quantities", "ai:creativeWorks", "ai:labels", "ai:textLines"]
},
"viewer": {
"enableDownloadPrompt": ${APP_CONFIG_ENABLE_DOWNLOAD_PROMPT},
"enableDownloadPromptReminder": ${APP_CONFIG_ENABLE_DOWNLOAD_PROMPT_REMINDERS},
"downloadPromptDelay": ${APP_CONFIG_DOWNLOAD_PROMPT_DELAY},
"downloadPromptReminderDelay": ${APP_CONFIG_DOWNLOAD_PROMPT_REMINDER_DELAY},
"enableFileAutoDownload": ${APP_CONFIG_ENABLE_FILE_AUTO_DOWNLOAD},
"fileAutoDownloadSizeThresholdInMB": ${APP_CONFIG_FILE_AUTO_DOWNLOAD_SIZE_THRESHOLD_IN_MB}
"enableDownloadPrompt": true,
"enableDownloadPromptReminder": true,
"downloadPromptDelay": 50,
"downloadPromptReminderDelay": 30,
"enableFileAutoDownload": true,
"fileAutoDownloadSizeThresholdInMB": 15
}
}
10 changes: 0 additions & 10 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,12 @@ eval ALL_ARGUMENTS=("BASE_PATH"
"APP_CONFIG_BPM_HOST"
"APP_CONFIG_ECM_HOST"
"APP_CONFIG_AUTH_TYPE"
"APP_CONFIG_OAUTH2_CLIENTID"
"APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI"
"APP_CONFIG_OAUTH2_IMPLICIT_FLOW"
"APP_CONFIG_OAUTH2_SILENT_LOGIN"
"APP_CONFIG_OAUTH2_REDIRECT_LOGIN"
"APP_CONFIG_OAUTH2_REDIRECT_LOGOUT"
"APP_CONFIG_PROVIDER"
"APP_CONFIG_APPS_DEPLOYED"
"APP_CONFIG_PLUGIN_MICROSOFT_ONLINE"
"APP_CONFIG_MICROSOFT_ONLINE_AUTHORITY"
"APP_CONFIG_MICROSOFT_ONLINE_CLIENTID"
"APP_CONFIG_MICROSOFT_ONLINE_OOI_URL"
"APP_CONFIG_MICROSOFT_ONLINE_REDIRECT"
"APP_CONFIG_PLUGIN_AOS",
"APP_CONFIG_PLUGIN_FOLDER_RULES",
"APP_CONFIG_PLUGIN_AI_SERVICE"
)
ALL_ARGUMENTS_LENGTH=${#ALL_ARGUMENTS[@]}
DOCKER_ARGS=""
Expand Down
3 changes: 0 additions & 3 deletions docs/getting-started/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ You need to set some environment variables to be able to run the local dev serve
```yml
# App config settings
APP_CONFIG_ECM_HOST="<URL>"
APP_CONFIG_PLUGIN_AOS=false
APP_CONFIG_PLUGIN_CONTENT_SERVICE=true
APP_CONFIG_PLUGIN_FOLDER_RULES=true
```

## Proxy settings
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"postinstall": "ngcc",
"ng": "ng",
"validate-app-config": "ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d ./app/.tmp/app.config.json --errors=text --verbose",
"assemble-app-config": "envsub --env-file ./.env --env APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port} --env APP_CONFIG_PROVIDER=ECM --env APP_CONFIG_AUTH_TYPE=BASIC --env APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco --env APP_CONFIG_OAUTH2_CLIENTID=alfresco --env APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true --env APP_CONFIG_OAUTH2_SILENT_LOGIN=true --env APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI={protocol}//{hostname}{:port}/assets/silent-refresh.html --env APP_CONFIG_OAUTH2_REDIRECT_LOGIN=/ --env APP_CONFIG_OAUTH2_REDIRECT_LOGOUT=/logout --all ./app/src/app.config.json.tpl ./app/.tmp/app.config.json",
"assemble-app-config": "envsub --env-file ./.env --env APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port} --env APP_CONFIG_PROVIDER=ECM --env APP_CONFIG_AUTH_TYPE=BASIC --env APP_CONFIG_OAUTH2_HOST=http://localhost:4200/auth/realms/alfresco --all ./app/src/app.config.json.tpl ./app/.tmp/app.config.json",
"prestart": "mkdir -p ./app/.tmp && npm run assemble-app-config && npm run validate-app-config",
"start": "nx serve content-ce",
"start:prod": "npm run validate-app-config && node --max-old-space-size=8192 nx serve content-ce --configuration production",
Expand Down
16 changes: 16 additions & 0 deletions projects/aca-shared/src/lib/components/open-in-app/open-in-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Open in Mobile Application

Configuring via `app.config.json`:

```json
{
"mobileAppSwitch": {
"enabled": true,
"iphoneUrl": "iosamw://",
"androidUrlPart1": "intent:///",
"androidUrlPart2": "#Intent;scheme=androidamw;package=com.alfresco.content.app;end",
"sessionTimeout": 12,
"appStoreUrl": "https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480"
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ describe('AcaMobileAppSwitcherService', () => {
});
appConfig = TestBed.inject(AppConfigService);
appConfig.config.mobileAppSwitch = {
enabled: true,
iphoneUrl: 'iosamw://',
androidUrlPart1: 'intent:///',
androidUrlPart2: '#Intent;scheme=androidamw;package=com.alfresco.content.app;end',
sessionTimeForOpenAppDialogDisplay: 12
enabled: true
};
service = TestBed.inject(AcaMobileAppSwitcherService);
sessionStorage.clear();
Expand All @@ -58,15 +54,14 @@ describe('AcaMobileAppSwitcherService', () => {
it('should set the redirectUrl to `iphoneUrl`', () => {
spyOnProperty(window.navigator, 'userAgent').and.returnValue('iphone');
const url: string = window.location.href;
const iphoneUrl: string = appConfig.config.mobileAppSwitch.iphoneUrl + url;
const iphoneUrl = service.getIPhoneRedirectUrl(url);
service.identifyBrowserAndSetRedirectURL();
expect(service.redirectUrl).toEqual(iphoneUrl);
});

it('should set the redirectUrl to `androidUrl`', () => {
spyOnProperty(window.navigator, 'userAgent').and.returnValue('android');
const url: string = window.location.href;
const androidUrl: string = appConfig.config.mobileAppSwitch.androidUrlPart1 + url + appConfig.config.mobileAppSwitch.androidUrlPart2;
const androidUrl = service.getAndroidRedirectUrl(window.location.href);
service.identifyBrowserAndSetRedirectURL();
expect(service.redirectUrl).toEqual(androidUrl);
});
Expand All @@ -86,15 +81,13 @@ describe('AcaMobileAppSwitcherService', () => {
});

it('should check if `openInApp` dialog box is getting opened with `iphone` url', () => {
const url: string = window.location.href;
service.redirectUrl = appConfig.config.mobileAppSwitch.iphoneUrl + url;
service.redirectUrl = service.getIPhoneRedirectUrl(window.location.href);
service.identifyBrowserAndSetRedirectURL();
expect(mockDialogRef.open).toHaveBeenCalled();
});

it('should check if `openInApp` dialog box is getting opened with `android` url', () => {
const url: string = window.location.href;
service.redirectUrl = appConfig.config.mobileAppSwitch.androidUrlPart1 + url + appConfig.config.mobileAppSwitch.androidUrlPart2;
service.redirectUrl = service.getAndroidRedirectUrl(window.location.href);
service.identifyBrowserAndSetRedirectURL();
expect(mockDialogRef.open).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,37 @@
*/

import { AppConfigService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { inject, Injectable } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { OpenInAppComponent } from '../components/open-in-app/open-in-app.component';

export interface MobileAppSwitchConfigurationOptions {
enabled: string;
iphoneUrl: string;
androidUrlPart1: string;
androidUrlPart2: string;
sessionTimeForOpenAppDialogDisplay: string;
appStoreUrl: string;
}
@Injectable({
providedIn: 'root'
})
export class AcaMobileAppSwitcherService {
private mobileAppSwitchConfig: MobileAppSwitchConfigurationOptions;
public redirectUrl: string;
public appStoreUrl: string;
private dialogRef: MatDialogRef<OpenInAppComponent>;
private config = inject(AppConfigService);
private dialog = inject(MatDialog);

get appStoreUrl(): string {
const defaultValue = 'https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480';
return this.config.get<string>('mobileAppSwitch.appStoreUrl', defaultValue);
}

get sessionTimeout(): number {
return this.config.get<number>('mobileAppSwitch.sessionTimeout', 12);
}

getIPhoneRedirectUrl(url: string): string {
const prefix = this.config.get<string>('mobileAppSwitch.iphoneUrl', 'iosamw://');
return prefix + url;
}

constructor(private config: AppConfigService, private dialog: MatDialog) {
this.mobileAppSwitchConfig = this.config.get<MobileAppSwitchConfigurationOptions>('mobileAppSwitch');
getAndroidRedirectUrl(url: string): string {
const prefix = this.config.get<string>('mobileAppSwitch.androidUrlPart1', 'intent:///');
const suffix = this.config.get<string>('mobileAppSwitch.androidUrlPart2', '#Intent;scheme=androidamw;package=com.alfresco.content.app;end');
return prefix + url + suffix;
}

resolveExistenceOfDialog(): void {
Expand All @@ -68,9 +76,8 @@ export class AcaMobileAppSwitcherService {
const currentTime: number = new Date().getTime();
const sessionConvertedTime: number = parseFloat(sessionTime);
const timeDifference: number = (currentTime - sessionConvertedTime) / (1000 * 60 * 60);
const sessionTimeForOpenAppDialogDisplay: number = parseFloat(this.mobileAppSwitchConfig.sessionTimeForOpenAppDialogDisplay);

if (timeDifference > sessionTimeForOpenAppDialogDisplay) {
if (timeDifference > this.sessionTimeout) {
this.clearSessionExpireTime();
this.identifyBrowserAndSetRedirectURL();
}
Expand All @@ -87,10 +94,9 @@ export class AcaMobileAppSwitcherService {
const currentUrl: string = this.getCurrentUrl();

if (isIOS === true) {
this.redirectUrl = this.mobileAppSwitchConfig.iphoneUrl + currentUrl;
this.appStoreUrl = this.mobileAppSwitchConfig.appStoreUrl;
this.redirectUrl = this.getIPhoneRedirectUrl(currentUrl);
} else if (isAndroid === true) {
this.redirectUrl = this.mobileAppSwitchConfig.androidUrlPart1 + currentUrl + this.mobileAppSwitchConfig.androidUrlPart2;
this.redirectUrl = this.getAndroidRedirectUrl(currentUrl);
}

if (this.redirectUrl !== undefined && this.redirectUrl !== null) {
Expand Down

0 comments on commit 46ed7a8

Please sign in to comment.