Skip to content

Commit 46a0dc0

Browse files
ADjenkovSvetoslavTsenov
authored andcommitted
feat: enable nesting named page router outlets (#1556)
1 parent f5dd37c commit 46a0dc0

File tree

136 files changed

+3191
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3191
-440
lines changed

e2e/modal-navigation-ng/app/modal-second/modal-second.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
</ActionBar>
55

66
<GridLayout #rootLayout rows="auto, auto" (loaded)="onLoaded($event)">
7-
<Button text="Go Back" (tap)="goBack()"></Button>
7+
<Button text="Go Back(activatedRoute)" (tap)="goBack()"></Button>
88
<Button row="1" text="Close Modal" (tap)="close(rootLayout)"></Button>
99
</GridLayout>

e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component } from "@angular/core";
2-
import { View, EventData } from "tns-core-modules/ui/core/view"
2+
import { View } from "tns-core-modules/ui/core/view"
3+
import { ActivatedRoute } from "@angular/router";
34
import { RouterExtensions } from "nativescript-angular/router";
45

56
@Component({
@@ -8,14 +9,14 @@ import { RouterExtensions } from "nativescript-angular/router";
89
templateUrl: "./modal-second.component.html"
910
})
1011
export class ModalSecondComponent {
11-
constructor(private routerExtension: RouterExtensions) { }
12+
constructor(private routerExtension: RouterExtensions, private activeRoute: ActivatedRoute) { }
1213

13-
onLoaded(args: EventData) {
14+
onLoaded() {
1415
console.log("modal-second loaded");
1516
}
1617

1718
goBack() {
18-
this.routerExtension.back();
19+
this.routerExtension.back({ relativeTo: this.activeRoute });
1920
}
2021

2122
close(layoutRoot: View) {

e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ describe("modal-frame:", () => {
3333

3434
afterEach(async function () {
3535
if (this.currentTest.state === "failed") {
36-
await driver.logPageSource(this.currentTest.title);
37-
await driver.logScreenshot(this.currentTest.title);
36+
await driver.logTestArtifacts(this.currentTest.title);
3837
await driver.resetApp();
3938
await screen[root]();
4039
}

e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ describe("modal-layout:", () => {
3333

3434
afterEach(async function () {
3535
if (this.currentTest.state === "failed") {
36-
await driver.logPageSource(this.currentTest.title);
37-
await driver.logScreenshot(this.currentTest.title);
36+
await driver.logTestArtifacts(this.currentTest.title);
3837
await driver.resetApp();
3938
await screen[root]();
4039
}

e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ describe("Shared modal from home and back", () => {
1818

1919
afterEach(async function () {
2020
if (this.currentTest.state === "failed") {
21-
await driver.logPageSource(this.currentTest.title);
22-
await driver.logScreenshot(this.currentTest.title);
21+
await driver.logTestArtifacts(this.currentTest.title);
2322
}
2423
});
2524

e2e/modal-navigation-ng/e2e/screen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const confirmDialog = "Yes";
2727
const confirmDialogMessage = "Message";
2828
const closeModalNested = "Close Modal Nested";
2929
const closeModal = "Close Modal";
30-
const goBack = "Go Back";
30+
const goBack = "Go Back(activatedRoute)";
3131

3232
export class Screen {
3333

e2e/modal-navigation-ng/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"webpack": "~4.6.0",
5858
"webpack-bundle-analyzer": "~2.13.0",
5959
"webpack-cli": "~2.1.3",
60-
"webpack-sources": "~1.1.0"
60+
"webpack-sources": "~1.1.0",
61+
"@angular-devkit/core": "~0.7.0-beta.1"
6162
},
6263
"scripts": {
6364
"e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.vscode
2+
3+
platforms
4+
node_modules
5+
hooks
6+
7+
/**/*.js
8+
/**/*.map
9+
e2e/reports
10+
test-results.xml
11+
12+
instrumentscli*.trace
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme">
27+
28+
<activity
29+
android:name="com.tns.NativeScriptActivity"
30+
android:label="@string/title_activity_kimera"
31+
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:theme="@style/LaunchScreenTheme">
33+
34+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
35+
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.LAUNCHER" />
39+
</intent-filter>
40+
</activity>
41+
<activity android:name="com.tns.ErrorReportActivity"/>
42+
</application>
43+
</manifest>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Add your native dependencies here:
2+
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// compile 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
android {
9+
defaultConfig {
10+
generatedDensities = []
11+
applicationId = "org.nativescript.nestedroutertabview"
12+
}
13+
aaptOptions {
14+
additionalParameters "--no-version-vectors"
15+
}
16+
}

0 commit comments

Comments
 (0)