From d367ef03619fe9ba264a972405ec94bf050f031b Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Thu, 11 Feb 2021 08:35:49 +0100 Subject: [PATCH] Add more attribute and dbp-set-property event documentation --- packages/app-shell/README.md | 9 ++++++++- packages/auth/README.md | 6 +++++- packages/file-handling/README.md | 21 +++++++++++++++++---- packages/language-select/README.md | 12 ++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/packages/app-shell/README.md b/packages/app-shell/README.md index 7bfd807c..d99df012 100644 --- a/packages/app-shell/README.md +++ b/packages/app-shell/README.md @@ -19,7 +19,7 @@ npm i @dbp-toolkit/app-shell ## Attributes - `lang` (optional, default: `de`): set to `de` or `en` for German or English - - example `<dbp-app-shell lang="de" </dbp-app-shell>` + - example `<dbp-app-shell lang="de"></dbp-app-shell>` - `src`: The path to a topic metadata file (json) - `base-path` (optional, default: `/`): An absolute base path for routing - `entry-point-url`: Entry point URL to access the API @@ -29,6 +29,13 @@ npm i @dbp-toolkit/app-shell - `matomo-site-id` (optional): set to your site id (required only for tracking) - example `<dbp-app-shell matomo-site-id="456789"></dbp-app-shell>` +### Emitted attributes + +The component emits `dbp-set-property` events for these attributes: + +- `lang` to propagate a language change (possible values `en`, `de`) +- `requested-login-status` (possible values `logged-in`, `logged-out`) + ## Topic Metadata ```json diff --git a/packages/auth/README.md b/packages/auth/README.md index c017ac9e..0a71a8c0 100644 --- a/packages/auth/README.md +++ b/packages/auth/README.md @@ -39,7 +39,7 @@ npm i @dbp-toolkit/auth - `silent-check-sso-redirect-uri` (optional): URI or path to a separate page for checking the login session in an iframe, see https://www.keycloak.org/docs/latest/securing_apps/#_javascript_adapter - `scope` (optional): Space separated list of scopes to request. These scopes get added in addition to the default ones, assuming the scope is in the optional scopes list of the Keycloak client in use. -### Emitted attribute +### Emitted attributes The component emits a `dbp-set-property` event for the attribute `auth`: @@ -68,6 +68,10 @@ The component emits a `dbp-set-property` event for the attribute `auth`: - example auth property: `{token: "THE_BEARER_TOKEN"}` - note: most often this should be an attribute that is not set directly, but subscribed at a provider +### Emitted attributes + +The component emits a `dbp-set-property` event for the attribute `requested-login-status` (possible values `logged-in`, `logged-out`). + ## Local development ```bash diff --git a/packages/file-handling/README.md b/packages/file-handling/README.md index 4c8fd690..8272ccac 100644 --- a/packages/file-handling/README.md +++ b/packages/file-handling/README.md @@ -81,8 +81,15 @@ files from a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-source button-label="Select files"></dbp-file-source>` - `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. - - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` - - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'my/server/path'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state"></dbp-file-source>` + +### Emitted attributes + +The component emits a `dbp-set-property` event for the attribute `initial-file-handling-state`: + +- `initial-file-handling-state.target`: Target that should be selected the first time (possible values `local`, `nextcloud`) +- `initial-file-handling-state.path`: Path to initially jump to (only supported by target `nextcloud`) ### Outgoing Events @@ -126,9 +133,15 @@ files to a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-sink button-label="Download files"></dbp-file-sink>` - `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. - - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` - - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'my/server/path'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state"></dbp-file-source>` + +### Emitted attributes + +The component emits a `dbp-set-property` event for the attribute `initial-file-handling-state`: +- `initial-file-handling-state.target`: Target that should be selected the first time (possible values `local`, `nextcloud`) +- `initial-file-handling-state.path`: Path to initially jump to (only supported by target `nextcloud`) ### Properties diff --git a/packages/language-select/README.md b/packages/language-select/README.md index 5ae55265..3875f8e0 100644 --- a/packages/language-select/README.md +++ b/packages/language-select/README.md @@ -13,6 +13,18 @@ npm i @dbp-toolkit/language-select <script type="module" src="node_modules/@dbp-toolkit/language-select/dist/dbp-language-select.js"></script> ``` +## Attributes + +- `lang` (optional, default: `de`): set to `de` or `en` for German or English (note that it will be shown the + other way around to make it easier to switch to a different language) + - example `<dbp-language-select lang="de"></dbp-language-select>` + +### Emitted attributes + +The component emits `dbp-set-property` events for these attributes: + +- `lang` to propagate a language change (possible values `en`, `de`) + ## Local development ```bash -- GitLab