update: remove HDAppUserInfo and HDAppAuthor

This commit is contained in:
Jean-Baptiste 2019-03-25 15:11:25 +01:00
parent 34804b8d0d
commit 5642525840
4 changed files with 6 additions and 63 deletions

View File

@ -5,7 +5,7 @@
script(src="/lib/oidc-client.js")
script(
src="https://cdn.happy-dev.fr/sib-oidc/sib-oidc.js"
src="https://unpkg.com/@startinblox/oidc"
data-authority=`${sdn}/openid/`,
data-client_id=`${client_id}`,
data-response_type='id_token token',
@ -34,8 +34,8 @@ link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Open+Sans:3
//- cdn
//- don't forget to change version in hd-widgets.js
script(type="module" src="https://unpkg.com/@startinblox/core@0.5.24")
script(type="module" src="https://unpkg.com/@startinblox/router@latest")
script(type="module" src="https://unpkg.com/@startinblox/core@0.6")
script(type="module" src="https://unpkg.com/@startinblox/router@0.6")
script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.1")
script(type="module" src="/scripts/hd-widgets.js")

View File

@ -9,9 +9,8 @@ div.grid-layer
data-fields='header, infos',
paginate-by='3',
set-header='user.account.picture, user, pseudonym, bio, send',
set-header='user.account.picture, user.first_name, user.last_name, pseudonym, bio, send',
widget-user.account.picture='sib-display-img',
widget-user='hdapp-userinfo',
set-pseudonym='before-pseudo,user.username',
value-before-pseudo='@',
value-send='SEND A MESSAGE',

View File

@ -54,10 +54,9 @@
id-suffix='members',
data-fields='teammate-img, teammate-profile, teammate-job',
set-teammate-img='user.account.picture',
set-teammate-profile='user, user.groups',
set-teammate-profile='user.first_name, user.last_name, user.groups',
set-teammate-job='name',
widget-user.account.picture='sib-display-img',
widget-user='hdapp-userinfo',
widget-user.groups='sib-display-lookuplist',
next='profile',
bind-resources,

View File

@ -1,32 +1,4 @@
import {Helpers, SIBWidget, SIBDisplayLookupList, store} from 'https://unpkg.com/@startinblox/core@0.5';
class HDAppUserInfo extends SIBDisplayLookupList {
get parentElement() {
return 'div';
}
getTemplate(value, index) {
var firstname, lastname, email;
if (typeof value == 'object')
if (Object.keys(value).length > 1) {
firstname = value.first_name;
lastname = value.last_name;
email = value.email;
} else {
store.get(value).then(resource => {
this.value.push(resource);
this.render();
});
if (Array.isArray(this.value))
this.value.splice(this.value.indexOf(value), 1);
else this.value = [];
return '';
}
return `<div>${firstname} ${lastname}</div>`;
// + `<div id="${email}">${email}</div>`;
}
}
import {Helpers, SIBWidget, store} from 'https://unpkg.com/@startinblox/core@0.6';
class HDAppMail extends SIBWidget {
get template() {
@ -51,31 +23,6 @@ class HDAppMember extends SIBWidget {
}
}
class HDAppAuthor extends SIBDisplayLookupList {
get parentElement() {
return 'div';
}
getTemplate(value, index) {
var firstname, lastname;
if (typeof value == 'object')
if (Object.keys(value).length > 1) {
firstname = value.user.first_name;
lastname = value.user.last_name;
} else {
store.get(value).then(resource => {
this.value.push(resource);
this.render();
});
if (Array.isArray(this.value))
this.value.splice(this.value.indexOf(value), 1);
else this.value = [];
return '';
}
return `${firstname} ${lastname}`;
}
}
class HDAppClosingDate extends SIBWidget {
get template() {
return this.value
@ -137,10 +84,8 @@ class HDAppFormText extends SIBWidget {
}
}
customElements.define('hdapp-userinfo', HDAppUserInfo);
customElements.define('hdapp-mail', HDAppMail);
customElements.define('hdapp-member', HDAppMember);
customElements.define('hdapp-author', HDAppAuthor);
customElements.define('hdapp-closing-date', HDAppClosingDate);
customElements.define('hdapp-available', HDAppAvailable);
customElements.define('hdapp-hyperlink', HDAppHyperlink);