Skip to content

Commit

Permalink
Merge pull request #33 from taras-omelchuk/master
Browse files Browse the repository at this point in the history
Updates for Blackberry Dynamics SDK for Cordova  12.0 release
  • Loading branch information
volodymyrtaliar authored Nov 16, 2023
2 parents f8a8ef0 + a90086a commit c130149
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 182 deletions.
14 changes: 8 additions & 6 deletions InAppBrowser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
This sample application demonstrates usage of `cordova.InAppBrowser.open` API of BlackBerry Dynamics Cordova InAppBrowser plugin to securely open helpful articles, videos, and web resources inside of your app without leaving your app.

## Requirements
* Node 12.x.x
* Cordova 11
* Dynamics SDK for Cordova v11.0
* Dynamics SDK for iOS v11.0
* Dynamics SDK for Android v11.0
* Node 18.x.x
* Cordova 11.0, 11.1, 12.0
* Dynamics SDK for Cordova v12.0
* Dynamics SDK for iOS v12.0 or previous releases (v11.1, v11.2)
* Dynamics SDK for Android v12.0 or previous releases (v11.1, v11.2)

## How To Build and Deploy
* Setup your BlackBerry Dynamics environment. See [Getting Started with Blackberry SDK for Cordova](https://docs.blackberry.com/en/development-tools/blackberry-dynamics-sdk-cordova/latest)
* Setup your BlackBerry Dynamics environment. See [Getting Started with Blackberry SDK for Cordova](https://docs.blackberry.com/en/development-tools/blackberry-dynamics-sdk-cordova/)
* Move `InAppBrowser` application to the `SampleApplications` directory of `BlackBerry_Dynamics_SDK_for_Cordova` package
* Open InAppBrowser in Terminal window:
`$ cd <path>/BlackBerry_Dynamics_SDK_for_Cordova_<version>/SampleApplications/InAppBrowser`
* Install the plugin `cordova-plugin-bbd-base`:
`$ cordova plugin add <path>/BlackBerry_Dynamics_SDK_for_Cordova_<version>/plugins/cordova-plugin-bbd-base`
* For iOS:
* `$ cordova platform add ios`
* `$ cordova build ios`
Expand Down
4 changes: 3 additions & 1 deletion InAppBrowser/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2021 BlackBerry Ltd.
Copyright 2023 BlackBerry Ltd.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -31,6 +31,8 @@
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
Expand Down
12 changes: 6 additions & 6 deletions Secure-ICC/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ This sample application is written using the Ionic framework. It demonstrates us
* Secure Storage Management

## Requirements
* Node 14.x.x
* Ionic 6
* Cordova 11.0.0, 11.1.0
* Dynamics SDK for Cordova v11.1
* Dynamics SDK for iOS v11.1, v11.2
* Dynamics SDK for Android v11.1, v11.2
* Node 18.x.x
* Ionic 7
* Cordova 11.0, 11.1, 12.0
* Dynamics SDK for Cordova v12.0
* Dynamics SDK for iOS v12.0 or previous releases (v11.1, v11.2)
* Dynamics SDK for Android v12.0 or previous releases (v11.1, v11.2)

## Author(s)
* [Volodymyr Taliar](mailto:[email protected]), [Taras Brateiko](mailto:[email protected]), [Taras Omelchuk](mailto:[email protected])
Expand Down
9 changes: 5 additions & 4 deletions Secure-ICC/angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
Expand Down Expand Up @@ -160,7 +159,7 @@
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"builder": "@ionic/cordova-builders:cordova-build",
"options": {
"browserTarget": "app:build"
},
Expand All @@ -171,7 +170,7 @@
}
},
"ionic-cordova-serve": {
"builder": "@ionic/angular-toolkit:cordova-serve",
"builder": "@ionic/cordova-builders:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
Expand All @@ -187,7 +186,9 @@
}
},
"cli": {
"defaultCollection": "@ionic/angular-toolkit"
"schematicCollections": [
"@ionic/angular-toolkit"
]
},
"schematics": {
"@ionic/angular-toolkit:component": {
Expand Down
3 changes: 2 additions & 1 deletion Secure-ICC/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="Orientation" value="portrait" />
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
Expand Down Expand Up @@ -80,7 +82,6 @@
</platform>
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^5.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
</widget>
45 changes: 21 additions & 24 deletions Secure-ICC/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@
},
"private": true,
"dependencies": {
"@angular/common": "~13.0.0",
"@angular/core": "~13.0.0",
"@angular/forms": "~13.0.0",
"@angular/platform-browser": "~13.0.0",
"@angular/platform-browser-dynamic": "~13.0.0",
"@angular/router": "~13.0.0",
"@ionic-native/core": "^5.0.7",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^6.0.5",
"rxjs": "~6.6.0",
"@angular/common": "^16.1.2",
"@angular/core": "^16.1.2",
"@angular/forms": "^16.1.2",
"@angular/platform-browser": "^16.1.2",
"@angular/platform-browser-dynamic": "^16.1.2",
"@angular/router": "^16.1.2",
"@ionic/angular": "^7.1.0",
"@ionic/cordova-builders": "^9.0.0",
"rxjs": "^7.8.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4",
"zone.js": "~0.13.1",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-bbd-base": "file:../../plugins/cordova-plugin-bbd-base",
"cordova-plugin-bbd-storage": "file:../../plugins/cordova-plugin-bbd-storage",
Expand All @@ -36,16 +33,16 @@
"cordova-plugin-bbd-mailto": "file:../../plugins/cordova-plugin-bbd-mailto"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.0.1",
"@angular-eslint/builder": "~13.0.1",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@angular/cli": "~13.0.1",
"@angular/compiler": "~13.0.0",
"@angular/compiler-cli": "~13.0.0",
"@angular/language-service": "~13.0.0",
"@ionic/angular-toolkit": "^5.0.0",
"@angular-devkit/build-angular": "^16.1.1",
"@angular-eslint/builder": "^16.0.0",
"@angular-eslint/eslint-plugin": "^16.0.0",
"@angular-eslint/eslint-plugin-template": "^16.0.0",
"@angular-eslint/template-parser": "^16.0.0",
"@angular/cli": "^16.1.1",
"@angular/compiler": "^16.1.2",
"@angular/compiler-cli": "^16.1.2",
"@angular/language-service": "^16.1.2",
"@ionic/angular-toolkit": "^9.0.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
Expand All @@ -65,7 +62,7 @@
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.4.4"
"typescript": "^5.0.2"
},
"cordova": {
"plugins": {
Expand Down
36 changes: 5 additions & 31 deletions Secure-ICC/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,21 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TestBed, async } from '@angular/core/testing';

import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { TestBed } from '@angular/core/testing';

import { AppComponent } from './app.component';

describe('AppComponent', () => {

let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;

beforeEach(async(() => {
statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']);
splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']);
platformReadySpy = Promise.resolve();
platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy });

TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
{ provide: StatusBar, useValue: statusBarSpy },
{ provide: SplashScreen, useValue: splashScreenSpy },
{ provide: Platform, useValue: platformSpy },
],
}).compileComponents();
}));
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it('should initialize the app', async () => {
TestBed.createComponent(AppComponent);
expect(platformSpy.ready).toHaveBeenCalled();
await platformReadySpy;
expect(statusBarSpy.styleDefault).toHaveBeenCalled();
expect(splashScreenSpy.hide).toHaveBeenCalled();
});

// TODO: add more tests!

});
19 changes: 1 addition & 18 deletions Secure-ICC/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
import { Component } from '@angular/core';

import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar
) {
this.initializeApp();
}

initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
constructor() {}
}
11 changes: 2 additions & 9 deletions Secure-ICC/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
bootstrap: [AppComponent]
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
bootstrap: [AppComponent],
})
export class AppModule {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
/*
* Copyright 2022 BlackBerry Ltd.
* Copyright 2023 BlackBerry Ltd.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -23,40 +23,40 @@

<section class="create-file-form">
<h2 class="ion-padding-start">File</h2>
<form

<form
[formGroup]="createFileForm">

<ion-item>
<ion-label>Location:</ion-label>
<ion-input
type="text"
<ion-input
type="text"
label="Location:"
formControlName="fileLocation">
</ion-input>
</ion-item>
<ion-item>
<ion-label>Name:</ion-label>
<ion-input
type="text"
<ion-input
type="text"
label="Name:"
formControlName="fileName">
</ion-input>
</ion-item>
<ion-item>
<ion-textarea
<ion-textarea
placeholder="Enter text..."
rows="4"
rows="4"
formControlName="fileText">
</ion-textarea>
</ion-item>

<div class="buttons-row">
<div class="col-45">
<ion-button
shape="round"
<ion-button
shape="round"
color="primary"
expand="full"
shape="round"
fill="outline"
shape="round"
fill="outline"
(click)="onReset(createFileForm)">
Reset
</ion-button>
Expand All @@ -72,7 +72,7 @@ <h2 class="ion-padding-start">File</h2>
</ion-button>
</div>
</div>

</form>

</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 BlackBerry Ltd.
* Copyright 2023 BlackBerry Ltd.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -20,7 +20,7 @@
*/

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';

@Component({
selector: 'app-create-file-form',
Expand All @@ -32,11 +32,11 @@ export class CreateFileFormComponent implements OnInit {
@Output() submitForm = new EventEmitter();

constructor(
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) { }
FILE_NAME = 'testfilename';
FILE_TEXT = 'Test data for creating new text attachment in secure storage.';
createFileForm: FormGroup;
createFileForm: UntypedFormGroup;
fileLocation = {
value: '/',
disabled: false
Expand Down
Loading

0 comments on commit c130149

Please sign in to comment.