Skip to content

Commit

Permalink
fix #419 - Update made with love, Fix bug - Table links sort (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-dassana authored Jul 26, 2021
1 parent bf061a0 commit 2e05cb8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down
19 changes: 18 additions & 1 deletion src/__snapshots__/storybook.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3290,7 +3290,24 @@ exports[`Storyshots Made With Love With Love 1`] = `
>
©
2021
Dassana.io, All Rights Reserved
Dassana Inc /
<a
className="ant-typography"
data-test="link"
href="https://dassanaio.notion.site/Privacy-Policy-ed4f1a5d498846c0b7a3edb02119a384"
rel="noopener noreferrer"
style={
Object {
"WebkitLineClamp": undefined,
}
}
target="_blank"
>
<u>
Privacy
</u>
</a>
</div>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion src/components/Pages/MadeWithLove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ export const MadeWithLove: FC<MadeWithLoveProps> = ({
))}
</div>
<div className={compClasses.copyright}>
© {new Date().getFullYear()} Dassana.io, All Rights Reserved
© {new Date().getFullYear()} Dassana Inc /{' '}
<Link
href='https://dassanaio.notion.site/Privacy-Policy-ed4f1a5d498846c0b7a3edb02119a384'
target='_blank'
>
Privacy
</Link>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/Table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ interface ComponentColoredDotType extends PartialComponentType {
interface RenderPropsLink extends Pick<LinkProps, 'target'> {
buildHref: (record?: string, data?: Record<string, any>) => string
isDisabled?: (record?: string, data?: Record<string, any>) => boolean
sortBy?: ColumnTypes.string | ColumnTypes.number
}

interface ComponentLinkType extends PartialComponentType {
Expand Down
12 changes: 11 additions & 1 deletion src/components/Table/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,24 @@ function applySort<TableData extends DataId>(
case component:
switch (column.format) {
case coloredDot:
case link:
antDColumn.sorter = compareStrings(column)
break

case icon:
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
Expand Down

0 comments on commit 2e05cb8

Please sign in to comment.