Merge branch 'feature/port-test' into feature/cypress-testing

This commit is contained in:
Jean-Baptiste Pasquier 2020-09-17 12:40:13 +02:00
commit 5901bd06a1
6 changed files with 38 additions and 7 deletions

View File

@ -3,5 +3,6 @@
"defaultCommandTimeout": 60000,
"chromeWebSecurity": false,
"viewportWidth": 1920,
"viewportHeight": 1080
"viewportHeight": 1080,
"video": false
}

View File

@ -31,7 +31,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards)
//- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer)
if endpoints.users || (endpoints.get && endpoints.get.users)
script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer)
script(type="module" src="https://unpkg.com/@startinblox/component-chat@1.0" defer)
//- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer)
script(src="/scripts/index.js" defer)

View File

@ -1,7 +1,7 @@
document.addEventListener("DOMContentLoaded", function (event) {
window.addEventListener('newMessage', event => {
let jid = event.detail.jid;
Array.from(document.querySelectorAll('[data-jabberID="'+jid+'"]')).forEach(el => {
Array.from(document.querySelectorAll('[data-jabberID="' + jid + '"]')).forEach(el => {
el.parentElement.parentElement.classList.add('unread');
});
});
@ -9,7 +9,12 @@ document.addEventListener("DOMContentLoaded", function (event) {
window.addEventListener('read', (event) => {
if (event.detail && event.detail.resource && event.detail.resource['@id']) {
const badge = document.querySelector(`solid-badge[data-src="${event.detail.resource['@id']}"]`);
if (badge) badge.parentElement.parentElement.classList.remove('unread');
if (badge) {
badge.parentElement.parentElement.classList.remove('unread');
const project = badge.parentElement.parentElement.querySelector('.unread');
if (project) project.classList.remove('unread');
}
}
});
});

View File

@ -37,6 +37,21 @@
margin-right: 1rem;
}
.user-thumb__send {
position: relative;
bottom: 7px;
left: -5px;
solid-link {
@include icon('speech');
&::before {
display: inline-block;
color: #FF6765;
}
}
}
.user-thumb__admin:not(:empty) {
display: block !important;
@extend %tag-admin;

View File

@ -4,11 +4,15 @@ solid-widget(name='hubl-circle-team-template')
template
solid-display.user-thumb.is-spaced(
data-src='${await value.user}'
fields='account.picture, sup(name, isadmin), sub(profile.city)'
fields='account.picture, sup(name, send, isadmin), sub(profile.city)'
value-isadmin='${await value.is_admin}'
action-send="messages"
label-send=""
class-account.picture='avatar user-thumb__picture'
class-name='user-thumb__name'
class-send='user-thumb__send'
class-isadmin='user-thumb__admin'
class-profile.city='user-thumb__city'

View File

@ -1,15 +1,21 @@
include hubl-user-avatar.pug
solid-widget(name='hubl-project-team-contact')
template
solid-link(data-src='\${value}', next='messages')
solid-widget(name='hubl-project-team')
template
solid-display.user-thumb.is-spaced(
data-src='${await value}'
fields='user.account.picture, sup(user.name, isadmin), sub(user.profile.city, name)'
fields='user.account.picture, sup(user.name, user, isadmin), sub(user.profile.city, name)'
value-isadmin='${await value.is_admin}'
class-user.account.picture='avatar user-thumb__picture'
widget-user='hubl-project-team-contact'
class-user.account.picture='avatar user-thumb__picture'
class-user.name='user-thumb__name'
class-user='user-thumb__send'
class-isadmin='user-thumb__admin'
class-user.profile.city='user-thumb__city'
class-name='user-thumb__lead'