mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
migrate mobileAppSwitch and aosPlugin
This commit is contained in:
@@ -7,14 +7,14 @@
|
||||
"authType": "${APP_CONFIG_AUTH_TYPE}",
|
||||
"loginRoute": "login",
|
||||
"mobileAppSwitch": {
|
||||
"enabled" : ${APP_CONFIG_ENABLE_MOBILE_APP_SWITCH},
|
||||
"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}"
|
||||
},
|
||||
"plugins": {
|
||||
"aosPlugin": ${APP_CONFIG_PLUGIN_AOS},
|
||||
"aosPlugin": "${APP_CONFIG_PLUGIN_AOS}",
|
||||
"contentService": ${APP_CONFIG_PLUGIN_CONTENT_SERVICE},
|
||||
"folderRules": ${APP_CONFIG_PLUGIN_FOLDER_RULES}
|
||||
},
|
||||
|
@@ -45,7 +45,7 @@ describe('AcaMobileAppSwitcherService', () => {
|
||||
});
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
appConfig.config.mobileAppSwitch = {
|
||||
enabled: true,
|
||||
enabled: 'true',
|
||||
iphoneUrl: 'iosamw://',
|
||||
androidUrlPart1: 'intent:///',
|
||||
androidUrlPart2: '#Intent;scheme=androidamw;package=com.alfresco.content.app;end',
|
||||
|
@@ -54,7 +54,7 @@ describe('AlfrescoOfficeExtensionService', () => {
|
||||
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
appConfig.onLoad = onLoad$;
|
||||
appConfig.config.aosPlugin = true;
|
||||
appConfig.config.aosPlugin = 'true';
|
||||
|
||||
service = TestBed.inject(AlfrescoOfficeExtensionService);
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('AlfrescoOfficeExtensionService', () => {
|
||||
|
||||
onLoad$.next({
|
||||
plugins: {
|
||||
aosPlugin: true
|
||||
aosPlugin: 'true'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('AlfrescoOfficeExtensionService', () => {
|
||||
|
||||
onLoad$.next({
|
||||
plugins: {
|
||||
aosPlugin: false
|
||||
aosPlugin: 'false'
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -34,10 +34,10 @@ export class AlfrescoOfficeExtensionService {
|
||||
this.appConfigService.onLoad
|
||||
.pipe(
|
||||
take(1),
|
||||
map((appConfig) => appConfig.plugins && appConfig.plugins.aosPlugin)
|
||||
map((appConfig) => appConfig.plugins?.aosPlugin)
|
||||
)
|
||||
.subscribe((aosPlugin) => {
|
||||
if (aosPlugin) {
|
||||
if (aosPlugin === 'true') {
|
||||
this.enablePlugin();
|
||||
} else {
|
||||
this.disablePlugin();
|
||||
@@ -55,7 +55,7 @@ export class AlfrescoOfficeExtensionService {
|
||||
localStorage.removeItem('aosPlugin');
|
||||
}
|
||||
|
||||
isAosPluginEnabled() {
|
||||
isAosPluginEnabled(): boolean {
|
||||
return localStorage && localStorage.getItem('aosPlugin') === 'true';
|
||||
}
|
||||
}
|
||||
|
@@ -142,9 +142,7 @@ export class AppService implements OnDestroy {
|
||||
|
||||
const { router } = this;
|
||||
|
||||
this.router.events
|
||||
.pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0))
|
||||
.subscribe((_event: ActivationEnd) => {
|
||||
this.router.events.pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)).subscribe(() => {
|
||||
this.store.dispatch(new SetCurrentUrlAction(router.url));
|
||||
});
|
||||
|
||||
@@ -171,7 +169,7 @@ export class AppService implements OnDestroy {
|
||||
|
||||
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
||||
|
||||
const isMobileSwitchEnabled: boolean = this.config.get<boolean>('mobileAppSwitch.enabled', false);
|
||||
const isMobileSwitchEnabled = this.config.get<string>('mobileAppSwitch.enabled', 'false') === 'true';
|
||||
if (isMobileSwitchEnabled) {
|
||||
this.acaMobileAppSwitcherService.resolveExistenceOfDialog();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user