From afd05265ecc4de5391ae5a3330e64f2eab6644fd Mon Sep 17 00:00:00 2001 From: Dotnara Condori Date: Thu, 19 Dec 2024 12:41:10 -0400 Subject: [PATCH] Fix/tm 1561 edit width cell table (#772) * [TM-1561] fix error width cell table in poligon review * [TM-1561] update snapshots * [TM-1561] fix width --------- Co-authored-by: diego-morales-flores-1996 --- .../components/VersionHistory.tsx | 2 +- src/components/elements/Table/Table.tsx | 9 +- .../elements/Table/TableVariants.ts | 4 +- .../__snapshots__/Table.stories.storyshot | 552 ++++++++++-------- src/styles/extended-utilities.css | 1 + 5 files changed, 315 insertions(+), 253 deletions(-) diff --git a/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonDrawer/components/VersionHistory.tsx b/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonDrawer/components/VersionHistory.tsx index 5e7989a32..bb8af6a2c 100644 --- a/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonDrawer/components/VersionHistory.tsx +++ b/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonDrawer/components/VersionHistory.tsx @@ -363,7 +363,7 @@ const VersionHistory = ({ options={polygonVersionData ?? []} optionVariant="text-12-light" titleClassname="one-line-text !w-full !text-nowrap" - titleContainerClassName="!w-[92%] !text-nowrap" + titleContainerClassName="!w-[calc(100%-25px)] !text-nowrap" defaultValue={[selectPolygonVersion?.uuid ?? selectedPolygon?.uuid] as string[]} onChange={e => { const polygonVersionData = (data as SitePolygonsDataResponse)?.find(item => item.uuid === e[0]); diff --git a/src/components/elements/Table/Table.tsx b/src/components/elements/Table/Table.tsx index 2c7ad9b2d..78becf5e2 100644 --- a/src/components/elements/Table/Table.tsx +++ b/src/components/elements/Table/Table.tsx @@ -186,6 +186,7 @@ function Table({ } >
({ fontFamily: "inherit" }} > - ({ /> - +
); diff --git a/src/components/elements/Table/TableVariants.ts b/src/components/elements/Table/TableVariants.ts index fd80fb984..a444c5694 100644 --- a/src/components/elements/Table/TableVariants.ts +++ b/src/components/elements/Table/TableVariants.ts @@ -97,9 +97,9 @@ export const VARIANT_TABLE_SITE_POLYGON_REVIEW = { table: "border-collapse", name: "border-airtable", tableWrapper: "border border-neutral-200 rounded-lg overflow-hidden", - trHeader: "bg-neutral-150", + trHeader: "bg-neutral-150 sticky top-0 z-auto", thHeader: - "first:pl-4 first:pr-2 last:pl-2 last:pr-4 border-y border-neutral-200 text-14-semibold whitespace-normal px-2 border-t-0", + "first:pl-4 first:pr-2 last:pl-2 last:pr-4 border-y border-neutral-200 text-14-semibold whitespace-normal px-2 border-t-0 sticky top-0 z-auto", tBody: "", trBody: "bg-white border-y border-neutral-200 last:border-b-0", tdBody: "text-14-light px-2 py-3 first:pl-4 first:pr-2 last:pl-2 last:pr-4 ", diff --git a/src/components/elements/Table/__snapshots__/Table.stories.storyshot b/src/components/elements/Table/__snapshots__/Table.stories.storyshot index f4994aa8d..ebac4acaa 100644 --- a/src/components/elements/Table/__snapshots__/Table.stories.storyshot +++ b/src/components/elements/Table/__snapshots__/Table.stories.storyshot @@ -124,6 +124,7 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` } >
- @@ -146,7 +147,7 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` > Funding type - +
- @@ -200,7 +202,7 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` } /> - +
- @@ -254,7 +257,7 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` } /> - +
- @@ -291,7 +295,7 @@ exports[`Storyshots Components/Elements/Table Default 1`] = ` > Status - +
- - +
@@ -1065,6 +1070,7 @@ exports[`Storyshots Components/Elements/Table Primary 1`] = ` } >
- @@ -1087,7 +1093,7 @@ exports[`Storyshots Components/Elements/Table Primary 1`] = ` > Funding type - +
- @@ -1141,7 +1148,7 @@ exports[`Storyshots Components/Elements/Table Primary 1`] = ` } /> - +
- @@ -1195,7 +1203,7 @@ exports[`Storyshots Components/Elements/Table Primary 1`] = ` } /> - +
- @@ -1232,7 +1241,7 @@ exports[`Storyshots Components/Elements/Table Primary 1`] = ` > Status - +
- - +
@@ -2006,6 +2016,7 @@ exports[`Storyshots Components/Elements/Table Secundary White 1`] = ` } >
- @@ -2028,7 +2039,7 @@ exports[`Storyshots Components/Elements/Table Secundary White 1`] = ` > Funding type - +
- @@ -2082,7 +2094,7 @@ exports[`Storyshots Components/Elements/Table Secundary White 1`] = ` } /> - +
- @@ -2136,7 +2149,7 @@ exports[`Storyshots Components/Elements/Table Secundary White 1`] = ` } /> - +
- @@ -2173,7 +2187,7 @@ exports[`Storyshots Components/Elements/Table Secundary White 1`] = ` > Status - +
- - +
@@ -2947,6 +2962,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable 1`] = ` } >
- @@ -2969,7 +2985,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable 1`] = ` > Funding type - +
- @@ -3023,7 +3040,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable 1`] = ` } /> - +
- @@ -3077,7 +3095,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable 1`] = ` } /> - +
- @@ -3114,7 +3133,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable 1`] = ` > Status - +
- - +
@@ -3891,6 +3911,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable Dashboard 1`] = ` } >
- @@ -3913,7 +3934,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable Dashboard 1`] = ` > Funding type - +
- @@ -3967,7 +3989,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable Dashboard 1`] = ` } /> - +
- @@ -4021,7 +4044,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable Dashboard 1`] = ` } /> - +
- @@ -4058,7 +4082,7 @@ exports[`Storyshots Components/Elements/Table Table Airtable Dashboard 1`] = ` > Status - +
- - +
@@ -4833,6 +4858,7 @@ exports[`Storyshots Components/Elements/Table Table Border 1`] = ` } >
- @@ -4855,7 +4881,7 @@ exports[`Storyshots Components/Elements/Table Table Border 1`] = ` > Funding type - +
- @@ -4909,7 +4936,7 @@ exports[`Storyshots Components/Elements/Table Table Border 1`] = ` } /> - +
- @@ -4963,7 +4991,7 @@ exports[`Storyshots Components/Elements/Table Table Border 1`] = ` } /> - +
- @@ -5000,7 +5029,7 @@ exports[`Storyshots Components/Elements/Table Table Border 1`] = ` > Status - +
- - +
@@ -5774,6 +5804,7 @@ exports[`Storyshots Components/Elements/Table Table Border All 1`] = ` } >
- @@ -5796,7 +5827,7 @@ exports[`Storyshots Components/Elements/Table Table Border All 1`] = ` > Funding type - +
- @@ -5850,7 +5882,7 @@ exports[`Storyshots Components/Elements/Table Table Border All 1`] = ` } /> - +
- @@ -5904,7 +5937,7 @@ exports[`Storyshots Components/Elements/Table Table Border All 1`] = ` } /> - +
- @@ -5941,7 +5975,7 @@ exports[`Storyshots Components/Elements/Table Table Border All 1`] = ` > Status - +
- - +
@@ -6718,6 +6753,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries 1`] = ` } >
- @@ -6740,7 +6776,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries 1`] = ` > Funding type - +
- @@ -6794,7 +6831,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries 1`] = ` } /> - +
- @@ -6848,7 +6886,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries 1`] = ` } /> - +
- @@ -6885,7 +6924,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries 1`] = ` > Status - +
- - +
@@ -7663,6 +7703,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries Modal 1` } >
- @@ -7685,7 +7726,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries Modal 1` > Funding type - +
- @@ -7739,7 +7781,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries Modal 1` } /> - +
- @@ -7793,7 +7836,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries Modal 1` } /> - +
- @@ -7830,7 +7874,7 @@ exports[`Storyshots Components/Elements/Table Table Dashboard Countries Modal 1` > Status - +
- - +
@@ -8608,6 +8653,7 @@ exports[`Storyshots Components/Elements/Table Table Organization 1`] = ` } >
- @@ -8630,7 +8676,7 @@ exports[`Storyshots Components/Elements/Table Table Organization 1`] = ` > Funding type - +
- @@ -8684,7 +8731,7 @@ exports[`Storyshots Components/Elements/Table Table Organization 1`] = ` } /> - +
- @@ -8738,7 +8786,7 @@ exports[`Storyshots Components/Elements/Table Table Organization 1`] = ` } /> - +
- @@ -8775,7 +8824,7 @@ exports[`Storyshots Components/Elements/Table Table Organization 1`] = ` > Status - +
- - +
@@ -9536,11 +9586,11 @@ exports[`Storyshots Components/Elements/Table Table Site Polygon 1`] = ` className="bg-blueCustom-100" >
- @@ -9572,12 +9623,12 @@ exports[`Storyshots Components/Elements/Table Table Site Polygon 1`] = ` > Funding type - +
- @@ -9626,12 +9678,12 @@ exports[`Storyshots Components/Elements/Table Table Site Polygon 1`] = ` } /> - +
- @@ -9680,12 +9733,12 @@ exports[`Storyshots Components/Elements/Table Table Site Polygon 1`] = ` } /> - +
- @@ -9717,12 +9771,12 @@ exports[`Storyshots Components/Elements/Table Table Site Polygon 1`] = ` > Status - +
- - +
@@ -10494,6 +10549,7 @@ exports[`Storyshots Components/Elements/Table Table Version 1`] = ` } >
- @@ -10516,7 +10572,7 @@ exports[`Storyshots Components/Elements/Table Table Version 1`] = ` > Funding type - +
- @@ -10570,7 +10627,7 @@ exports[`Storyshots Components/Elements/Table Table Version 1`] = ` } /> - +
- @@ -10624,7 +10682,7 @@ exports[`Storyshots Components/Elements/Table Table Version 1`] = ` } /> - +
- @@ -10661,7 +10720,7 @@ exports[`Storyshots Components/Elements/Table Table Version 1`] = ` > Status - +
- - +
diff --git a/src/styles/extended-utilities.css b/src/styles/extended-utilities.css index a1ff1c221..13ee9b42f 100644 --- a/src/styles/extended-utilities.css +++ b/src/styles/extended-utilities.css @@ -674,6 +674,7 @@ -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; + text-wrap: nowrap; } .two-line-text{