2.0.2 • Published 1 month ago
@startinblox/solid-data-permissioning v2.0.2
Data-sharing
Table of Contents
Introduction
This is the data sharing startin'blox component.
Installation
npm install
Development
npm run watch
Tests
npm run cy:run
or
npm run cy:open
Storybook
npm run storybook
Build
npm run build
Localization
This project uses @lit/localize
for internationalization.
Extracting strings
To extract strings for translation, run:
npm run locale:extract
This command will generate XLIFF files in the locales
directory.
Changing locale
To change the locale, run:
window.setLocale.map((setLocale) => setLocale("your-lang-code"));
Getting current locale
To get the current locale, run:
window.getLocale.map((locale) => console.log(locale));
License
Usage of the component
To use the component, first, you'll need to import the startinblox core in the head of your file :
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@startinblox/core@latest/dist/index.js"
></script>
In the html file, you will also need to add this script to the body :
<script type="module">
window.orbit = {
client: {
name: "Orbit",
logo: "https://cdn.startinblox.com/logos/ACME.svg",
},
components: [],
getRoute: (route) => route,
getDefaultRoute: () => "",
getComponent: () => undefined,
getComponentFromRoute: () => undefined,
Swal: () => {},
defaultRoute: "",
federations: {},
componentSet: new Set(["routing", "menu", "menu-top", "autoLogin", "solid-permissioning"]),
};
</script>
Then, you have to call the component with three parameters :
- data-src : where the datas wil be found. You need to respect the specifications here. You can find an example here
- scopes-uri : the list of scopes. You need to respect the specifications here. You can find an example here
- noRouter
<solid-permissioning
data-src="https://data-server.cqcm.startinblox.com/enterprises/1/platforms"
scopes-uri="https://data-server.cqcm.startinblox.com/scopes"
noRouter>
</solid-permissioning>
Finally in the body, after the call at the component, you'll have to import the script :
<script
src="https://cdn.jsdelivr.net/npm/@startinblox/solid-data-permissioning@latest/dist/index.js"
type="module">
</script>