Skip to content

Commit 851ba1d

Browse files
Merge pull request #1619 from NativeScript/prepare-701
2 parents d049409 + 7f668e0 commit 851ba1d

File tree

55 files changed

+839
-430
lines changed

Some content is hidden

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

55 files changed

+839
-430
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ env:
33
- NODE_VERSION=8
44
- EMULATOR_API_LEVEL=23
55
- ANDROID_VERSION=28
6-
- ANDROID_BUILD_TOOLS_VERSION=28.0.2
6+
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
77
- ANDROID_ABI=armeabi-v7a
88
- EMULATOR_NAME=test
99
- ANDROID_TAG=google_apis

Diff for: CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
<a name="7.0.1"></a>
2+
## [7.0.1](https://github.com/NativeScript/nativescript-angular/compare/7.0.0...7.0.1) (2018-11-20)
3+
4+
5+
### Bug Fixes
6+
7+
* crash in deactivate page router outlet ([#1590](https://github.com/NativeScript/nativescript-angular/issues/1590)) ([f8c7468](https://github.com/NativeScript/nativescript-angular/commit/f8c7468))
8+
* **dialogs:** unable to reopen shared modal view when tab as root ([199c245](https://github.com/NativeScript/nativescript-angular/commit/199c245))
9+
* **location-strategy:** crash when going back on nested named lazy loaded module ([#1618](https://github.com/NativeScript/nativescript-angular/issues/1618)) ([d9ffb83](https://github.com/NativeScript/nativescript-angular/commit/d9ffb83))
10+
11+
12+
113
<a name="7.0.0"></a>
214
# [7.0.0](https://github.com/NativeScript/nativescript-angular/compare/6.2.0...7.0.0) (2018-11-12)
315

Diff for: e2e/modal-navigation-ng/app/app.android.css

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Button{
2+
font-size: 8;
3+
margin: 0px;
4+
padding: 0px;
5+
height: 40;
6+
}
7+
8+
TextView {
9+
font-size: 10;
10+
margin: 0px;
11+
padding: 0px;
12+
}

Diff for: e2e/modal-navigation-ng/app/app.component.ts

+38-15
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,47 @@ import { NSLocationStrategy } from "nativescript-angular/router/ns-location-stra
44

55
import { ViewContainerRefService } from "./shared/ViewContainerRefService";
66

7+
import { AppModule } from "./app.module";
8+
import { ModalDialogOptions, ModalDialogService } from "nativescript-angular";
9+
import { ModalViewComponent } from "./modal-shared/modal-view.component";
10+
711
@Component({
8-
selector: "ns-app",
9-
templateUrl: "app.component.html",
12+
selector: "ns-app",
13+
templateUrl: "app.component.html"
1014
})
11-
1215
export class AppComponent {
13-
constructor(
14-
router: Router,
15-
location: NSLocationStrategy,
16-
private _vcRef: ViewContainerRef,
17-
private _viewContainerRefService: ViewContainerRefService) {
18-
router.events.subscribe(e => {
19-
if (e instanceof NavigationEnd) {
20-
console.log("[ROUTER]: " + e.toString());
21-
console.log(location.toString());
22-
}
23-
});
16+
constructor(
17+
router: Router,
18+
location: NSLocationStrategy,
19+
private modal: ModalDialogService,
20+
private _vcRef: ViewContainerRef,
21+
private _viewContainerRefService: ViewContainerRefService) {
22+
router.events.subscribe(e => {
23+
if (e instanceof NavigationEnd) {
24+
console.log("[ROUTER]: " + e.toString());
25+
console.log(location.toString());
26+
}
27+
});
28+
29+
this._viewContainerRefService.root = this._vcRef;
30+
}
2431

25-
this._viewContainerRefService.root = this._vcRef;
32+
ngOnInit() {
33+
if (AppModule.root === "page-router-modal") {
34+
this.onRootModalTap();
35+
console.log("Page modal page from frame root");
2636
}
37+
}
38+
39+
onRootModalTap(): void {
40+
const options: ModalDialogOptions = {
41+
viewContainerRef: this._viewContainerRefService.root,
42+
context: {},
43+
fullscreen: true
44+
};
45+
46+
this.modal.showModal(ModalViewComponent, options).then((result: string) => {
47+
console.log(result);
48+
});
49+
}
2750
}

Diff for: e2e/modal-navigation-ng/app/app.css

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ In many cases you may want to use the NativeScript core theme instead
99
of writing your own CSS rules. For a full list of class names in the theme
1010
refer to http://docs.nativescript.org/ui/theme.
1111
*/
12-
@import '~nativescript-theme-core/css/core.light.css';
1312
Button {
1413
font-size: 10px;
15-
}
14+
}

Diff for: e2e/modal-navigation-ng/app/app.ios.css

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#home-page {
2+
font-size: 10;
3+
margin: 0px;
4+
padding: 0px;
5+
}
6+
#home-page Button {
7+
margin-bottom: 20px;
8+
padding: 20px;
9+
border-color: gray;
10+
border-width: 2px;
11+
border-radius: 8px;
12+
}

Diff for: e2e/modal-navigation-ng/app/app.module.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { TabComponent } from "./tab.component";
77
import { LayoutComponent } from "./layout.component";
88

99
import { HomeComponent } from "./home/home.component";
10+
import { RootSectionComponent } from "./navigation/root.section.component";
11+
import { BasicsNavigationComponent } from "./navigation/basic.navigation.component";
1012
import { SecondComponent } from "./second/second.component";
1113
import { ModalSecondComponent } from "./modal-second/modal-second.component";
1214
import { ModalComponent } from "./modal/modal.component";
@@ -44,6 +46,8 @@ traceEnable();
4446
NamedRouterComponent,
4547
TabComponent,
4648
LayoutComponent,
49+
RootSectionComponent,
50+
BasicsNavigationComponent,
4751
HomeComponent,
4852
SecondComponent,
4953
ModalComponent,
@@ -78,9 +82,13 @@ export class AppModule {
7882
static bootstrapRootComponent() {
7983
const options = {
8084
'page-router': AppComponent,
85+
'page-router-modal': AppComponent,
8186
'named-page-router': NamedRouterComponent,
87+
'named-page-router-modal': NamedRouterComponent,
8288
'tab': TabComponent,
83-
'layout': LayoutComponent
89+
'tab-modal': TabComponent,
90+
'layout': LayoutComponent,
91+
'layout-modal': LayoutComponent,
8492
};
8593

8694
const component = options[AppModule.root];

Diff for: e2e/modal-navigation-ng/app/app.routing.ts

+17-6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ const routesTab: Routes = [
102102
path: "modal-second", component: ModalSecondComponent
103103
}
104104
]
105+
},
106+
{
107+
path: "modal-shared", component: ModalViewContentComponent, outlet: "modalOutlet"
108+
},
109+
{
110+
path: "modal-shared-second-host", component: ModalSharedSecondComponent
105111
}
106112
];
107113

@@ -110,23 +116,28 @@ const routesLayout: Routes = [
110116
path: "modal", component: ModalComponent, children: [
111117
{ path: "nested-frame-modal", component: NestedModalComponent }]
112118
},
113-
{ path: "modal-second", component: ModalSecondComponent }
119+
{ path: "modal-second", component: ModalSecondComponent },
120+
{
121+
path: "modal-shared", component: ModalViewContentComponent, outlet: "modalOutlet"
122+
},
123+
{
124+
path: "modal-shared-second-host", component: ModalSharedSecondComponent
125+
}
114126
]
115127

116-
117128
@NgModule({
118129
imports: [NativeScriptRouterModule.forRoot(routes)],
119130
exports: [NativeScriptRouterModule]
120131
})
121132
export class AppRoutingModule {
122133
constructor(private router: Router) {
123-
if (AppModule.root === "page-router") {
134+
if (AppModule.root === "page-router" || AppModule.root === "page-router-modal") {
124135
this.router.resetConfig(routes);
125-
} else if (AppModule.root === "layout") {
136+
} else if (AppModule.root === "layout" || AppModule.root === "layout-modal") {
126137
this.router.resetConfig(routesLayout);
127-
} else if (AppModule.root === "named-page-router") {
138+
} else if (AppModule.root === "named-page-router" || AppModule.root === "named-page-router-modal") {
128139
this.router.resetConfig(namedOutletRoutes);
129-
} else {
140+
} else if(AppModule.root === "tab" || AppModule.root === "tab-modal"){
130141
this.router.resetConfig(routesTab);
131142
}
132143
}

Diff for: e2e/modal-navigation-ng/app/home/home.component.html

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
<ActionBar class="action-bar">
2-
<Label class="action-bar-title" text="Home Component" automationText="Home Component" ></Label>
1+
<ActionBar >
2+
<Label text="Home Component" automationText="Home Component"></Label>
33
</ActionBar>
44

5-
<WrapLayout>
6-
<Button text="Show Modal Without Frame" (tap)="onModalNoFrame()"></Button>
7-
<Button text="Show Modal Page With Frame" (tap)="onModalFrame()"></Button>
8-
<Button text="Navigate To Second Page" (tap)="onNavigateSecond()"></Button>
9-
<Button text="Reset Named Frame Root View" (tap)="onNamedFrameRootViewReset()"></Button>
10-
<Button text="Reset Frame Root View" (tap)="onFrameRootViewReset()"></Button>
11-
<Button text="Reset Tab Root View" (tap)="onTabRootViewReset()"></Button>
12-
<Button text="Reset Layout Root View" automationText="Reset Layout Root View" (tap)="onLayoutRootViewReset()"></Button>
13-
<Button text="Show Dialog" (tap)="onShowDialog()"></Button>
14-
15-
<Button text="show shared modal" (tap)="onRootModalTap()"></Button>
16-
<Button text="go to second (to open shared modal)" [nsRouterLink]="['/modal-shared-second-host']"></Button>
17-
</WrapLayout>
5+
<GridLayout rows="auto, auto" columns="auto, *" >
6+
<root-section row="0" col="0" ></root-section>
7+
<StackLayout id="home-page" row="0" col="1" borderColor="blue" borderWidth="1" borderRadius="5" marginLeft="2"
8+
padding="2">
9+
<basic-nav></basic-nav>
10+
<Button text="Navigate To Second Page" (tap)="onNavigateSecond()" textAlignment="left"></Button>
11+
<Button text="Navigate To Second Page Named Outlet" (tap)="onNavigateSecondWithOutlet()" textAlignment="left"></Button>
12+
<Button text="Go To Second (to open shared modal)" [nsRouterLink]="['/modal-shared-second-host']" textAlignment="left"></Button>
13+
</StackLayout>
14+
</GridLayout>

Diff for: e2e/modal-navigation-ng/app/home/home.component.ts

+16-87
Original file line numberDiff line numberDiff line change
@@ -12,93 +12,22 @@ import { confirm } from "tns-core-modules/ui/dialogs";
1212
import { AppModule } from "../app.module";
1313

1414
@Component({
15-
moduleId: module.id,
16-
selector: "home-page",
17-
templateUrl: "./home.component.html"
15+
moduleId: module.id,
16+
selector: "home-page",
17+
templateUrl: "./home.component.html"
1818
})
1919
export class HomeComponent {
20-
constructor(
21-
private modal: ModalDialogService,
22-
private vcRef: ViewContainerRef,
23-
private viewContainerRefService: ViewContainerRefService,
24-
private routerExtension: RouterExtensions) { }
25-
26-
onModalNoFrame() {
27-
const options: ModalDialogOptions = {
28-
context: {
29-
navigationVisibility: false
30-
},
31-
fullscreen: true,
32-
viewContainerRef: this.vcRef
33-
};
34-
35-
this.modal.showModal(ModalComponent, options).then((res: string) => {
36-
console.log("moda-no-frame closed");
37-
});
38-
}
39-
40-
onModalFrame() {
41-
const options: ModalDialogOptions = {
42-
context: {
43-
navigationVisibility: true,
44-
modalRoute: "modal"
45-
},
46-
fullscreen: true,
47-
viewContainerRef: this.vcRef
48-
};
49-
50-
this.modal.showModal(ModalRouterComponent, options).then((res: string) => {
51-
console.log("moda-frame closed");
52-
});
53-
}
54-
55-
onNavigateSecond() {
56-
this.routerExtension.navigate(["second"]);
57-
}
58-
59-
onFrameRootViewReset() {
60-
AppModule.root = "page-router";
61-
AppModule.platformRef._livesync();
62-
}
63-
64-
onNamedFrameRootViewReset() {
65-
AppModule.root = "named-page-router";
66-
AppModule.platformRef._livesync();
67-
}
68-
69-
onTabRootViewReset() {
70-
AppModule.root = "tab";
71-
AppModule.platformRef._livesync();
72-
}
73-
74-
onLayoutRootViewReset() {
75-
AppModule.root = "layout";
76-
AppModule.platformRef._livesync();
77-
}
78-
79-
onRootModalTap(): void {
80-
const options: ModalDialogOptions = {
81-
viewContainerRef: this.viewContainerRefService.root,
82-
context: {},
83-
fullscreen: true
84-
};
85-
86-
this.modal.showModal(ModalViewComponent, options)
87-
.then((result: string) => {
88-
console.log(result);
89-
});
90-
}
91-
92-
onShowDialog() {
93-
let options = {
94-
title: "Dialog",
95-
message: "Message",
96-
okButtonText: "Yes",
97-
cancelButtonText: "No"
98-
}
99-
100-
confirm(options).then((result: boolean) => {
101-
console.log(result);
102-
})
103-
}
20+
constructor(
21+
private modal: ModalDialogService,
22+
private vcRef: ViewContainerRef,
23+
private viewContainerRefService: ViewContainerRefService,
24+
private routerExtension: RouterExtensions) { }
25+
26+
onNavigateSecond() {
27+
this.routerExtension.navigate(["second"]);
28+
}
29+
30+
onNavigateSecondWithOutlet() {
31+
this.routerExtension.navigate([ { outlets: { namedRouter:["second"] } }]);
32+
}
10433
}

Diff for: e2e/modal-navigation-ng/app/layout.component.html

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<WrapLayout>
2-
<Label text="Home Component" horizontalAlignment="center"></Label>
3-
<Button text="Show Modal Without Frame" (tap)="onModalNoFrame()"></Button>
4-
<Button text="Show Modal Page With Frame" (tap)="onModalFrame()"></Button>
5-
<Button text="Reset Named Frame Root View" (tap)="onNamedFrameRootViewReset()"></Button>
6-
<Button text="Reset Frame Root View" (tap)="onFrameRootViewReset()"></Button>
7-
<Button text="Reset Tab Root View" (tap)="onTabRootViewReset()"></Button>
8-
<Button text="Reset Layout Root View" (tap)="onLayoutRootViewReset()"></Button>
9-
<Button text="Show Dialog" (tap)="onShowDialog()"></Button>
10-
</WrapLayout>
1+
<GridLayout columns="auto, *" automationText="Home Component" >
2+
<root-section></root-section>
3+
<basic-nav col="1" ></basic-nav>
4+
</GridLayout>

0 commit comments

Comments
 (0)