update: remove HDAppUserInfo and HDAppAuthor
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user