forked from NativeScript/nativescript-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into modal-options
* master: exclude files from api ref build NS Angular api ref build script fix(location-strategy): crash on going back with router-outlet after closing modal (NativeScript#1748) release: cut the 7.2.2 release (NativeScript#1742) fix(router): routing services should be provided in forRoot only (NativeScript#1729) fix(list-view): Add support for default item template fix(list-view): add support for "defailtTemplate" docs: cut the 7.2.1 release fix: Router tracing does not work with webpack chore: bump package version to 7.2.1 chore: bump package versino tp 7.3.0 test: Add tests for nested primary outlets fix(location-strategy): extend support for nested primary outlets
- Loading branch information
Showing
36 changed files
with
625 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set -e | ||
|
||
ENV="${ENV:-dev}" | ||
DIST_DIR="nativescript-angular/bin/dist" | ||
APIREF_DIR="$DIST_DIR/ng-api-reference" | ||
rm -rf "$APIREF_DIR" | ||
cd "nativescript-angular" | ||
npm install | ||
npm run typedoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<page-router-outlet></page-router-outlet> | ||
<page-router-outlet tag="rootPRO"></page-router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
e2e/nested-router-tab-view/app/custom-tabs/custom-tabs.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<ActionBar title="Custom Tabs Component" class="action-bar"> | ||
<NavigationButton text="Root Back"></NavigationButton> | ||
|
||
<StackLayout orientation="horizontal"> | ||
<Button horizontalAlignment="left" android:visibility="visible" ios:visibility="collapse" text="Root Back" (tap)="onRootBack()"></Button> | ||
<Label horizontalAlignment="center" text="Custom Tabs Component"></Label> | ||
</StackLayout> | ||
</ActionBar> | ||
|
||
<GridLayout rows="50,*, auto"> | ||
<!-- <Button row="0" text="CanGoBack(ParentRoute)" automationText="CanGoBack(ParentRoute)" col="3" (tap)="canGoBackParentRoute()"></Button> --> | ||
<GridLayout row="1"> | ||
<page-router-outlet tag="customTabsPRO"></page-router-outlet> | ||
</GridLayout> | ||
<GridLayout row="2" columns="*, *"> | ||
<Button col="0" text="Players Tab" [nsRouterLink]="['../tabs/players']"></Button> | ||
<Button col="1" text="Teams Tab" [nsRouterLink]="['../tabs/teams']"></Button> | ||
</GridLayout> | ||
</GridLayout> |
44 changes: 44 additions & 0 deletions
44
e2e/nested-router-tab-view/app/custom-tabs/custom-tabs.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; | ||
import { RouterExtensions } from "nativescript-angular/router"; | ||
import { ActivatedRoute } from "@angular/router"; | ||
import { confirm } from "tns-core-modules/ui/dialogs"; | ||
import { Page } from 'tns-core-modules/ui/page/page'; | ||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'custom-tabs', | ||
templateUrl: './custom-tabs.component.html' | ||
}) | ||
export class CustomTabsComponent implements OnInit { | ||
|
||
constructor( | ||
private activeRoute: ActivatedRoute, | ||
private routerExtension: RouterExtensions, | ||
private page: Page) { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
canGoBackParentRoute() { | ||
const canGoBackParentRoute = this.routerExtension.canGoBack({ relativeTo: this.activeRoute }); | ||
const title = "CanGoBack(ParentRoute)"; | ||
this.onShowDialog(title, title + ` ${canGoBackParentRoute}`); | ||
} | ||
|
||
onRootBack() { | ||
this.page.frame.goBack(); | ||
} | ||
|
||
onShowDialog(title: string, result: string) { | ||
let options: any = { | ||
title: title, | ||
message: result, | ||
okButtonText: "Ok" | ||
} | ||
|
||
confirm(options).then((result: boolean) => { | ||
console.log(result); | ||
}) | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
e2e/nested-router-tab-view/app/custom-tabs/custom-tabs.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { NativeScriptCommonModule } from 'nativescript-angular/common'; | ||
import { NativeScriptRouterModule } from 'nativescript-angular/router'; | ||
|
||
import { CustomTabsComponent } from './custom-tabs.component'; | ||
import { PlayerComponent } from "../player/players.component"; | ||
import { PlayerDetailComponent } from "../player/player-detail.component"; | ||
import { TeamsComponent } from "../team/teams.component"; | ||
import { TeamDetailComponent } from "../team/team-detail.component"; | ||
import { Route } from "@angular/router"; | ||
import { SharedModule } from "../shared.module"; | ||
|
||
const routes: Route[] = [ | ||
{ | ||
path: 'tabs', | ||
component: CustomTabsComponent, | ||
children: [ | ||
{ path: "players", component: PlayerComponent }, | ||
{ path: "player/:id", component: PlayerDetailComponent }, | ||
|
||
{ path: "teams", component: TeamsComponent }, | ||
{ path: "team/:id", component: TeamDetailComponent }, | ||
] | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [CustomTabsComponent | ||
], | ||
imports: [ | ||
NativeScriptCommonModule, | ||
NativeScriptRouterModule, | ||
NativeScriptRouterModule.forChild(routes), | ||
SharedModule | ||
], | ||
schemas: [NO_ERRORS_SCHEMA] | ||
}) | ||
export class CustomTabsModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
e2e/nested-router-tab-view/app/player/player-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
e2e/nested-router-tab-view/app/player/players.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<ActionBar title="Player List" class="action-bar"></ActionBar> | ||
<ActionBar title="Player List" class="action-bar"> | ||
<!-- <NavigationButton visibility="hidden"></NavigationButton> --> | ||
</ActionBar> | ||
|
||
<GridLayout> | ||
<!-- <Button text="Open Named Modal" (tap)="onModalFrame()"></Button> --> | ||
<ListView [items]="items" class="list-group"> | ||
<GridLayout rows="auto,*"> | ||
<ListView row="1" [items]="items" class="list-group"> | ||
<ng-template let-item="item"> | ||
<Label [nsRouterLink]="['../player', item.id]" [text]="item.name" | ||
class="list-group-item"></Label> | ||
<Label [nsRouterLink]="['../player', item.id]" [text]="item.name" class="list-group-item"></Label> | ||
</ng-template> | ||
</ListView> | ||
</GridLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
e2e/nested-router-tab-view/app/team/team-detail.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { AppiumDriver, createDriver } from "nativescript-dev-appium"; | ||
import { Screen } from "./screen" | ||
import { | ||
testPlayerNavigated, | ||
testTeamNavigated, | ||
testPlayerNextNavigated, | ||
testTeamNextNavigated, | ||
} from "./shared.e2e-spec" | ||
|
||
describe("custom-tabs:", () => { | ||
let driver: AppiumDriver; | ||
let screen: Screen; | ||
|
||
before(async () => { | ||
driver = await createDriver(); | ||
screen = new Screen(driver); | ||
}); | ||
|
||
after(async () => { | ||
await driver.quit(); | ||
console.log("Quit driver!"); | ||
}); | ||
|
||
afterEach(async function () { | ||
if (this.currentTest.state === "failed") { | ||
await driver.logTestArtifacts(this.currentTest.title); | ||
} | ||
}); | ||
|
||
it("loaded custom tab component and tabs", async () => { | ||
await screen.navigateCustomTabsPage(); | ||
await screen.loadedCustomTabsPage(); | ||
await screen.loadedPlayersList(); | ||
await gotoTeamsTab(driver); | ||
await screen.loadedTeamList(); | ||
}); | ||
|
||
it("navigate back to login and again to custom tabs", async () => { | ||
await backRoot(driver); | ||
await screen.loadedLogin(); | ||
await screen.navigateCustomTabsPage(); | ||
await screen.loadedCustomTabsPage(); | ||
await screen.loadedPlayersList(); | ||
await gotoTeamsTab(driver); | ||
await screen.loadedTeamList(); | ||
}); | ||
|
||
it("navigate back to login and again to custom tabs", async () => { | ||
await gotoPlayersTab(driver); | ||
await testPlayerNavigated(screen, screen.playerOne); | ||
await gotoTeamsTab(driver); | ||
await screen.loadedTeamList(); | ||
await testTeamNavigated(screen, screen.teamOne); | ||
await backRoot(driver); | ||
await screen.loadedLogin(); | ||
}); | ||
}); | ||
|
||
async function backRoot(driver: AppiumDriver) { | ||
const btnBackRoot = await driver.findElementByAutomationText("Root Back"); | ||
await btnBackRoot.tap(); | ||
} | ||
|
||
async function gotoPlayersTab(driver: AppiumDriver) { | ||
const btnTabTeams = await driver.findElementByAutomationText("Players Tab"); | ||
await btnTabTeams.tap(); | ||
} | ||
|
||
async function gotoTeamsTab(driver: AppiumDriver) { | ||
const btnTabTeams = await driver.findElementByAutomationText("Teams Tab"); | ||
await btnTabTeams.tap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.title { | ||
font-size: 30; | ||
font-size: 15; | ||
margin: 16; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<StackLayout> | ||
<Label text="Welcome to modal"></Label> | ||
<Button text="Close Modal" (tap)="close()"></Button> | ||
</StackLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from '@angular/core'; | ||
import { ModalDialogParams } from "nativescript-angular/modal-dialog"; | ||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'modal', | ||
templateUrl: './modal.component.html' | ||
}) | ||
|
||
export class ModalComponent { | ||
|
||
constructor(private params: ModalDialogParams) { | ||
} | ||
|
||
public close() { | ||
this.params.closeCallback(); | ||
} | ||
|
||
} |
Oops, something went wrong.