From 4d59daad411fc19d8be261969c94bea4d2e5528a Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Tue, 9 Jul 2019 07:55:31 +0200 Subject: [PATCH 1/7] alias fn --- client/luigi-client.d.ts | 8 ++++++++ client/src/lifecycleManager.js | 8 ++++++++ client/src/luigi-client.js | 3 +++ docs/luigi-client-api.md | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/client/luigi-client.d.ts b/client/luigi-client.d.ts index 890f35362d..ef4be89786 100644 --- a/client/luigi-client.d.ts +++ b/client/luigi-client.d.ts @@ -259,6 +259,14 @@ export type getToken = () => AuthData['accessToken']; export function getEventData(): Context; export type getEventData = () => Context; +/** + * Returns the context object. Typically it is not required as the {@link #addContextUpdateListener addContextUpdateListener()} receives the same values. + * @returns {Object} current context data. + * @memberof Lifecycle + */ +export function getContext(): Context; +export type getContext = () => Context; + /** * Returns the node parameters of the active URL. * Node parameters are defined like URL query parameters but with a specific prefix allowing Luigi to pass them to the micro front-end view. The default prefix is **~** and you can use it in the following way: `https://my.luigi.app/home/products?~sort=asc~page=3`. diff --git a/client/src/lifecycleManager.js b/client/src/lifecycleManager.js index 563a859977..2440056aa5 100644 --- a/client/src/lifecycleManager.js +++ b/client/src/lifecycleManager.js @@ -196,6 +196,14 @@ class LifecycleManager extends LuigiClientBase { getEventData() { return this.currentContext.context; } + /** + * Returns the context object. Typically it is not required as the {@link #addContextUpdateListener addContextUpdateListener()} receives the same values. + * @returns {Object} current context data + * @memberof Lifecycle + */ + getContext() { + return this.getEventData(); + } /** * Returns the node parameters of the active URL. * Node parameters are defined like URL query parameters but with a specific prefix allowing Luigi to pass them to the micro front-end view. The default prefix is **~** and you can use it in the following way: `https://my.luigi.app/home/products?~sort=asc~page=3`. diff --git a/client/src/luigi-client.js b/client/src/luigi-client.js index 9d8633b8cf..91ea790559 100644 --- a/client/src/luigi-client.js +++ b/client/src/luigi-client.js @@ -25,6 +25,9 @@ class LuigiClient { getEventData() { return lifecycleManager.getEventData(); } + getContext() { + return lifecycleManager.getContext(); + } getNodeParams() { return lifecycleManager.getNodeParams(); } diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index 7e8ec15e2e..98d60e6ea8 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -50,6 +50,12 @@ Returns the context object. Typically it is not required as the [addContextUpdat Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data +### getContext + +Returns the context object. Typically it is not required as the [addContextUpdateListener()](#addContextUpdateListener) receives the same values. + +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data + ### getNodeParams Returns the node parameters of the active URL. From e15e96dbb4982397a1aeed439ce7705243bf2b9a Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Tue, 9 Jul 2019 11:53:36 +0200 Subject: [PATCH 2/7] Docu update --- client/luigi-client.d.ts | 2 +- client/src/lifecycleManager.js | 2 +- docs/luigi-client-api.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/luigi-client.d.ts b/client/luigi-client.d.ts index ef4be89786..2d1b8c4af1 100644 --- a/client/luigi-client.d.ts +++ b/client/luigi-client.d.ts @@ -260,7 +260,7 @@ export function getEventData(): Context; export type getEventData = () => Context; /** - * Returns the context object. Typically it is not required as the {@link #addContextUpdateListener addContextUpdateListener()} receives the same values. + * Returns the context object. It invokes the getEventData() function. * @returns {Object} current context data. * @memberof Lifecycle */ diff --git a/client/src/lifecycleManager.js b/client/src/lifecycleManager.js index 2440056aa5..5f24594eba 100644 --- a/client/src/lifecycleManager.js +++ b/client/src/lifecycleManager.js @@ -197,7 +197,7 @@ class LifecycleManager extends LuigiClientBase { return this.currentContext.context; } /** - * Returns the context object. Typically it is not required as the {@link #addContextUpdateListener addContextUpdateListener()} receives the same values. + * Returns the context object. It invokes the getEventData() function. * @returns {Object} current context data * @memberof Lifecycle */ diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index 98d60e6ea8..931dce1c12 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -52,7 +52,7 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G ### getContext -Returns the context object. Typically it is not required as the [addContextUpdateListener()](#addContextUpdateListener) receives the same values. +Returns the context object. It invokes the getEventData() function. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data From dfa14b09dc89e34e5104d80bb2592d5e79e7be3c Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Thu, 11 Jul 2019 11:18:25 +0200 Subject: [PATCH 3/7] docu improvement --- client/luigi-client.d.ts | 2 +- client/src/lifecycleManager.js | 2 +- docs/luigi-client-api.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/luigi-client.d.ts b/client/luigi-client.d.ts index 2d1b8c4af1..f298565918 100644 --- a/client/luigi-client.d.ts +++ b/client/luigi-client.d.ts @@ -260,7 +260,7 @@ export function getEventData(): Context; export type getEventData = () => Context; /** - * Returns the context object. It invokes the getEventData() function. + * Returns the context object. It is an alias function for getEventData(). * @returns {Object} current context data. * @memberof Lifecycle */ diff --git a/client/src/lifecycleManager.js b/client/src/lifecycleManager.js index 5f24594eba..d8f54e6ea9 100644 --- a/client/src/lifecycleManager.js +++ b/client/src/lifecycleManager.js @@ -197,7 +197,7 @@ class LifecycleManager extends LuigiClientBase { return this.currentContext.context; } /** - * Returns the context object. It invokes the getEventData() function. + * Returns the context object. It is an alias function for getEventData(). * @returns {Object} current context data * @memberof Lifecycle */ diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index 931dce1c12..e5bba636c3 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -52,7 +52,7 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G ### getContext -Returns the context object. It invokes the getEventData() function. +Returns the context object. It is an alias function for getEventData(). Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data From 0d1b39057f188ea6b5e846cb738756c78aad748f Mon Sep 17 00:00:00 2001 From: JohannesDoberer Date: Fri, 12 Jul 2019 08:11:15 +0200 Subject: [PATCH 4/7] docu format --- docs/luigi-client-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index e5bba636c3..4be6fba357 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -52,7 +52,7 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G ### getContext -Returns the context object. It is an alias function for getEventData(). +Returns the context object. It is an alias function for `getEventData()`. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data From b618c4dc7d0144b9679b2ffd63ff886609523fbe Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Fri, 12 Jul 2019 08:24:08 +0200 Subject: [PATCH 5/7] run docu job --- core/src/App.html | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/App.html b/core/src/App.html index cda689bf54..983faa0d10 100644 --- a/core/src/App.html +++ b/core/src/App.html @@ -381,7 +381,6 @@ {} ); } - ViewGroupPreloading.viewGroupLoaded(iframe); } From 698e49ae1fad23ecba97dfed5c4d166f05b42cde Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Fri, 12 Jul 2019 08:29:33 +0200 Subject: [PATCH 6/7] docu check --- docs/luigi-client-api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index 4be6fba357..619fa3f2e6 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -48,13 +48,13 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G Returns the context object. Typically it is not required as the [addContextUpdateListener()](#addContextUpdateListener) receives the same values. -Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data. ### getContext Returns the context object. It is an alias function for `getEventData()`. -Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data. ### getNodeParams From fd6ebb21cc4122b46975ca56c90188a208e798cf Mon Sep 17 00:00:00 2001 From: Johannes Doberer Date: Fri, 12 Jul 2019 08:51:03 +0200 Subject: [PATCH 7/7] no message --- docs/luigi-client-api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/luigi-client-api.md b/docs/luigi-client-api.md index 619fa3f2e6..e5bba636c3 100644 --- a/docs/luigi-client-api.md +++ b/docs/luigi-client-api.md @@ -48,13 +48,13 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G Returns the context object. Typically it is not required as the [addContextUpdateListener()](#addContextUpdateListener) receives the same values. -Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data. +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data ### getContext -Returns the context object. It is an alias function for `getEventData()`. +Returns the context object. It is an alias function for getEventData(). -Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data. +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data ### getNodeParams