aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/DashboardView.tsx10
-rw-r--r--src/client/views/topbar/TopBar.tsx9
2 files changed, 11 insertions, 8 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index efc1644fe..5aacec61f 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -40,10 +40,12 @@ export class DashboardView extends React.Component {
}
getDashboards = () => {
- const allDashbaords = DocListCast(CurrentUserUtils.MyDashboards.data);
- // TODO: filter the dashboards
- // return allDashbaords.filter(...)
- return allDashbaords
+ const allDashboards = DocListCast(CurrentUserUtils.MyDashboards.data);
+ if (this.selectedDashboardGroup === DashboardGroup.MyDashboards) {
+ return allDashboards.filter((dashboard) => Doc.GetProto(dashboard).author === Doc.CurrentUserEmail)
+ } else {
+ return allDashboards.filter((dashboard) => Doc.GetProto(dashboard).author !== Doc.CurrentUserEmail)
+ }
}
render() {
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index 0db3950a2..7ff7063cd 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -66,11 +66,12 @@ export class TopBar extends React.Component {
</Tooltip>
</div>
<div className="topbar-right" >
- <div className="topbar-button-text" onClick={() => {SharingManager.Instance.open(undefined, activeDashboard)}}>
- {/* TODO: if this is my dashboard, display share
+ {CurrentUserUtils.ActiveDashboard ? <div className="topbar-button-text" onClick={() => {SharingManager.Instance.open(undefined, activeDashboard)}}>
+ {/* TODO: if I have edit access to the dashboard, display share
if this is a shared dashboard, display "view original or view annotated" */}
- { Doc.GetProto(CurrentUserUtils.ActiveDashboard)?.author === Doc.CurrentUserEmail ? "Share": "view original" }
- </div>
+ {/* { Doc.GetProto(CurrentUserUtils.ActiveDashboard)?.author === Doc.CurrentUserEmail ? "Share": "view original" } */}
+ { GetEffectiveAcl(Doc.GetProto(CurrentUserUtils.ActiveDashboard)) === AclAdmin ? "Share": "view original" }
+ </div> : (null)}
<div className="topbar-button-icon" onClick={() => window.open(
"https://brown-dash.github.io/Dash-Documentation/", "_blank")}>
<FontAwesomeIcon icon="question-circle" />