From 2be46741ed306ab8a62c8be8e4f4f06909bc84c2 Mon Sep 17 00:00:00 2001 From: Pascal Date: Wed, 22 Jan 2025 15:34:51 +0100 Subject: [PATCH] css_not_ok --- public/style/chat.css | 4 ++++ src/pages/chat/chat.ts | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/style/chat.css b/public/style/chat.css index 1c6a8c7..bd72d23 100755 --- a/public/style/chat.css +++ b/public/style/chat.css @@ -330,6 +330,10 @@ body { color: var(--primary-color); } +.my-process { + background-color: var(--accent-color); +} + #message-input { width: 100%; height: 50px; diff --git a/src/pages/chat/chat.ts b/src/pages/chat/chat.ts index 9942b1b..ad30453 100755 --- a/src/pages/chat/chat.ts +++ b/src/pages/chat/chat.ts @@ -792,12 +792,13 @@ class ChatElement extends HTMLElement { }); for (const process of processResult) { - //console.log('🎯 Processing process:', process); const li = document.createElement('li'); li.className = 'group-list-item'; const oneProcess = process.states[0].commited_in; + // Si le processus est dans notre Set, ajouter une classe spéciale if (processSet?.has(oneProcess)) { + li.classList.add('my-process'); console.log("Je suis le processus dans le set :" ,oneProcess); } @@ -913,6 +914,7 @@ class ChatElement extends HTMLElement { //fonction qui renvoie les processus où le sp_adress est impliqué private async getProcessesWhereTheCurrentMemberIs() { + const service = await Services.getInstance(); try { const currentMember = await service.getMemberFromDevice(); @@ -940,6 +942,7 @@ class ChatElement extends HTMLElement { } } + this.userProcessesSet = processSet; console.log("Ensemble des processus :", processSet); return processSet; } catch (e) { @@ -1257,17 +1260,13 @@ class ChatElement extends HTMLElement { async connectedCallback() { this.processId = this.getAttribute('process-id'); - //const processSet = await this.getProcessesWhereTheCurrentMemberIs(); - //this.userProcessesSet = processSet || null; - //console.log("📋 ProcessSet chargé:", this.userProcessesSet); - if (this.processId) { console.log("🔍 Chargement du chat avec processID"); await this.loadGroupListFromAProcess(this.processId); } else { console.log("🔍 Chargement des processus par défaut"); - await this.loadAllProcesses(); await this.getProcessesWhereTheCurrentMemberIs(); + await this.loadAllProcesses(); } if (this.selectedMember && this.selectedMember.length > 0) { @@ -1277,7 +1276,6 @@ class ChatElement extends HTMLElement { console.warn('⚠️ No member selected yet. Waiting for selection...'); } } - } customElements.define('chat-element', ChatElement);