From 611992db3635123da39c64a98ff656a5d2f38f7a Mon Sep 17 00:00:00 2001
From: bobzel
Date: Mon, 28 Aug 2023 14:12:05 -0400
Subject: fixed runtime error in sharing manager when sharing the dashboard
---
src/client/util/SharingManager.tsx | 28 +++++++++++++++-------------
src/fields/Doc.ts | 2 +-
2 files changed, 16 insertions(+), 14 deletions(-)
(limited to 'src')
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 9a9097bf7..8d59426ec 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -378,15 +378,17 @@ export class SharingManager extends React.Component<{}> {
}
});
- const { left, width, top, height } = this.shareDocumentButtonRef.current!.getBoundingClientRect();
- TaskCompletionBox.popupX = left - 1.5 * width;
- TaskCompletionBox.popupY = top - 1.5 * height;
- TaskCompletionBox.textDisplayed = 'Document shared!';
- TaskCompletionBox.taskCompleted = true;
- setTimeout(
- action(() => (TaskCompletionBox.taskCompleted = false)),
- 2000
- );
+ if (this.shareDocumentButtonRef.current) {
+ const { left, width, top, height } = this.shareDocumentButtonRef.current.getBoundingClientRect();
+ TaskCompletionBox.popupX = left - 1.5 * width;
+ TaskCompletionBox.popupY = top - 1.5 * height;
+ TaskCompletionBox.textDisplayed = 'Document shared!';
+ TaskCompletionBox.taskCompleted = true;
+ setTimeout(
+ action(() => (TaskCompletionBox.taskCompleted = false)),
+ 2000
+ );
+ }
this.layoutDocAcls = false;
this.selectedUsers = null;
@@ -555,7 +557,7 @@ export class SharingManager extends React.Component<{}> {
background: SettingsManager.userBackgroundColor,
color: StrCast(Doc.UserDoc().userColor),
}}>
-
+
window.open('https://brown-dash.github.io/Dash-Documentation/features/collaboration/', '_blank')}>
window.open('https://brown-dash.github.io/Dash-Documentation/features/collaboration/', '_blank')} />
@@ -563,10 +565,10 @@ export class SharingManager extends React.Component<{}> {
{this.focusOn(docs.length < 2 ? StrCast(targetDoc?.title, 'this document') : '-multiple-')}
- } iconPlacement={'left'} text={'Copy Guest URL'} onClick={this.copyURL} />
+ } iconPlacement={'left'} text={'Copy Guest URL'} onClick={this.copyURL} />
- } onClick={this.close} color={StrCast(Doc.UserDoc().userColor)} />
+ } onClick={this.close} color={SettingsManager.userColor} />
{admin ? (
@@ -608,7 +610,7 @@ export class SharingManager extends React.Component<{}> {
-
+
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index f17e10d9e..ad0e548ed 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1001,7 +1001,7 @@ export namespace Doc {
references.add(doc);
return;
}
- const excludeLists = doc.title === 'My Recently Closed' || doc.title === 'My Header Bar' || doc.title === 'My Dashboards';
+ const excludeLists = ['My Recently Closed', 'My Header Bar', 'My Dashboards'].includes(StrCast(doc.title));
if (system !== undefined && ((system && !Doc.IsSystem(doc)) || (!system && Doc.IsSystem(doc)))) return;
references.add(doc);
Object.keys(doc).forEach(key => {
--
cgit v1.2.3-70-g09d2
From 49ff44c885e6a823f9579c1c3248feff44af015a Mon Sep 17 00:00:00 2001
From: bobzel
Date: Mon, 28 Aug 2023 14:39:28 -0400
Subject: fixed explore button
---
src/client/views/topbar/TopBar.tsx | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
(limited to 'src')
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index 68446d4e7..5b097e639 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -1,5 +1,5 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { Button, IconButton, isDark, Size, Type } from 'browndash-components';
+import { Button, IconButton, isDark, Size, Toggle, Type } from 'browndash-components';
import { action, computed, observable, reaction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
@@ -37,10 +37,10 @@ export class TopBar extends React.Component {
};
@computed get color() {
- return StrCast(Doc.UserDoc().userColor, Colors.LIGHT_GRAY);
+ return SettingsManager.userColor;
}
@computed get variantColor() {
- return StrCast(Doc.UserDoc().userVariantColor, Colors.MEDIUM_BLUE);
+ return SettingsManager.userVariantColor;
}
@computed get backgroundColor() {
return PingManager.Instance.IsBeating ? SettingsManager.userBackgroundColor : Colors.MEDIUM_GRAY;
@@ -76,7 +76,17 @@ export class TopBar extends React.Component {
dash
)}
- {Doc.ActiveDashboard &&