From c3a5bdb0c9197f3de4070c81a8eaf7c492800635 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Fri, 12 May 2023 11:30:15 +0530 Subject: [PATCH 01/13] implementation of download Ios app as per new design shared in case IOS --- app/src/app.config.json.tpl | 3 ++- projects/aca-content/assets/i18n/en.json | 3 ++- .../open-in-app/open-in-app.component.html | 8 ++++++- .../open-in-app/open-in-app.component.scss | 23 +++++++++++++++---- .../open-in-app/open-in-app.component.ts | 11 ++++++++- .../aca-mobile-app-switcher.service.ts | 10 +++++--- projects/aca-shared/src/lib/shared.module.ts | 5 ++-- 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/app/src/app.config.json.tpl b/app/src/app.config.json.tpl index 49333691b5..527e3714d4 100644 --- a/app/src/app.config.json.tpl +++ b/app/src/app.config.json.tpl @@ -11,7 +11,8 @@ "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}" + "sessionTimeForOpenAppDialogDisplay": "${APP_CONFIG_SESSION_TIME_FOR_OPEN_APP_DIALOG_DISPLAY_IN_HOURS}", + "appStoreUrl": "https://apps.apple.com/us/app/alfresco-mobile-workspace/id1514434480" }, "plugins": { "aosPlugin": ${APP_CONFIG_PLUGIN_AOS}, diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json index c4c280e380..e2758b3992 100644 --- a/projects/aca-content/assets/i18n/en.json +++ b/projects/aca-content/assets/i18n/en.json @@ -287,7 +287,8 @@ "NO_LABEL": "Cancel" }, "MOBILE_APP": { - "MOBILE_APP_BUTTON_LABEL": "Open in App" + "MOBILE_APP_BUTTON_LABEL": "Open in App", + "DOWNLOAD_APP_BUTTON_LABEL": "Download App" } }, "DOCUMENT_LIST": { diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index 4433ab6b3a..d46a7700c1 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -1,4 +1,4 @@ -
+
@@ -6,3 +6,9 @@ close
+ +
+ +
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 7dcba44cdd..1e7e7871ef 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -1,21 +1,34 @@ -.container{ +.open-in-app-container { display: flex; flex-direction: row; justify-content: space-between; align-items: center; -} - -.mat-dialog-container{ padding: 5px; - border-radius: 36px; + border-radius: 22px; background-color: var(--theme-blue-button-color); color: var(--theme-about-panel-background-color); } +.mat-dialog-container { + box-shadow: none; +} + .open-in-app.mat-button { overflow-x: hidden; + font-size: 16px; } .open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { opacity: 0; } + +.download-app-container { + margin-top: 16px; +} + +.mat-button.download-app-button { + background: var(--theme-dialog-background-color); + color: var(--theme-blue-button-color); + font-size: 16px; + padding-left: 40px; +} diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts index 873669eff7..d57692e041 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts @@ -27,6 +27,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; export interface OpenInAppDialogOptions { redirectUrl: string; + appStoreUrl: string; } @Component({ selector: 'aca-open-in-app', @@ -35,7 +36,8 @@ export interface OpenInAppDialogOptions { encapsulation: ViewEncapsulation.None }) export class OpenInAppComponent { - private readonly redirectUrl: string; + private redirectUrl: string; + public appStoreUrl: string; public window: Window & typeof globalThis = window; constructor( @@ -45,6 +47,9 @@ export class OpenInAppComponent { ) { if (data) { this.redirectUrl = data.redirectUrl; + if (data.appStoreUrl) { + this.appStoreUrl = data.appStoreUrl; + } } } @@ -52,6 +57,10 @@ export class OpenInAppComponent { this.window.location.href = this.redirectUrl; } + downloadIosApp(): void { + this.window.location.href = this.appStoreUrl; + } + onCloseDialog(): void { const time: number = new Date().getTime(); sessionStorage.setItem('mobile_notification_expires_in', time.toString()); diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 27ac08831a..e513d26795 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -33,6 +33,7 @@ export interface MobileAppSwitchConfigurationOptions { androidUrlPart1: string; androidUrlPart2: string; sessionTimeForOpenAppDialogDisplay: string; + appStoreUrl: string; } @Injectable({ providedIn: 'root' @@ -40,6 +41,7 @@ export interface MobileAppSwitchConfigurationOptions { export class AcaMobileAppSwitcherService { private mobileAppSwitchConfig: MobileAppSwitchConfigurationOptions; public redirectUrl: string; + public appStoreUrl: string; constructor(private config: AppConfigService, private dialog: MatDialog) { this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch'); @@ -84,19 +86,21 @@ export class AcaMobileAppSwitcherService { if (isIOS === true) { this.redirectUrl = this.mobileAppSwitchConfig.iphoneUrl + currentUrl; + this.appStoreUrl = this.mobileAppSwitchConfig.appStoreUrl; } else if (isAndroid === true) { this.redirectUrl = this.mobileAppSwitchConfig.androidUrlPart1 + currentUrl + this.mobileAppSwitchConfig.androidUrlPart2; } if (this.redirectUrl !== undefined && this.redirectUrl !== null) { - this.openDialog(this.redirectUrl); + this.openDialog(this.redirectUrl, this.appStoreUrl); } } - openDialog(redirectUrl: string): void { + openDialog(redirectUrl: string, appStoreUrl?: string): void { this.dialog.open(OpenInAppComponent, { data: { - redirectUrl + redirectUrl, + appStoreUrl }, hasBackdrop: false, width: 'auto', diff --git a/projects/aca-shared/src/lib/shared.module.ts b/projects/aca-shared/src/lib/shared.module.ts index fdd0b9ba50..a180e9b19a 100644 --- a/projects/aca-shared/src/lib/shared.module.ts +++ b/projects/aca-shared/src/lib/shared.module.ts @@ -32,10 +32,11 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatDialogModule } from '@angular/material/dialog'; import { TranslateModule } from '@ngx-translate/core'; +import { BrowserModule } from '@angular/platform-browser'; @NgModule({ - imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule], - exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule], + imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, BrowserModule], + exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, BrowserModule], declarations: [OpenInAppComponent] }) export class SharedModule { From 6ebc56f74c95f53dff72ceeee3574b5b89393910 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Tue, 16 May 2023 15:36:18 +0530 Subject: [PATCH 02/13] design changes as per new design shared my mobile application team --- projects/aca-content/assets/i18n/en.json | 3 +- .../open-in-app/open-in-app.component.html | 10 ++++-- .../open-in-app/open-in-app.component.scss | 32 ++++++++++++------- .../aca-mobile-app-switcher.service.ts | 4 +-- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json index e2758b3992..68c23ef5e1 100644 --- a/projects/aca-content/assets/i18n/en.json +++ b/projects/aca-content/assets/i18n/en.json @@ -288,7 +288,8 @@ }, "MOBILE_APP": { "MOBILE_APP_BUTTON_LABEL": "Open in App", - "DOWNLOAD_APP_BUTTON_LABEL": "Download App" + "DOWNLOAD_APP_BUTTON_LABEL": "Don't have the app, Download App?", + "OPEN_ALFRESCO_MOBILE_APP": "Open using Alfresco Mobile application?" } }, "DOCUMENT_LIST": { diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index d46a7700c1..210103e5c4 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -1,10 +1,14 @@ +
+ {{ 'APP.DIALOGS.MOBILE_APP.OPEN_ALFRESCO_MOBILE_APP' | translate }} + +
+
-
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 1e7e7871ef..89759d83f2 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -1,16 +1,11 @@ .open-in-app-container { display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - padding: 5px; - border-radius: 22px; + place-content: center; + padding: 8px 24px; + border-radius: 8px; background-color: var(--theme-blue-button-color); color: var(--theme-about-panel-background-color); -} - -.mat-dialog-container { - box-shadow: none; + margin-top: 12px; } .open-in-app.mat-button { @@ -23,12 +18,27 @@ } .download-app-container { - margin-top: 16px; + display: flex; + place-content: center; + margin-top: 12px; +} + +.alfresco-mobile-application-container { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + font-size: 14px; + padding: 6px 0; +} + +.mat-button.cross-button { + padding-right: 0; } .mat-button.download-app-button { background: var(--theme-dialog-background-color); color: var(--theme-blue-button-color); - font-size: 16px; + font-size: 14px; padding-left: 40px; } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index e513d26795..559f69c183 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -103,9 +103,9 @@ export class AcaMobileAppSwitcherService { appStoreUrl }, hasBackdrop: false, - width: 'auto', + width: '100%', role: 'dialog', - position: { bottom: '20px' } + position: { bottom: '0' } }); } From e92f3e427a1a5981fd03bd684dfdda678f155862 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Thu, 18 May 2023 11:11:49 +0530 Subject: [PATCH 03/13] implementation of dialog after login and visibility enabled for private files --- .../shared-link-view.component.ts | 6 +++-- .../open-in-app/open-in-app.component.html | 2 +- .../open-in-app/open-in-app.component.scss | 22 +++++++++++++++++-- .../aca-mobile-app-switcher.service.ts | 9 ++++++-- .../src/lib/services/app.service.ts | 21 ++++++++++++------ 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts index 5e0f2faf85..71964d1f15 100644 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts +++ b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts @@ -31,7 +31,7 @@ import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { forkJoin, from, of, Subject } from 'rxjs'; import { catchError, mergeMap, takeUntil } from 'rxjs/operators'; -import { AppExtensionService } from '@alfresco/aca-shared'; +import { AppExtensionService, AppService } from '@alfresco/aca-shared'; @Component({ selector: 'app-shared-link-view', @@ -50,7 +50,8 @@ export class SharedLinkViewComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private store: Store, private extensions: AppExtensionService, - private alfrescoApiService: AlfrescoApiService + private alfrescoApiService: AlfrescoApiService, + private appService: AppService ) { this.sharedLinksApi = new SharedlinksApi(this.alfrescoApiService.getInstance()); } @@ -65,6 +66,7 @@ export class SharedLinkViewComponent implements OnInit, OnDestroy { .subscribe(([sharedEntry, sharedId]: [SharedLinkEntry, string]) => { if (sharedEntry) { this.store.dispatch(new SetSelectedNodesAction([sharedEntry as any])); + this.appService.getMobileAppDialog(); } this.sharedLinkId = sharedId; }); diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index 210103e5c4..e445f500c9 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -1,7 +1,7 @@
{{ 'APP.DIALOGS.MOBILE_APP.OPEN_ALFRESCO_MOBILE_APP' | translate }}
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 89759d83f2..a528e6f12a 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -3,7 +3,7 @@ place-content: center; padding: 8px 24px; border-radius: 8px; - background-color: var(--theme-blue-button-color); + background-color: #0055b8; color: var(--theme-about-panel-background-color); margin-top: 12px; } @@ -17,6 +17,15 @@ opacity: 0; } +.cross-button.mat-button.cdk-program-focused .mat-button-focus-overlay { + opacity: 0; +} + +.cross-button.mat-button:focus-visible { + outline: none; + border-radius: unset; +} + .download-app-container { display: flex; place-content: center; @@ -36,9 +45,18 @@ padding-right: 0; } +.mat-icon.cross-icon { + font-weight: bold; + font-size: 21px; + height: 21px; +} + .mat-button.download-app-button { background: var(--theme-dialog-background-color); color: var(--theme-blue-button-color); font-size: 14px; - padding-left: 40px; +} + +.mat-dialog-container { + padding: 8px 24px 24px; } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 559f69c183..95c37447c5 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -24,7 +24,7 @@ import { AppConfigService } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { OpenInAppComponent } from '../components/open-in-app/open-in-app.component'; export interface MobileAppSwitchConfigurationOptions { @@ -42,6 +42,7 @@ export class AcaMobileAppSwitcherService { private mobileAppSwitchConfig: MobileAppSwitchConfigurationOptions; public redirectUrl: string; public appStoreUrl: string; + dialogRef: MatDialogRef; constructor(private config: AppConfigService, private dialog: MatDialog) { this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch'); @@ -97,7 +98,7 @@ export class AcaMobileAppSwitcherService { } openDialog(redirectUrl: string, appStoreUrl?: string): void { - this.dialog.open(OpenInAppComponent, { + this.dialogRef = this.dialog.open(OpenInAppComponent, { data: { redirectUrl, appStoreUrl @@ -116,4 +117,8 @@ export class AcaMobileAppSwitcherService { getCurrentUrl(): string { return window.location.href; } + + closeDialog(): void { + this.dialog.closeAll(); + } } diff --git a/projects/aca-shared/src/lib/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts index 51b62df2dd..fad1945bcd 100644 --- a/projects/aca-shared/src/lib/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -103,6 +103,10 @@ export class AppService implements OnDestroy { this.authenticationService.onLogout.subscribe(() => { searchQueryBuilderService.resetToDefaults(); + acaMobileAppSwitcherService.clearSessionExpireTime(); + if (acaMobileAppSwitcherService.dialogRef !== null && acaMobileAppSwitcherService.dialogRef !== undefined) { + acaMobileAppSwitcherService.closeDialog(); + } }); this.pageHeading$ = this.router.events.pipe( @@ -164,17 +168,11 @@ export class AppService implements OnDestroy { if (isReady) { this.loadRepositoryStatus(); this.loadUserProfile(); + this.getMobileAppDialog(); } }); this.overlayContainer.getContainerElement().setAttribute('role', 'region'); - - const isMobileSwitchEnabled: boolean = this.config.get('mobileAppSwitch.enabled', false); - if (isMobileSwitchEnabled) { - this.acaMobileAppSwitcherService.resolveExistenceOfDialog(); - } else { - this.acaMobileAppSwitcherService.clearSessionExpireTime(); - } } private loadRepositoryStatus() { @@ -266,4 +264,13 @@ export class AppService implements OnDestroy { cssLinkElement.setAttribute('href', url); document.head.appendChild(cssLinkElement); } + + public getMobileAppDialog(): void { + const isMobileSwitchEnabled: boolean = this.config.get('mobileAppSwitch.enabled', false); + if (isMobileSwitchEnabled) { + this.acaMobileAppSwitcherService.resolveExistenceOfDialog(); + } else { + this.acaMobileAppSwitcherService.clearSessionExpireTime(); + } + } } From 5f46a2fb039ba8f7aa5bde17dcedd23f381e0194 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Thu, 18 May 2023 13:24:29 +0530 Subject: [PATCH 04/13] single click on cross dialog to close popup which was occuring earlier on double click --- .../open-in-app/open-in-app.component.ts | 5 +++- .../aca-mobile-app-switcher.service.ts | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts index d57692e041..c74fbbdbfe 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts @@ -24,6 +24,7 @@ import { Component, Inject, ViewEncapsulation } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { AcaMobileAppSwitcherService } from '../../services/aca-mobile-app-switcher.service'; export interface OpenInAppDialogOptions { redirectUrl: string; @@ -43,7 +44,8 @@ export class OpenInAppComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: OpenInAppDialogOptions, - private dialog: MatDialogRef + private dialog: MatDialogRef, + private acaMobileAppSwitcherService: AcaMobileAppSwitcherService ) { if (data) { this.redirectUrl = data.redirectUrl; @@ -65,5 +67,6 @@ export class OpenInAppComponent { const time: number = new Date().getTime(); sessionStorage.setItem('mobile_notification_expires_in', time.toString()); this.dialog.close(); + this.acaMobileAppSwitcherService.isDialogEnable = false; } } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 95c37447c5..35f5de11dc 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -43,6 +43,7 @@ export class AcaMobileAppSwitcherService { public redirectUrl: string; public appStoreUrl: string; dialogRef: MatDialogRef; + isDialogEnable = false; constructor(private config: AppConfigService, private dialog: MatDialog) { this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch'); @@ -98,16 +99,19 @@ export class AcaMobileAppSwitcherService { } openDialog(redirectUrl: string, appStoreUrl?: string): void { - this.dialogRef = this.dialog.open(OpenInAppComponent, { - data: { - redirectUrl, - appStoreUrl - }, - hasBackdrop: false, - width: '100%', - role: 'dialog', - position: { bottom: '0' } - }); + if (!this.isDialogEnable) { + this.dialogRef = this.dialog.open(OpenInAppComponent, { + data: { + redirectUrl, + appStoreUrl + }, + hasBackdrop: false, + width: '100%', + role: 'dialog', + position: { bottom: '0' } + }); + this.isDialogEnable = true; + } } clearSessionExpireTime(): void { @@ -120,5 +124,6 @@ export class AcaMobileAppSwitcherService { closeDialog(): void { this.dialog.closeAll(); + this.isDialogEnable = false; } } From a924f91b9dd88306b2c24902a08ef8445a5f4e9e Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Mon, 22 May 2023 18:38:27 +0530 Subject: [PATCH 05/13] test cases added for open in app component, shared link view component and name changes --- .../shared-link-view.component.spec.ts | 9 ++++++++- .../shared-link-view.component.ts | 2 +- .../open-in-app/open-in-app.component.html | 2 +- .../open-in-app/open-in-app.component.scss | 2 +- .../open-in-app/open-in-app.component.spec.ts | 20 ++++++++++++++++++- .../open-in-app/open-in-app.component.ts | 5 +---- .../aca-mobile-app-switcher.service.ts | 6 ++---- .../src/lib/services/app.service.ts | 4 ++-- 8 files changed, 35 insertions(+), 15 deletions(-) diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts index 9ef8f8e3db..f2ef538f5a 100644 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts +++ b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.spec.ts @@ -30,7 +30,7 @@ import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { SetSelectedNodesAction } from '@alfresco/aca-shared/store'; -import { AppExtensionService } from '@alfresco/aca-shared'; +import { AppExtensionService, AppService } from '@alfresco/aca-shared'; describe('SharedLinkViewComponent', () => { let component: SharedLinkViewComponent; @@ -41,6 +41,9 @@ describe('SharedLinkViewComponent', () => { dispatch: jasmine.createSpy('dispatch'), select: () => of({}) }; + const appServiceMock = { + openMobileAppDialog: () => {} + }; beforeEach(() => { TestBed.configureTestingModule({ @@ -55,6 +58,10 @@ describe('SharedLinkViewComponent', () => { snapshot: { data: { preferencePrefix: 'prefix' } }, params: of({ id: '123' }) } + }, + { + provide: AppService, + useValue: appServiceMock } ], schemas: [NO_ERRORS_SCHEMA] diff --git a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts index 71964d1f15..07ce9b2aa5 100644 --- a/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts +++ b/projects/aca-content/src/lib/components/shared-link-view/shared-link-view.component.ts @@ -66,7 +66,7 @@ export class SharedLinkViewComponent implements OnInit, OnDestroy { .subscribe(([sharedEntry, sharedId]: [SharedLinkEntry, string]) => { if (sharedEntry) { this.store.dispatch(new SetSelectedNodesAction([sharedEntry as any])); - this.appService.getMobileAppDialog(); + this.appService.openMobileAppDialog(); } this.sharedLinkId = sharedId; }); diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index e445f500c9..9152a34f46 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -12,7 +12,7 @@
-
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index a528e6f12a..254e51686b 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -3,7 +3,7 @@ place-content: center; padding: 8px 24px; border-radius: 8px; - background-color: #0055b8; + background-color: var(--theme-primary-color); color: var(--theme-about-panel-background-color); margin-top: 12px; } diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts index 00998d45ca..f52685ff5d 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts @@ -45,7 +45,7 @@ describe('OpenInAppComponent', () => { imports: [LibTestingModule, SharedModule.forRoot(), MatIconTestingModule], providers: [ provideMockStore({ initialState }), - { provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl' } }, + { provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl', appStoreUrl: 'mockAppStoreUrl' } }, { provide: MatDialogRef, useValue: mockDialogRef } ] }); @@ -78,4 +78,22 @@ describe('OpenInAppComponent', () => { expect(sessionStorage.getItem('mobile_notification_expires_in')).not.toBeNull(); expect(mockDialogRef.close).toHaveBeenCalled(); }); + + it('should redirect to App Store for downloading the app in case of Ios device', async () => { + let currentLocation: string | string[]; + const windowStub: Window & typeof globalThis = { + location: { + set href(value: string | string[]) { + currentLocation = value; + } + } + } as Window & typeof globalThis; + component.window = windowStub; + const downloadAppButton = fixture.debugElement.query(By.css('[data-automation-id="download-app-button"]')).nativeElement; + downloadAppButton.dispatchEvent(new Event('click')); + fixture.detectChanges(); + await fixture.whenStable(); + + expect(currentLocation).toBe('mockAppStoreUrl'); + }); }); diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts index c74fbbdbfe..d57692e041 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts @@ -24,7 +24,6 @@ import { Component, Inject, ViewEncapsulation } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { AcaMobileAppSwitcherService } from '../../services/aca-mobile-app-switcher.service'; export interface OpenInAppDialogOptions { redirectUrl: string; @@ -44,8 +43,7 @@ export class OpenInAppComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: OpenInAppDialogOptions, - private dialog: MatDialogRef, - private acaMobileAppSwitcherService: AcaMobileAppSwitcherService + private dialog: MatDialogRef ) { if (data) { this.redirectUrl = data.redirectUrl; @@ -67,6 +65,5 @@ export class OpenInAppComponent { const time: number = new Date().getTime(); sessionStorage.setItem('mobile_notification_expires_in', time.toString()); this.dialog.close(); - this.acaMobileAppSwitcherService.isDialogEnable = false; } } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 35f5de11dc..05875754a5 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -43,7 +43,6 @@ export class AcaMobileAppSwitcherService { public redirectUrl: string; public appStoreUrl: string; dialogRef: MatDialogRef; - isDialogEnable = false; constructor(private config: AppConfigService, private dialog: MatDialog) { this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch'); @@ -99,7 +98,7 @@ export class AcaMobileAppSwitcherService { } openDialog(redirectUrl: string, appStoreUrl?: string): void { - if (!this.isDialogEnable) { + if (this.dialogRef === null || this.dialogRef === undefined) { this.dialogRef = this.dialog.open(OpenInAppComponent, { data: { redirectUrl, @@ -110,7 +109,6 @@ export class AcaMobileAppSwitcherService { role: 'dialog', position: { bottom: '0' } }); - this.isDialogEnable = true; } } @@ -124,6 +122,6 @@ export class AcaMobileAppSwitcherService { closeDialog(): void { this.dialog.closeAll(); - this.isDialogEnable = false; + this.dialogRef = null; } } diff --git a/projects/aca-shared/src/lib/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts index fad1945bcd..a1e8abee0c 100644 --- a/projects/aca-shared/src/lib/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -168,7 +168,7 @@ export class AppService implements OnDestroy { if (isReady) { this.loadRepositoryStatus(); this.loadUserProfile(); - this.getMobileAppDialog(); + this.openMobileAppDialog(); } }); @@ -265,7 +265,7 @@ export class AppService implements OnDestroy { document.head.appendChild(cssLinkElement); } - public getMobileAppDialog(): void { + public openMobileAppDialog(): void { const isMobileSwitchEnabled: boolean = this.config.get('mobileAppSwitch.enabled', false); if (isMobileSwitchEnabled) { this.acaMobileAppSwitcherService.resolveExistenceOfDialog(); From ee1f3792635abf06af613044b89bc6c1f7323c76 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Tue, 23 May 2023 16:08:33 +0530 Subject: [PATCH 06/13] ipad changes to open in Safari browser, open in app button clickable width increased and focus unset on open in app button click --- .../lib/components/open-in-app/open-in-app.component.scss | 5 +++++ .../src/lib/services/aca-mobile-app-switcher.service.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 254e51686b..639d030360 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -11,12 +11,17 @@ .open-in-app.mat-button { overflow-x: hidden; font-size: 16px; + width: 100%; } .open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { opacity: 0; } +.open-in-app.mat-button.cdk-touch-focused { + background-color: var(--theme-primary-color); +} + .cross-button.mat-button.cdk-program-focused .mat-button-focus-overlay { opacity: 0; } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 05875754a5..3681c648de 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -82,7 +82,8 @@ export class AcaMobileAppSwitcherService { identifyBrowserAndSetRedirectURL(): void { const ua: string = navigator.userAgent.toLowerCase(); const isAndroid: boolean = ua.indexOf('android') > -1; - const isIOS: boolean = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1; + const iPadInSafari = /Macintosh/i.test(ua) && navigator.maxTouchPoints && navigator.maxTouchPoints > 1; + const isIOS: boolean = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || iPadInSafari; const currentUrl: string = this.getCurrentUrl(); if (isIOS === true) { From dd3223488c569a591cc35071f080c7e8aeb8ab66 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Tue, 23 May 2023 17:48:41 +0530 Subject: [PATCH 07/13] open in app button style changes --- .../src/lib/components/open-in-app/open-in-app.component.scss | 4 +++- .../src/lib/services/aca-mobile-app-switcher.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 639d030360..9e43774a83 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -1,7 +1,7 @@ .open-in-app-container { display: flex; place-content: center; - padding: 8px 24px; + padding: 0; border-radius: 8px; background-color: var(--theme-primary-color); color: var(--theme-about-panel-background-color); @@ -12,6 +12,8 @@ overflow-x: hidden; font-size: 16px; width: 100%; + padding: 0; + height: 48px; } .open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 3681c648de..152501f6be 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -82,8 +82,8 @@ export class AcaMobileAppSwitcherService { identifyBrowserAndSetRedirectURL(): void { const ua: string = navigator.userAgent.toLowerCase(); const isAndroid: boolean = ua.indexOf('android') > -1; - const iPadInSafari = /Macintosh/i.test(ua) && navigator.maxTouchPoints && navigator.maxTouchPoints > 1; - const isIOS: boolean = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || iPadInSafari; + const isIPadInSafari = /Macintosh/i.test(ua) && navigator.maxTouchPoints && navigator.maxTouchPoints > 1; + const isIOS: boolean = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || isIPadInSafari; const currentUrl: string = this.getCurrentUrl(); if (isIOS === true) { From 1db4ee98b1a8e624af1c5fc4890e295ed4c44647 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Wed, 24 May 2023 11:33:36 +0530 Subject: [PATCH 08/13] theme button color changes --- .../lib/components/open-in-app/open-in-app.component.html | 8 ++++---- .../lib/components/open-in-app/open-in-app.component.scss | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index 9152a34f46..7b91e262b3 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -1,8 +1,8 @@
- {{ 'APP.DIALOGS.MOBILE_APP.OPEN_ALFRESCO_MOBILE_APP' | translate }} - + {{ 'APP.DIALOGS.MOBILE_APP.OPEN_ALFRESCO_MOBILE_APP' | translate }} +
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 9e43774a83..0621a5ad34 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -60,7 +60,7 @@ .mat-button.download-app-button { background: var(--theme-dialog-background-color); - color: var(--theme-blue-button-color); + color: var(--theme-primary-color); font-size: 14px; } From cd48f7fff47e71df2994acd7d130ca88a5f8905b Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Thu, 25 May 2023 13:35:28 +0530 Subject: [PATCH 09/13] review comments addressed --- .../open-in-app/open-in-app.component.scss | 14 +++---- .../open-in-app/open-in-app.module.ts | 38 +++++++++++++++++++ .../aca-mobile-app-switcher.service.ts | 8 ++-- .../src/lib/services/app.service.ts | 4 +- projects/aca-shared/src/lib/shared.module.ts | 8 ++-- 5 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 projects/aca-shared/src/lib/components/open-in-app/open-in-app.module.ts diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index 0621a5ad34..ae248a6d73 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -20,7 +20,7 @@ opacity: 0; } -.open-in-app.mat-button.cdk-touch-focused { +.open-in-app.cdk-touch-focused { background-color: var(--theme-primary-color); } @@ -28,11 +28,6 @@ opacity: 0; } -.cross-button.mat-button:focus-visible { - outline: none; - border-radius: unset; -} - .download-app-container { display: flex; place-content: center; @@ -50,6 +45,11 @@ .mat-button.cross-button { padding-right: 0; + + &:focus-visible { + outline: none; + border-radius: unset; + } } .mat-icon.cross-icon { @@ -58,7 +58,7 @@ height: 21px; } -.mat-button.download-app-button { +.download-app-button { background: var(--theme-dialog-background-color); color: var(--theme-primary-color); font-size: 14px; diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.module.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.module.ts new file mode 100644 index 0000000000..97ac934ad6 --- /dev/null +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.module.ts @@ -0,0 +1,38 @@ +/*! + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Alfresco Example Content Application + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * from Hyland Software. If not, see . + */ + +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { BrowserModule } from '@angular/platform-browser'; +import { TranslateModule } from '@ngx-translate/core'; +import { OpenInAppComponent } from './open-in-app.component'; + +@NgModule({ + imports: [CommonModule, MatIconModule, TranslateModule, MatButtonModule, BrowserModule], + declarations: [OpenInAppComponent], + exports: [OpenInAppComponent] +}) +export class OpenInAppModule {} diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 152501f6be..579718046e 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -42,7 +42,7 @@ export class AcaMobileAppSwitcherService { private mobileAppSwitchConfig: MobileAppSwitchConfigurationOptions; public redirectUrl: string; public appStoreUrl: string; - dialogRef: MatDialogRef; + private dialogRef: MatDialogRef; constructor(private config: AppConfigService, private dialog: MatDialog) { this.mobileAppSwitchConfig = this.config.get('mobileAppSwitch'); @@ -122,7 +122,9 @@ export class AcaMobileAppSwitcherService { } closeDialog(): void { - this.dialog.closeAll(); - this.dialogRef = null; + if (this.dialogRef !== null && this.dialogRef !== undefined) { + this.dialog.closeAll(); + this.dialogRef = null; + } } } diff --git a/projects/aca-shared/src/lib/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts index a1e8abee0c..25171b21f9 100644 --- a/projects/aca-shared/src/lib/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -104,9 +104,7 @@ export class AppService implements OnDestroy { this.authenticationService.onLogout.subscribe(() => { searchQueryBuilderService.resetToDefaults(); acaMobileAppSwitcherService.clearSessionExpireTime(); - if (acaMobileAppSwitcherService.dialogRef !== null && acaMobileAppSwitcherService.dialogRef !== undefined) { - acaMobileAppSwitcherService.closeDialog(); - } + acaMobileAppSwitcherService.closeDialog(); }); this.pageHeading$ = this.router.events.pipe( diff --git a/projects/aca-shared/src/lib/shared.module.ts b/projects/aca-shared/src/lib/shared.module.ts index a180e9b19a..f15bb1e566 100644 --- a/projects/aca-shared/src/lib/shared.module.ts +++ b/projects/aca-shared/src/lib/shared.module.ts @@ -27,17 +27,15 @@ import { ContentApiService } from './services/content-api.service'; import { NodePermissionService } from './services/node-permission.service'; import { AppService } from './services/app.service'; import { ContextActionsModule } from './directives/contextmenu/contextmenu.module'; -import { OpenInAppComponent } from './components/open-in-app/open-in-app.component'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatDialogModule } from '@angular/material/dialog'; import { TranslateModule } from '@ngx-translate/core'; -import { BrowserModule } from '@angular/platform-browser'; +import { OpenInAppModule } from './components/open-in-app/open-in-app.module'; @NgModule({ - imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, BrowserModule], - exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, BrowserModule], - declarations: [OpenInAppComponent] + imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, OpenInAppModule], + exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, OpenInAppModule] }) export class SharedModule { static forRoot(): ModuleWithProviders { From 2e15129a0d420a5f957fb58c0fbb10f3dff338a0 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Thu, 25 May 2023 22:12:28 +0530 Subject: [PATCH 10/13] review comments addressed --- projects/aca-content/assets/i18n/en.json | 2 +- .../src/lib/components/open-in-app/open-in-app.component.ts | 4 +--- projects/aca-shared/src/lib/shared.module.ts | 5 ++--- projects/aca-shared/src/public-api.ts | 2 ++ 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json index 68c23ef5e1..74175821ca 100644 --- a/projects/aca-content/assets/i18n/en.json +++ b/projects/aca-content/assets/i18n/en.json @@ -288,7 +288,7 @@ }, "MOBILE_APP": { "MOBILE_APP_BUTTON_LABEL": "Open in App", - "DOWNLOAD_APP_BUTTON_LABEL": "Don't have the app, Download App?", + "DOWNLOAD_APP_BUTTON_LABEL": "Don't have the app? Download app", "OPEN_ALFRESCO_MOBILE_APP": "Open using Alfresco Mobile application?" } }, diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts index d57692e041..4cab112580 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts @@ -47,9 +47,7 @@ export class OpenInAppComponent { ) { if (data) { this.redirectUrl = data.redirectUrl; - if (data.appStoreUrl) { - this.appStoreUrl = data.appStoreUrl; - } + this.appStoreUrl = data.appStoreUrl; } } diff --git a/projects/aca-shared/src/lib/shared.module.ts b/projects/aca-shared/src/lib/shared.module.ts index f15bb1e566..dd0a223972 100644 --- a/projects/aca-shared/src/lib/shared.module.ts +++ b/projects/aca-shared/src/lib/shared.module.ts @@ -31,11 +31,10 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatDialogModule } from '@angular/material/dialog'; import { TranslateModule } from '@ngx-translate/core'; -import { OpenInAppModule } from './components/open-in-app/open-in-app.module'; @NgModule({ - imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, OpenInAppModule], - exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule, OpenInAppModule] + imports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule], + exports: [ContextActionsModule, MatButtonModule, MatIconModule, MatDialogModule, TranslateModule] }) export class SharedModule { static forRoot(): ModuleWithProviders { diff --git a/projects/aca-shared/src/public-api.ts b/projects/aca-shared/src/public-api.ts index b54edf65cf..6080bd6bcf 100644 --- a/projects/aca-shared/src/public-api.ts +++ b/projects/aca-shared/src/public-api.ts @@ -41,6 +41,8 @@ export * from './lib/components/info-drawer/info-drawer.component'; export * from './lib/components/info-drawer/shared-info-drawer.module'; export * from './lib/components/document-base-page/document-base-page.component'; export * from './lib/components/document-base-page/document-base-page.service'; +export * from './lib/components/open-in-app/open-in-app.component'; +export * from './lib/components/open-in-app/open-in-app.module'; export * from './lib/directives/contextmenu/contextmenu.directive'; export * from './lib/directives/contextmenu/contextmenu.module'; From bda2c7890166dd83846ab758f125fa8c2edb3e6a Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Fri, 26 May 2023 13:35:50 +0530 Subject: [PATCH 11/13] review comments addressed --- .../open-in-app/open-in-app.component.scss | 114 +++++++++--------- .../aca-mobile-app-switcher.service.ts | 4 +- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index ae248a6d73..a004d3f01b 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -1,69 +1,71 @@ -.open-in-app-container { - display: flex; - place-content: center; - padding: 0; - border-radius: 8px; - background-color: var(--theme-primary-color); - color: var(--theme-about-panel-background-color); - margin-top: 12px; -} +aca-open-in-app { + .open-in-app-container { + display: flex; + place-content: center; + padding: 0; + border-radius: 8px; + background-color: var(--theme-primary-color); + color: var(--theme-about-panel-background-color); + margin-top: 12px; + } -.open-in-app.mat-button { - overflow-x: hidden; - font-size: 16px; - width: 100%; - padding: 0; - height: 48px; -} + .open-in-app.mat-button { + overflow-x: hidden; + font-size: 16px; + width: 100%; + padding: 0; + height: 48px; + } -.open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { - opacity: 0; -} + .open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { + opacity: 0; + } -.open-in-app.cdk-touch-focused { - background-color: var(--theme-primary-color); -} + .open-in-app.cdk-touch-focused { + background-color: var(--theme-primary-color); + } -.cross-button.mat-button.cdk-program-focused .mat-button-focus-overlay { - opacity: 0; -} + .cross-button.mat-button.cdk-program-focused .mat-button-focus-overlay { + opacity: 0; + } -.download-app-container { - display: flex; - place-content: center; - margin-top: 12px; -} + .download-app-container { + display: flex; + place-content: center; + margin-top: 12px; + } -.alfresco-mobile-application-container { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - font-size: 14px; - padding: 6px 0; -} + .alfresco-mobile-application-container { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + font-size: 14px; + padding: 6px 0; + } -.mat-button.cross-button { - padding-right: 0; + .mat-button.cross-button { + padding-right: 0; - &:focus-visible { - outline: none; - border-radius: unset; + &:focus-visible { + outline: none; + border-radius: unset; + } } -} -.mat-icon.cross-icon { - font-weight: bold; - font-size: 21px; - height: 21px; -} + .mat-icon.cross-icon { + font-weight: bold; + font-size: 21px; + height: 21px; + } -.download-app-button { - background: var(--theme-dialog-background-color); - color: var(--theme-primary-color); - font-size: 14px; -} + .download-app-button { + background: var(--theme-dialog-background-color); + color: var(--theme-primary-color); + font-size: 14px; + } -.mat-dialog-container { - padding: 8px 24px 24px; + .mat-dialog-container { + padding: 8px 24px 24px; + } } diff --git a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts index 579718046e..38623ba0f2 100644 --- a/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts +++ b/projects/aca-shared/src/lib/services/aca-mobile-app-switcher.service.ts @@ -99,7 +99,7 @@ export class AcaMobileAppSwitcherService { } openDialog(redirectUrl: string, appStoreUrl?: string): void { - if (this.dialogRef === null || this.dialogRef === undefined) { + if (!this.dialogRef) { this.dialogRef = this.dialog.open(OpenInAppComponent, { data: { redirectUrl, @@ -122,7 +122,7 @@ export class AcaMobileAppSwitcherService { } closeDialog(): void { - if (this.dialogRef !== null && this.dialogRef !== undefined) { + if (this.dialogRef) { this.dialog.closeAll(); this.dialogRef = null; } From 2b220d04e4c5a91c0a987098dcf01704f65824fe Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Fri, 26 May 2023 15:59:47 +0530 Subject: [PATCH 12/13] download app text changes --- projects/aca-content/assets/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json index 74175821ca..9e366431c0 100644 --- a/projects/aca-content/assets/i18n/en.json +++ b/projects/aca-content/assets/i18n/en.json @@ -288,7 +288,7 @@ }, "MOBILE_APP": { "MOBILE_APP_BUTTON_LABEL": "Open in App", - "DOWNLOAD_APP_BUTTON_LABEL": "Don't have the app? Download app", + "DOWNLOAD_APP_BUTTON_LABEL": "Don't have the app? Download now.", "OPEN_ALFRESCO_MOBILE_APP": "Open using Alfresco Mobile application?" } }, From 313e6f6baa125fa958f116bf8308553e55d34f33 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Fri, 26 May 2023 18:22:27 +0530 Subject: [PATCH 13/13] improved open-in-app.scss file and removed mat and cdk classed --- .../open-in-app/open-in-app.component.html | 2 +- .../open-in-app/open-in-app.component.scss | 21 +++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html index 7b91e262b3..8c814acd01 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.html @@ -6,7 +6,7 @@
-
diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss index a004d3f01b..36cf82b28b 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.scss @@ -9,24 +9,17 @@ aca-open-in-app { margin-top: 12px; } - .open-in-app.mat-button { + .open-in-app { overflow-x: hidden; font-size: 16px; width: 100%; padding: 0; height: 48px; - } - - .open-in-app.mat-button.cdk-program-focused .mat-button-focus-overlay { - opacity: 0; - } - - .open-in-app.cdk-touch-focused { - background-color: var(--theme-primary-color); - } - .cross-button.mat-button.cdk-program-focused .mat-button-focus-overlay { - opacity: 0; + &:focus-visible { + outline: none; + border-radius: unset; + } } .download-app-container { @@ -44,7 +37,7 @@ aca-open-in-app { padding: 6px 0; } - .mat-button.cross-button { + .cross-button { padding-right: 0; &:focus-visible { @@ -53,7 +46,7 @@ aca-open-in-app { } } - .mat-icon.cross-icon { + .cross-icon { font-weight: bold; font-size: 21px; height: 21px;