Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to use pathRouting with angular-cli #288

Merged
merged 48 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ec5f47c
tets
pekura Aug 6, 2018
1f7802a
Revert "tets"
pekura Aug 6, 2018
830407f
Merge remote-tracking branch 'upstream/master'
pekura Aug 8, 2018
7e110fa
Merge remote-tracking branch 'upstream/master'
pekura Aug 23, 2018
d600374
Merge remote-tracking branch 'upstream/master'
pekura Sep 11, 2018
e530f6d
Merge remote-tracking branch 'upstream/master'
pekura Oct 8, 2018
66776e8
Merge remote-tracking branch 'upstream/master'
pekura Oct 17, 2018
d4d3412
Merge remote-tracking branch 'upstream/master'
pekura Oct 17, 2018
fbc2301
Merge remote-tracking branch 'upstream/master'
pekura Oct 23, 2018
446bac3
Merge remote-tracking branch 'upstream/master'
pekura Oct 26, 2018
b589a3d
Merge remote-tracking branch 'upstream/master'
pekura Oct 31, 2018
ab1cc3f
Merge remote-tracking branch 'upstream/master'
pekura Nov 6, 2018
47d28b6
Merge remote-tracking branch 'upstream/master'
pekura Nov 12, 2018
aedd8da
Merge remote-tracking branch 'upstream/master'
pekura Nov 21, 2018
3cf4917
tets
maxmarkus Oct 15, 2018
8abd146
Merge remote-tracking branch 'upstream/master'
maxmarkus Nov 26, 2018
2ea8f6b
Merge remote-tracking branch 'upstream/master'
pekura Nov 26, 2018
996844a
Luigi client creates extra entry in browser navigation history - fix.
pekura Nov 26, 2018
a6b091c
Merge remote-tracking branch 'upstream/master'
maxmarkus Nov 27, 2018
a1f7843
Merge branch 'master' into Luigi-client-creates-extra-entry-in-browse…
maxmarkus Nov 27, 2018
12d000d
Merge branch 'master' into Luigi-client-creates-extra-entry-in-browse…
kwiatekus Nov 28, 2018
057c7ee
Merge remote-tracking branch 'upstream/master'
pekura Nov 28, 2018
dd539e6
Merge remote-tracking branch 'upstream/master'
maxmarkus Nov 28, 2018
40c4a48
Merge remote-tracking branch 'upstream/master'
pekura Nov 28, 2018
bc3ffbe
Merge remote-tracking branch 'upstream/master'
pekura Nov 28, 2018
18e1ba6
Merge remote-tracking branch 'upstream/master'
maxmarkus Nov 29, 2018
d7b0cee
Merge remote-tracking branch 'upstream/master'
pekura Dec 4, 2018
4d92318
Merge branch 'master' into Luigi-client-creates-extra-entry-in-browse…
pekura Dec 4, 2018
7bf4fb3
hash navigation in FF fix
pekura Dec 4, 2018
9aa3241
context switcher on blur FF fix
pekura Dec 4, 2018
6a31016
do not show three dot menu on narrow screens if there is no displayab…
pekura Dec 4, 2018
2d3bd78
top nav links from the three dots menu did not work properly - fix
pekura Dec 4, 2018
92988f2
- fix content rendering in edge browser
pekura Dec 4, 2018
c33e2fc
Merge branch 'master' into Luigi-client-creates-extra-entry-in-browse…
pekura Dec 4, 2018
102e434
Merge remote-tracking branch 'upstream/master'
maxmarkus Dec 4, 2018
3e78486
Merge branch 'Luigi-client-creates-extra-entry-in-browser-navigation-…
maxmarkus Dec 5, 2018
f0ad156
Merge remote-tracking branch 'upstream/master'
maxmarkus Dec 5, 2018
6f32df2
Merge remote-tracking branch 'upstream/master'
maxmarkus Dec 7, 2018
c502d65
typo in doc
maxmarkus Dec 7, 2018
56fc04f
added @angular-builders to support webpack extension in angular-cli. …
maxmarkus Dec 10, 2018
cfa6454
removed obsolete webpack config and refactored e2e tests to work with…
maxmarkus Dec 10, 2018
d30619c
removed obsolete webpack scripts
maxmarkus Dec 11, 2018
d0706c5
Merge remote-tracking branch 'upstream/master' into refactor-webpack-…
maxmarkus Dec 11, 2018
6140a25
fix for non-redirect issue for path routing and logo + title click
maxmarkus Dec 12, 2018
5bb4ba8
fix for path routing e2e test
maxmarkus Dec 12, 2018
2127ef3
update package lock
maxmarkus Dec 12, 2018
8db1893
renamed inline doc
maxmarkus Dec 12, 2018
7e4e61b
Merge branch 'master' into refactor-webpack-config
jesusreal Dec 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions core/examples/luigi-sample-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ To have this application running, follow these steps:

You can use hash-based routing or path-based routing in your application:

- To run Luigi with hash-based routing, change the **routing.useHashrouting** configuration to `true` and run the following command:
- To run Luigi with hash-based routing, set the **routing.useHashrouting** configuration to `true`.
- To run Luigi with path-based routing, set the **routing.useHashrouting** configuration to `false`.

Run the server with the following command:
```bash
npm run start
```

- To run Luigi with path-based routing, change the **routing.useHashrouting** configuration to `false` and run the following command:
```bash
npm run startWebpack
```

5. Go to [http://localhost:4200/](http://localhost:4200/) to start the application.

6. Optional: Reflect the changes introducted to the Luigi Core code in the sample application.
Expand All @@ -68,11 +66,6 @@ Run the sample application to perform the tests. When the application is ready:
<!-- ## Run server
* Using Angular CLI (standard): `npm run start`

> If you want to enable path routing instead of hash, run the app without Angular CLI.

* Without Angular CLI: `npm run startWebpack`


## Use OpenID Connect

For running OpenID Connect (OIDC) locally, for example with DEX, follow these steps:
Expand Down
7 changes: 5 additions & 2 deletions core/examples/luigi-sample-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack-extra.config.js"
},
"outputPath": "dist",
"index": "src/sampleapp.html",
"main": "src/main.ts",
Expand Down Expand Up @@ -73,7 +76,7 @@
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular-builders/dev-server:generic",
"options": {
"browserTarget": "luigisample:build"
},
Expand Down
4 changes: 2 additions & 2 deletions core/examples/luigi-sample-angular/e2e/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Cypress.Commands.add('login', (email, password) => {
cy.get('#login-button').click();
cy.get('.fd-shellbar').contains('Overview');
cy.location().should(loc => {
expect(loc.hash).to.eq('#/overview');
expect(loc.pathname).to.eq('/overview');
});
});

Expand All @@ -23,7 +23,7 @@ Cypress.Commands.add('goToFeaturesPage', iframe => {
.contains('linkManager()')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2');
expect(loc.pathname).to.eq('/projects/pr2');
});
cy.wrap(iframe).should('contain', 'LuigiClient uxManager methods:');
cy.wrap(iframe).should('contain', 'LuigiClient linkManager methods:');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Context switcher', () => {
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/create-environment');
expect(loc.pathname).to.eq('/create-environment');
});

// default label
Expand All @@ -30,7 +30,7 @@ describe('Context switcher', () => {
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/environments/env1');
expect(loc.pathname).to.eq('/environments/env1');
});

// check label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Luigi client features', () => {
.contains('absolute: to overview')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/overview');
expect(loc.pathname).to.eq('/overview');
});
cy.goToFeaturesPage($iframeBody);

Expand All @@ -26,7 +26,7 @@ describe('Luigi client features', () => {
.contains('relative: to stakeholders')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/users/groups/stakeholders');
expect(loc.pathname).to.eq('/projects/pr2/users/groups/stakeholders');
});
cy.goToOverviewPage();
cy.goToFeaturesPage($iframeBody);
Expand All @@ -36,7 +36,7 @@ describe('Luigi client features', () => {
.contains('closest parent: to stakeholders')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/users/groups/stakeholders');
expect(loc.pathname).to.eq('/projects/pr2/users/groups/stakeholders');
});
cy.goToOverviewPage();
cy.goToFeaturesPage($iframeBody);
Expand All @@ -46,14 +46,14 @@ describe('Luigi client features', () => {
.contains('parent by name: project to settings')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/settings');
expect(loc.pathname).to.eq('/projects/pr2/settings');
});
cy.wrap($iframeBody).should('contain', 'Settings');
cy.wrap($iframeBody)
.contains('Click here')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2');
expect(loc.pathname).to.eq('/projects/pr2');
});

//navigate with params
Expand All @@ -63,29 +63,30 @@ describe('Luigi client features', () => {
cy.wrap($iframeBody).should('contain', 'Called with params:');
cy.wrap($iframeBody).should('contain', '"foo": "bar"');
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/settings?~foo=bar&');
expect(loc.pathname).to.eq('/projects/pr2/settings');
expect(loc.search).to.eq('?~foo=bar&');
});
cy.wrap($iframeBody)
.contains('Click here')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2');
expect(loc.pathname).to.eq('/projects/pr2');
});

//don't navigate
cy.wrap($iframeBody)
.contains('parent by name: with nonexisting context')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2');
expect(loc.pathname).to.eq('/projects/pr2');
});

//navigate with preserve view functionality
cy.wrap($iframeBody)
.contains('with preserved view: project to global settings and back')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/settings');
expect(loc.pathname).to.eq('/settings');
});

//wait for the second iFrame to be loaded
Expand All @@ -104,7 +105,7 @@ describe('Luigi client features', () => {
.find('button')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2');
expect(loc.pathname).to.eq('/projects/pr2');
});
});

Expand Down Expand Up @@ -153,7 +154,7 @@ describe('Luigi client features', () => {
.contains('Partly wrong link')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/miscellaneous2');
expect(loc.pathname).to.eq('/projects/pr2/miscellaneous2');
});
cy.get('.fd-alert').contains(
'Could not map the exact target node for the requested route projects/pr2/miscellaneous2/maskopatol'
Expand All @@ -165,7 +166,7 @@ describe('Luigi client features', () => {
.contains('Totally wrong link')
.click();
cy.location().should(loc => {
expect(loc.hash).to.eq('#/overview');
expect(loc.pathname).to.eq('/overview');
});
cy.get('.fd-alert').contains(
'Could not find the requested route maskopatol/has/a/child'
Expand Down
19 changes: 10 additions & 9 deletions core/examples/luigi-sample-angular/e2e/tests/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Navigation', () => {

//project one page
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr1');
expect(loc.pathname).to.eq('/projects/pr1');
});
cy.get('.fd-app__sidebar').should('not.contain', 'Project One');
cy.get('.fd-app__sidebar').should('contain', 'Miscellaneous2');
Expand All @@ -29,7 +29,7 @@ describe('Navigation', () => {

//default child node example
cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr1/dps/dps2');
expect(loc.pathname).to.eq('/projects/pr1/dps/dps2');
});
cy.get('.fd-app__sidebar').should('contain', 'First Child');
cy.get('.fd-app__sidebar').should('contain', 'Second Child');
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('Navigation', () => {
});

cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr1/avengers/thor');
expect(loc.pathname).to.eq('/projects/pr1/avengers/thor');
});

cy.get('.fd-app__sidebar').should('contain', 'Keep Selected Example');
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('Navigation', () => {
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/settings');
expect(loc.pathname).to.eq('/settings');
});

//go to relative path from the parent node
Expand All @@ -114,7 +114,7 @@ describe('Navigation', () => {
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/dps/dps1');
expect(loc.pathname).to.eq('/projects/pr2/dps/dps1');
});

//go to relative path from node that is a sibiling
Expand All @@ -124,19 +124,20 @@ describe('Navigation', () => {
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/avengers');
expect(loc.pathname).to.eq('/projects/pr2/avengers');
});

cy.get('.fd-app__sidebar .fd-side-nav__item')
.contains('Go to relative path')
.click();

cy.location().should(loc => {
expect(loc.hash).to.eq('#/projects/pr2/dps/dps1');
expect(loc.pathname).to.eq('/projects/pr2/dps/dps1');
});
});
it('should hide left Nav', () => {
cy.visit('/#/projects/pr1/hideSideNav');

it('Left navigation hidden', () => {
cy.visit('http://localhost:4200/projects/pr1/hideSideNav');
cy.get('.no-side-nav').should('exist');
cy.get('.fd-app__sidebar').should('not.be.visible');
});
Expand Down
Loading