From d8cffc8a8a1251b0d0858cde426dfcf6e4351322 Mon Sep 17 00:00:00 2001 From: Markus Edenhauser <1720843+maxmarkus@users.noreply.github.com> Date: Mon, 15 Oct 2018 12:46:20 +0200 Subject: [PATCH 01/45] tets --- core/examples/luigi-sample-angular/src/app/app.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/examples/luigi-sample-angular/src/app/app.component.ts b/core/examples/luigi-sample-angular/src/app/app.component.ts index 48b58e9afd..78dc87f0fd 100644 --- a/core/examples/luigi-sample-angular/src/app/app.component.ts +++ b/core/examples/luigi-sample-angular/src/app/app.component.ts @@ -12,9 +12,9 @@ import { }) export class AppComponent implements OnInit { public luigiClient: LuigiClient = LuigiClient; - public title = 'app'; + public title: string = 'app'; - constructor(private luigiService: LuigiContextService) {} + constructor(private luigiService: LuigiContextService) { } ngOnInit() { this.luigiClient.addInitListener(context => From e8e0405634bb0a95a90f0db36235cb4fbedc8d95 Mon Sep 17 00:00:00 2001 From: Markus Edenhauser <1720843+maxmarkus@users.noreply.github.com> Date: Tue, 30 Oct 2018 09:18:58 +0100 Subject: [PATCH 02/45] initial --- .../src/assets/extendedConfiguration.js | 47 +++++++++++++++---- core/src/TopNav.html | 29 ++++++++++-- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/core/examples/luigi-sample-angular/src/assets/extendedConfiguration.js b/core/examples/luigi-sample-angular/src/assets/extendedConfiguration.js index 7e5ac1aaa9..200c9a4dbd 100644 --- a/core/examples/luigi-sample-angular/src/assets/extendedConfiguration.js +++ b/core/examples/luigi-sample-angular/src/assets/extendedConfiguration.js @@ -434,13 +434,13 @@ Luigi.setConfig({ label: 'Settings', viewUrl: '/sampleapp.html#/settings' }, - { - label: 'Open Google in this tab', - externalLink: { - url: 'http://google.com', - sameWindow: true - } - }, + // { + // label: 'Open Google in this tab', + // externalLink: { + // url: 'http://google.com', + // sameWindow: true + // } + // }, { pathSegment: 'ext', label: 'External Page', @@ -468,7 +468,38 @@ Luigi.setConfig({ ] } ]; - } + }, + // The following configuration will be used to render the context switcher component + contextSwitcher: [ + { + id: 'environmentSwitcher', + options: () => { + return [...Array(10).keys()].map(n => ({ + label: 'Environment ' + n, // (i.e mapping between what the user sees and what is taken to replace the dynamic part for the dynamic node) + pathSegmentValue: 'env' + n // will be used to replace dynamic part + })); + }, + actions: [ + { + label: '+ New Environment', + link: '/environments/new', + position: 'bottom', // top | bottom + clickHandler: () => { + // called BEFORE route change + return true; // route change will be done using link value (if defined) + // return false // route change will not be done even if link attribute is defined + } + } + ], + parentNode: '/environments', // Can only be an absolute path + + fallbackLabelResolver: id => { + // would resolve what do display in the context switcher (Label) in case the activated context (option) is not listed in available options + // hidden context case (i.e kyma-system namespace) + return capitalize(id); + } + } + ] }, routing: { diff --git a/core/src/TopNav.html b/core/src/TopNav.html index 8aa645864d..a7bbe3e999 100644 --- a/core/src/TopNav.html +++ b/core/src/TopNav.html @@ -7,7 +7,7 @@
-
+
{#if children && pathData.length > 0} {#each children as node} {#if !node.hideFromNav} @@ -21,15 +21,36 @@ {/if} {/each} {/if} +
+ +
+
+
+ +
+
+ +
+
+
- {#if authorizationEnabled} + {#if authorizationEnabled} +