From 2e05cb854617acb12d4d7d87933a6253e9393b67 Mon Sep 17 00:00:00 2001 From: Sam M <68707128+sam-m-m@users.noreply.github.com> Date: Mon, 26 Jul 2021 15:36:53 -0700 Subject: [PATCH] fix #419 - Update made with love, Fix bug - Table links sort (#420) --- package-lock.json | 2 +- package.json | 2 +- src/__snapshots__/storybook.test.ts.snap | 19 ++++++++++++++++++- src/components/Pages/MadeWithLove.tsx | 8 +++++++- src/components/Table/types.ts | 1 + src/components/Table/utils.tsx | 12 +++++++++++- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2794041a..87f90381 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dassana-io/web-components", - "version": "0.11.23", + "version": "0.11.24", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3360efa5..f464a1d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dassana-io/web-components", - "version": "0.11.23", + "version": "0.11.24", "publishConfig": { "registry": "https://npm.pkg.github.com/dassana-io" }, diff --git a/src/__snapshots__/storybook.test.ts.snap b/src/__snapshots__/storybook.test.ts.snap index 5c2945cd..a0cada35 100644 --- a/src/__snapshots__/storybook.test.ts.snap +++ b/src/__snapshots__/storybook.test.ts.snap @@ -3290,7 +3290,24 @@ exports[`Storyshots Made With Love With Love 1`] = ` > © 2021 - Dassana.io, All Rights Reserved + Dassana Inc / + + + + Privacy + + diff --git a/src/components/Pages/MadeWithLove.tsx b/src/components/Pages/MadeWithLove.tsx index e74a26ca..1db27851 100644 --- a/src/components/Pages/MadeWithLove.tsx +++ b/src/components/Pages/MadeWithLove.tsx @@ -239,7 +239,13 @@ export const MadeWithLove: FC = ({ ))}
- © {new Date().getFullYear()} Dassana.io, All Rights Reserved + © {new Date().getFullYear()} Dassana Inc /{' '} + + Privacy +
diff --git a/src/components/Table/types.ts b/src/components/Table/types.ts index 123aaa7b..66a4abdd 100644 --- a/src/components/Table/types.ts +++ b/src/components/Table/types.ts @@ -149,6 +149,7 @@ interface ComponentColoredDotType extends PartialComponentType { interface RenderPropsLink extends Pick { buildHref: (record?: string, data?: Record) => string isDisabled?: (record?: string, data?: Record) => boolean + sortBy?: ColumnTypes.string | ColumnTypes.number } interface ComponentLinkType extends PartialComponentType { diff --git a/src/components/Table/utils.tsx b/src/components/Table/utils.tsx index aaec1955..f38f3340 100644 --- a/src/components/Table/utils.tsx +++ b/src/components/Table/utils.tsx @@ -265,7 +265,6 @@ function applySort( case component: switch (column.format) { case coloredDot: - case link: antDColumn.sorter = compareStrings(column) break @@ -273,6 +272,17 @@ function applySort( antDColumn.sorter = compareIcons(column) break + case link: { + const { renderProps = { sortBy: ColumnTypes.string } } = + column + + antDColumn.sorter = + renderProps.sortBy === ColumnTypes.number + ? compareNumbers(column) + : compareStrings(column) + break + } + case tag: antDColumn.sorter = compareTags(column) break