aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/CurrentUserUtils.ts1
-rw-r--r--src/client/views/DashboardView.tsx31
2 files changed, 32 insertions, 0 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index c0318e86b..3085e7e72 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -1286,6 +1286,7 @@ export class CurrentUserUtils {
public static get ActivePresentation() { return Cast(Doc.UserDoc().activePresentation, Doc, null); }
public static get MyRecentlyClosed() { return Cast(Doc.UserDoc().myRecentlyClosedDocs, Doc, null); }
public static get MyDashboards() { return Cast(Doc.UserDoc().myDashboards, Doc, null); }
+ public static get MySharedDocs() { return Cast(Doc.UserDoc().mySharedDocs, Doc, null); }
public static get EmptyPane() { return Cast(Doc.UserDoc().emptyPane, Doc, null); }
public static get OverlayDocs() { return DocListCast((Doc.UserDoc().myOverlayDocs as Doc)?.data); }
public static set SelectedTool(tool: InkTool) { Doc.UserDoc().activeInkTool = tool; }
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index 9f497dcbf..a105e0790 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -15,6 +15,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { ContextMenuProps } from "./ContextMenuItem";
import { simulateMouseClick } from "../../Utils";
import { SharingManager } from "../util/SharingManager";
+import { CollectionViewType } from "./collections/CollectionView";
enum DashboardGroup {
MyDashboards, SharedDashboards
@@ -54,6 +55,11 @@ export class DashboardView extends React.Component {
}
}
+ getSharedDashboards = () => {
+ const sharedDashs = DocListCast(CurrentUserUtils.MySharedDocs.data).filter(doc => doc._viewType === CollectionViewType.Docking);
+ return sharedDashs.filter((dashboard) => !DocListCast(CurrentUserUtils.MySharedDocs.viewed).includes(dashboard))
+ }
+
createNewDashboard = async (name: string) => {
const batch = UndoManager.StartBatch("new dash");
await CurrentUserUtils.createNewDashboard(Doc.UserDoc(), undefined, name);
@@ -129,6 +135,31 @@ export class DashboardView extends React.Component {
</div>
})}
+ </div>
+
+ <div style={{display:"block"}} > UNVIEWED SHARED DASHBOARDS </div>
+ <div className="all-dashboards">
+ {this.getSharedDashboards().map((dashboard) => {
+ const href = ImageCast((dashboard.thumb as Doc)?.data)?.url.href;
+ return <div className="dashboard-container" key={dashboard[Id]}
+ onContextMenu={(e) => {this.onContextMenu(dashboard, e)}}
+ onClick={e => this.clickDashboard(e, dashboard)}>
+ <img src={href ?? "https://media.istockphoto.com/photos/hot-air-balloons-flying-over-the-botan-canyon-in-turkey-picture-id1297349747?b=1&k=20&m=1297349747&s=170667a&w=0&h=oH31fJty_4xWl_JQ4OIQWZKP8C6ji9Mz7L4XmEnbqRU="}></img>
+ <div className="info">
+ <div className="title"> {StrCast(dashboard.title)} </div>
+ <div className="more" onPointerDown={e => {
+ this._downX = e.clientX;
+ this._downY = e.clientY;
+ }}
+ onClick={(e) => {this.onContextMenu(dashboard, e)}}
+ >
+ <FontAwesomeIcon color="black" size="lg" icon="bars" />
+ </div>
+ </div>
+
+ </div>
+
+ })}
</div>
</div>