[MOBILEAPPS-1654] Open in App pop-up implementation in android and iphone (#2889)

* Open in App pop up implementation

* review comments addressed

* unit test cases added for open-in-app component and aca-mobile-app-switcher-service and review comments addressed

* cspell changes

* test case build failing issue resolved

* review comments addressed of using specific type and void in functions that do not return anything

* remaining review comments fixed for type cases

* added check for ipad and ipod

* checkForIOSDevice function removed and checked for ios device in same line

* spacing issues addressed

* missing unit tests added and some review comments addressed

* app.config.json file updated

* removed configuration variables from default Readme file

* used only boolean instead of string conversion in app service file

* session storage name change

* review comments addressed
This commit is contained in:
Jatin Chugh
2023-02-10 13:43:24 +05:30
committed by GitHub
parent 6b72ef5b52
commit c10a1370a4
14 changed files with 360 additions and 6 deletions

View File

@@ -0,0 +1,54 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* 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
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
export interface OpenInAppDialogOptions {
redirectUrl: string;
}
@Component({
selector: 'aca-open-in-app',
templateUrl: './open-in-app.component.html',
styleUrls: ['./open-in-app.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class OpenInAppComponent {
private redirectUrl: string;
public window: Window & typeof globalThis = window;
constructor(
@Inject(MAT_DIALOG_DATA)
public data: OpenInAppDialogOptions
) {
if (data) {
this.redirectUrl = data.redirectUrl;
}
}
openInApp(): void {
this.window.location.href = this.redirectUrl;
}
}