Skip to content

fix: show sort state on column header#18950

Merged
eunjae-lee merged 1 commit intomainfrom
fix/show-sort-state-on-column
Jan 28, 2025
Merged

fix: show sort state on column header#18950
eunjae-lee merged 1 commit intomainfrom
fix/show-sort-state-on-column

Conversation

@eunjae-lee
Copy link
Copy Markdown
Contributor

@eunjae-lee eunjae-lee commented Jan 28, 2025

What does this PR do?

This PR adds sorting state on column headers.

Screenshot 2025-01-28 at 17 43 50

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Try sorting on /insights/routing or org member list.

@keithwillcode keithwillcode added consumer core area: core, team members only labels Jan 28, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 5:00pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 5:00pm

@eunjae-lee eunjae-lee force-pushed the fix/show-sort-state-on-column branch from d106375 to 31636e4 Compare January 28, 2025 17:00
Comment on lines +316 to +317
{header.column.getIsSorted() === "asc" && <Icon name="arrow-up" className="h-4 w-4 shrink-0" />}
{header.column.getIsSorted() === "desc" && <Icon name="arrow-down" className="h-4 w-4 shrink-0" />}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show sorting state

Comment on lines +309 to +315
<div
className="truncate"
title={
typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : undefined
}>
{header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
</div>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

truncate header label, and apply "title" attribute if possible

fetchNextPage,
isFetching,
});
const { sorting, setSorting } = useDataTable();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR, but this sets states and options within DataTableWrapper, so that we don't have to do this in actual components like UserListTable, RoutingFormResponsesTable, etc.

Comment on lines 248 to 249
enableRowSelection: true,
columnResizeMode: "onChange",
debugTable: true,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already done by resizing.ts

Screenshot 2025-01-28 at 18 03 35

@eunjae-lee eunjae-lee marked this pull request as ready for review January 28, 2025 17:05
@graphite-app graphite-app Bot requested a review from a team January 28, 2025 17:05
@dosubot dosubot Bot added the ui area: UI, frontend, button, form, input label Jan 28, 2025
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jan 28, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (01/28/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Copy Markdown
Contributor

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

@eunjae-lee eunjae-lee merged commit f8a4435 into main Jan 28, 2025
@eunjae-lee eunjae-lee deleted the fix/show-sort-state-on-column branch January 28, 2025 17:50
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 25, 2025
@Iceshen87
Copy link
Copy Markdown

Hi @calcom team,

I'd like to fix this issue.

My Approach:

  1. Reproduce the bug
  2. Identify root cause
  3. Implement fix
  4. Add tests
  5. Submit PR

Relevant Experience:

  • Full-stack development
  • Calendar integrations
  • Cal.com familiarity

Timeline: 1-2 days

Ready to start!

Best,
Ethan (Iceshen87)
GitHub: https://github.com/Iceshen87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e ui area: UI, frontend, button, form, input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants