Merge branch 'master' into feature/new-integration

This commit is contained in:
Jean-Baptiste Pasquier 2020-12-14 14:18:26 +01:00
commit 33ed9e27db
No known key found for this signature in database
GPG Key ID: CC04B91B949C163A
85 changed files with 15633 additions and 5252 deletions

View File

@ -1,3 +0,0 @@
{
}

21
.gitignore vendored
View File

@ -1,11 +1,22 @@
**/node_modules **/node_modules
config.json
.DS_Store .DS_Store
*.iml *.iml
*.swp *.swp
dist .npm
# Test cache
cache
cypress/screenshots cypress/screenshots
cypress/videos cypress/videos
cache
.npm # Built files
.DS_Store .cache
dist
# Config specific files
config.json
config.*.json
!config.sample.json
# PWA Generated file
src/manifest.webmanifest

View File

@ -38,7 +38,7 @@ build:
test:e2e: test:e2e:
stage: test stage: test
image: cypress/included:4.5.0 image: cypress/included:5.6.0
services: services:
- name: ${CI_REGISTRY_IMAGE}/server:0.1 - name: ${CI_REGISTRY_IMAGE}/server:0.1
before_script: before_script:
@ -150,7 +150,7 @@ stg2:
publish: publish:
stage: release stage: release
script: script:
- npm install -g semantic-release@v17 @semantic-release/gitlab - npm install -g semantic-release@v17 @semantic-release/gitlab@v6.0.5
- semantic-release - semantic-release
only: only:
- master - master
@ -752,3 +752,219 @@ studiossinguliers:
when: manual when: manual
tags: tags:
- deploy - deploy
apluscestmieux:
stage: deployment
environment:
name: apluscestmieux
url: https://apluscestmieux.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_APLUS" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* apluscestmieux@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
projetlerepaire:
stage: deployment
environment:
name: projetlerepaire
url: https://projet.le.repaire.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_LEREPAIRE" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* projetlerepaire@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
oxamyne:
stage: deployment
environment:
name: oxamyne
url: https://oxamyne.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_OXAMYNE" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* oxamyne@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
laruchesaintgermain:
stage: deployment
environment:
name: laruchesaintgermain
url: https://la.ruche.saint-germain.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_LARUCHE" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* laruche-saint-germain@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
artefacts:
stage: deployment
environment:
name: artefacts
url: https://artefacts.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_ARTEFACTS" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* artefacts@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
lab01:
stage: deployment
environment:
name: lab01
url: https://le.lab01.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_LAB01" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* le-lab01@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
makesense:
stage: deployment
environment:
name: makesense
url: https://makesense.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_MAKESENSE" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* makesense@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
moulindepontru:
stage: deployment
environment:
name: moulindepontru
url: https://moulin.de.pont-ru.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_MOULINPONTRU" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* moulin-de-pont-ru@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
latreso:
stage: deployment
environment:
name: latreso
url: https://la.treso.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_LATRESO" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* la-treso@astral.startinblox.com:~/front/
only:
- master
when: manual
tags:
- deploy
montpellier:
stage: deployment
environment:
name: montpellier
url: https://app.montpellier.happy-dev.fr
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_MONTPELLIER" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* montpellier@ssh-montpellier.happy-dev.fr:~/front/
only:
- master
when: manual
tags:
- deploy
acn:
stage: deployment
environment:
name: acn
url: https://acn.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_ACN" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* acn@astral.startinblox.com:~/client/dist/
only:
- master
when: manual
tags:
- deploy
woma:
stage: deployment
environment:
name: woma
url: https://woma.hubl.world
before_script:
- npm ci --cache .npm --prefer-offline --only=production
script:
- echo "$APP_CONFIG_WOMA" > config.json
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
- npm run build
- scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* woma@astral.startinblox.com:~/client/dist/
only:
- master
when: manual
tags:
- deploy

3
.sassrc Normal file
View File

@ -0,0 +1,3 @@
{
"includePaths": ["node_modules"],
}

158
README.md
View File

@ -1,6 +1,18 @@
# Hubl <h1 align="center">
<br>
<a href="http://hubl.world"><img src="https://cdn.startinblox.com/logos/hubl-logo.png" alt="Hubl" width="200"></a>
<br>
</h1>
Hubl is the magic tool that allows the Freelance Network to thrive in a decentralized way. <h4 align="center">A magic tool that allows the Freelance Network to thrive in a decentralized way, built on top of <a href="https://startinblox.com/" target="_blank">Startin'blox</a>.</h4>
<hr>
<p align="center">
<a href="https://git.startinblox.com/management/product-owners-sync/issues/"><img alt="create a feature request" src="https://img.shields.io/badge/%2B-feature%20request-blue" /></a>
<a href="https://git.startinblox.com/applications/hubl/issues/"><img alt="create an issue" src="https://img.shields.io/badge/%2B-issue-orange" /></a>
<a href="https://git.startinblox.com/applications/hubl/commits/master"><img alt="pipeline status" src="https://git.startinblox.com/applications/hubl/badges/master/pipeline.svg" /></a>
</p>
## Getting Started ## Getting Started
@ -10,8 +22,8 @@ These instructions will get you a copy of the project up and running on your loc
To install Hubl, you'll need: To install Hubl, you'll need:
* A Hubl Server (djangoldp>=0.7.11) with the appropriate modules * A [Hubl Server](https://git.startinblox.com/djangoldp-packages/server-manager/) (djangoldp>1)
* A Prosody Server (with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) * A [Prosody Server](https://prosody.im/) (with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/))
* A SMTP Server (optional) * A SMTP Server (optional)
* NodeJS on your machine * NodeJS on your machine
@ -23,11 +35,11 @@ Before diving in you have to check your Hubl Server supports the following LDP p
* djangoldp_profile * djangoldp_profile
* djangoldp_skill * djangoldp_skill
* djangoldp_uploader * djangoldp_uploader
* oidc_provider: 'git+https://github.com/jblemee/django-oidc-provider.git@develop' * oidc_provider: django-webidoidc-provider
Those packages are given with the last stable version tested. Those packages are given with the last stable version tested.
Refer to the [documentation to install a Hubl Server](https://git.startinblox.com/documentation/doc/wikis/devops/install_sib_server) with this configuration. Refer to the [documentation to install a Hubl Server](https://docs.startinblox.com/import_documentation/install-sib-server.html) with this configuration.
## Build the application ## Build the application
@ -43,13 +55,6 @@ npm install
Then create a `config.json` based on your needs, see Mandatory and Optional Modules on this page. For convienence a `config.sample.json` exists in the source. Then create a `config.json` based on your needs, see Mandatory and Optional Modules on this page. For convienence a `config.sample.json` exists in the source.
Federated Hubl needs to use `config.sample.federated.json` example.
You can quickly update your API URI from the samples:
```
$ sed 's/http:\/\/localhost:8000/https:\/\/api.your-server.startinblox.com/' config.sample.json > config.json
```
Then build your new Hubl: Then build your new Hubl:
```bash ```bash
@ -66,6 +71,22 @@ Serve, watch files & rebuild on change with this command:
npm run watch npm run watch
``` ```
### Multiple config.json
You can have as many `config.*.json` as you need.
Watch on a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run watch
```
Build with a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run build
```
## Mandatory modules ## Mandatory modules
By default, a Hubl includes only individual chat modules. By default, a Hubl includes only individual chat modules.
@ -76,21 +97,32 @@ On `config.json`:
```json ```json
{ {
"xmpp": "https://jabber.happy-dev.fr/http-bind/", "xmppWebsocket": "wss://jabber.happy-dev.fr/xmpp-websocket",
"clientName": "My local Hubl",
"clientLogo": "/images/logo.webp",
"authority": "http://localhost:8000/", "authority": "http://localhost:8000/",
"endpoints": { "endpoints": {
"get": {
"skills": "http://server.url/skills/", "skills": "http://server.url/skills/",
"users": "http://server.url/users/"
},
"post": {
"users": "http://server.url/users/", "users": "http://server.url/users/",
"uploads": "http://server.url/upload/" "uploads": "http://server.url/upload/"
} }
}
} }
``` ```
Where: Where:
* `xmpp` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on. * `clientName` is the name of your Hubl
* `clientLogo` is an URL to an image file
* `xmppWebsocket` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on.
* `authority` is the OpenID Provider. Usually, if you use `djangoldp-account` it's the same as your djangoldp server. * `authority` is the OpenID Provider. Usually, if you use `djangoldp-account` it's the same as your djangoldp server.
* `endpoints.users` is the API endpoints for Users on your djangoldp server. * `endpoints.*.users` is the API endpoints for Users on your djangoldp server. (djangoldp-account)
* `endpoints.*.skills` is the API endpoints for Skills on your djangoldp server. (djangoldp-skill)
* `endpoints.*.uploads` is the API endpoints for Uploads on your djangoldp server. (djangoldp-upload)
### Communities ### Communities
@ -107,9 +139,7 @@ Don't forget to set some users as admin from the Django Admin if you want to all
On `config.json`: On `config.json`:
```json ```json
"clientName": "Hubl",
"clientFavicon": "/images/favicon.webp", "clientFavicon": "/images/favicon.webp",
"clientLogo": "/images/logo.webp",
"clientLogoHeight": "32px", "clientLogoHeight": "32px",
"clientCSS": "/path/to/custom.css", "clientCSS": "/path/to/custom.css",
"authorityName": "djangoldp-server-name" "authorityName": "djangoldp-server-name"
@ -117,9 +147,7 @@ On `config.json`:
Where: Where:
* `clientName` is the name of your Hubl.
* `clientFavicon` is an URL to a distant favicon * `clientFavicon` is an URL to a distant favicon
* `clientLogo` is an URL to a distant logo for your client
* `clientLogoHeight` allow a quick fix to manage different height logos * `clientLogoHeight` allow a quick fix to manage different height logos
* `clientCSS` is an URL to a distant CSS that'll be the last one loaded by the Hubl * `clientCSS` is an URL to a distant CSS that'll be the last one loaded by the Hubl
* `authorityName` is a visual name of your OpenID Provider * `authorityName` is a visual name of your OpenID Provider
@ -150,7 +178,12 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"get": {
"circle": "http://server.url/circles/" "circle": "http://server.url/circles/"
},
"post": {
"circle": "http://server.url/circles/"
},
} }
``` ```
@ -164,11 +197,29 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"get": {
"dashboard": "http://server.url/dashboard/" "dashboard": "http://server.url/dashboard/"
} }
}
``` ```
A [sample fixture](https://git.startinblox.com/djangoldp-packages/djangoldp-dashboard/blob/master/djangoldp_dashboard/fixtures/sample.json) can be loaded with `./manage.py loaddata path/to/djangoldp_dashboard/fixtures/sample.json`. A [sample fixture](https://git.startinblox.com/djangoldp-packages/djangoldp-dashboard/blob/master/djangoldp_dashboard/fixtures/sample.json) can be loaded with `./manage.py loaddata sample`.
### Job Offers
Job Offers includes a job board with conversation. To activate them, you need:
On Server: `djangoldp_joboffer`, `djangoldp_skill`, `djangoldp_upload`, `djangoldp_conversation` packages
On `config.json`:
```json
"endpoints": {
"get": {
"joboffers": "http://server.url/job-offers/"
}
}
```
### Project ### Project
@ -180,10 +231,12 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"projects": "http://server.url/projects/", "get": {
"customers": "http://server.url/customers/", "projects": "http://server.url/projects/"
"businessproviders": "http://server.url/businessproviders/", },
"skills": "http://server.url/skills/" "post": {
"projects": "http://server.url/projects/"
}
} }
``` ```
@ -196,29 +249,10 @@ On Server: `djangoldp_skill`, `djangoldp_upload` packages
On `config.json`: On `config.json`:
```json ```json
"publicDirectory": true, "publicDirectory": true
"endpoints": {
"groups": "http://server.url/groups/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
}
``` ```
### Job Offers ## Optional community modules
Job Offers includes a job board with conversation. To activate them, you need:
On Server: `djangoldp_joboffer`, `djangoldp_skill`, `djangoldp_upload`, `djangoldp_conversation` packages
On `config.json`:
```json
"endpoints": {
"joboffers": "http://server.url/job-offers/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
}
```
### Events ### Events
@ -232,9 +266,14 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"get": {
"events":"http://server.url/events/", "events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/", "typeevents":"http://server.url/typeevents/"
"uploads": "http://server.url/upload/" },
"post": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/"
}
} }
``` ```
@ -250,10 +289,16 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"get": {
"resources":"http://server.url/resources/", "resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/", "resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/", "resourcestypes":"http://server.url/types/"
"uploads": "http://server.url/upload/" },
"post": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/"
}
} }
``` ```
@ -267,7 +312,12 @@ On `config.json`:
```json ```json
"endpoints": { "endpoints": {
"get": {
"polls":"http://server.url/polls/" "polls":"http://server.url/polls/"
},
"post": {
"polls":"http://server.url/polls/"
}
} }
``` ```
@ -299,6 +349,12 @@ docker push registry.startinblox.com/applications/hubl/server:0.1
Note: within a Kubernetes pod all services are bound to `localhost`. Note: within a Kubernetes pod all services are bound to `localhost`.
## Troubleshooting
### Circles or Projects are missing the @user list
Did you properly created subscriptions on your DjangoLDP's server? You can quickly create them with `./manage.py create_subscriptions`
## Built With ## Built With
* [Sib-Core](https://git.startinblox.com/framework/sib-core/) - An awesome new framework! * [Sib-Core](https://git.startinblox.com/framework/sib-core/) - A SOLID-Compliant framework

View File

@ -1,23 +0,0 @@
# Documentation
## Define your own colors
We use css variables to apply colors in the application.
The file can be found in src/styles/etc/
Example of use:
```css
:root {
--color-primary: #FFD759;
--color-secondary: #FFB700;
--color-complementary: #3C3F57;
--color-complementary-darken: #27293A;
}
```
Users can find example files at the root of the application. Use
- client.sample.happy-dev.css : for a more advanced example of customization.
- client.sample.css : to set five basic colors and let the default setup apply the colors.

View File

@ -1,282 +0,0 @@
:root {
--color-primary: #FFB700;
--color-secondary: #3C3F57;
--color-complementary: #6259E5;
--color-complementary-darken: #36383B;
--color-white: #FFFFFF;
--color-black-h: 216;
--color-black-s: 4%;
--color-black-l: 22%;
--color-main-background: var(--color-grey-13);
--color-main-text: #7A7F85;
--color-highlight-primary: var(--color-primary);
--color-user-panel: var(--color-black);
--color-bell: var(--color-secondary);
--color-avatar-background: #E4E8ED;
--color-title: #36383B;
--color-h1: var(--color-title);
--color-h2: var(--color-title);
/* Depreciated */
--color-tag-group-text: #9BA0A7;
--color-tag-group-border: var(--color-primary);
--color-label-dark: var(--color-grey-6);
/* Header's elements */
--color-header-background: var(--color-white);
--color-bell: var(--color-complementary-darken);
--color-notification-counter-number: black;
--color-notification-summary: #7A7F85;
--solid-notifications-theme: var(--color-primary);
--color-notification-item-border: #E4E8ED;
--color-notification-scrollbar-background: #EDF1FA;
--color-notification-scrollbar-track: #BDC2D7;
--color-user-panel-header-text: var(--color-complementary-darken);
--color-user-panel-header-background: var(--color-white);
--color-user-panel-header-text-open: var(--color-white);
--color-user-panel-header-background-open: var(--color-secondary);
--color-user-panel-list-background: var(--color-white);
--color-user-panel-list-text-hover: var(--color-complementary);
--color-user-panel-list-border: #E4E8ED;
/* Left menu */
--color-menu-highlight-primary: #FFD759;
--color-menu-background: var(--color-secondary);
--color-menu-text: var(--color-white);
--color-menu-text-active: var(--color-secondary);
--color-menu-background-active: var(--color-menu-highlight-primary);
--color-menu-badge-background: var(--color-menu-highlight-primary);
--color-menu-badge-text-active: var(--color-menu-highlight-primary);
--color-menu-badge-background-active: var(--color-secondary);
--color-menu-icon-background-active: var(--color-secondary);
/* Right menu */
--color-right-menu-background: #DAE2F3;
--color-right-menu-text: var(--color-secondary);
--color-right-menu-link-border: #BDC2D7;
--color-right-menu-active-text: var(--color-primary);
--color-right-menu-active-background: var(--color-secondary);
--color-right-menu-active-icon: var(--color-primary);
/* Scrollbar */
--color-scrollbar-right-background: var(--color-white);
--color-scrollbar-right-track: var(--color-grey-6);
--color-scrollbar-left-background: var(--color-secondary);
--color-scrollbar-left-track: var(--color-grey-11);
/* Tags */
--color-tag-admin-text: var(--color-complementary);
--color-tag-admin-border: var(--color-complementary);
/* Form elements */
--color-button-white: var(--color-white);
--color-button-primary: var(--color-primary);
--color-button-secondary: var(--color-complementary);
--color-button-complementary: var(--color-secondary);
--color-input-background: #EDF1FA;
--color-input-text: var(--color-secondary);
--color-input-icon: var(--color-complementary);
--color-input-active: var(--color-complementary);
--color-fieldset: var(--color-title);
--color-fieldset-border: #DAE2F3;
--color-button-modal: var(--color-title);
--color-select-list: var(--color-secondary);
--color-select-add-button: var(--color-button-secondary);
--color-select-add-button-background: var(--color-button-white);
--color-label-light: var(--color-grey-6);
/* Skill */
--color-skill-background: var(--color-primary);
--color-skill-text: var(--color-white);
/* Icon */
--color-icon: var(--color-primary);
/* Table */
--color-table-header-background: #BDC2D7;
--color-table-header-text: var(--color-white);
--color-table-border: #BDC2D7;
/* User thumb */
--color-user-thumb-name: #7A7F85;
--color-backlink: var(--color-secondary);
--color-content-header: #DAE2F3;
/* Chat */
--color-chat-white: var(--color-white);
--color-chat-primary: var(--color-primary);
--color-chat-complementary: var(--color-complementary);
--color-chat-secondary: var(--color-secondary);
--color-chat-complementary-darken: var(--color-complementary-darken);
--color-chat-grey-1: var(--color-grey-4);
--color-chat-grey-2: var(--color-grey-6);
--color-chat-grey-3: var(--color-grey-10);
/* Directory */
--color-directory-grey-4: #7A7F85 !important;
--color-directory-grey-5: #F0F3F6 !important;
--color-directory-avatar-background: #E4E8ED !important;
--color-directory-back-link: #36383B !important;
--color-directory-border: #DAE2F3 !important;
--color-directory-content-header-border: #DAE2F3 !important;
--color-directory-h1: var(--color-complementary-darken);
--color-directory-list-icon: var(--color-primary);
--color-directory-text: var(--color-directory-grey-4);
--color-directory-send-border: var(--color-complementary) !important;
--color-directory-list-icon: var(--color-primary) !important;
--color-directory-counter-background: var(--color-directory-grey-5) !important;
--color-directory-counter-border: #9BA0A7 !important;
--color-directory-counter-text: #4A4A4A !important;
--color-directory-paginate: #36383B !important;
--color-directory-paginate-disabled: #9BA0A7 !important;
--color-directory-form-input: #EDF1FA !important;
--color-directory-form-input-text: var(--color-directory-grey-4) !important;
--color-directory-form-input-active: var(--color-complementary) !important;
--color-directory-form-select-icon: var(--color-complementary) !important;
}
/* Text color for the beta label */
#header>div.header-left>span.beta-tag {
color: var(--color-complementary);
}
/* Button to edit a channel or a project (in project-profile) */
#project solid-link[next="project-edit"],
#circle solid-link[next="circle-edit"] {
background: var(--color-complementary);
border: 1px solid var(--color-complementary);
}
#project solid-link[next="project-edit"]:hover,
#circle solid-link[next="circle-edit"]:hover {
background: var(--color-white);
border: 1px solid var(--color-complementary);
color: var(--color-complementary);
}
/* Button to delete a channel */
/* box-button is depreciated */
#circle-profile>div>div.desktop-button__end>solid-ac-checker>solid-delete,
#circle-profile>div>div.box-button>solid-ac-checker>solid-delete {
background: var(--color-white);
border: 1px solid var(--color-complementary);
color: var(--color-complementary);
}
#circle-profile>div>div.desktop-button__end>solid-ac-checker>solid-delete>button,
#circle-profile>div>div.box-button>solid-ac-checker>solid-delete>button {
color: var(--color-complementary);
}
#circle-profile>div>div.desktop-button__end>solid-ac-checker>solid-delete:hover,
#circle-profile>div>div.box-button>solid-ac-checker>solid-delete:hover {
background: var(--color-complementary);
border: 1px solid var(--color-complementary);
color: var(--color-white);
}
#circle-profile>div>div.desktop-button__end>solid-ac-checker>solid-delete:hover>button,
#circle-profile>div>div.box-button>solid-ac-checker>solid-delete:hover>button {
color: var(--color-white);
}
/* Button with a pen to edit a user */
#admin-users-list>div>div.table>solid-display>div>solid-display>div>solid-action-hd-custom>solid-ac-checker>solid-link {
background: var(--color-complementary);
border: 1px solid var(--color-complementary);
color: var(--color-white);
}
#admin-users-list>div>div.table>solid-display>div>solid-display>div>solid-action-hd-custom>solid-ac-checker>solid-link:hover {
background: var(--color-white);
border: 1px solid var(--color-complementary);
color: var(--color-complementary);
}
/* Button to join a channel */
#admin-circle-list>div>div.table>solid-display:nth-child(5)>div>solid-display>div>admin-circle-join-button>solid-form {
background: var(--color-complementary);
border: 1px solid var(--color-complementary);
color: var(--color-white);
}
#admin-circle-list>div>div.table>solid-display:nth-child(5)>div>solid-display>div>admin-circle-join-button>solid-form:hover {
background: var(--color-white);
border: 1px solid var(--color-complementary);
color: var(--color-complementary);
}
#admin-circle-list>div>div.table>solid-display:nth-child(5)>div>solid-display>div>admin-circle-join-button>solid-form:hover input {
color: var(--color-complementary);
}
/* Directory - my profile*/
/* Colors for buttons to send a message to a member and to update or remove your profile picture */
#member-profile>div.profile-card>div.user-profile>div>solid-display>div>solid-action.button.button-primary.bordered,
button#solid-picture-browse.button.button-primary,
button#solid-picture-remove.button.button-primary {
border: 1px solid var(--color-directory-complementary) !important;
}
#member-profile solid-action.button.button-primary>solid-link,
button#solid-picture-browse.button.button-primary,
button#solid-picture-remove.button.button-primary {
color: var(--color-directory-complementary) !important;
}
#member-profile>div.profile-card>div.user-profile>div>solid-display>div>solid-action.button.button-primary.bordered>solid-link::before {
background-color: var(--color-directory-complementary) !important;
}
/* Hover */
#member-profile solid-action.button.button-primary:hover,
#member-profile solid-action.button.button-primary:hover>solid-link,
button#solid-picture-browse.button.button-primary:hover,
button#solid-picture-remove.button.button-primary:hover {
color: var(--color-directory-white) !important;
background-color: var(--color-directory-complementary) !important;
}
#member-profile>div.profile-card>div.user-profile>div>solid-display>div>solid-action.button.button-primary.bordered:hover>solid-link::before {
background-color: var(--color-directory-white) !important;
}
#members-list .send-display solid-link::before {
background-color: var(--color-directory-complementary)!important;
}
/* Dashboard */
.dashboard-card>div>div>p {
color: var(--color-complementary) !important;
}
.dashboard-card .svg-color-secondary {
fill: var(--color-complementary) !important;
}
.dashboard-card i {
border-color: var(--color-primary) !important;
color: var(--color-complementary) !important;
}
.dashboard-card sib-link, .dashboard-card solid-link {
border-color: var(--color-complementary) !important;
color: var(--color-complementary) !important;
}
.dashboard-card sib-link:hover, .dashboard-card solid-link:hover {
background-color: var(--color-complementary) !important;
color: #fff !important;
}

View File

@ -1,18 +0,0 @@
{
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"authority": "http://localhost:8000/",
"clientName": "Hubl",
"clientLogo": "https://cdn.startinblox.com/logos/hubl-logo.png",
"endpoints": {
"get": {
"skills": "http://localhost:8000/skills/",
"users": "http://localhost:8000/users/",
"groups": "http://localhost:8000/groups/"
},
"post": {
"skills": "http://localhost:8000/skills/",
"users": "http://localhost:8000/users/",
"groups": "http://localhost:8000/groups/"
}
}
}

View File

@ -1,12 +1,16 @@
{ {
"xmpp": "https://jabber.happy-dev.fr/http-bind/", "xmppWebsocket": "wss://jabber.happy-dev.fr/xmpp-websocket",
"clientName": "My local Hubl",
"clientLogo": "/images/logo.webp",
"authority": "http://localhost:8000/", "authority": "http://localhost:8000/",
"authorityName": "djangoldp-server-name",
"clientName": "Hubl",
"clientLogo": "https://cdn.startinblox.com/logos/hubl-logo.png",
"endpoints": { "endpoints": {
"groups": "http://localhost:8000/groups/", "get": {
"skills": "http://localhost:8000/skills/", "skills": "http://localhost:8000/skills/",
"users": "http://localhost:8000/users/" "users": "http://localhost:8000/users/"
},
"post": {
"users": "http://localhost:8000/users/",
"upload": "http://localhost:8000/upload/"
}
} }
} }

View File

@ -1,24 +0,0 @@
{
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"authority": "$SERVER",
"authorityName": "djangoldp-server-name",
"publicDirectory": true,
"endpoints": {
"get": {
"circles": "$SERVER/circles/",
"dashboards": "$SERVER/dashboards/",
"groups": "$SERVER/groups/",
"users": "$SERVER/users/",
"skills": "$SERVER/skills/",
"uploads": "$SERVER/upload/"
},
"post": {
"circles": "$SERVER/circles/",
"dashboards": "$SERVER/dashboards/",
"groups": "$SERVER/groups/",
"users": "$SERVER/users/",
"skills": "$SERVER/skills/",
"uploads": "$SERVER/upload/"
}
}
}

21
internal/assets.js Normal file
View File

@ -0,0 +1,21 @@
const HTMLAsset = require('parcel-bundler/lib/assets/HTMLAsset')
function shouldIgnore (file) {
// Ignore img(src="${...}") on pug & keep the components folder pristine
return /\${.+}/.test(file) || /components/.test(file) || /\/lib\/solid-/.test(file);
}
class SkipStartinbloxWidgetAsset extends HTMLAsset {
addDependency (name, opts) {
if (!shouldIgnore(opts.resolved)) {
return super.addDependency(name, opts)
}
}
processSingleDependency (p, opts) {
if (shouldIgnore(p)) return p
else return super.processSingleDependency(p, opts)
}
}
module.exports = SkipStartinbloxWidgetAsset

79
internal/parcel.js Normal file
View File

@ -0,0 +1,79 @@
'use strict';
const fs = require('fs');
const fse = require('fs-extra');
const Bundler = require('parcel-bundler');
const options = {
outDir: './dist',
outFile: 'index.html',
publicUrl: '/',
watch: process.env.NODE_ENV !== 'production',
cache: process.env.NODE_ENV !== 'production',
cacheDir: '.cache',
contentHash: false,
minify: process.env.NODE_ENV === 'production',
scopeHoist: false,
target: 'browser',
bundleNodeModules: false,
https: true,
logLevel: 3,
hmr: false,
hmrPort: 1235,
sourceMaps: true,
hmrHostname: '',
detailedReport: false,
autoInstall: true
};
(async function() {
let configPath = process.env.CONFIG_PATH || 'config.json';
if(!fs.existsSync(configPath)) throw `[Error] (Mandatory) Missing ${configPath} file`;
console.log(`Using ${configPath} config file`);
let config = JSON.parse(fs.readFileSync(configPath));
if(!config.clientName) throw `[Error] (Mandatory) Missing clientName on ${configPath}`;
if(!config.clientLogo) throw `[Error] (Mandatory) Missing clientLogo on ${configPath}`;
let manifest = {
"lang": "fr",
"dir": "ltr",
"name": config.clientName,
"description": `Hubl of ${config.clientName}`,
"short_name": config.clientName,
"icons": [{
"src": config.clientLogo,
"purpose": "any"
}, {
"src": "/images/hubl-icon-192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "/images/hubl-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}],
"start_url": ".",
"display": "standalone",
"orientation": "portrait",
"background_color": "#fff",
'theme_color': "white"
}
await fse.writeJSON('./src/manifest.webmanifest', manifest)
console.log(`Created manifest for ${config.clientName}`);
await fse.copy("./src/locales", "./dist/locales")
console.log(`Copied locales to dist folder`);
await fse.copy("./src/components", "./dist/components")
console.log(`Copied components to dist folder`);
const bundler = new Bundler('./src/index.pug', options);
bundler.addAssetType('html', require.resolve('./assets.js'));
if(process.env.NODE_ENV !== 'production') {
await bundler.serve();
} else {
await bundler.bundle();
}
})();

View File

@ -1,39 +0,0 @@
'use strict';
import fs from 'fs';
if(!fs.existsSync("config.json")) throw "[Error] (Mandatory) Missing config.json file";
let config = JSON.parse(fs.readFileSync('config.json'));
if(!config.clientName) throw "[Error] (Mandatory) Missing clientName on config.json";
if(!config.clientLogo) throw "[Error] (Mandatory) Missing clientLogo on config.json";
let manifest = {
"lang": "fr",
"dir": "ltr",
"name": config.clientName,
"description": `Hubl of ${config.clientName}`,
"short_name": config.clientName,
"icons": [{
"src": config.clientLogo,
"purpose": "any"
}, {
"src": "/images/hubl-icon-192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "/images/hubl-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}],
"start_url": ".",
"display": "standalone",
"orientation": "portrait",
"background_color": "#fff",
'theme_color': "white"
}
fs.existsSync("dist") || fs.mkdirSync("dist");
fs.writeFileSync('dist/manifest.webmanifest', JSON.stringify(manifest, null, 2));
console.log(`Created manifest for ${config.clientName}`);

18388
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,45 +7,14 @@
"url": "https://git.startinblox.com/applications/hubl.git" "url": "https://git.startinblox.com/applications/hubl.git"
}, },
"scripts": { "scripts": {
"build:interactions": "cp src/interactions.html dist", "prebuild": "rimraf build",
"build": "run-p copy:* build:*", "build": "NODE_ENV='production' node internal/parcel.js",
"build:css": "node-sass src/styles/index.scss -o dist/styles/", "watch": "rimraf build && node internal/parcel.js",
"build:js": "babel \"src/scripts/*.js\" -o dist/scripts/index.js",
"build:jscomponents": "babel \"src/components/*.js\" --out-dir dist/components/",
"build:pug": "pug src/index.pug -o dist/ --obj config.json",
"build:manifest": "node --experimental-modules make-webmanifest.mjs",
"build:i18n": "copyfiles -u 2 src/locales/*.json dist/locales",
"copy:font": "copyfiles -f src/fonts/* dist/fonts",
"copy:image": "copyfiles -f src/images/* dist/images",
"copy:sw": "copyfiles -f src/sw.js dist",
"serve": "pushstate-server -d ./dist -p 3000",
"watch:interactions": "npm-watch build:interactions",
"watch": "run-p build watch:* serve",
"watch:css": "npm-watch build:css",
"watch:js": "npm-watch build:js",
"watch:jscomponents": "npm-watch build:jscomponents",
"watch:manifest": "npm-watch build:manifest",
"watch:pug": "pug --watch src/index.pug -o dist/ --obj config.json",
"watch:i18n": "npm-watch build:i18n",
"watch:font": "npm-watch copy:font",
"watch:image": "npm-watch copy:image",
"watch:sw": "npm-watch copy:sw",
"cypress:open": "cypress open", "cypress:open": "cypress open",
"cypress:verify": "cypress verify", "cypress:verify": "cypress verify",
"cypress:info": "cypress info", "cypress:info": "cypress info",
"test": "cypress run" "test": "cypress run"
}, },
"watch": {
"build:interactions": "src/interactions.html",
"build:css": "src/styles/**/*",
"build:manifest": "make-webmanifest.mjs",
"build:i18n": "src/locales/**/*",
"copy:images": "src/fonts/*.js",
"copy:fonts": "src/images/*.js",
"copy:sw": "src/sw.js",
"build:js": "src/scripts/*.js",
"build:jscomponents": "src/components/*.js"
},
"release": { "release": {
"branches": [ "branches": [
"master" "master"
@ -76,21 +45,15 @@
] ]
}, },
"dependencies": { "dependencies": {
"@babel/cli": "^7.7.0", "fs-extra": "^9.0.1",
"@babel/core": "^7.9.0",
"copyfiles": "^2.1.1",
"include-media": "^1.4.9",
"node-sass": "^4.14.0",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5", "parcel-bundler": "^1.12.4",
"pug": "^2.0.4", "pug": "^3.0.0",
"pug-cli": "^1.0.0-alpha6", "rimraf": "^2.7.1",
"pushstate-server": "^3.1.0" "sass": "^1.29.0"
}, },
"devDependencies": { "devDependencies": {
"cypress": "^4.5.0", "cypress": "^5.6.0",
"cypress-localstorage-commands": "^1.2.1", "cypress-localstorage-commands": "^1.2.4"
"cypress-terminal-report": "^1.2.1",
"npm-watch": "^0.7.0"
} }
} }

View File

@ -1,4 +1,4 @@
import { store, Sib, StoreMixin } from 'https://cdn.skypack.dev/@startinblox/core@0.13'; import { store, Sib, StoreMixin } from 'https://cdn.skypack.dev/@startinblox/core@0.14';
export const HublReactivity = { export const HublReactivity = {
name: 'hubl-reactivity', name: 'hubl-reactivity',
@ -11,10 +11,8 @@ export const HublReactivity = {
this.subscribe(); this.subscribe();
} }
}, },
dataSrc: { },
type: String, async fetchData(value) {
default: '',
callback: async function (value) {
this.resourceId = null; this.resourceId = null;
if (this.nestedField) { if (this.nestedField) {
const resource = store.get(value) || await store.getData(value, this.context); const resource = store.get(value) || await store.getData(value, this.context);
@ -24,8 +22,6 @@ export const HublReactivity = {
this.resourceId = value; this.resourceId = value;
} }
this.subscribe(); this.subscribe();
}
},
}, },
subscribe() { subscribe() {
if (this.resourceId && this.targetSrc) { if (this.resourceId && this.targetSrc) {

View File

@ -1,4 +1,4 @@
import { widgetFactory } from 'https://cdn.skypack.dev/@startinblox/core@0.13'; import { widgetFactory } from 'https://cdn.skypack.dev/@startinblox/core@0.14';
const HublSearchUsers = widgetFactory( const HublSearchUsers = widgetFactory(
'hubl-search-users', 'hubl-search-users',

View File

@ -1,4 +1,4 @@
import { widgetFactory, Helpers } from 'https://cdn.skypack.dev/@startinblox/core@0.13'; import { widgetFactory, Helpers } from 'https://cdn.skypack.dev/@startinblox/core@0.14';
import SlimSelect from 'https://cdn.skypack.dev/slim-select@1.23'; import SlimSelect from 'https://cdn.skypack.dev/slim-select@1.23';
const HublStatus = widgetFactory( const HublStatus = widgetFactory(

10
src/context.pug Normal file
View File

@ -0,0 +1,10 @@
//- Context - Fix for default context
script(data-default-context, type="application/ld+json")
| {
| "inbox": "http://happy-dev.fr/owl/#inbox",
| "object": "http://happy-dev.fr/owl/#object",
| "author": "http://happy-dev.fr/owl/#author",
| "account": "http://happy-dev.fr/owl/#account",
| "jabberID": "foaf:jabberID",
| "picture": "foaf:depiction"
| }

View File

@ -1,70 +1,43 @@
script(src="https://browser.sentry-cdn.com/5.25.0/bundle.tracing.min.js" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/core@0.14" defer)
script(type="module" src="/components/sentry.js" defer)
script(type="module" src="/components/hubl-search-users.js" defer)
script(type="module" src="/components/hubl-status.js" defer)
script(type="module" src="/components/hubl-reactivity.js" defer)
script(type="module" src="https://cdn.skypack.dev/@startinblox/core@0.13" defer)
//- script(type="module" src="/lib/sib-core/dist/index.js" defer) //- script(type="module" src="/lib/sib-core/dist/index.js" defer)
script(type="module" src="https://cdn.skypack.dev/@startinblox/oidc@0.11" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/oidc@0.12" defer)
//- script(type="module" src="/lib/sib-auth/index.js" defer) //- script(type="module" src="/lib/sib-auth/index.js" defer)
script(type="module" src="https://cdn.skypack.dev/@startinblox/router@0.11" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/router@0.11" defer)
//- script(type="module" src="/lib/sib-router/src/index.js" defer) //- script(type="module" src="/lib/sib-router/src/index.js" defer)
//-script(type="module" src="https://cdn.skypack.dev/@startinblox/component-notifications@0.8" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/component-notifications@0.9" defer)
//- script(type="module" src="/lib/sib-notifications/index.js" defer) //- script(type="module" src="/lib/sib-notifications/index.js" defer)
//- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13 if endpoints.get
//- if (endpoints.events || (endpoints.get && endpoints.get.events)) && (endpoints.typeevents || (endpoints.get && endpoints.get.typeevents)) //- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13
//- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-event@1.2" defer) //- if endpoints.get.events && endpoints.get.typeevents
//- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-event@1.2" defer)
//- script(type="module" src="/lib/sib-event-component/sib-event.js" defer) //- script(type="module" src="/lib/sib-event-component/sib-event.js" defer)
//- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13 //- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13
//- if (endpoints.resources || (endpoints.get && endpoints.get.resources)) && (endpoints.resourceskeywords || (endpoints.get && endpoints.get.resourceskeywords)) && (endpoints.resourcestypes || (endpoints.get && endpoints.get.resourcestypes)) //- if endpoints.get.resources && endpoints.get.resourceskeywords && endpoints.get.resourcestypes
//- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-resource@1.0" defer) //- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-resource@1.0" defer)
//- script(type="module" src="/lib/sib-resource/sib-resource.js" defer) //- script(type="module" src="/lib/sib-resource/sib-resource.js" defer)
//-if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) if endpoints.get.joboffers
script(type="module" src="https://cdn.skypack.dev/@startinblox/component-job-board@1.2" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/component-job-board@1.3" defer)
//- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer)
//-if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) if endpoints.get.uploads && endpoints.get.skills && endpoints.get.users
script(type="module" src="https://cdn.skypack.dev/@startinblox/component-directory@1.2" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/component-directory@1.3" defer)
//- script(type="module" src="/lib/solid-directory/dist/index.js" defer) //- script(type="module" src="/lib/solid-directory/dist/index.js" defer)
//-if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) if endpoints.get.dashboards
script(type="module" src="https://cdn.skypack.dev/@startinblox/component-dashboard@0.6" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/component-dashboard@0.7" defer)
//- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer)
//-if endpoints.users || (endpoints.get && endpoints.get.users) if endpoints.get.users
script(type="module" src="https://cdn.skypack.dev/@startinblox/component-chat@1.4" defer) script(type="module" src="https://cdn.skypack.dev/@startinblox/component-chat@1.7" defer)
//- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer)
//- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13 //- DISABLED - please migrate to dev.skypack.dev + upgrade to core@0.13
//- if endpoints.polls || (endpoints.get && endpoints.get.polls) //- if endpoints.get.polls
//- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-poll@1.0" defer) //- script(type="module" src="https://cdn.skypack.dev/@startinblox/component-poll@1.0" defer)
//- script(type="module" src="/lib/sib-polls-component/index.js" defer) //- script(type="module" src="/lib/sib-polls-component/index.js" defer)
//- swal2 does not work with skypack
script(src="https://cdn.jsdelivr.net/npm/sweetalert2@10")
script(src="/scripts/index.js" defer)
//- Stylesheets
link(rel='stylesheet', href='/styles/index.css')
link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700&amp;subset=latin-ext')
link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i')
//- Context - Fix for LDFlex
script(data-default-context, type="application/ld+json")
| {
| "inbox": "http://happy-dev.fr/owl/#inbox",
| "object": "http://happy-dev.fr/owl/#object",
| "author": "http://happy-dev.fr/owl/#author",
| "account": "http://happy-dev.fr/owl/#account",
| "jabberID": "foaf:jabberID",
| "picture": "foaf:depiction"
| }

View File

@ -1,5 +0,0 @@
-
var __env = locals[process.env.ENV]
for(k in __env){
eval(`var ${k} = __env[${JSON.stringify(k)}]`);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 78 KiB

2
src/index.js Normal file
View File

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

View File

@ -1,39 +1,67 @@
include get_config.pug
doctype html doctype html
html(lang="en") html(lang="en")
head head
meta(charset="UTF-8") meta(charset="UTF-8")
title #{clientName || "My Personal Hubl"} title #{clientName || "My Personal Hubl"}
meta(name="viewport", content="width=device-width, initial-scale=1.0") meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(http-equiv="X-UA-Compatible", content="ie=edge") meta(http-equiv="X-UA-Compatible", content="ie=edge")
if clientFavicon if clientFavicon
link(rel="icon" type="image/png" href=`${clientFavicon}`) link(rel="icon" type="image/png" href=`${clientFavicon}`)
else else
link(rel="icon" type="image/webp" href="/images/favicon.webp") link(rel="icon" type="image/webp" href="./images/favicon.webp")
include dependencies.pug
link(rel="preconnect" href="https://fonts.gstatic.com")
link(rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap")
link(rel='stylesheet', href='/styles/index.scss')
if clientCSS if clientCSS
link(rel='stylesheet', href=`${clientCSS}`) link(rel='stylesheet', href=`${clientCSS}`)
link(rel="manifest" href="/manifest.webmanifest") link(rel="manifest" href="/manifest.webmanifest")
script(src="https://browser.sentry-cdn.com/5.25.0/bundle.tracing.min.js" defer)
script(type="module" src="/components/sentry.js" defer)
script(type="module" src="/components/hubl-search-users.js" defer)
script(type="module" src="/components/hubl-status.js" defer)
script(type="module" src="/components/hubl-reactivity.js" defer)
include dependencies.pug
include context.pug
//- swal2 does not work with skypack
script(src="https://cdn.jsdelivr.net/npm/sweetalert2@10" defer)
script(src="index.js" defer)
body body
if endpoints.get && endpoints.post
include views/partials/notifications.pug
include views/partials/widgets.pug
header#header.segment.padding-left-large.padding-right-large.shadow-small header#header.segment.padding-left-large.padding-right-large.shadow-small
include header.pug include views/partials/header.pug
nav#main__menu.segment.bg-color-heading.lg-quarter.float-left nav#main__menu.segment.bg-color-heading.lg-quarter.float-left
include menu-left.pug include views/partials/menu-left.pug
main#content.segment.lg-three-quarter.float-left.notLoggedIn main#content.segment.lg-three-quarter.float-left.notLoggedIn
if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards)
if endpoints.get.dashboards
#dashboard(hidden, data-view="dashboard").no-sidebar.with-padding #dashboard(hidden, data-view="dashboard").no-sidebar.with-padding
include page-dashboard.pug include views/page-dashboard.pug
if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) if publicDirectory && endpoints.get.users
#members(hidden, data-view="members").no-sidebar.with-padding #members(hidden, data-view="members", no-render).no-sidebar.with-padding
include page-directory.pug include views/page-directory.pug
if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) if endpoints.get.joboffers
#job-offers(hidden, data-view="job-offers").no-sidebar.with-padding #job-offers(hidden, data-view="job-offers", no-render).no-sidebar.with-padding
if (endpoints.post && endpoints.post.joboffers) && (endpoints.get && endpoints.get.joboffers)
hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`) hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`) hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}` target-src=`${endpoints.get.joboffers}`) hubl-reactivity(data-src=`${endpoints.post.joboffers}` target-src=`${endpoints.get.joboffers}`)
@ -43,11 +71,11 @@ html(lang="en")
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}expired/`) hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}expired/`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}`) hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}current/`) hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}current/`)
include page-job-offers.pug include views/page-job-offers.pug
if endpoints.projects || (endpoints.get && endpoints.get.projects) if endpoints.get.projects
#project(hidden, data-view="project").segment.lg-full.with-sidebar #project(hidden, data-view="project", no-render).segment.lg-full.with-sidebar
if (endpoints.post && endpoints.post.projects) && (endpoints.get && endpoints.get.projects) hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.projects")
hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`) hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`)
hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`) hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.post.projects}`) hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.post.projects}`)
@ -55,11 +83,11 @@ html(lang="en")
hubl-reactivity(data-src=`${endpoints.projects || endpoints.get.projects}joinable/` target-src=`${endpoints.projects || endpoints.get.projects}`) hubl-reactivity(data-src=`${endpoints.projects || endpoints.get.projects}joinable/` target-src=`${endpoints.projects || endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}`) hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}joinable/`) hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}joinable/`)
include page-project.pug include views/page-project.pug
if endpoints.circles || (endpoints.get && endpoints.get.circles) if endpoints.get.circles
#circle(hidden, data-view="circle").segment.lg-full.with-sidebar #circle(hidden, data-view="circle").segment.lg-full.with-sidebar
if (endpoints.post && endpoints.post.circles) && (endpoints.get && endpoints.get.circles) hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.circles")
hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`) hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`)
hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`) hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.post.circles}`) hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.post.circles}`)
@ -67,111 +95,34 @@ html(lang="en")
hubl-reactivity(data-src=`${endpoints.circles || endpoints.get.circles}joinable/` target-src=`${endpoints.circles || endpoints.get.circles}`) hubl-reactivity(data-src=`${endpoints.circles || endpoints.get.circles}joinable/` target-src=`${endpoints.circles || endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}`) hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`) hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`)
include page-circle.pug include views/page-circle.pug
if endpoints.users || (endpoints.get && endpoints.get.users)
#messages(hidden, data-view="messages").with-sidebar
include page-messages.pug
if endpoints.polls || (endpoints.get && endpoints.get.polls) if endpoints.get.users
#polls(hidden, data-view="polls").with-sidebar #messages(hidden, data-view="messages", no-render).with-sidebar
include page-polls.pug hubl-reactivity(bind-user nested-field='inbox' target-src="store://user.contacts")
include views/page-messages.pug
if endpoints.events || (endpoints.get && endpoints.get.events) if endpoints.get.polls
#events(hidden, data-view="events") #polls(hidden, data-view="polls", no-render).with-sidebar
include page-events.pug include views/page-polls.pug
if endpoints.resources || (endpoints.get && endpoints.get.resources) if endpoints.get.events
#resources(hidden, data-view="resources") #events(hidden, data-view="events", no-render)
include page-resources.pug include views/page-events.pug
if endpoints.get.resources
#resources(hidden, data-view="resources", no-render)
include views/page-resources.pug
#admin(hidden, data-view="admin").segment.lg-full.with-sidebar #admin(hidden, data-view="admin").segment.lg-full.with-sidebar
include page-admin.pug include views/page-admin.pug
#about(data-view="about").no-sidebar.with-padding #about(data-view="about").no-sidebar.with-padding
include page-about.pug include views/page-about.pug
if (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.uploads || (endpoints.post && endpoints.post.uploads)) && (endpoints.users || (endpoints.post && endpoints.post.users)) if endpoints.get.skills && endpoints.post.uploads && endpoints.post.users
#profile(hidden, data-view="profile", no-render).no-sidebar
include views/page-profile.pug
//-nav#main__menu.segment.float-left.bg-color-heading.text-small.text-color-white.left-menu.jsLeftMenu
include menu-left.pug
//-nav.segment.lg-quarter.bg-color-heading
//-main.segment.lg-three-quarter.bg-color-third
//-main#viewport.segment.float-left.notLoggedIn
if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards)
#dashboard(hidden, data-view="dashboard").no-sidebar.with-padding
include page-dashboard.pug
if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users))
#members(hidden, data-view="members").no-sidebar.with-padding
include page-directory.pug
if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers)
#job-offers(hidden, data-view="job-offers").no-sidebar.with-padding
if (endpoints.post && endpoints.post.joboffers) && (endpoints.get && endpoints.get.joboffers)
hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.joboffers || endpoints.get.joboffers}current/` target-src=`${endpoints.joboffers || endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.joboffers || endpoints.get.joboffers}current/` target-src=`${endpoints.joboffers || endpoints.get.joboffers}expired/`)
hubl-reactivity(data-src=`${endpoints.joboffers || endpoints.get.joboffers}expired/` target-src=`${endpoints.joboffers || endpoints.get.joboffers}`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}expired/`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}`)
hubl-reactivity(bind-user nested-field="joboffers" target-src=`${endpoints.joboffers || endpoints.get.joboffers}current/`)
include page-job-offers.pug
if endpoints.projects || (endpoints.get && endpoints.get.projects)
#project(hidden, data-view="project").segment.lg-full.with-sidebar
if (endpoints.post && endpoints.post.projects) && (endpoints.get && endpoints.get.projects)
hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`)
hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.post.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.post.projects}joinable/`)
hubl-reactivity(data-src=`${endpoints.projects || endpoints.get.projects}joinable/` target-src=`${endpoints.projects || endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}`)
hubl-reactivity(bind-user nested-field="projects" target-src=`${endpoints.projects || endpoints.get.projects}joinable/`)
include page-project.pug
if endpoints.circles || (endpoints.get && endpoints.get.circles)
#circle(hidden, data-view="circle").with-sidebar
if (endpoints.post && endpoints.post.circles) && (endpoints.get && endpoints.get.circles)
hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`)
hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.post.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.post.circles}joinable/`)
hubl-reactivity(data-src=`${endpoints.circles || endpoints.get.circles}joinable/` target-src=`${endpoints.circles || endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}`)
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`)
include page-circle.pug
if endpoints.users || (endpoints.get && endpoints.get.users)
#messages(hidden, data-view="messages").with-sidebar
include page-messages.pug
if endpoints.polls || (endpoints.get && endpoints.get.polls)
#polls(hidden, data-view="polls").with-sidebar
include page-polls.pug
if endpoints.events || (endpoints.get && endpoints.get.events)
#events(hidden, data-view="events")
include page-events.pug
if endpoints.resources || (endpoints.get && endpoints.get.resources)
#resources(hidden, data-view="resources")
include page-resources.pug
#admin(hidden, data-view="admin").segment.lg-full.with-sidebar
include page-admin.pug
#about(data-view="about").no-sidebar.with-padding
include page-about.pug
if (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.uploads || (endpoints.post && endpoints.post.uploads)) && (endpoints.users || (endpoints.post && endpoints.post.users))
#profile(hidden, data-view="profile").no-sidebar
include page-profile.pug
if analytics if analytics
each provider in analytics each provider in analytics
@ -181,3 +132,5 @@ html(lang="en")
url=`${provider.url}` url=`${provider.url}`
id=`${provider.id}` id=`${provider.id}`
) )
else
h1(style='color:red') Invalid config.json (missing `endpoints.get` or `endpoints.post`)

View File

@ -15,12 +15,17 @@
"project": "project", "project": "project",
"circle": "circle" "circle": "circle"
}, },
"dashboard": "Dahsboard", "contact": {
"create": "Find your contacts on the",
"profileDir": "profile directory",
"create2": ""
},
"dashboard": "Dashboard",
"events": "Events", "events": "Events",
"gov": "Governance", "gov": "Governance",
"resources": "Resources", "resources": "Resources",
"jobBoard": "Job offers", "jobBoard": "Job offers",
"profileDirectory": "Members directory", "profileDirectory": "Profiles directory",
"projects": "Projects", "projects": "Projects",
"circles": "Circles", "circles": "Circles",
"messages": "Messages", "messages": "Messages",
@ -139,6 +144,8 @@
"title": "Edit your project", "title": "Edit your project",
"labelName": "Project name *", "labelName": "Project name *",
"labelCustomer": "Customer name *", "labelCustomer": "Customer name *",
"labelCaptain": "Capitain *",
"labelDescription": "Description",
"subTitle": "Team members :", "subTitle": "Team members :",
"tableHeader1": "Name", "tableHeader1": "Name",
"tableHeader2": "Access", "tableHeader2": "Access",

View File

@ -15,6 +15,11 @@
"project": "proyecto", "project": "proyecto",
"circle": "círculo" "circle": "círculo"
}, },
"contact": {
"create": "Encuentre sus contactos en el",
"profileDir": "directorio de miembros",
"create2": ""
},
"dashboard": "Panel de control", "dashboard": "Panel de control",
"events": "Eventos", "events": "Eventos",
"gov": "Gobernanza", "gov": "Gobernanza",
@ -139,6 +144,8 @@
"title": "Modificar tu proyecto", "title": "Modificar tu proyecto",
"labelName": "Nombre del proyecto *", "labelName": "Nombre del proyecto *",
"labelCustomer": "Nombre del/la clientx *", "labelCustomer": "Nombre del/la clientx *",
"labelCaptain": "Capitain *",
"labelDescription": "Description",
"subTitle": "Lista de miembrxs: ", "subTitle": "Lista de miembrxs: ",
"tableHeader1": "Nombre", "tableHeader1": "Nombre",
"tableHeader2": "Acceso", "tableHeader2": "Acceso",

View File

@ -15,6 +15,11 @@
"project": "projet", "project": "projet",
"circle": "cercle" "circle": "cercle"
}, },
"contact": {
"create": "Retrouve tes contacts sur",
"profileDir": "l'annuaire des membres",
"create2": ""
},
"dashboard": "Tableau de bord", "dashboard": "Tableau de bord",
"events": "Evènements", "events": "Evènements",
"gov": "Gouvernance", "gov": "Gouvernance",
@ -139,6 +144,8 @@
"title": "Modifie ton projet", "title": "Modifie ton projet",
"labelName": "Nom du projet *", "labelName": "Nom du projet *",
"labelCustomer": "Nom du client *", "labelCustomer": "Nom du client *",
"labelCaptain": "Capitaine *",
"labelDescription": "Description",
"subTitle": "Liste des membres :", "subTitle": "Liste des membres :",
"tableHeader1": "Nom", "tableHeader1": "Nom",
"tableHeader2": "Accès", "tableHeader2": "Accès",

6
src/pug.config.js Normal file
View File

@ -0,0 +1,6 @@
let configPath = process.env.CONFIG_PATH || 'config.json';
const config = require(`../${configPath}`);
module.exports = {
locals: config
};

View File

@ -1,5 +1,8 @@
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const resizeChat = () => { const resizeChat = () => {
let isMobile = window.innerWidth < 993;
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
let isFirefoxMobile = navigator.platform.toLowerCase().indexOf("mobile") > -1 || navigator.platform.toLowerCase().indexOf("tablet") > -1;
let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat")) let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false) .map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
.filter((el) => el) .filter((el) => el)
@ -19,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("#viewport .chat-view") document.querySelectorAll("#viewport .chat-view")
); );
viewportChat.forEach( viewportChat.forEach(
(c) => (c.style.height = "calc(100vh - 106px - 57px - 4px)") (c) => (c.style.height = isMobile ? (isFirefox && isFirefoxMobile) ? "calc(100vh - 106px - 57px)" : "calc(100vh - 106px)" : "calc(100vh - 64px - 83px)")
); );
} }
} }
@ -33,7 +36,7 @@ document.addEventListener("DOMContentLoaded", () => {
clearInterval(isbody); clearInterval(isbody);
resizeChat(); resizeChat();
} }
}, 15); }, 50);
window.addEventListener("load", () => { window.addEventListener("load", () => {
setTimeout(() => { setTimeout(() => {
@ -41,10 +44,12 @@ document.addEventListener("DOMContentLoaded", () => {
}, 0); }, 0);
}); });
let windowResizing;
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
setTimeout(() => { windowResizing = setTimeout(() => {
clearInterval(windowResizing);
resizeChat(); resizeChat();
}, 0); }, 50);
}); });
document.addEventListener("navigate", () => { document.addEventListener("navigate", () => {

View File

@ -187,10 +187,14 @@ document.addEventListener("DOMContentLoaded", () => {
*/ */
function recursivePopulate(element) { function recursivePopulate(element) {
Array.from(element.querySelectorAll('*')).forEach((e) => { Array.from(element.querySelectorAll('*')).forEach((e) => {
e.addEventListener("populate", (e) => { if(e.content && e.content instanceof DocumentFragment) {
recursivePopulate(e.target); recursivePopulate(e.content);
jsI18n.processNode(e.target); } else if(e instanceof HTMLElement) {
e.addEventListener("populate", (el) => {
recursivePopulate(el.target);
jsI18n.processNode(el.target);
}); });
}
}); });
} }
// Process every children from document // Process every children from document

View File

@ -10,8 +10,6 @@ document.addEventListener("DOMContentLoaded", function () {
document document
.querySelector('.loggedIn') .querySelector('.loggedIn')
.setAttribute("style", "display:none !important"); .setAttribute("style", "display:none !important");
} else {
document.querySelector('sib-auth').login();
} }
}); });
}); });

View File

@ -1,11 +1,11 @@
// if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
// var refreshing; var refreshing;
// navigator.serviceWorker.addEventListener('controllerchange', () => { navigator.serviceWorker.addEventListener('controllerchange', () => {
// if (refreshing) { if (refreshing) {
// return; return;
// } }
// refreshing = true; refreshing = true;
// window.location.reload(); window.location.reload();
// }); });
// navigator.serviceWorker.register('/sw.js'); navigator.serviceWorker.register('/sw.js');
// } }

View File

@ -0,0 +1,284 @@
// Button global CSS
solid-delete,
solid-route,
solid-link,
button,
input[type='submit'],
a,
.button {
background: none;
border: none;
cursor: pointer;
display: inline-block;
padding: 0;
&.button {
padding: 0.55rem 2.5rem;
border-radius: 100em;
*,
& {
font-size: 1.4rem;
}
&.mobile-full-width {
margin-bottom: 1rem;
padding-left: 5rem;
width: -webkit-fill-available;
width: -moz-available;
@include breakpoint(lg) {
margin-bottom: 0;
padding-left: 2.5rem;
width: auto;
}
&::before {
margin-left: -2.6rem;
@include breakpoint(lg) {
margin-left: 0;
}
}
}
&.desktop-btn-margin__left {
margin: 0;
@include breakpoint(lg) {
margin-left: 2.2rem;
}
}
&.small {
*,
& {
font-size: 1rem;
}
}
&.text-bold {
*,
& {
font-weight: bold;
}
}
&.text-uppercase {
*,
& {
text-transform: uppercase;
}
}
&.rounded {
border-radius: 50%;
font-size: 1.8rem;
padding: 1rem;
height: 42px;
width: 42px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}
&.button-link {
border-radius: 100em;
*,
& {
text-decoration: underline;
}
&:hover {
text-decoration: none;
}
}
&.with-icon::before {
font-size: 1.6rem;
margin-right: 1rem;
}
&.button-primary{
background-color: var(--color-white);
*,
& {
color: var(--color-primary);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-primary);
}
&:hover {
background-color: var(--color-primary);
*,
& {
color: var(--color-white);
}
}
}
&.button-disabled{
cursor: not-allowed;
background-color: var(--color-white);
*,
& {
color: var(--color-grey-3);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-grey-3);
}
&:hover {
background-color: var(--color-white);
*,
& {
color: var(--color-grey-3);
}
}
}
&.button-secondary {
background-color: var(--color-white);
*,
& {
color: var(--color-secondary);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-secondary);
}
&:hover {
background-color: var(--color-secondary);
*,
& {
color: var(--color-white);
}
}
}
&.button-complementary {
color: var(--color-complementary);
background-color: var(--color-white);
&.bordered, &.button-bordered {
border: 1px solid var(--color-complementary);
}
&:hover {
background-color: var(--color-complementary);
color: var(--color-white);
}
}
&.flex {
display: flex;
}
&.reversed {
&.button-primary {
background-color: var(--color-primary);
*,
& {
color: var(--color-white);
}
&:hover {
background-color: var(--color-white);
color: var(--color-primary);
*,
& {
color: var(--color-primary);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-primary);
}
}
}
&.button-disabled{
cursor: not-allowed;
background-color: var(--color-grey-3);
*,
& {
color: var(--color-white);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-white);
}
&:hover {
background-color: var(--color-grey-3);
*,
& {
color: var(--color-white);
}
}
}
&.button-secondary {
background-color: var(--color-secondary);
*,
& {
color: var(--color-white);
}
&:hover {
background-color: var(--color-white);
*,
& {
color: var(--color-secondary);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-secondary);
}
}
}
&.button-complementary {
background-color: var(--color-complementary);
*,
& {
color: var(--color-white);
}
&:hover {
background-color: var(--color-white);
*,
& {
color: var(--color-complementary);
}
&.bordered, &.button-bordered {
border: 1px solid var(--color-complementary);
}
}
}
}
}
}

View File

@ -1,8 +1,6 @@
@charset "UTF-8"; @charset "UTF-8";
@import '../../node_modules/include-media/dist/include-media'; @import 'normalize.css';
@import '../../node_modules/normalize.css/normalize';
:root { :root {
box-sizing: border-box; box-sizing: border-box;

View File

@ -18,13 +18,14 @@ solid-form {
} }
} }
.button-register>form>input[type=submit] {
@extend .button, .button-register input[type=submit] {
.text-bolder, @extend .button;
.text-uppercase, @extend .text-bold;
.reversed, @extend .text-uppercase;
.button-secondary, @extend .reversed;
.bordered; @extend .button-secondary;
@extend .bordered;
height: auto; height: auto;
position: fixed; position: fixed;
bottom: 1em; bottom: 1em;
@ -115,12 +116,12 @@ hubl-status {
min-width: 35vw; min-width: 35vw;
} }
input[type='submit'] { input[type=submit] {
@extend .button, @extend .button;
.text-bold, @extend .text-bold;
.text-uppercase, @extend .text-uppercase;
.button-complementary, @extend .button-complementary;
.bordered; @extend .bordered;
margin: 10px 0; margin: 10px 0;
width: 100%; width: 100%;
@ -199,11 +200,11 @@ solid-form-file {
} }
label { label {
@extend .button, @extend .button;
.text-bold, @extend .text-bold;
.text-uppercase, @extend .text-uppercase;
.button-primary, @extend .button-primary;
.bordered; @extend .bordered;
text-align: center; text-align: center;
width: 100%; width: 100%;
@ -215,83 +216,6 @@ solid-form-file {
} }
} }
/*solid-form-multipleselect {
&.select-skills .ss-values .ss-disabled::before {
content: "Select skills";
}
solid-form-dropdown-autocompletion-label > label {
display: flex;
flex-direction: column;
.ss-main {
font-weight: normal;
margin-bottom: 7.8rem;
margin-top: 1.6rem;
max-width: 50vw;
text-transform: none;
.ss-multi-selected {
align-items: center;
background-color: var(--color-input-background);
border: none;
border-radius: 0px;
display: flex;
justify-content: flex-end;
min-height: 4.2rem;
padding-left: 1.2rem;
.ss-add {
font-size: 1.8rem;
margin: 0 18px 0 0;
span.ss-plus {
background: var(--color-input-icon);
&::after {
background: var(--color-input-icon);
}
}
}
.ss-values {
background: transparent;
position: absolute;
top: 6rem;
width: 100%;
.ss-disabled {
color: transparent;
font-size: 1.4rem;
left: calc(1.2rem - 5px);
position: absolute;
top: calc(-6rem + 7px);
&::before {
color: var(--color-grey-5);
font-weight: normal;
}
}
.ss-value {
@extend .skill;
display: flex;
.ss-value-delete {
font-weight: normal;
}
}
}
}
.ss-list {
color: var(--color-input-text);
}
}
}
}*/
/* CUSTOM WIDGETS */ /* CUSTOM WIDGETS */
hubl-member-form { hubl-member-form {

View File

@ -677,11 +677,11 @@ h6 {
} }
input[type='submit'] { input[type='submit'] {
@extend .button, @extend .button;
.text-bold, @extend .text-bold;
.text-uppercase, @extend .text-uppercase;
.button-primary, @extend .button-primary;
.bordered; @extend .bordered;
align-self: center; align-self: center;
} }
} }
@ -723,11 +723,11 @@ h6 {
} }
input { input {
@extend .button, @extend .button;
.text-bold, @extend .text-bold;
.text-uppercase, @extend .text-uppercase;
.button-primary, @extend .button-primary;
.bordered; @extend .bordered;
margin: 10px 0; margin: 10px 0;
width: 100%; width: 100%;
@ -982,290 +982,9 @@ h6 {
} }
// Other base components // Other base components
@import 'buttons';
@import 'form'; @import 'form';
@import 'table'; @import 'table';
@import 'header'; @import 'header';
@import 'menu-left'; @import 'menu-left';
@import 'user-thumb'; @import 'user-thumb';
// Button global CSS
solid-delete,
solid-route,
solid-link,
button,
input[type='submit'],
a,
.button {
background: none;
border: none;
cursor: pointer;
display: inline-block;
padding: 0;
/* fix to prevent `form` element to act as a block so your text will go under your icon */
form {
display: contents;
}
&.backlink {
@include icon('arrow-left-circle');
font-size: 13px;
text-decoration: underline;
&::before {
font-size: 20px;
margin-right: 15px;
text-decoration: none;
}
&:hover {
text-decoration: none;
}
}
&.button {
padding: 5.5px 25px;
border-radius: 100em;
*,
& {
font-size: 12px;
}
&.mobile-full-width {
margin-bottom: 1rem;
padding-left: 5rem;
width: -webkit-fill-available;
width: -moz-available;
@include breakpoint(lg) {
margin-bottom: 0;
padding-left: 2.5rem;
width: auto;
}
&::before {
margin-left: -2.6rem;
@include breakpoint(lg) {
margin-left: 0;
}
}
}
&.desktop-btn-margin__left {
margin: 0;
@include breakpoint(lg) {
margin-left: 2.2rem;
}
}
&.small {
*,
& {
font-size: 1rem;
}
}
&.text-uppercase {
*,
& {
text-transform: uppercase;
}
}
&.text-bolder {
*,
& {
font-weight: 700;
}
}
&.rounded {
border-radius: 50%;
font-size: 18px;
padding: 10px;
height: 42px;
width: 42px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}
&.button-link {
border-radius: 100em;
*,
& {
text-decoration: underline;
}
&:hover {
text-decoration: none;
}
}
&.icon::before {
font-size: 15px;
margin-right: 10px;
}
&.button-primary{
background-color: white;
*,
& {
color: var(--color-primary);
}
&.bordered {
border: 1px solid var(--color-primary);
}
&:hover {
background-color: var(--color-primary);
*,
& {
color: var(--color-white);
}
}
}
&.button-disabled{
cursor: not-allowed;
background-color: white;
*,
& {
color: var(--color-grey);
}
&.bordered {
border: 1px solid var(--color-grey);
}
&:hover {
background-color: white;
*,
& {
color: var(--color-grey);
}
}
}
&.button-secondary {
background-color: white;
*,
& {
color: var(--color-secondary);
}
&.bordered {
border: 1px solid var(--color-secondary);
}
&:hover {
background-color: var(--color-secondary);
*,
& {
color: white;
}
}
}
&.button-third {
color: var(--color-third);
background-color:white;
*,
& {
color: var(--color-third);
}
&.bordered {
border: 1px solid var(--color-third);
}
&:hover {
background-color: var(--color-third);
*,
& {
color: white;
}
}
}
&.reversed {
&.button-primary {
background-color: var(--color-primary);
*,
& {
color: white;
}
&:hover {
background-color: white;
*,
& {
color: var(--color-primary);
}
&.bordered {
border: 1px solid var(--color-primary);
}
}
}
&.button-disabled{
cursor: not-allowed;
background-color: var(--color-grey);
*,
& {
color: white;
}
&.bordered {
border: 1px solid white;
}
&:hover {
background-color: var(--color-grey);
*,
& {
color: white;
}
}
}
&.button-secondary {
background-color: var(--color-secondary);
*,
& {
color: white;
}
&:hover {
background-color: white;
*,
& {
color: var(--color-secondary);
}
&.bordered {
border: 1px solid var(--color-secondary);
}
}
}
&.button-complementary {
background-color: var(--color-complementary);
*,
& {
color: white;
}
&:hover {
background-color: white;
*,
& {
color: var(--color-complementary);
}
&.bordered {
border: 1px solid var(--color-complementary);
}
}
}
}
}
}

View File

@ -135,6 +135,36 @@
/* Styles of specific cells */ /* Styles of specific cells */
.cell-with-buttons {
text-align: center;
[name='button'] {
input[type='submit'] {
@extend .button;
@extend .text-bold;
@extend .text-uppercase;
@extend .reversed;
@extend .button-secondary;
@extend .bordered;
@extend .desktop-btn-margin__left;
}
}
&.is-spaced {
padding: 0.8rem 2.2rem;
}
}
.cell-with-name {
color: var(--color-secondary);
font-weight: 600;
padding-left: 2rem;
text-align: left;
}
/* Styles of elements inside cells */
.table { .table {
.user-thumb.is-spaced, .user-thumb.is-spaced,

View File

@ -9,5 +9,8 @@
} }
.avatar-text { .avatar-text {
position: absolute; position: absolute;
top: 7.5rem;
@include breakpoint(lg) {
top: 2.8rem; top: 2.8rem;
}
} }

View File

@ -1,4 +1,4 @@
const CACHE_NAME = 'hubl-store'; const CACHE_NAME = 'hubl-store-cnt82i';
self.addEventListener('install', function (e) { self.addEventListener('install', function (e) {
self.skipWaiting(); self.skipWaiting();
@ -30,7 +30,8 @@ self.addEventListener('activate', function (e) {
self.clients.claim(); self.clients.claim();
}); });
self.addEventListener('fetch', function (event) { if(process.env.NODE_ENV === 'production'){
self.addEventListener('fetch', function (event) {
let requestURL = new URL(event.request.url); let requestURL = new URL(event.request.url);
if (requestURL.origin == location.origin) { if (requestURL.origin == location.origin) {
// Static asset, cache then network // Static asset, cache then network
@ -72,7 +73,7 @@ self.addEventListener('fetch', function (event) {
} else { } else {
if ( if (
/unpkg/.test(requestURL.origin) || /unpkg/.test(requestURL.origin) ||
/skypack/.test(request.origin) || /skypack/.test(requestURL.origin) ||
/jspm/.test(requestURL.origin) || /jspm/.test(requestURL.origin) ||
/jsdeliver/.test(requestURL.origin) || /jsdeliver/.test(requestURL.origin) ||
/cdn/.test(requestURL.origin) || /cdn/.test(requestURL.origin) ||
@ -110,4 +111,5 @@ self.addEventListener('fetch', function (event) {
} }
} }
} }
}); });
}

View File

@ -1,2 +0,0 @@
solid-widget(name='hubl-user-avatar')
template ${await value ? `<img src="${await value}" style="max-width:100%; max-height: 100%;" />` : `<object type="image/svg+xml" data="/images/alien.svg"></object>`}

View File

@ -1,14 +1,13 @@
.views-container.sidebar-is-closed .views-container.sidebar-is-closed
if endpoints.circles || (endpoints.get && endpoints.get.circles) if endpoints.circles || (endpoints.get && endpoints.get.circles)
#admin-circles(hidden, data-view="admin-circles") #admin-circles(hidden, data-view="admin-circles")
include views/admin/page-admin-circles.pug include partials/admin/page-admin-circles.pug
if endpoints.projects || (endpoints.get && endpoints.get.projects) if endpoints.projects || (endpoints.get && endpoints.get.projects)
#admin-projects(hidden, data-view="admin-projects") #admin-projects(hidden, data-view="admin-projects")
include views/admin/page-admin-projects.pug include partials/admin/page-admin-projects.pug
if (endpoints.users || (endpoints.get && endpoints.get.users)) if (endpoints.users || (endpoints.get && endpoints.get.users))
#admin-communities(hidden, data-view="admin-communities") #admin-communities(hidden, data-view="admin-communities")
include views/admin/page-admin-communities.pug include partials/admin/page-admin-communities.pug
nav.jsRightMenu(role='navigation') nav.jsRightMenu(role='navigation')
solid-router.text-color-heading.text-bold(default-route='admin-circles') solid-router.text-color-heading.text-bold(default-route='admin-circles')
ul ul

View File

@ -7,7 +7,6 @@ solid-router(default-route='admin-circle-list', hidden)
include ../circle/page-circle-left.pug include ../circle/page-circle-left.pug
#admin-circle-list(hidden, data-view="admin-circle-list") #admin-circle-list(hidden, data-view="admin-circle-list")
include ../../templates/hubl-user-avatar.pug
solid-widget(name='hubl-circle-owner') solid-widget(name='hubl-circle-owner')
template template

View File

@ -7,7 +7,6 @@ solid-router(default-route='admin-project-list', hidden)
include ../project/page-project-left.pug include ../project/page-project-left.pug
#admin-project-list(hidden, data-view="admin-project-list") #admin-project-list(hidden, data-view="admin-project-list")
include ../../templates/hubl-user-avatar.pug
div.segment.padding-top-xsmall.padding-right-large.padding-bottom-xsmall.padding-left-large.border-bottom.border-color-grey.text-color-heading div.segment.padding-top-xsmall.padding-right-large.padding-bottom-xsmall.padding-left-large.border-bottom.border-color-grey.text-color-heading
div div

View File

@ -14,7 +14,6 @@ solid-ac-checker(permission='acl:Read', bind-resources)
solid-link(class="backlink right", bind-resources, next='circle-profile' data-trans='circle.edit.backlink') solid-link(class="backlink right", bind-resources, next='circle-profile' data-trans='circle.edit.backlink')
div.segment.padding-large div.segment.padding-large
include ../../templates/hubl-user-avatar.pug
solid-widget(name="circle-edit-members-delete") solid-widget(name="circle-edit-members-delete")
template template

View File

@ -61,10 +61,3 @@
data-id=`${authorityName || "authority"}` data-id=`${authorityName || "authority"}`
data-client-name=`${clientName || "Hubl"}` data-client-name=`${clientName || "Hubl"}`
) )
//- Templates for notifications from circles and from other users
include views/notifications/message-circle.pug
include views/notifications/message-private.pug
include templates/hubl-user-avatar.pug

View File

@ -12,6 +12,15 @@ solid-widget(name='hubl-menu-publicprivate')
template template
div ${value == 'Public' ? '#' : ''} div ${value == 'Public' ? '#' : ''}
solid-widget(name='hubl-create-contact')
template
p.create
span(data-trans="menuLeft.contact.create")
span &nbsp;
solid-link(next="members" data-trans="menuLeft.contact.profileDir")
span &nbsp;
span(data-trans="menuLeft.contact.create2")
solid-widget(name='hubl-create') solid-widget(name='hubl-create')
template template
p.create.segment.margin-left-small p.create.segment.margin-left-small
@ -22,6 +31,19 @@ solid-widget(name='hubl-create')
span &nbsp; span &nbsp;
solid-link.segment.lg-full(next="${value == 'projet' ? 'admin-projects' : 'admin-circles'}", data-trans="menuLeft.emptyCircleProject.adminPanel") solid-link.segment.lg-full(next="${value == 'projet' ? 'admin-projects' : 'admin-circles'}", data-trans="menuLeft.emptyCircleProject.adminPanel")
solid-widget(name='hubl-menu-fix-url-contact')
template
solid-link(data-src="${value}" next="messages")
solid-display(
data-src='${value}'
fields='name, chatProfile.jabberID, badge'
value-badge='${value}'
widget-badge='hubl-counter'
widget-chatProfile.jabberID='hubl-menu-jabberid'
widget-name='solid-display-div'
order-asc='username'
)
solid-widget(name='hubl-menu-fix-url-circle') solid-widget(name='hubl-menu-fix-url-circle')
template template
solid-link.segment.lg-full(data-src="${value}" next="circle") solid-link.segment.lg-full(data-src="${value}" next="circle")
@ -36,7 +58,7 @@ solid-widget(name='hubl-menu-fix-url-circle')
widget-badge='hubl-counter' widget-badge='hubl-counter'
widget-jabberID='hubl-menu-jabberid' widget-jabberID='hubl-menu-jabberid'
widget-name='solid-display-div' widget-name='solid-display-div'
order-by="name" order-asc="name"
) )
solid-widget(name='hubl-menu-fix-url-project') solid-widget(name='hubl-menu-fix-url-project')
@ -55,7 +77,7 @@ solid-widget(name='hubl-menu-fix-url-project')
widget-jabberID='hubl-menu-jabberid' widget-jabberID='hubl-menu-jabberid'
widget-badge='hubl-counter' widget-badge='hubl-counter'
widget-name='solid-display-div' widget-name='solid-display-div'
order-by="customer.name" order-asc="customer.name"
) )
@ -116,7 +138,7 @@ solid-router#navbar-router(default-route='dashboard')
empty-value='' empty-value=''
data-trans="empty-value=menuLeft.emptyCircleProject.project" data-trans="empty-value=menuLeft.emptyCircleProject.project"
widget-project='hubl-menu-fix-url-project' widget-project='hubl-menu-fix-url-project'
order-by="project.customer.name" order-asc="project.customer.name"
) )
div.divider div.divider
if endpoints.circles || (endpoints.get && endpoints.get.circles) if endpoints.circles || (endpoints.get && endpoints.get.circles)
@ -145,10 +167,9 @@ solid-router#navbar-router(default-route='dashboard')
empty-value='' empty-value=''
data-trans="empty-value=menuLeft.emptyCircleProject.circle" data-trans="empty-value=menuLeft.emptyCircleProject.circle"
widget-circle='hubl-menu-fix-url-circle' widget-circle='hubl-menu-fix-url-circle'
order-by="circle.name" order-asc="circle.name"
) )
div.divider div.divider
if endpoints.users || (endpoints.get && endpoints.get.users)
div.menu-wrapper div.menu-wrapper
div.menu.segment.lg-auto.padding.text-bold div.menu.segment.lg-auto.padding.text-bold
div.menu-icon.icon-envelope-letter.segment.lg-auto.margin-right-xsmall.float-left div.menu-icon.icon-envelope-letter.segment.lg-auto.margin-right-xsmall.float-left
@ -162,25 +183,21 @@ solid-router#navbar-router(default-route='dashboard')
div div
div div
div div
solid-display.nosub.message-tab.segment.lg-full( //- search-fields="contact.name"
data-src=`${endpoints.users || (endpoints.get && endpoints.get.users)}` //- search-label-contact.name=""
fields='name, chatProfile.jabberID, badge' //- data-trans="search-label-contact.name=menuLeft.search"
class-name='sub-menu-name' //- search-widget-contact.name="hubl-search-users"
class-badge='sub-menu-badge' solid-display.message-tab.segment.lg-full(
bind-user
nested-field='contacts'
fields='contact'
loader-id='loader-messages' loader-id='loader-messages'
search-fields="name" empty-widget='hubl-create-contact'
search-label-name="" empty-value=''
search-class-name="search-field" widget-contact='hubl-menu-fix-url-contact'
data-trans="search-label-name=menuLeft.search" order-asc="contact.username"
search-widget-name="hubl-search-users"
widget-name='solid-display-div'
widget-badge='hubl-counter'
widget-chatProfile.jabberID='hubl-menu-jabberid'
action-badge='badge'
order-by='username'
next='messages'
paginate-by='10'
) )
div.divider
solid-route(name='admin', hidden) solid-route(name='admin', hidden)
solid-route.menu(name='profile', hidden) solid-route.menu(name='profile', hidden)

View File

@ -0,0 +1,4 @@
//- Templates for notifications
include notifications/message-circle.pug
include notifications/message-private.pug

View File

@ -18,7 +18,6 @@ solid-ac-checker(permission='acl:Read', bind-resources)
solid-link(class='backlink right', bind-resources, next='project-profile' data-trans='project.edit.backlink') solid-link(class='backlink right', bind-resources, next='project-profile' data-trans='project.edit.backlink')
div.segment.padding-large div.segment.padding-large
include ../../templates/hubl-user-avatar.pug
solid-widget(name="project-edit-members-delete") solid-widget(name="project-edit-members-delete")
template template
@ -65,7 +64,7 @@ div.segment.padding-large
submit-button='Enregistrer' submit-button='Enregistrer'
next='project-information' next='project-information'
data-trans='label-name=project.edit.labelName;label-customer.name=project.edit.labelCustomer;submit-button=project.edit.buttonSubmit' data-trans='label-name=project.edit.labelName;label-captain=project.edit.labelCaptain;label-customer.name=project.edit.labelCustomer;label-description=project.edit.labelDescription;submit-button=project.edit.buttonSubmit'
) )
h3.segment.padding-bottom-small.border-bottom.border-color-grey.text-color-heading.text-bold.text-letter-spacing-large(data-trans='project.edit.subTitle') h3.segment.padding-bottom-small.border-bottom.border-color-grey.text-color-heading.text-bold.text-letter-spacing-large(data-trans='project.edit.subTitle')

View File

@ -3,7 +3,6 @@ solid-router(default-route='project-profile', hidden)
solid-route(name='project-edit') solid-route(name='project-edit')
#project-profile(hidden, data-view="project-profile") #project-profile(hidden, data-view="project-profile")
include ../../templates/hubl-captain.pug
solid-ac-checker(permission='acl:Read', bind-resources) solid-ac-checker(permission='acl:Read', bind-resources)
div.segment.padding-large.border-bottom.border-color-grey.clearfix div.segment.padding-large.border-bottom.border-color-grey.clearfix

View File

@ -0,0 +1,4 @@
//- Import your widgets from the `widget`folder here
include widgets/hubl-captain.pug
include widgets/hubl-user-avatar.pug

View File

@ -1,9 +1,7 @@
include hubl-user-avatar.pug
solid-widget(name='hubl-captain') solid-widget(name='hubl-captain')
template template
solid-display.user-thumb( solid-display.user-thumb(
data-src="${await value}" data-src="${value}"
fields='account.picture, content(name-and-icon(name, user, is_lead), sub(atom, communities))' fields='account.picture, content(name-and-icon(name, user, is_lead), sub(atom, communities))'
class-account.picture='user-thumb-avatar' class-account.picture='user-thumb-avatar'

View File

@ -0,0 +1,2 @@
solid-widget(name='hubl-user-avatar')
template ${value ? `<img src="${value}" style="max-width:100%; max-height: 100%;" />` : `<object type="image/svg+xml" data="/images/alien.svg"></object>`}