From 454f557d146b4e93c05a2293deb51adc58f17951 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Thu, 6 Jun 2024 11:49:06 +0530 Subject: [PATCH] fix: position of cards and reports in dashboard --- .../src/components/dashboard/GetDashboard.js | 4 +-- apps/OpenSign/src/json/dashboardJson.js | 20 ++++----------- apps/OpenSign/src/pages/Dashboard.js | 25 +------------------ 3 files changed, 8 insertions(+), 41 deletions(-) diff --git a/apps/OpenSign/src/components/dashboard/GetDashboard.js b/apps/OpenSign/src/components/dashboard/GetDashboard.js index 4c5bcffcd..660f910ca 100644 --- a/apps/OpenSign/src/components/dashboard/GetDashboard.js +++ b/apps/OpenSign/src/components/dashboard/GetDashboard.js @@ -146,11 +146,11 @@ const GetDashboard = (props) => {
{props?.dashboard?.columns?.map((col, i) => col.widget.data && col.widget.data.tourSection ? ( -
+
{renderSwitchWithTour(col)}
) : ( -
+
{renderSwitch(col)}
) diff --git a/apps/OpenSign/src/json/dashboardJson.js b/apps/OpenSign/src/json/dashboardJson.js index 0a2837432..deea5021f 100644 --- a/apps/OpenSign/src/json/dashboardJson.js +++ b/apps/OpenSign/src/json/dashboardJson.js @@ -3,9 +3,7 @@ const dashboardJson = [ id: "35KBoSgoAK", columns: [ { - colxs: "12", - colmd: "6", - collg: "6", + colsize: "col-span-12 md:col-span-6 lg:col-span-6", widget: { type: "Card", icon: "fas fa-signature", @@ -28,9 +26,7 @@ const dashboardJson = [ } }, { - colxs: "12", - colmd: "6", - collg: "6", + colsize: "col-span-12 md:col-span-6 lg:col-span-6", widget: { type: "Card", icon: "fas fa-sign-out-alt", @@ -53,9 +49,7 @@ const dashboardJson = [ } }, { - colxs: "12", - colmd: "6", - collg: "6", + colsize: "col-span-12 md:col-span-6 lg:col-span-6", widget: { type: "report", reportId: "5Go51Q7T8r", @@ -67,9 +61,7 @@ const dashboardJson = [ } }, { - colxs: "12", - colmd: "6", - collg: "6", + colsize: "col-span-12 md:col-span-6 lg:col-span-6", widget: { type: "report", reportId: "d9k3UfYHBc", @@ -81,9 +73,7 @@ const dashboardJson = [ } }, { - colxs: "12", - colmd: "12", - collg: "12", + colsize: "col-span-12 md:col-span-12 lg:col-span-12", widget: { type: "report", reportId: "kC5mfynCi4", diff --git a/apps/OpenSign/src/pages/Dashboard.js b/apps/OpenSign/src/pages/Dashboard.js index af31fbf7e..28a13345a 100644 --- a/apps/OpenSign/src/pages/Dashboard.js +++ b/apps/OpenSign/src/pages/Dashboard.js @@ -12,7 +12,6 @@ const Dashboard = () => { const dispatch = useDispatch(); const { id } = useParams(); const [dashboard, setdashboard] = useState([]); - const [classnameArray, setclassnameArray] = useState([]); const [loading, setloading] = useState(true); const [defaultQuery, setDefaultQuery] = useState(""); @@ -32,23 +31,6 @@ const Dashboard = () => { const getDashboard = async (id) => { try { const dashboard = dashboardJson.find((x) => x.id === id); - let classArray = []; - dashboard?.columns?.forEach((row) => { - let item = ""; - if (row?.colxs) { - item += " col-span-" + row?.colxs; - } - if (row?.colmd) { - item += " md:col-span-" + row?.colmd; - } - if (row?.collg) { - item += " lg:col-span-" + row?.collg + " "; - } - if (!row?.colxs && !row?.colmd && !row?.collg) { - item += "col-span-12"; - } - classArray.push(item); - }); setdashboard(dashboard); const dashboardTour = dashboard.columns .filter((col) => { @@ -65,7 +47,6 @@ const Dashboard = () => { }; }); dispatch(saveTourSteps(dashboardTour)); - setclassnameArray(classArray); if (localStorage.getItem("DashboardDefaultFilter")) { setDefaultQuery(localStorage.getItem("DashboardDefaultFilter")); } @@ -92,11 +73,7 @@ const Dashboard = () => { >
) : ( - + )} );