aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DashboardView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-07-07 14:20:57 -0400
committerbobzel <zzzman@gmail.com>2023-07-07 14:20:57 -0400
commit0f0d646e45de42c7f84f6fa316c80d1413f92e5c (patch)
tree4322fc75f8621c793d623be4836f3d77894156e3 /src/client/views/DashboardView.tsx
parentfa38dbe06d6ddb5f4499b759459a24d2b3c111e8 (diff)
parentaaaea6344e74b2d4585dccbc0ca3f0249d6dacd6 (diff)
added a dashboard count to dashboard view to indicate that shared dashboards exist. made dashboard lists scrollable. made guest mode be livePlayground to
Diffstat (limited to 'src/client/views/DashboardView.tsx')
-rw-r--r--src/client/views/DashboardView.tsx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx
index 6feeb8846..123090fcf 100644
--- a/src/client/views/DashboardView.tsx
+++ b/src/client/views/DashboardView.tsx
@@ -62,15 +62,13 @@ export class DashboardView extends React.Component {
Doc.ActivePage = 'dashboard';
};
- getDashboards = () => {
+ getDashboards = (whichGroup: DashboardGroup) => {
const allDashboards = DocListCast(Doc.MyDashboards.data);
- if (this.selectedDashboardGroup === DashboardGroup.MyDashboards) {
+ if (whichGroup === DashboardGroup.MyDashboards) {
return allDashboards.filter(dashboard => Doc.GetProto(dashboard).author === Doc.CurrentUserEmail);
- } else {
- const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc.dockingConfig);
- // const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc._type_collection === CollectionViewType.Docking);
- return sharedDashboards;
}
+ const sharedDashboards = DocListCast(Doc.MySharedDocs.data).filter(doc => doc.dockingConfig);
+ return sharedDashboards;
};
isUnviewedSharedDashboard = (dashboard: Doc): boolean => {
@@ -159,14 +157,14 @@ export class DashboardView extends React.Component {
<Button icon={<FaPlus />} size={Size.MEDIUM} text="New" onClick={() => this.setNewDashboardName('')} />
</div>
<div className={`text-button ${this.selectedDashboardGroup === DashboardGroup.MyDashboards && 'selected'}`} onClick={() => this.selectDashboardGroup(DashboardGroup.MyDashboards)}>
- My Dashboards
+ {'My Dashboards (' + this.getDashboards(DashboardGroup.MyDashboards).length + ')'}
</div>
<div className={`text-button ${this.selectedDashboardGroup === DashboardGroup.SharedDashboards && 'selected'}`} onClick={() => this.selectDashboardGroup(DashboardGroup.SharedDashboards)}>
- Shared Dashboards
+ {'Shared Dashboards (' + this.getDashboards(DashboardGroup.SharedDashboards).length + ')'}
</div>
</div>
<div className="all-dashboards">
- {this.getDashboards().map(dashboard => {
+ {this.getDashboards(this.selectedDashboardGroup).map(dashboard => {
const href = ImageCast(dashboard.thumb)?.url.href;
const shared = Object.keys(dashboard[DocAcl])
.filter(key => key !== `acl-${Doc.CurrentUserEmailNormalized}` && !['acl-Me', 'acl-Public'].includes(key))