Skip to content

Commit

Permalink
BDE-236 allow browsing documents if not admin
Browse files Browse the repository at this point in the history
  • Loading branch information
nxmatic committed Jul 9, 2024
1 parent 1622c3c commit e856a20
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/server-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class ServerConnector extends ServiceWorkerComponent {
asConnectRegistration() {
return this
.executeScript('connect-registration')
.then((result) => ({ ...result, serverUrl: this.serverUrl }));
.then((result) => ({ ...result, serverUrl: this.serverUrl }))
.catch((cause) => ({ cause, serverUrl: this.serverUrl }));
}

asInstalledAddons() {
Expand Down
15 changes: 15 additions & 0 deletions src/popup/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,21 @@ ABOUT
to {transform: rotate(-15deg);}
}

/*==============================================================================
Content messages
==============================================================================*/

#messages > #designer-livepreview-need-update {
display: none;
font-size: 0.75em;
}

#messages > #no-admin-rights {
display: none;
animation: blink 1s infinite alternate;
font-size: 0.75em;
}

/*==============================================================================
SHADE POPUP
==============================================================================*/
Expand Down
8 changes: 5 additions & 3 deletions src/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@

</div>

<div class="nxrow under-version-message message" id="messages">
<p id="designer-livepreview-need-update">Chrome version 72 or upper is needed to enable designer live preview functionality</p>
<p id="no-admin-rights">You need to be an administrator to enable the other features.</p>
</div>

<div class="buttons">
<div class="nxrow under-version-message" id="designer-livepreview-need-update">
<p>Chrome version 72 or upper is needed to enable designer live preview functionality</p>
</div>
<div id="studio-buttons">
<div class="nxrow">
<div class="hot-reload">
Expand Down
4 changes: 2 additions & 2 deletions src/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ function loadPage(worker) {
doGetJson(`id/${input}`);
}

function hideActionsAndToggles() {
function hideActionsAndToggles(messageId = 'no-admin-rights') {
$('.buttons').css('display', 'none');
$('.toggles').css('display', 'none');
$('.search').css('display', 'none');
$(`#messages > #${messageId}`).css('display', 'block');
}

pendingPromises.push(
Expand Down

0 comments on commit e856a20

Please sign in to comment.