From b7ec25b883020695abb550d8fc169275c86a9e27 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 28 Sep 2020 12:42:13 +0000 Subject: [PATCH 1/9] cicd: lescanumeriques, cpe & lepool --- .gitlab-ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 704c6db..5f57299 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -607,3 +607,57 @@ toulouse: when: manual tags: - deploy + +lepool: + stage: deployment + environment: + name: lepool + url: https://lepool.hubl.world + before_script: + - npm ci --cache .npm --prefer-offline --only=production + script: + - echo "$APP_CONFIG_LEPOOL" > 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/* lepool@astral.startinblox.com:~/front/ + only: + - master + when: manual + tags: + - deploy + +cpe: + stage: deployment + environment: + name: cpe + url: https://cpe.hubl.world + before_script: + - npm ci --cache .npm --prefer-offline --only=production + script: + - echo "$APP_CONFIG_CPE" > 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/* cpe@astral.startinblox.com:~/front/ + only: + - master + when: manual + tags: + - deploy + +lescanumeriques: + stage: deployment + environment: + name: lescanumeriques + url: https://fichemetier.fr.hubl.world + before_script: + - npm ci --cache .npm --prefer-offline --only=production + script: + - echo "$APP_CONFIG_LESCANUMERIQUES" > 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/* lescanumeriques@astral.startinblox.com:~/front/ + only: + - master + when: manual + tags: + - deploy \ No newline at end of file From 7d82f951250ed506d75a161db9e6a1aa986d3dbe Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Mon, 28 Sep 2020 14:47:37 +0200 Subject: [PATCH 2/9] feature: beta label added --- src/header.pug | 9 ++++--- src/styles/base/header.scss | 40 +++++++++++++++++++++++++----- src/styles/components/sidebar.scss | 4 +++ 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/header.pug b/src/header.pug index 3de936b..552f26f 100644 --- a/src/header.pug +++ b/src/header.pug @@ -1,6 +1,9 @@ -.logo - solid-link(next='dashboard') - img(src=`${clientLogo || '/images/logo.png'}` style=`max-height:${clientLogoHeight || '32px'}`) +.header-left + .logo + solid-link(next='dashboard') + img(src=`${clientLogo || '/images/logo.png'}` style=`max-height:${clientLogoHeight || '32px'}`) + + span.beta-tag Beta solid-notifications.notLoggedIn( nested-field="inbox" diff --git a/src/styles/base/header.scss b/src/styles/base/header.scss index 7966a19..1f7f663 100644 --- a/src/styles/base/header.scss +++ b/src/styles/base/header.scss @@ -26,6 +26,34 @@ } } + .header-left { + flex-grow: 1; + position: relative; + + .logo { + display: inline-block; + } + + .beta-tag { + display: none; + + @include breakpoint(lg) { + display: inline-block; + font-size: 1.4rem; + font-weight: 600; + line-height: 19px; + letter-spacing: 0.19px; + padding: 3px 13px 3px 15px; + border-radius: 3px; + background: var(--color-primary); + color: var(--color-complementary); + position: absolute; + top: -9px; + left: 267px; + } + } + } + >*:not(:first-child) { margin-left: 2rem; @@ -34,15 +62,15 @@ } } - .logo { - flex: 1 0 0; - align-items: stretch; - } - - /* To remove the place taken by this element */ + /* Fix: to remove the place taken by these elements */ solid-widget[name='hubl-user-avatar'] { display: contents; } + + solid-notifications-template[data-rdf-type='hd:circle'], + solid-notifications-template[data-rdf-type='foaf:user'] { + position: absolute; + } } /* General styling for both notification and user's panel */ diff --git a/src/styles/components/sidebar.scss b/src/styles/components/sidebar.scss index 9454ebe..012f7ce 100644 --- a/src/styles/components/sidebar.scss +++ b/src/styles/components/sidebar.scss @@ -8,6 +8,10 @@ &.with-padding { padding: 1.3rem; + + @include breakpoint(lg) { + padding: 2.5rem; + } } } From 927c76b442d60c8e2a63c260cd07b1d89e80e06c Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Mon, 28 Sep 2020 17:02:28 +0200 Subject: [PATCH 3/9] fix: color for HD beta label --- client.sample.happy-dev.css | 6 ++++++ src/styles/base/header.scss | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client.sample.happy-dev.css b/client.sample.happy-dev.css index 2ce6bdc..bcb1d5c 100644 --- a/client.sample.happy-dev.css +++ b/client.sample.happy-dev.css @@ -144,6 +144,12 @@ --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"] { diff --git a/src/styles/base/header.scss b/src/styles/base/header.scss index 1f7f663..eca9ca6 100644 --- a/src/styles/base/header.scss +++ b/src/styles/base/header.scss @@ -46,7 +46,7 @@ padding: 3px 13px 3px 15px; border-radius: 3px; background: var(--color-primary); - color: var(--color-complementary); + color: var(--color-white); position: absolute; top: -9px; left: 267px; From 4578b30ff95c6546724b708583e338acea0f0891 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Wed, 7 Oct 2020 14:25:53 +0200 Subject: [PATCH 4/9] minor: form feedbacks --- cypress/integration/edit-user.spec.js | 4 ++-- src/dependencies.pug | 4 +++- src/scripts/save-feedback.js | 19 +++++++++++++++++++ .../admin/page-admin-projects-create.pug | 11 ----------- src/views/admin/page-admin-users-create.pug | 13 +++++++++++++ src/views/admin/page-admin-users-edit.pug | 1 + src/views/circle/page-circle-edit.pug | 4 ++-- 7 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 src/scripts/save-feedback.js diff --git a/cypress/integration/edit-user.spec.js b/cypress/integration/edit-user.spec.js index 5bc2923..ff82266 100644 --- a/cypress/integration/edit-user.spec.js +++ b/cypress/integration/edit-user.spec.js @@ -66,8 +66,8 @@ context('Edit User Browser Testing', () => { cy.contains('solid-display-value[name="name"]', userFirstName + ' ' + userLastName).should("exist"); cy.contains('solid-display-value[name="profile.job"]', jobDescription).should("exist"); cy.contains('solid-display-value[name="profile.city"]', city).should("exist"); - cy.contains('solid-display-tel[name="profile.phone"] a', phone).should("exist"); - cy.contains('profile-website[name="profile.website"] a', website).should("exist"); + cy.contains('directory-link-tel a', phone).should("exist"); + cy.contains('directory-website a', website).should("exist"); }); }); }); diff --git a/src/dependencies.pug b/src/dependencies.pug index 562b7ef..7222b97 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -23,7 +23,7 @@ if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) //- 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)) - script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.8" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.9" defer) //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) @@ -34,6 +34,8 @@ if endpoints.users || (endpoints.get && endpoints.get.users) script(type="module" src="https://unpkg.com/@startinblox/component-chat@1.1" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) +script(src="https://cdn.jsdelivr.net/npm/sweetalert2@10") + script(src="/scripts/index.js" defer) //- Stylesheets diff --git a/src/scripts/save-feedback.js b/src/scripts/save-feedback.js new file mode 100644 index 0000000..154bddf --- /dev/null +++ b/src/scripts/save-feedback.js @@ -0,0 +1,19 @@ +document.addEventListener("DOMContentLoaded", () => { + const Toast = Swal.mixin({ + toast: true, + position: 'top', + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer) + toast.addEventListener('mouseleave', Swal.resumeTimer) + } + }) + document.addEventListener("save", () => { + Toast.fire({ + icon: 'success', + title: 'Succès!' + }) + }); +}); \ No newline at end of file diff --git a/src/views/admin/page-admin-projects-create.pug b/src/views/admin/page-admin-projects-create.pug index 202131b..8a42024 100644 --- a/src/views/admin/page-admin-projects-create.pug +++ b/src/views/admin/page-admin-projects-create.pug @@ -1,17 +1,6 @@ div.content-box__info.flex solid-link(class="backlink right" next='admin-project-list') Retour - solid-widget(name="hubl-admin-project-add-user") - template - solid-form( - data-holder - fields='user, project' - range-user=`${endpoints.users || endpoints.get.users}` - value-project='${src}' - widget-project='solid-form-hidden' - naked - ) - h1.centered Créer un nouveau projet div#loader-projects-create.loader.loader-top diff --git a/src/views/admin/page-admin-users-create.pug b/src/views/admin/page-admin-users-create.pug index f98c5f9..c0fb8b1 100644 --- a/src/views/admin/page-admin-users-create.pug +++ b/src/views/admin/page-admin-users-create.pug @@ -9,6 +9,16 @@ div.content-box__info.flex div div + solid-widget(name='hubl-username-field') + template + label Nom d'utilisateur* + input(type="text" title='Caractères alphanumérique uniquement' pattern="[a-zA-Z0-9]+" label="Nom d'utilisateur *" name="username" required value="\${value}" data-holder) + + solid-widget(name='hubl-email-field') + template + label E-mail * + input(type="email" label="E-mail *" name="email" required value="\${value}" data-holder) + solid-form.form.button-register( data-src=`${endpoints.users || endpoints.post.users}` @@ -32,6 +42,9 @@ div.content-box__info.flex value-password='' widget-password='solid-form-hidden' + widget-username='hubl-username-field' + widget-email='hubl-email-field' + next='admin-users-list' submit-button='Enregistrer' diff --git a/src/views/admin/page-admin-users-edit.pug b/src/views/admin/page-admin-users-edit.pug index af39318..572367a 100644 --- a/src/views/admin/page-admin-users-edit.pug +++ b/src/views/admin/page-admin-users-edit.pug @@ -32,6 +32,7 @@ div.content-box__info.flex label-first_name='Prénom *' label-last_name='Nom *' label-email='E-mail *' + widget-email='hubl-email-field' next='admin-user-list' diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index 3e7c5e5..281cff6 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -35,8 +35,8 @@ div.content-box__info label-status='Statut du cercle' widget-status='hubl-status' - label-name='Nom du cercle' - label-owner='Administrateur ou administratrice' + label-name='Nom du cercle *' + label-owner='Administrateur ou administratrice *' label-description='Sous-titre du cercle *' class-name='form-label is-light is-half-width input-text-like' From d2f2d594d0cecefb4ca1e7a8ffd1e9cef07caaf2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 8 Oct 2020 09:55:56 +0200 Subject: [PATCH 5/9] fix: redo 722 --- src/styles/base/about.scss | 14 ++++++-------- src/styles/base/user-thumb.scss | 2 +- src/views/circle/page-circle-profile.pug | 6 +++++- src/views/project/page-project-profile.pug | 9 ++++++++- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/styles/base/about.scss b/src/styles/base/about.scss index ead128a..ab2026a 100644 --- a/src/styles/base/about.scss +++ b/src/styles/base/about.scss @@ -1,6 +1,4 @@ #about{ - $main-color: rgb(236, 94, 92); - $second-color: white; h2,h3{ text-transform: uppercase; } @@ -37,10 +35,10 @@ } .main-cta{ - background: $second-color none repeat scroll 0% 0%; - border: 1px solid $main-color; + background: var(--color-white) none repeat scroll 0% 0%; + border: 1px solid var(--color-primary); border-radius: 55px; - color: $main-color; + color: var(--color-primary); cursor: pointer; font-weight: bold; text-transform: uppercase; @@ -51,8 +49,8 @@ } .main-cta:hover{ - background: $main-color none repeat scroll 0% 0%; - border : 1px solid $second-color; - color: $second-color; + background: var(--color-primary) none repeat scroll 0% 0%; + border : 1px solid var(--color-primary); + color: var(--color-white); } } \ No newline at end of file diff --git a/src/styles/base/user-thumb.scss b/src/styles/base/user-thumb.scss index 4b6f874..9dfa593 100644 --- a/src/styles/base/user-thumb.scss +++ b/src/styles/base/user-thumb.scss @@ -48,7 +48,7 @@ &::before { display: inline-block; - color: #FF6765; + color: var(--color-primary); } } } diff --git a/src/views/circle/page-circle-profile.pug b/src/views/circle/page-circle-profile.pug index 892ba4e..c62abae 100644 --- a/src/views/circle/page-circle-profile.pug +++ b/src/views/circle/page-circle-profile.pug @@ -87,11 +87,15 @@ solid-router(default-route='circle-profile', hidden) bind-resources nested-field='members' loader-id='loader-circle-profile' - fields='classGroup(user.account.picture, sup(user.name, is_admin), sub(user.profile.city))' + fields='classGroup(user.account.picture, sup(user.name, send, is_admin), sub(user.profile.city))' + + action-send="messages" + label-send="" class-classGroup='user-thumb is-spaced' class-user.account.picture='avatar user-thumb__picture' class-user.name='user-thumb__name' + class-send='user-thumb__send' class-is_admin='user-thumb__admin' class-user.profile.city='user-thumb__city' diff --git a/src/views/project/page-project-profile.pug b/src/views/project/page-project-profile.pug index 30d39f2..b21502f 100644 --- a/src/views/project/page-project-profile.pug +++ b/src/views/project/page-project-profile.pug @@ -5,6 +5,10 @@ solid-router(default-route='project-profile', hidden) #project-profile(hidden) include ../../templates/hubl-captain.pug + solid-widget(name='hubl-project-team-contact') + template + solid-link(data-src='\${value}', next='messages') + .content-box__info.flex div#loader-project-profile.loader @@ -85,11 +89,14 @@ solid-router(default-route='project-profile', hidden) solid-display.block( bind-resources nested-field='members' - fields='classGroup(user.account.picture, sup(user.name, is_admin), sub(user.profile.city, name))' + fields='classGroup(user.account.picture, sup(user.name, user, is_admin), sub(user.profile.city, name))' + + widget-user='hubl-project-team-contact' class-classGroup='user-thumb is-spaced' class-user.account.picture='avatar user-thumb__picture' class-user.name='user-thumb__name' + class-user='user-thumb__send' class-is_admin='user-thumb__admin' class-user.profile.city='user-thumb__city' class-name='user-thumb__lead' From a356e0102613a229f0c16ebe08fdc9e16c7fdca2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 8 Oct 2020 10:07:00 +0200 Subject: [PATCH 6/9] cicd: add sentry integration --- src/components/sentry.js | 7 +++++++ src/dependencies.pug | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 src/components/sentry.js diff --git a/src/components/sentry.js b/src/components/sentry.js new file mode 100644 index 0000000..5509fc1 --- /dev/null +++ b/src/components/sentry.js @@ -0,0 +1,7 @@ +Sentry.init({ + dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4', + integrations: [new Sentry.Integrations.BrowserTracing()], + environment: document.location.hostname, + tracesSampleRate: 1.0, + }); + \ No newline at end of file diff --git a/src/dependencies.pug b/src/dependencies.pug index 7222b97..703d847 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -1,3 +1,5 @@ +script(src="https://browser.sentry-cdn.com/5.24.2/bundle.tracing.min.js" integrity="sha384-Epltozh7S1cJM2hcIRDJBbqiiVpZsNlFCciHxKIAfKN8mSTa+gMivtz7glp/30Mz" crossorigin="anonymous" 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) From 2c539947a581a49c7cbd8bb32e1c68f306f21d11 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 8 Oct 2020 10:21:36 +0200 Subject: [PATCH 7/9] cicd: fix sentry integration --- src/components/sentry.js | 15 ++++++++------- src/dependencies.pug | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/sentry.js b/src/components/sentry.js index 5509fc1..f406310 100644 --- a/src/components/sentry.js +++ b/src/components/sentry.js @@ -1,7 +1,8 @@ -Sentry.init({ - dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4', - integrations: [new Sentry.Integrations.BrowserTracing()], - environment: document.location.hostname, - tracesSampleRate: 1.0, - }); - \ No newline at end of file +if(typeof Sentry !== 'undefined') { + Sentry.init({ + dsn: 'https://b4b29557689049a39168599577adb940@sentry.startinblox.com/4', + integrations: [new Sentry.Integrations.BrowserTracing()], + environment: document.location.hostname, + tracesSampleRate: 1.0, + }); +} \ No newline at end of file diff --git a/src/dependencies.pug b/src/dependencies.pug index 703d847..754c486 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -1,4 +1,4 @@ -script(src="https://browser.sentry-cdn.com/5.24.2/bundle.tracing.min.js" integrity="sha384-Epltozh7S1cJM2hcIRDJBbqiiVpZsNlFCciHxKIAfKN8mSTa+gMivtz7glp/30Mz" crossorigin="anonymous" defer) +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) From 3451a2ab2fca5efd1fdf016048c078b19b3843e6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 8 Oct 2020 12:31:26 +0200 Subject: [PATCH 8/9] feature: arrow on circle and project --- src/menu-left.pug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/menu-left.pug b/src/menu-left.pug index 3180ce7..5b19711 100644 --- a/src/menu-left.pug +++ b/src/menu-left.pug @@ -70,12 +70,12 @@ solid-router#navbar-router(default-route='dashboard') div.menu-icon.icon-calendar div.divider if endpoints.projects || (endpoints.get && endpoints.get.projects) - div + div.menu-wrapper solid-link //- (next='admin-project-list') div.menu div.menu-chevron - div.menu-icon + div.menu-icon.icon-arrow-up //- div.menu-icon.icon-arrow-right-circle div.menu-label Projets div.menu-icon.icon-folder-alt @@ -99,12 +99,12 @@ solid-router#navbar-router(default-route='dashboard') ) div.divider if endpoints.circles || (endpoints.get && endpoints.get.circles) - div + div.menu-wrapper solid-link //- (next='admin-circle-list') div.menu div.menu-chevron - div.menu-icon + div.menu-icon.icon-arrow-up //- div.menu-icon.icon-arrow-right-circle div.menu-label Cercles div.menu-icon.icon-folder-alt From 9fd676d6ab56a9ee00329dbf534cd4b37b75d91d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 8 Oct 2020 14:03:30 +0200 Subject: [PATCH 9/9] fix: circle link 722 --- src/views/circle/page-circle-profile.pug | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/circle/page-circle-profile.pug b/src/views/circle/page-circle-profile.pug index c62abae..c2b5aa8 100644 --- a/src/views/circle/page-circle-profile.pug +++ b/src/views/circle/page-circle-profile.pug @@ -3,6 +3,10 @@ solid-router(default-route='circle-profile', hidden) solid-route(name='circle-edit') #circle-profile(hidden) + + solid-widget(name='hubl-circle-team-contact') + template + solid-link(data-src='\${value}', next='messages') .content-box__info.flex @@ -87,15 +91,14 @@ solid-router(default-route='circle-profile', hidden) bind-resources nested-field='members' loader-id='loader-circle-profile' - fields='classGroup(user.account.picture, sup(user.name, send, is_admin), sub(user.profile.city))' + fields='classGroup(user.account.picture, sup(user.name, user, is_admin), sub(user.profile.city))' - action-send="messages" - label-send="" + widget-user='hubl-circle-team-contact' class-classGroup='user-thumb is-spaced' class-user.account.picture='avatar user-thumb__picture' class-user.name='user-thumb__name' - class-send='user-thumb__send' + class-user='user-thumb__send' class-is_admin='user-thumb__admin' class-user.profile.city='user-thumb__city'