From 8784ae7641aceacdadfa683914b37094e1a6f9d0 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Tue, 12 Nov 2019 13:13:52 +0100
Subject: [PATCH] fix: selector for admin css

---
 src/scripts/index.js                       |  6 +++---
 src/styles/layout/circle/circle-admin.scss |  2 +-
 src/styles/layout/circle/circle.scss       | 10 +++++++++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/scripts/index.js b/src/scripts/index.js
index b48dd538..6b7e65b9 100644
--- a/src/scripts/index.js
+++ b/src/scripts/index.js
@@ -48,7 +48,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
   document.querySelector('sib-auth').getUser().then(user => {
     if(user !== null) {
       // Hide login button if already logged
-      document.querySelector('button[role="log in"]').style.display = 'none';
+      document.querySelector('button[role="log in"]').setAttribute('style', 'display:none !important');
       // Set current user id on set-user-id of sib-display
       for(sibDisplay of document.querySelectorAll('sib-display[set-user-id]')) {
         sibDisplay.setAttribute(sibDisplay.getAttribute('set-user-id'), user['@id']);
@@ -58,7 +58,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
         sibForm.addEventListener('populate', () => {
           // BUG: Populate event trigger before the view is fully loaded! - https://git.happy-dev.fr/startinblox/framework/sib-core/issues/521
           document.querySelectorAll('sib-ac-checker:not([hidden]) > sib-delete[data-label^="Leave"]').forEach((el)=>{
-            querySelectorParentChild(el, 'sib-form[submit-button^="Join"]').style.display = "none";
+            querySelectorParentChild(el, 'sib-form[submit-button^="Join"]').setAttribute('style', 'display:none !important');
           });
           for(select of sibForm.querySelectorAll('select[name="'+sibForm.getAttribute('set-user-id-select')+'"]')) {
             for(option of select.options) {
@@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
         });
       }
       for(leaveBtn of document.querySelectorAll('admin-circle-leave > sib-ac-checker:not([hidden])')) {
-        leaveBtn.parentNode.parentNode.parentNode.nextElementSibling.style.display = "none"; // Hide Join button
+        leaveBtn.parentNode.parentNode.parentNode.nextElementSibling.setAttribute('style', 'display:none !important'); // Hide Join button
       }
     }
   }).catch(error => console.log(error));
diff --git a/src/styles/layout/circle/circle-admin.scss b/src/styles/layout/circle/circle-admin.scss
index c9593494..ba4b600d 100644
--- a/src/styles/layout/circle/circle-admin.scss
+++ b/src/styles/layout/circle/circle-admin.scss
@@ -9,7 +9,7 @@
 }
 
 .circle-admin-join-button select[name='user'] {
-  display: none;
+  display: none!important;
 }
 
 #admin-circle-list{
diff --git a/src/styles/layout/circle/circle.scss b/src/styles/layout/circle/circle.scss
index b54a0ade..caf0bbfc 100644
--- a/src/styles/layout/circle/circle.scss
+++ b/src/styles/layout/circle/circle.scss
@@ -36,10 +36,18 @@
       display: contents;
     }
 
-    hd-user-avatar, hd-user-avatar > * {
+    hd-user-avatar, hd-user-avatar > *, hd-user-groups {
       display: flex!important;
     }
 
+    sib-set-default[name="buttons"] * {
+      display: inline-block!important;
+    }
+    
+    sib-set-default[name="buttons"] select[name='user'] {
+      display: none!important;
+    }
+
     sib-set-default[name='buttons'],
     .cell,
     .table-header {
-- 
GitLab