From 08ecf61295d794e61da716bf44e47545499d1547 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:08:21 -0400 Subject: [PATCH 1/3] convert starredProjects to star --- apps/new/widget/components/project/StarProject.jsx | 8 ++++---- apps/new/widget/page/projects/Watchlist.jsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/new/widget/components/project/StarProject.jsx b/apps/new/widget/components/project/StarProject.jsx index a9e1e3c5..ed95a1d5 100644 --- a/apps/new/widget/components/project/StarProject.jsx +++ b/apps/new/widget/components/project/StarProject.jsx @@ -12,7 +12,7 @@ useEffect(() => { State.update({ hasStar: null }); }, [item]); -const stars = Social.index("starredProjects", item); +const stars = Social.index("star", item); const dataLoading = stars === null; const starsByUsers = {}; @@ -48,7 +48,7 @@ const starClick = (event) => { const type = hasStar ? "unstar" : "star"; const data = { index: { - starredProjects: JSON.stringify({ + star: JSON.stringify({ key: item, value: { type, @@ -61,9 +61,9 @@ const starClick = (event) => { const keys = item.path.split("/"); if (keys.length > 0) { data.graph = { - starredProjects: {}, + star: {}, }; - let root = data.graph.starredProjects; + let root = data.graph.star; keys.slice(0, -1).forEach((key) => { root = root[key] = {}; }); diff --git a/apps/new/widget/page/projects/Watchlist.jsx b/apps/new/widget/page/projects/Watchlist.jsx index bdb97f75..1570bbe1 100644 --- a/apps/new/widget/page/projects/Watchlist.jsx +++ b/apps/new/widget/page/projects/Watchlist.jsx @@ -20,7 +20,7 @@ if (!fetchProjects) { return ""; } const stars = Social.getr( - `${context.accountId}/graph/starredProjects`, + `${context.accountId}/graph/star/*/project`, "final", { withBlockHeight: true, From 7a49add233e45d51e678616233f4c9c3ffa459ca Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:31:31 -0400 Subject: [PATCH 2/3] notify account --- apps/new/widget/components/project/Card.jsx | 15 +++++++++------ apps/new/widget/components/project/ListCard.jsx | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/new/widget/components/project/Card.jsx b/apps/new/widget/components/project/Card.jsx index f7580895..c16c3d91 100644 --- a/apps/new/widget/components/project/Card.jsx +++ b/apps/new/widget/components/project/Card.jsx @@ -108,13 +108,18 @@ const ProjectCard = ({ data, showEditProjectAction }) => { location, } = data; + const item = { + type: "social", + path: `${accountId}/project/${projectID}`, + } + return ( { params: { page: "projects", tab: "editor", - id: `${accountId}/project/${projectID}`, + id: item.path, }, })} type="icon" @@ -181,10 +186,8 @@ const ProjectCard = ({ data, showEditProjectAction }) => { src="${config_account}/widget/components.project.StarProject" loading="" props={{ - item: { - type: "social", - path: `${accountId}/project/${projectID}`, - }, + item: item, + notifyAccountId: accountId, }} /> diff --git a/apps/new/widget/components/project/ListCard.jsx b/apps/new/widget/components/project/ListCard.jsx index a2226394..39166715 100644 --- a/apps/new/widget/components/project/ListCard.jsx +++ b/apps/new/widget/components/project/ListCard.jsx @@ -107,13 +107,18 @@ const ListCard = ({ data, showEditProjectAction }) => { location, } = data; + const item = { + type: "social", + path: `${accountId}/project/${projectID}`, + } + return ( { params: { page: "projects", tab: "editor", - id: `${accountId}/project/${projectID}`, + id: item.path, }, })} type="icon" @@ -192,10 +197,8 @@ const ListCard = ({ data, showEditProjectAction }) => { src="${config_account}/widget/components.project.StarProject" loading="" props={{ - item: { - type: "social", - path: `${accountId}/project/${projectID}`, - }, + item: item, + notifyAccountId: accountId, }} /> From 168064dcc7c1427a42a04d6c1de43324dcecea5e Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:42:03 +0530 Subject: [PATCH 3/3] fmt --- apps/new/widget/components/project/Card.jsx | 2 +- apps/new/widget/components/project/ListCard.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/new/widget/components/project/Card.jsx b/apps/new/widget/components/project/Card.jsx index c16c3d91..c07f2b74 100644 --- a/apps/new/widget/components/project/Card.jsx +++ b/apps/new/widget/components/project/Card.jsx @@ -111,7 +111,7 @@ const ProjectCard = ({ data, showEditProjectAction }) => { const item = { type: "social", path: `${accountId}/project/${projectID}`, - } + }; return ( { const item = { type: "social", path: `${accountId}/project/${projectID}`, - } + }; return (