major: frontend federation

This commit is contained in:
Jean-Baptiste Pasquier 2021-06-15 21:55:06 +02:00
parent a2123f07df
commit a5730680d0
39 changed files with 1621 additions and 764 deletions

276
README.md
View File

@ -97,7 +97,8 @@ On `config.json`:
{ {
"client": { "client": {
"name": "Localhost", "name": "Localhost",
"logo": "/images/logo.webp" "logo": "/images/logo.webp",
"server": "http://server"
}, },
"components": [] "components": []
} }
@ -107,6 +108,7 @@ Where:
* `client.name` is the name of your Orbit * `client.name` is the name of your Orbit
* `client.logo` is an URL to an image file * `client.logo` is an URL to an image file
* `client.server` is the main data server of the client
* `components` is your modules declaration registry * `components` is your modules declaration registry
### Optional personalisation ### Optional personalisation
@ -226,18 +228,28 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "circles", "type": "circles",
"endpoints": { "parameters": {
"get": "http://server.url/circles/", "dataSrc": "federation://circles/",
"post": "http://server.url/circles/", "dataSrcJoinable": "federation://circles/joinable/",
"owners": "http://server.url/users/", "owners": "federation://users/",
"users": "http://server.url/users/", "post": "server://circles/",
"users": "federation://users/",
"noRender": "",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket" "xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
} },
"federation": [
"..."
],
"route": "circles"
} }
``` ```
Where: Where:
* `dataSrc`: is a container listing every circles
* `dataSrcJoinable`: is a container listing every public & not joined circles for the user
* `post`: is where you create new circles
* `noRender`: will load datas only when it'll be on screen, remove it if you encounter any issue
* `owners`: is your users container which contains valid owners * `owners`: is your users container which contains valid owners
* `users`: is your users container * `users`: is your users container
* `xmpp` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on. * `xmpp` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on.
@ -246,6 +258,8 @@ Where:
You can extend circles with other components, the same way you would add them to your modules. You can extend circles with other components, the same way you would add them to your modules.
Extensions always inherit from its parent federation.
Actually it support: Events, Resources & Polls. Actually it support: Events, Resources & Polls.
Eg.: Eg.:
@ -253,23 +267,34 @@ Eg.:
```json ```json
{ {
"type": "circles", "type": "circles",
"endpoints": { "parameters": {
"get": "http://server.url/circles/", "dataSrc": "federation://circles/",
"post": "http://server.url/circles/", "dataSrcJoinable": "federation://circles/joinable/",
"owners": "http://server.url/users/", "owners": "federation://users/",
"users": "http://server.url/users/", "post": "server://circles/",
"users": "federation://users/",
"noRender": "",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket" "xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
}, },
"federation": [
"..."
],
"route": "circles",
"extensions": [ "extensions": [
{ {
"type": "events", "type": "events",
"endpoints": { "parameters": {
"get": "http://server.url/events/", "events": "federation://events/",
"post": "http://server.url/events/", "circles": "federation://circles/",
"typeevents": "http://server.url/typeevents/", "get": "federation://events/",
"postTypeevents": "http://server.url/typeevents/", "post": "server://events/",
"uploads": "http://server.url/upload/" "postTypeevents": "server://typeevents/",
} "typeevents": "federation://typeevents/",
"uploads": "server://upload/"
},
"federation": [
"..."
]
} }
] ]
} }
@ -305,10 +330,10 @@ You can activate it by changing the route to anything else than false. Some endp
```json ```json
{ {
"type": "communities", "type": "communities",
"endpoints": { "parameters": {
"get": "http://server/communities/", "addresses": "federation://community-addresses/",
"addresses": "http://server/community-addresses/", "dataSrc": "federation://communities/",
"uploads": "http://server/upload/" "uploads": "server://upload/"
}, },
"route": "communities" "route": "communities"
} }
@ -325,12 +350,15 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "dashboard", "type": "dashboard",
"endpoints": {
"get": "http://server.url/dashboards/"
},
"parameters": { "parameters": {
"target": "default" "dataSrc": "server://dashboards/",
} "noRender": "",
"target": false
},
"route": "dashboard",
"experimental": [
"routing"
]
} }
``` ```
@ -338,6 +366,8 @@ A [sample fixture](https://git.startinblox.com/djangoldp-packages/djangoldp-dash
You can have multiple dashboard module, see the [related documentation](https://git.startinblox.com/components/solid-dashboard#having-multiple-dashboard). You can have multiple dashboard module, see the [related documentation](https://git.startinblox.com/components/solid-dashboard#having-multiple-dashboard).
You need the experimental routing enabled to have a Dashboard.
### Events ### Events
The events module includes a listing of upcoming events and the capability to create new ones. The events module includes a listing of upcoming events and the capability to create new ones.
@ -350,19 +380,21 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "events", "type": "events",
"endpoints": { "parameters": {
"get": "http://server.url/events/", "events": "federation://events/",
"post": "http://server.url/events/", "circles": "federation://circles/",
"regionevents": "http://server.url/regionevents/", "get": "federation://events/",
"typeevents": "http://server.url/typeevents/", "post": "server://events/",
"postTypeevents": "http://server.url/typeevents/", "postTypeevents": "server://typeevents/",
"uploads": "http://server.url/upload/" "typeevents": "federation://typeevents/",
} "pastevents": "visible",
"parameters" : { "visiblecheckbox": "visible",
"pastevents": "", "visibilityregions": "visible",
"visiblecheckbox": "", "uploads": "server://upload/"
"visibilityregions": "" },
} "federation": [
"..."
]
} }
``` ```
@ -454,8 +486,8 @@ Module declaration, on `config.json`:
"extensions": [ "extensions": [
{ {
"type": "invoices", "type": "invoices",
"endpoints": { "parameters": {
"uploads": "http://server.url/upload/" "uploads": "server://upload/"
} }
} }
] ]
@ -478,14 +510,18 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "jobBoard", "type": "jobBoard",
"endpoints": {
"get": "http://server.url/job-offers/",
"post": "http://server.url/job-offers/",
"skills": "http://server.url/skills/"
},
"parameters": { "parameters": {
"dataSrc": "federation://job-offers/current/",
"dataSrcExpired": "federation://job-offers/expired/",
"postDataSrc": "server://job-offers/",
"noRender": "",
"rangeSkills": "federation://skills/",
"fields": "earnBusinessProviding" "fields": "earnBusinessProviding"
} },
"route": "job-offers",
"experimental": [
"routing"
]
} }
``` ```
@ -493,6 +529,8 @@ Where:
* `parameters.fields`: Optional set of custom fields. Notice that only `earnBusinessProviding` is already handled on djangoldp-joboffer. * `parameters.fields`: Optional set of custom fields. Notice that only `earnBusinessProviding` is already handled on djangoldp-joboffer.
You need the experimental routing enabled to have a Job Board.
### Notifications ### Notifications
The notification module adds a bell with user's notification list and a badge on each menus with how much notifications are related to this resource. You'll need: The notification module adds a bell with user's notification list and a badge on each menus with how much notifications are related to this resource. You'll need:
@ -521,7 +559,8 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "chat", "type": "chat",
"endpoints": { "parameters": {
"noRender": "",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket" "xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
} }
} }
@ -542,14 +581,12 @@ On `config.json`:
```json ```json
{ {
"type": "polls", "type": "polls",
"endpoints": { "parameters": {
"get": "http://server.url/polls/", "dataSrc": "http://server.url/polls/",
"post": "http://server.url/polls/", "post": "http://server.url/polls/",
"pollRangeTags": "http://server.url/tags/", "pollRangeTags": "http://server.url/tags/",
"pollRangeCircles": "http://server.url/circles/", "pollRangeCircles": "http://server.url/circles/",
"uploads": "http://server.url/upload/" "uploads": "http://server.url/upload/",
},
"parameters": {
"displayStartEndDates": false "displayStartEndDates": false
} }
} }
@ -574,12 +611,17 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "projects", "type": "projects",
"endpoints": { "parameters": {
"get": "http://server.url/projects/", "captains": "federation://users/",
"post": "http://server.url/projects/", "circles": "federation://circles/",
"captains": "http://server.url/users/", "dataSrc": "federation://projects/",
"dataSrcJoinable": "federation://projects/joinable/",
"post": "server://projects/",
"users": "federation://users/",
"noRender": "",
"xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket" "xmpp": "wss://xmpp-dev.startinblox.com/xmpp-websocket"
} },
"route": "projects"
} }
``` ```
@ -600,8 +642,8 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "resources", "type": "resources",
"endpoints": { "parameters": {
"get": "http://server.url/resources/", "dataSrc": "http://server.url/resources/",
"post": "http://server.url/resources/", "post": "http://server.url/resources/",
"types": "http://server.url/types/", "types": "http://server.url/types/",
"keywords": "http://server.url/keywords/", "keywords": "http://server.url/keywords/",
@ -629,11 +671,9 @@ Module declaration, on `config.json`:
{ {
"type": "registering", "type": "registering",
"parameters": { "parameters": {
"dataSrc": "server://open-communities/",
"authority": "http://server.url/", "authority": "http://server.url/",
"authorityName": "your-authority-indentifier" "authorityName": "your-authority-indentifier"
},
"endpoints": {
"get": "http://server.url/open-communities/"
} }
} }
``` ```
@ -675,14 +715,25 @@ Module declaration, on `config.json`:
```json ```json
{ {
"type": "profileDirectory", "type": "profileDirectory",
"endpoints": { "parameters": {
"get": "http://server.url/users/", "dataSrc": "federation://users/",
"skills": "http://server.url/skills/", "rangeSkills": "federation://skills/",
"uploads": "http://server.url/upload/" "noRender": "",
} "paginateBy": "30",
"uploads": "server://upload/"
},
"federation": [
"..."
],
"route": "members",
"experimental": [
"routing"
]
} }
``` ```
You need the experimental routing enabled to have a Profile Directory.
### Route generation ### Route generation
Orbit will, by default, generate an unique route for every of your module. You can customize this route by setting a `route` attribute on your module declaration. Orbit will, by default, generate an unique route for every of your module. You can customize this route by setting a `route` attribute on your module declaration.
@ -692,10 +743,10 @@ Eg. for the Users Directory:
```json ```json
{ {
"type": "profileDirectory", "type": "profileDirectory",
"endpoints": { "parameters": {
"get": "http://server.url/users/", "dataSrc": "server://users/",
"skills": "http://server.url/skills/", "skills": "server://skills/",
"uploads": "http://server.url/upload/" "uploads": "server://upload/"
}, },
"route": "directory" "route": "directory"
} }
@ -709,6 +760,29 @@ Some module don't need any route to be active, set `route` to `false` so.
Components can get the route of a module with `window.orbit.getRoute('componentName')`. Components can get the route of a module with `window.orbit.getRoute('componentName')`.
#### Experimental routing
This experimental setting allow to create a view containing a `solid-*` with every parameters provided without any code.
```json
{
"type": "display",
"parameters": {
"dataSrc": "server://users/",
"fields": "name"
},
"experimental": [
"routing"
]
}
```
will provide a view with:
```html
<solid-display data-src="http://server/users/" fields="name"></solid-display>
```
#### Change the default route #### Change the default route
By default, Orbit will take a Dashboard as a default route. By default, Orbit will take a Dashboard as a default route.
@ -720,10 +794,10 @@ Eg.:
```json ```json
{ {
"type": "profileDirectory", "type": "profileDirectory",
"endpoints": { "parameters": {
"get": "http://server.url/users/", "dataSrc": "server://users/",
"skills": "http://server.url/skills/", "skills": "server://skills/",
"uploads": "http://server.url/upload/" "uploads": "server://upload/"
}, },
"route": "directory", "route": "directory",
"defaultRoute": true "defaultRoute": true
@ -732,6 +806,52 @@ Eg.:
If there is more than one component with this parameter, it'll be ignored. If there is more than one component with this parameter, it'll be ignored.
### Federation generation
Any parameter of your config.json can take benefits from the source generation:
`server://` will be replaced by the value of `client.server`:
```json
{
"type": "awesome",
"parameters": {
"dataSrc": "server://users/"
}
}
```
`federation://` will generate a virtual federated container linking:
* `client.server`
* `client.servers`
* `component.federation`
* `extension.federation`, if on an extension
```json
{
"client": {
"server": "http://serverA",
"servers": [
"http://serverB"
]
},
"components": [
{
"type": "awesome",
"parameters": {
"dataSrc": "federation://users/"
},
"federation": [
"http://serverC"
]
}
]
}
```
Will result on a virtual federated container containing `http://serverA/users/`, `http://serverB/users/` and `http://serverC/users/` on data-src.
## Troubleshooting ## Troubleshooting
### Circles or Projects are missing the @user list ### Circles or Projects are missing the @user list

1513
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -56,8 +56,14 @@
], ],
"clearDist": false "clearDist": false
}, },
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"dependencies": { "dependencies": {
"@startinblox/orbit-styling-framework": "^1.9.9", "@startinblox/orbit-styling-framework": "^1.9.9",
"autoprefixer": "^9.8.6",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",

View File

@ -1,8 +0,0 @@
if (typeof Sentry !== 'undefined') {
Sentry.init({
dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4',
integrations: [new Sentry.Integrations.BrowserTracing()],
environment: document.location.hostname,
tracesSampleRate: 0.2,
});
}

View File

@ -1,2 +1,3 @@
//- Automatically import every scripts //- Automatically import every scripts
import './libs/**/*.js';
import './scripts/**/*.js'; import './scripts/**/*.js';

View File

@ -25,11 +25,8 @@ html(lang="en")
script(src="https://browser.sentry-cdn.com/5.25.0/bundle.tracing.min.js" defer) script(src="https://browser.sentry-cdn.com/5.25.0/bundle.tracing.min.js" defer)
include orbit-router.pug include orbit-envoy.pug
include orbit-unify.pug
script(type="module" src="/components/getRoute.js" defer)
script(type="module" src="/components/sentry.js" defer)
script(type="module" src="/components/orbit-auto-login.js" defer) script(type="module" src="/components/orbit-auto-login.js" defer)
script(type="module" src="/components/orbit-reactivity.js" defer) script(type="module" src="/components/orbit-reactivity.js" defer)
script(type="module" src="/components/sw-toolbox.js" defer) script(type="module" src="/components/sw-toolbox.js" defer)
@ -88,7 +85,27 @@ html(lang="en")
id=component.route id=component.route
data-view=component.route data-view=component.route
hidden hidden
)&attributes({"no-render": component.noRender}) )
//- Experimental routing
Codeless component loading
Eg.:
```
{
"type": "awesome",
"parameters": {
"dataSrc": "server://some-model/"
},
"experimental": [
"routing"
]
}
```
will generate a view vith a <solid-awesome data-src="http://server/some-model/"></solid-awesome>
if component.experimental
if component.experimental.includes('routing')
.scrollbar-content.whitespace-normal.padding-top-xlarge.padding-right-xsmall.padding-bottom-xlarge.padding-left-xsmall.sm-padding-top-medium
#{"solid-"+component.type}&attributes(component.attributes)
if component.type == "about" if component.type == "about"
include views/page-about.pug include views/page-about.pug
@ -102,66 +119,52 @@ html(lang="en")
.with-sidebar.whitespace-normal.jsMobileContentSidebarControl .with-sidebar.whitespace-normal.jsMobileContentSidebarControl
orbit-reactivity(bind-user nested-field='inbox' target-src="store://user.circles") orbit-reactivity(bind-user nested-field='inbox' target-src="store://user.circles")
orbit-reactivity(bind-user nested-field="circles" target-src="store://user") orbit-reactivity(bind-user nested-field="circles" target-src="store://user")
orbit-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.dataSrcJoinable}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.post}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.post}`) orbit-reactivity(bind-user nested-field="circles" target-src=`${component.parameters.post}`)
orbit-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.post}joinable/`) orbit-reactivity(bind-user nested-field="circles" target-src=`${component.parameters.dataSrcJoinable}`)
orbit-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`) orbit-reactivity(bind-user nested-field="circles" target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.get}`)
orbit-reactivity(bind-user nested-field="circles" target-src=`${component.endpoints.get}joinable/`)
include views/page-circle.pug include views/page-circle.pug
if component.type == "communities" if component.type == "communities"
.scrollbar-content.whitespace-normal .scrollbar-content.whitespace-normal
include views/page-communities.pug include views/page-communities.pug
if component.type == "dashboard"
.scrollbar-content
include views/page-dashboard.pug
if component.type == "events" if component.type == "events"
.scrollbar-content.bg-color-white .scrollbar-content.bg-color-white
include views/page-events.pug include views/page-events.pug
if component.type == "jobBoard" if component.type == "jobBoard"
.scrollbar-content orbit-reactivity(data-src=`${component.parameters.dataSrcExpired}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(data-src=`${component.endpoints.post}current/` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.post}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(data-src=`${component.endpoints.post}expired/` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.dataSrcExpired}` target-src=`${component.parameters.post}`)
orbit-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`) orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(data-src=`${component.endpoints.get}current/` target-src=`${component.endpoints.get}`) orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.parameters.dataSrcExpired}`)
orbit-reactivity(data-src=`${component.endpoints.get}current/` target-src=`${component.endpoints.get}expired/`) orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.parameters.post}`)
orbit-reactivity(data-src=`${component.endpoints.get}expired/` target-src=`${component.endpoints.get}`)
orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}expired/`)
orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}`)
orbit-reactivity(bind-user nested-field="joboffers" target-src=`${component.endpoints.get}current/`)
include views/page-job-board.pug
if component.type == "polls" if component.type == "polls"
.scrollbar-content .scrollbar-content
include views/page-polls.pug include views/page-polls.pug
if component.type == "profileDirectory"
orbit-reactivity(bind-user nested-field="profile" target-src="store://user")
orbit-reactivity(bind-user nested-field="account" target-src="store://user")
if component.type == "projects" if component.type == "projects"
.with-sidebar.whitespace-normal.jsMobileContentSidebarControl .with-sidebar.whitespace-normal.jsMobileContentSidebarControl
orbit-reactivity(bind-user nested-field='inbox' target-src="store://user.projects") orbit-reactivity(bind-user nested-field='inbox' target-src="store://user.projects")
orbit-reactivity(bind-user nested-field="projects" target-src="store://user") orbit-reactivity(bind-user nested-field="projects" target-src="store://user")
orbit-reactivity(data-src=`${component.endpoints.post}joinable/` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.dataSrcJoinable}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(data-src=`${component.endpoints.post}` target-src=`${component.endpoints.get}`) orbit-reactivity(data-src=`${component.parameters.dataSrcJoinable}` target-src=`${component.parameters.post}`)
orbit-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.post}`) orbit-reactivity(data-src=`${component.parameters.post}` target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.post}joinable/`) orbit-reactivity(bind-user nested-field="projects" target-src=`${component.parameters.post}`)
orbit-reactivity(data-src=`${component.endpoints.get}joinable/` target-src=`${component.endpoints.get}`) orbit-reactivity(bind-user nested-field="projects" target-src=`${component.parameters.dataSrcJoinable}`)
orbit-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.get}`) orbit-reactivity(bind-user nested-field="projects" target-src=`${component.parameters.dataSrc}`)
orbit-reactivity(bind-user nested-field="projects" target-src=`${component.endpoints.get}joinable/`)
include views/page-project.pug include views/page-project.pug
if component.type == "resources" if component.type == "resources"
.scrollbar-content.bg-color-white .scrollbar-content.bg-color-white
include views/page-resources.pug include views/page-resources.pug
if component.type == "profileDirectory"
.scrollbar-content
orbit-reactivity(bind-user nested-field="profile" target-src="store://user")
orbit-reactivity(bind-user nested-field="account" target-src="store://user")
include views/page-directory.pug
else else
//- Components declaration without any route (`route`="false") but that need some code declaration //- Components declaration without any route (`route`="false") but that need some code declaration

11
src/libs/sentry.js Normal file
View File

@ -0,0 +1,11 @@
document.addEventListener("DOMContentLoaded", () => {
if (typeof Sentry !== 'undefined') {
Sentry.init({
dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4',
integrations: [new Sentry.Integrations.BrowserTracing()],
environment: document.location.hostname,
tracesSampleRate: 0.2,
});
window.orbit.sentry = Sentry;
}
});

198
src/orbit-envoy.pug Normal file
View File

@ -0,0 +1,198 @@
//-
Orbit Envoy - Collision-free route generation & federation management for latter usage
Create a window.orbit.components, accessible by all components with the route declaration.
Components can also get benefits from the `getRoute` function
Eg.
```
window.orbit.getRoute('chat', true)
window.orbit.getRoute('ffb39ad020645') // Where uxnzsa is the uniq of the component
```
will return the route of the first chat component, if exists, or triggers an error.
Okay. This file really needs a cleanup now... Emergency, have to release for Friday...
-
let routes = new Set();
const getRoute = (type, returnFirst = false) => {
let availables = components.filter(c => c.type == type || c.uniq == type);
components.forEach(c => {
if (c.extensions) {
c.extensions.forEach(e => {
if (e.type == type || e.uniq == type) {
availables.push(e);
}
});
}
});
if (availables.length > 1) {
if (returnFirst) {
return availables[0].route;
} else {
return availables[availables.length - 1].route;
}
} else if (availables.length < 1) {
console.error(`No component found for route ${type}`);
} else {
return availables[0].route;
}
}
const getComponent = (type, returnFirst = false) => {
let availables = components.filter(c=>c.type==type);
if(availables.length > 1) {
if(returnFirst) {
return availables[0];
} else {
console.error(`Too much components availables for type ${type}`);
}
} else if(availables.length < 1) {
console.error(`No component found for type ${type}`);
} else {
return availables[0];
}
}
const generateUrl = (federation, path) => {
let result = [];
for(let target of federation) {
result.push({
"@id": target + path.replace(/federation:\//, ''),
"@type": "sib:federatedContainer"
});
}
return result;
}
var federations = {};
let federationRegistering = "";
for component of components
-
if(typeof component.route === 'undefined') {
component.route = component.type;
}
component.uniq = Math.random().toString(16).slice(2);
if(component.route) {
let route = component.route;
if (routes.has(component.route)) {
route += "-" + component.uniq;
}
routes.add(route);
component.route = route;
}
if(component.extensions) {
for(extension of component.extensions) {
if(typeof extension.route === 'undefined') {
extension.route = extension.type;
}
extension.uniq = Math.random().toString(16).slice(2);
if(extension.route) {
let route = extension.route;
if (routes.has(extension.route)) {
route += "-" + extension.uniq;
}
routes.add(route);
extension.route = route;
}
}
}
if(component.parameters) {
let federation = new Set();
if(client.server) {
federation.add(client.server);
}
if(client.servers) {
for(server of client.servers) {
federation.add(server);
}
}
if(component.federation) {
for(target of component.federation) {
federation.add(target);
}
}
component.federation = [...federation];
for(const [attribute, path] of Object.entries(component.parameters)) {
if(typeof path === 'string') {
if(path.startsWith('federation://')) {
federations[`store://local.${component.uniq}/${attribute}/`] = {
"@context": "https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
"@type": "ldp:Container",
"@id": `store://local.${component.uniq}/${attribute}/`,
"ldp:contains": generateUrl(federation, path),
"permissions": [{"mode": {"@type": "view"}}]
};
component.parameters[attribute] = `store://local.${component.uniq}/${attribute}/`;
}
if(path.startsWith('server://')) {
component.parameters[attribute] = client.server + path.replace(/server:\//, '');
}
}
}
/* Rewrite every parameters to kebab-case */
let rewriteParameters = {};
for(const [attribute, value] of Object.entries(component.parameters)) {
rewriteParameters[attribute.replace(/((?<=[a-z\d])[A-Z]|(?<=[A-Z\d])[A-Z](?=[a-z]))/g, '-$1').toLowerCase()] = value;
}
component.attributes = rewriteParameters;
component.attributes.route = component.route;
component.attributes.uniq = component.uniq;
}
if(component.extensions) {
for(extension of component.extensions) {
if(extension.parameters) {
let federation = new Set();
if(client.server) {
federation.add(client.server);
}
if(client.servers) {
for(server of client.servers) {
federation.add(server);
}
}
if(component.federation) {
for(target of component.federation) {
federation.add(target);
}
}
if(extension.federation) {
for(target of extension.federation) {
federation.add(target);
}
}
extension.federation = [...federation];
for(const [attribute, path] of Object.entries(extension.parameters)) {
if(typeof path === 'string') {
if(path.startsWith('federation://')) {
federations[`store://local.${extension.uniq}/${attribute}/`] = {
"@context": "https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
"@type": "ldp:Container",
"@id": `store://local.${extension.uniq}/${attribute}/`,
"ldp:contains": generateUrl(federation, path),
"permissions": [{"mode": {"@type": "view"}}]
};
extension.parameters[attribute] = `store://local.${extension.uniq}/${attribute}/`;
}
if(path.startsWith('server://')) {
extension.parameters[attribute] = client.server + path.replace(/server:\//, '');
}
}
}
/* Rewrite every parameters to kebab-case */
let rewriteParameters = {};
for(const [attribute, value] of Object.entries(extension.parameters)) {
rewriteParameters[attribute.replace(/((?<=[a-z\d])[A-Z]|(?<=[A-Z\d])[A-Z](?=[a-z]))/g, '-$1').toLowerCase()] = value;
}
extension.attributes = rewriteParameters;
extension.attributes.uniq = extension.uniq;
}
}
}
-
const defaultComponent = components.filter(e=>e.defaultRoute != undefined);
let defaultRoute = "dashboard";
if(defaultComponent.length == 1) {
defaultRoute = defaultComponent[0].uniq;
}
- const orbitComponents = `window.orbit={};window.orbit.components = ${JSON.stringify(components)};window.orbit.federations = ${JSON.stringify(federations)};window.orbit.defaultRoute = "${defaultRoute}";window.orbit.client = ${JSON.stringify(client)};window.hubl = window.orbit;`;
script!=orbitComponents

View File

@ -1,89 +0,0 @@
//-
Orbit router declaration for latter generation
Create a window.orbit.components, accessible by all components with the route declaration.
Components can also get benefits from the `getRoute` function
Eg.
```
window.orbit.getRoute('chat', true)
window.orbit.getRoute('uxnzsa') // Where uxnzsa is the uniq of the component
```
will return the route of the first chat component, if exists, or triggers an error.
-
let routes = new Set();
const getRoute = (type, returnFirst = false) => {
let availables = components.filter(c => c.type == type || c.uniq == type);
components.forEach(c => {
if (c.extensions) {
c.extensions.forEach(e => {
if (e.type == type || e.uniq == type) {
availables.push(e);
}
});
}
});
if (availables.length > 1) {
if (returnFirst) {
return availables[0].route;
} else {
return availables[availables.length - 1].route;
}
} else if (availables.length < 1) {
console.error(`No component found for route ${type}`);
} else {
return availables[0].route;
}
}
const getComponent = (type, returnFirst = false) => {
let availables = components.filter(c=>c.type==type);
if(availables.length > 1) {
if(returnFirst) {
return availables[0];
} else {
console.error(`Too much components availables for type ${type}`);
}
} else if(availables.length < 1) {
console.error(`No component found for type ${type}`);
} else {
return availables[0];
}
}
for component of components
-
if(typeof component.route === 'undefined') {
component.route = component.type;
}
if(component.route) {
component.uniq = Math.random().toString(16).slice(2);
let route = component.route;
if (routes.has(component.route)) {
route += "-" + component.uniq;
}
routes.add(route);
component.route = route;
}
if(component.extensions)
for extension of component.extensions
-
if(typeof extension.route === 'undefined') {
extension.route = extension.type;
}
if(extension.route) {
extension.uniq = Math.random().toString(16).slice(2);
let route = extension.route;
if (routes.has(extension.route)) {
route += "-" + extension.uniq;
}
routes.add(route);
extension.route = route;
}
-
const defaultComponent = components.filter(e=>e.defaultRoute != undefined);
let defaultRoute = "dashboard";
if(defaultComponent.length == 1) {
defaultRoute = defaultComponent[0].uniq;
}
- const orbitComponents = `window.orbit={};window.orbit.components = ${JSON.stringify(components)};window.orbit.defaultRoute = "${defaultRoute}";window.orbit.client = ${JSON.stringify(client)};window.hubl = window.orbit;`;
script!=orbitComponents

View File

View File

@ -0,0 +1,7 @@
document.addEventListener("DOMContentLoaded", () => {
for(const [uniq, federation] of Object.entries(window.orbit.federations)) {
if (sibStore && "setLocalData" in sibStore) {
sibStore.setLocalData(federation, uniq);
}
}
});

View File

@ -1,5 +0,0 @@
div.padding-top-xlarge.padding-right-xsmall.padding-bottom-xlarge.padding-left-xsmall.sm-padding-top-medium.bg-color-grey.whitespace-normal
solid-dashboard(
data-src=component.endpoints.get
uniq=component.uniq
)&attributes({target:component.parameters ? component.parameters.target : false})

View File

@ -1,7 +0,0 @@
div.bg-color-grey.padding-top-xlarge.padding-right-small.padding-bottom-xlarge.padding-left-small.whitespace-normal
solid-directory(
data-src=`${component.endpoints.get}`
range-skills=`${component.endpoints.skills}`
uniq=component.uniq
paginate-by="30"
)

View File

@ -1,12 +1,11 @@
div.whitespace-normal solid-event(
solid-event( data-src=`${component.parameters.events}`
data-src=`${component.endpoints.events}` past-events=`${component.parameters.pastevents || "hidden"}`
past-events=`${component.parameters ? component.parameters.pastevents : "hidden"}` visiblecheckbox=`${component.parameters.visiblecheckbox || "hidden"}`
visiblecheckbox=`${component.parameters ? component.parameters.visiblecheckbox : "hidden"}` visibilityregions=`${component.parameters.visibilityregions || "hidden"}`
visibilityregions=`${component.parameters ? component.parameters.visibilityregions : "hidden"}` range-event-region=`${component.parameters.regionevents}`
range-event-region=`${component.endpoints.regionevents}` range-event-type=`${component.parameters.typeevents}`
range-event-type=`${component.endpoints.typeevents}` range-event-circle=`${component.parameters.circles}`
range-event-circle=`${getComponent('circles').endpoints.get}/` upload-dir=`${component.parameters.uploads}`
upload-dir=`${component.endpoints.uploads}` id-prefix='default'
id-prefix='default' )
)

View File

@ -1,8 +0,0 @@
solid-job-board(
data-src=`${component.endpoints.get}`
post-data-src=`${component.endpoints.post}`
range-skills=`${component.endpoints.skills}`
uniq=component.uniq
)&attributes({
"fields": component.parameters ? component.parameters.fields : false
})

View File

@ -25,7 +25,7 @@ div.segment.full.padding-top-small.padding-right-large.padding-bottom-small.padd
solid-xmpp-chat( solid-xmpp-chat(
data-authentication='login' data-authentication='login'
data-auto-login='true' data-auto-login='true'
data-websocket-url=component.endpoints.xmpp data-websocket-url=component.parameters.xmpp
bind-resources bind-resources
uniq=component.uniq uniq=component.uniq
) )

View File

@ -1,9 +1,9 @@
solid-poll( solid-poll(
data-src=component.endpoints.get data-src=component.parameters.dataSrc
data-dest=component.endpoints.post data-dest=component.parameters.post
range-tags=component.endpoints.pollRangeTags range-tags=component.parameters.pollRangeTags
range-circles=component.endpoints.pollRangeCircles range-circles=component.parameters.pollRangeCircles
upload-dir=component.endpoints.uploads upload-dir=component.parameters.uploads
uniq=component.uniq uniq=component.uniq
)&attributes({ )&attributes({
"display-start-end-dates": component.parameters ? component.parameters.displayStartEndDates : false "display-start-end-dates": component.parameters ? component.parameters.displayStartEndDates : false

View File

@ -1,6 +1,6 @@
solid-profile( solid-profile(
bind-user bind-user
upload-src=`${getComponent('profileDirectory', true).endpoints.uploads}` upload-src=`${getComponent('profileDirectory', true).parameters.uploads}`
range-skills=`${getComponent('profileDirectory', true).endpoints.skills}` range-skills=`${getComponent('profileDirectory', true).parameters.skills}`
uniq=`${getComponent('profileDirectory', true).uniq}` uniq=`${getComponent('profileDirectory', true).uniq}`
) )

View File

@ -28,14 +28,14 @@
widget-logo='orbit-index-community-logo' widget-logo='orbit-index-community-logo'
widget-name='orbit-index-community-text' widget-name='orbit-index-community-text'
) )
if getComponent('registering').endpoints.get if getComponent('registering').parameters.dataSrc
div.loader#orbit-index-community-selector-loader div.loader#orbit-index-community-selector-loader
div div
div div
div div
div div
solid-display.community-flex-container( solid-display.community-flex-container(
data-src=`${getComponent('registering').endpoints.get}` data-src=`${getComponent('registering').parameters.dataSrc}`
fields='action' fields='action'
action-action='action' action-action='action'
widget-action='orbit-index-select-community' widget-action='orbit-index-select-community'

View File

@ -1,14 +1,14 @@
div.whitespace-normal div.whitespace-normal
solid-resource(data-src=`${component.endpoints.get}` solid-resource(data-src=`${component.parameters.dataSrc}`
post-data-src=`${component.endpoints.post}` post-data-src=`${component.parameters.post}`
range-resource-type=`${component.endpoints.types}` range-resource-type=`${component.parameters.types}`
post-data-type-src=`${component.endpoints.postTypes}` post-data-type-src=`${component.parameters.postTypes}`
range-resource-keyword=`${component.endpoints.keywords}` range-resource-keyword=`${component.parameters.keywords}`
post-data-keyword-src=`${component.endpoints.postKeywords}` post-data-keyword-src=`${component.parameters.postKeywords}`
circles=`${component.endpoints.circles}/` circles=`${component.parameters.circles}`
associated-circle-label="" associated-circle-label=""
data-trans=`associated-circle-label=${component.parameters && component.parameters.associatedName ? component.parameters.associatedName : 'circle.extensions.associated'}` data-trans=`associated-circle-label=${component.parameters && component.parameters.associatedName ? component.parameters.associatedName : 'circle.extensions.associated'}`
upload-dir=`${component.endpoints.uploads}` upload-dir=`${component.parameters.uploads}`
id-prefix='default' id-prefix='default'
uniq=component.uniq uniq=component.uniq
) )

View File

@ -14,7 +14,7 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
div div
solid-form.form( solid-form.form(
data-src=`${getComponent('circles').endpoints.post}` data-src=`${getComponent('circles').parameters.post}`
fields='status, community.community, name, subtitle, description, help' fields='status, community.community, name, subtitle, description, help'
required-status required-status

View File

@ -13,10 +13,9 @@ solid-widget(name=`orbit-admin-circle-join-button`)
class-submit-button="add-member-button segment sm-full margin-top-xsmall text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-arrow-right-circle children-icon-small children-icon-margin-right-xsmall" class-submit-button="add-member-button segment sm-full margin-top-xsmall text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-arrow-right-circle children-icon-small children-icon-margin-right-xsmall"
data-trans='submit-button=circle.list.buttonJoin' data-trans='submit-button=circle.list.buttonJoin'
) )
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrc}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}joinable/` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrcJoinable}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.post}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}joinable/` target-src='${value}')
orbit-reactivity(bind-user nested-field="circles" target-src='${value}') orbit-reactivity(bind-user nested-field="circles" target-src='${value}')
include page-admin-circles.pug include page-admin-circles.pug
@ -24,7 +23,7 @@ include page-admin-circles.pug
div.segment.full.padding-small.padding-top-xsmall.sm-padding-xsmall.whitespace-normal div.segment.full.padding-small.padding-top-xsmall.sm-padding-xsmall.whitespace-normal
solid-display( solid-display(
class='segment full children children-quarter sm-children-full children-margin-bottom-medium sm-children-margin-bottom-xsmall children-padding-right-xsmall children-padding-left-xsmall sm-children-padding-none sm-whitespace-normal masonry pagination' class='segment full children children-quarter sm-children-full children-margin-bottom-medium sm-children-margin-bottom-xsmall children-padding-right-xsmall children-padding-left-xsmall sm-children-padding-none sm-whitespace-normal masonry pagination'
data-src=`${getComponent('circles').endpoints.get}joinable/` data-src=`${getComponent('circles').parameters.dataSrcJoinable}`
fields='segment1(segment2(community.community.logo), segment3(name, subtitle, counter, members))' fields='segment1(segment2(community.community.logo), segment3(name, subtitle, counter, members))'
filtered-by=`admin-circle-filter-${page}` filtered-by=`admin-circle-filter-${page}`
order-by='name' order-by='name'

View File

@ -1,9 +1,8 @@
solid-widget(name=`leave-circle-reactivity`) solid-widget(name=`leave-circle-reactivity`)
template template
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrc}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}joinable/` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrcJoinable}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('circles').parameters.post}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}joinable/` target-src='${value}')
orbit-reactivity(bind-user nested-field="circles" target-src='${value}') orbit-reactivity(bind-user nested-field="circles" target-src='${value}')
solid-widget(name=`orbit-admin-circle-leave-button`) solid-widget(name=`orbit-admin-circle-leave-button`)
@ -14,10 +13,9 @@ solid-widget(name=`orbit-admin-circle-leave-button`)
data-label='' data-label=''
data-trans='data-label=circle.list.buttonQuit' data-trans='data-label=circle.list.buttonQuit'
) )
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}` target-src='${src}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrc}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.get}joinable/` target-src='${src}') orbit-reactivity(data-src=`${getComponent('circles').parameters.dataSrcJoinable}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}` target-src='${src}') orbit-reactivity(data-src=`${getComponent('circles').parameters.post}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('circles').endpoints.post}joinable/` target-src='${src}')
orbit-reactivity(bind-user nested-field="circles" target-src='${src}') orbit-reactivity(bind-user nested-field="circles" target-src='${src}')
solid-display( solid-display(
data-src="${src}" data-src="${src}"

View File

@ -16,7 +16,7 @@ div.segment.full.padding-large.padding-top-medium.padding-bottom-xsmall.sm-paddi
div.segment.half.sm-full div.segment.half.sm-full
h3.text-color-heading.text-semibold.text-letter-spacing-large(data-trans='circle.list.subTitle') h3.text-color-heading.text-semibold.text-letter-spacing-large(data-trans='circle.list.subTitle')
div.segment.half.sm-full.text-right div.segment.half.sm-full.text-right
solid-ac-checker(data-src=`${getComponent('circles').endpoints.post}`, permission='acl:Append') solid-ac-checker(data-src=`${getComponent('circles').parameters.post}`, permission='acl:Append')
solid-link( solid-link(
class='segment sm-full button text-xsmall text-bold text-uppercase text-center reversed color-secondary bordered button-icon icon icon-margin-right-xsmall icon-plus' class='segment sm-full button text-xsmall text-bold text-uppercase text-center reversed color-secondary bordered button-icon icon icon-margin-right-xsmall icon-plus'
next=`admin-${getRoute('circles', true)}-create` next=`admin-${getRoute('circles', true)}-create`
@ -43,7 +43,7 @@ div.segment.full.padding-large.padding-top-medium.padding-bottom-xsmall.sm-paddi
span(data-trans='circle.list.tabJoin') span(data-trans='circle.list.tabJoin')
solid-display( solid-display(
class="margin-left-xxsmall" class="margin-left-xxsmall"
data-src=`${getComponent('circles').endpoints.get}joinable/` data-src=`${getComponent('circles').parameters.dataSrcJoinable}`
fields="" fields=""
counter-template="(${counter})" counter-template="(${counter})"
filtered-by=`admin-circle-filter-${page}` filtered-by=`admin-circle-filter-${page}`

View File

@ -14,9 +14,9 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
div div
solid-form.form( solid-form.form(
data-src=`${getComponent('projects').endpoints.post}` data-src=`${getComponent('projects').parameters.post}`
range-captain=`${getComponent('projects').endpoints.captains}` range-captain=`${getComponent('projects').parameters.captains}`
required-status required-status
required-customer.name required-customer.name

View File

@ -10,7 +10,7 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
div.segment.half.sm-full div.segment.half.sm-full
h3.text-color-heading.text-semibold.text-letter-spacing-large(data-trans='project.list.subTitle') h3.text-color-heading.text-semibold.text-letter-spacing-large(data-trans='project.list.subTitle')
div.segment.half.sm-full.text-right div.segment.half.sm-full.text-right
solid-ac-checker(data-src=`${getComponent('projects').endpoints.post}`, permission='acl:Append') solid-ac-checker(data-src=`${getComponent('projects').parameters.post}`, permission='acl:Append')
solid-link( solid-link(
class='segment sm-full button text-xsmall text-bold text-uppercase text-center reversed color-secondary bordered button-icon icon icon-margin-right-xsmall icon-plus' class='segment sm-full button text-xsmall text-bold text-uppercase text-center reversed color-secondary bordered button-icon icon icon-margin-right-xsmall icon-plus'
next=`admin-${getRoute('projects', true)}-create` next=`admin-${getRoute('projects', true)}-create`
@ -40,10 +40,9 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
solid-widget(name=`leave-project-reactivity`) solid-widget(name=`leave-project-reactivity`)
template template
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrc}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}joinable/` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrcJoinable}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.post}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}joinable/` target-src='${value}')
orbit-reactivity(bind-user nested-field="projects" target-src='${value}') orbit-reactivity(bind-user nested-field="projects" target-src='${value}')
solid-widget(name=`orbit-admin-project-leave-button`) solid-widget(name=`orbit-admin-project-leave-button`)
@ -54,10 +53,9 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
data-label='' data-label=''
data-trans='data-label=project.list.buttonQuit' data-trans='data-label=project.list.buttonQuit'
) )
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}` target-src='${src}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrc}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}joinable/` target-src='${src}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrcJoinable}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}` target-src='${src}') orbit-reactivity(data-src=`${getComponent('projects').parameters.post}` target-src='${src}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}joinable/` target-src='${src}')
orbit-reactivity(bind-user nested-field="projects" target-src='${src}') orbit-reactivity(bind-user nested-field="projects" target-src='${src}')
solid-display( solid-display(
data-src="${src}" data-src="${src}"
@ -119,17 +117,16 @@ div.segment.full.padding-large.sm-padding-xsmall.sm-padding-top-medium.whitespac
class-submit-button="add-member-button segment margin-top-xsmall text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-arrow-right-circle children-icon-small children-icon-margin-right-xsmall" class-submit-button="add-member-button segment margin-top-xsmall text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-arrow-right-circle children-icon-small children-icon-margin-right-xsmall"
data-trans='submit-button=project.list.buttonJoin' data-trans='submit-button=project.list.buttonJoin'
) )
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrc}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.get}joinable/` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.dataSrcJoinable}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}` target-src='${value}') orbit-reactivity(data-src=`${getComponent('projects').parameters.post}` target-src='${value}')
orbit-reactivity(data-src=`${getComponent('projects').endpoints.post}joinable/` target-src='${value}')
orbit-reactivity(bind-user nested-field="projects" target-src='${value}') orbit-reactivity(bind-user nested-field="projects" target-src='${value}')
solid-display( solid-display(
class='table-body' class='table-body'
filtered-by="admin-project-filter" filtered-by="admin-project-filter"
data-src=`${getComponent('projects').endpoints.get}joinable/` data-src=`${getComponent('projects').parameters.dataSrcJoinable}`
fields='cell1(customer.name, counter, name), cell2(members), cell3(captain), cell4(joinButton)' fields='cell1(customer.name, counter, name), cell2(members), cell3(captain), cell4(joinButton)'
loader-id='loader-admin-projects' loader-id='loader-admin-projects'

View File

@ -16,7 +16,7 @@ div.segment.full.padding-large.sm-padding-top-small.sm-padding-right-xsmall.sm-p
solid-xmpp-chat( solid-xmpp-chat(
data-authentication='login' data-authentication='login'
data-auto-login='true' data-auto-login='true'
data-websocket-url=component.endpoints.xmpp data-websocket-url=component.parameters.xmpp
bind-resources bind-resources
uniq=component.uniq uniq=component.uniq
) )

View File

@ -33,7 +33,7 @@ div.segment.full.padding-large.whitespace-normal
required-owner required-owner
required-subtitle required-subtitle
required-community.community required-community.community
range-owner=`${component.endpoints.owners}` range-owner=`${component.parameters.owners}`
label-name='' label-name=''
label-owner='' label-owner=''
@ -79,7 +79,7 @@ div.segment.full.padding-large.whitespace-normal
bind-resources bind-resources
nested-field='members' nested-field='members'
fields='user' fields='user'
range-user=`${component.endpoints.users}` range-user=`${component.parameters.users}`
class-user='segment block margin-bottom' class-user='segment block margin-bottom'
widget-user='solid-form-dropdown-autocompletion' widget-user='solid-form-dropdown-autocompletion'

View File

@ -1,9 +1,9 @@
solid-event( solid-event(
bind-resources bind-resources
nested-field="events" nested-field="events"
range-event-type=`${extension.endpoints.typeevents}` range-event-type=`${extension.parameters.typeevents}`
range-event-circle=`${getComponent('circles').endpoints.get}/` range-event-circle=`${extension.parameters.circles}`
upload-dir=`${extension.endpoints.uploads}` upload-dir=`${extension.parameters.uploads}`
id-prefix='default' id-prefix='default'
uniq=extension.uniq uniq=extension.uniq
) )

View File

@ -1,10 +1,10 @@
solid-poll( solid-poll(
bind-resources bind-resources
nested-field="polls" nested-field="polls"
data-dest=extension.endpoints.post data-dest=extension.parameters.post
range-tags=extension.endpoints.pollRangeTags range-tags=extension.parameters.pollRangeTags
range-circles=extension.endpoints.pollRangeCircles range-circles=extension.parameters.pollRangeCircles
upload-dir=extension.endpoints.uploads upload-dir=extension.parameters.uploads
uniq=extension.uniq uniq=extension.uniq
)&attributes({ )&attributes({
"display-start-end-dates": extension.parameters ? extension.parameters.displayStartEndDates : false "display-start-end-dates": extension.parameters ? extension.parameters.displayStartEndDates : false

View File

@ -1,14 +1,14 @@
solid-resource( solid-resource(
bind-resources bind-resources
nested-field="resources" nested-field="resources"
post-data-src=`${extension.endpoints.post}` post-data-src=`${extension.parameters.post}`
range-resource-type=`${extension.endpoints.types}` range-resource-type=`${extension.parameters.types}`
post-data-type-src=`${extension.endpoints.postTypes}` post-data-type-src=`${extension.parameters.postTypes}`
range-resource-keyword=`${extension.endpoints.keywords}` range-resource-keyword=`${extension.parameters.keywords}`
post-data-keyword-src=`${extension.endpoints.postKeywords}` post-data-keyword-src=`${extension.parameters.postKeywords}`
circles=`${extension.endpoints.circles}/` circles=`${extension.parameters.circles}`
associated-circle-label="" associated-circle-label=""
upload-dir=`${extension.endpoints.uploads}` upload-dir=`${extension.parameters.uploads}`
id-prefix='circles' id-prefix='circles'
uniq=extension.uniq uniq=extension.uniq
) )

View File

@ -26,7 +26,7 @@
div div
solid-display( solid-display(
class='segment full children children-quarter sm-children-full children-margin-bottom-medium sm-children-margin-bottom-xsmall children-padding-right-xsmall children-padding-left-xsmall sm-children-padding-none sm-whitespace-normal masonry pagination text-disable-selection' class='segment full children children-quarter sm-children-full children-margin-bottom-medium sm-children-margin-bottom-xsmall children-padding-right-xsmall children-padding-left-xsmall sm-children-padding-none sm-whitespace-normal masonry pagination text-disable-selection'
data-src=`${component.endpoints.get}` data-src=`${component.parameters.dataSrc}`
loader-id=`loader-${component.route}-directory` loader-id=`loader-${component.route}-directory`
fields='segment1(segment2(logo), segment3(name, profile.shortDescription, counter))' fields='segment1(segment2(logo), segment3(name, profile.shortDescription, counter))'
filtered-by=`communities-filter` filtered-by=`communities-filter`

View File

@ -53,7 +53,7 @@ div.bg-color-white
widget-profile.description="solid-form-richtext-label" widget-profile.description="solid-form-richtext-label"
widget-profile.email="orbit-communities-edit-email" widget-profile.email="orbit-communities-edit-email"
widget-profile.website="orbit-communities-edit-website" widget-profile.website="orbit-communities-edit-website"
upload-url-logo=component.endpoints.uploads upload-url-logo=component.parameters.uploads
widget-logo="solid-form-image-label" widget-logo="solid-form-image-label"
submit-button="" submit-button=""
@ -70,9 +70,9 @@ div.bg-color-white
fields="profile.picture1, profile.picture2, profile.picture3" fields="profile.picture1, profile.picture2, profile.picture3"
upload-url-profile.picture1=component.endpoints.uploads upload-url-profile.picture1=component.parameters.uploads
upload-url-profile.picture2=component.endpoints.uploads upload-url-profile.picture2=component.parameters.uploads
upload-url-profile.picture3=component.endpoints.uploads upload-url-profile.picture3=component.parameters.uploads
widget-profile.picture1="solid-form-image-label" widget-profile.picture1="solid-form-image-label"
widget-profile.picture2="solid-form-image-label" widget-profile.picture2="solid-form-image-label"

View File

@ -21,7 +21,7 @@
span span
solid-map.communities-map.margin-right-xsmall.margin-left-xsmall.sm-margin-none.shadow( solid-map.communities-map.margin-right-xsmall.margin-left-xsmall.sm-margin-none.shadow(
data-src=`${component.endpoints.addresses}` data-src=`${component.parameters.addresses}`
loader-id=`loader-${component.route}-map` loader-id=`loader-${component.route}-map`
fields="position(segment1(community.logo), segment2(community.name, community.profile.shortDescription, community.members))" fields="position(segment1(community.logo), segment2(community.name, community.profile.shortDescription, community.members))"

View File

@ -20,7 +20,7 @@ div.segment.full.padding-large.sm-padding-top-small.sm-padding-right-xsmall.sm-p
solid-xmpp-chat( solid-xmpp-chat(
data-authentication='login' data-authentication='login'
data-auto-login='true' data-auto-login='true'
data-websocket-url=component.endpoints.xmpp data-websocket-url=component.parameters.xmpp
bind-resources bind-resources
uniq=component.uniq uniq=component.uniq
) )

View File

@ -31,7 +31,7 @@ div.segment.full.padding-large.whitespace-normal
solid-form.form( solid-form.form(
bind-resources bind-resources
range-captain=`${getComponent('projects').endpoints.captains}` range-captain=`${getComponent('projects').parameters.captains}`
required-status required-status
required-customer.name required-customer.name
@ -149,7 +149,7 @@ div.segment.full.padding-large.whitespace-normal
bind-resources bind-resources
nested-field='members' nested-field='members'
fields='user' fields='user'
range-user=`${component.endpoints.users}` range-user=`${component.parameters.users}`
class-user='add-member' class-user='add-member'
label-user='' label-user=''

View File

@ -14,7 +14,7 @@ div.segment.full.padding-large.sm-padding-top-small.sm-padding-right-xsmall.sm-p
) )
solid-invoicing( solid-invoicing(
bind-resources bind-resources
upload-dir=`${extension.endpoints.uploads}` upload-dir=`${extension.parameters.uploads}`
logo-dir=`${client.logo}` logo-dir=`${client.logo}`
uniq=extension.uniq uniq=extension.uniq
) )

View File

@ -6,7 +6,7 @@
//- solid-picture.project-edit-picture( //- solid-picture.project-edit-picture(
//- bind-resources //- bind-resources
//- upload-src=`${component.endpoints.uploads}` //- upload-src=`${component.parameters.uploads}`
//- upload-id="solid-project-edit-picture" //- upload-id="solid-project-edit-picture"
//- nested-fields='customer' //- nested-fields='customer'
//- fields='logo' //- fields='logo'