diff --git a/core/examples/luigi-sample-angular/e2e/tests/navigation.spec.js b/core/examples/luigi-sample-angular/e2e/tests/navigation.spec.js index 61851083eb..69ffecc7b0 100644 --- a/core/examples/luigi-sample-angular/e2e/tests/navigation.spec.js +++ b/core/examples/luigi-sample-angular/e2e/tests/navigation.spec.js @@ -49,6 +49,16 @@ describe('Navigation', () => { .should('exist'); }); + it('Anonymous content', () => { + cy.get('.fd-shellbar') + .contains('Visible for all users') + .should('exist'); + + cy.get('.fd-shellbar') + .contains('Visible for anonymous users only') + .should('not.exist'); + }); + describe('features', () => { it('keepSelectedForChildren', () => { // keep selected for children example diff --git a/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.css b/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.html b/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.html new file mode 100644 index 0000000000..2daebdbb05 --- /dev/null +++ b/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.html @@ -0,0 +1,13 @@ +
+
+

Anonymous content

+
+
+
+ This page is visible only for users that are not logged in. +
+
+ This page is visible for all users, also those that are not logged in. +
+
+
\ No newline at end of file diff --git a/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.ts b/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.ts new file mode 100644 index 0000000000..a304ff5c7a --- /dev/null +++ b/core/examples/luigi-sample-angular/src/app/anonymous/anonymous.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'app-anonymous', + templateUrl: './anonymous.component.html', + styleUrls: ['./anonymous.component.css'] +}) +export class AnonymousComponent implements OnInit { + exclusive: false; + + constructor(private route: ActivatedRoute) { + this.route.queryParams.subscribe( + params => { + this.exclusive = params.exclusive; + }, + err => {} + ); + } + + ngOnInit() {} +} diff --git a/core/examples/luigi-sample-angular/src/app/app-routing.module.ts b/core/examples/luigi-sample-angular/src/app/app-routing.module.ts index 75e73c5e63..bfe861c67b 100644 --- a/core/examples/luigi-sample-angular/src/app/app-routing.module.ts +++ b/core/examples/luigi-sample-angular/src/app/app-routing.module.ts @@ -16,11 +16,13 @@ import { OverviewComponent } from './overview/overview.component'; import { RestrictedComponent } from './restricted/restricted.component'; import { DynamicComponent } from './project/dynamic/dynamic.component'; import { HideSideNavComponent } from './project/hideSideNav/hideSideNav.component'; +import { AnonymousComponent } from './anonymous/anonymous.component'; const routes: Routes = [ { path: 'overview', component: OverviewComponent }, { path: 'settings', component: SettingsComponent }, { path: 'restricted', component: RestrictedComponent }, + { path: 'anonymous', component: AnonymousComponent }, { path: 'projects/:projectId', component: ProjectComponent }, { path: 'projects/:projectId/users', component: UsersComponent }, { diff --git a/core/examples/luigi-sample-angular/src/app/app.module.ts b/core/examples/luigi-sample-angular/src/app/app.module.ts index 0108a45d0c..f77ba5277d 100644 --- a/core/examples/luigi-sample-angular/src/app/app.module.ts +++ b/core/examples/luigi-sample-angular/src/app/app.module.ts @@ -24,6 +24,7 @@ import { LuigiContextService } from './services/luigi-context.service'; import { GroupSettingsComponent } from './project/users/groups/group-details/group-settings/group-settings.component'; import { DynamicComponent } from './project/dynamic/dynamic.component'; import { HideSideNavComponent } from './project/hideSideNav/hideSideNav.component'; +import { AnonymousComponent } from './anonymous/anonymous.component'; @NgModule({ declarations: [ @@ -46,7 +47,8 @@ import { HideSideNavComponent } from './project/hideSideNav/hideSideNav.componen RestrictedComponent, GroupSettingsComponent, DynamicComponent, - HideSideNavComponent + HideSideNavComponent, + AnonymousComponent ], imports: [BrowserModule, FormsModule, AppRoutingModule], providers: [LuigiContextService], diff --git a/docs/navigation-configuration.md b/docs/navigation-configuration.md index d650fdebf2..c4b5705222 100644 --- a/docs/navigation-configuration.md +++ b/docs/navigation-configuration.md @@ -252,6 +252,7 @@ The node parameters are as follows: - **loadingIndicator.hideAutomatically** disables the automatic hiding of the loading indicator once the micro front-end is loaded. It is only considered if the loading indicator is enabled. It does not apply if the loading indicator is activated manually with the `LuigiClient.uxManager().showLoadingIndicator()` function. If the loading indicator is enabled and automatic hiding is disabled, use `LuigiClient.uxManager().hideLoadingIndicator()` to hide it manually in your micro front-end during the startup. This parameter is enabled by default. - **viewGroup** defines a group of views in the same domain sharing a common security context. This improves performance through reusing the frame. Use **viewGroup** only for the views that use path routing internally. - **icon** is the name of an icon from the [OpenUI](https://openui5.hana.ondemand.com/1.40.10/iconExplorer.html) or a custom link (relative or absolute) to an image displayed next to the Node label in the side navigation or instead of the label in the top navigation. +- **anonymousAccess** defines if the node should be visible for the anonymous user. If set to `true`, all users see the node, while if set to `exclusive`, only the users that are not logged in can see it. The property is not propagated to the node's children and is disabled by default. ### Navigation configuration example