Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added column freeze and unfreeze functionality to table widget #18757

Merged
merged 62 commits into from
Feb 15, 2023

Conversation

keyurparalkar
Copy link
Contributor

@keyurparalkar keyurparalkar commented Dec 7, 2022

Description

PRD: https://www.notion.so/appsmith/Ability-to-freeze-columns-dd118f7ed2e14e008ee305056b79874a?d=300f4968889244da9f737e1bfd8c06dc#2ddaf28e10a0475cb69f1af77b938d0b

This PR adds the following features to the table widget:

  • Freeze the columns to the left or right of the table.(Both canvas and page view mode).
  • Unfreeze the frozen columns. (Both canvas and page view mode).
  • Columns that are left frozen, will get unfrozen at a position after the last left frozen column. (Both canvas and page view mode).
  • Columns that are right frozen, will get unfrozen at a position before the first right frozen column. (Both canvas and page view mode).
  • Column order can be persisted in the Page view mode.
  • Users can also unfreeze the columns that are frozen by the developers.
  • Columns that are frozen cannot be reordered(Both canvas and page view mode)
  • Property pane changes (Columns property):
    • If the column is frozen to the left then that column should appear at top of the list.
    • If the column is frozen to the right then that column should appear at the bottom of the list.
    • The columns that are frozen cannot be moved or re-ordered in the list. They remain fixed in their position.
  • In-Page mode, If there is a change in frozen or unfrozen columns in multiple tables then the order of columns and frozen and unfrozen columns should get persisted on refresh i.e. changes should get persisted across refreshes.

Fixes #3265 #18230

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Manual. Below are the cases that were tested manually:
    • Existing frozen columns should be frozen when server-side pagination is enabled.
    • Two applications having two different tables should persist their column order and frozen items.
    • Scroll bars are appearing as expected.
    • Edit mode functionalities are working as expected.
    • Hidden columns should appear before the first right frozen column but should be overlayed by the right frozen column in such a way that the column is hidden.
    • Custom columns that are added should appear as before the first right frozen column.
  • Jest: Added test for generateNewColumnOrderFromStickyValue
  • Cypress: Added cypress test: column_freeze_spec.js
    • Check column freeze and unfreeze mechanism in canavs mode
      • Column freeze and unfreeze testing via propertypane
      • Column freeze and unfreeze testing via dropdown
    • Check column freeze and unfreeze mechanism in page mode
      • Column freeze and unfreeze testing with 0 pre-frozen columns
      • Column freeze and unfreeze testing with multiple pre-frozen columns

Test Plan

https://github.com/appsmithorg/TestSmith/issues/2164
https://appsmith.notion.site/appsmith/TEST-PLAN-Table-Widget-v2-2-Column-Freeze-0aa438ec5be94702a87a480fe2952c53

Issues raised during DP testing

#18757 (comment)
#18757 (comment)
#18757 (comment)
#18757 (comment)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Test plan has been approved by relevant developers
  • Test plan has been peer reviewed by QA
  • Cypress test cases have been added and approved by either SDET or manual QA
  • Organized project review call with relevant stakeholders after Round 1/2 of QA
  • Added Test Plan Approved label after reveiwing all Cypress test

@vercel
Copy link

vercel bot commented Dec 7, 2022

Deployment failed with the following error:

Resource is limited - try again in 13 minutes (more than 100, code: "api-deployments-free-per-day").

@vercel
Copy link

vercel bot commented Dec 7, 2022

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

Name Status Preview Comments Updated
appsmith ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 14, 2023 at 7:55PM (UTC)

@github-actions github-actions bot added Widgets Product This label groups issues related to widgets Enhancement New feature or request Medium Issues that frustrate users due to poor UX Table Widget labels Dec 7, 2022
@@ -206,10 +209,42 @@ class TableWidgetV2 extends BaseWidget<TableWidgetProps, WidgetState> {

const { componentWidth } = this.getPaddingAdjustedDimensions();
let totalColumnWidth = 0;
let localLeftOrder = localStorage.getItem("leftOrder");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When in page view mode, we decide the sticky value based on the values present in the local storage.

* hidden columns and custom columns position when columns are frozen
* position newly added column before the right frozen column in property pane
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/TableWidgetV2/widget/index.tsx Outdated Show resolved Hide resolved
@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/ApplicationURL_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Button/Button_onClickAction_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_Widget_Add_button_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/MemberRoles_Spec.ts

@keyurparalkar
Copy link
Contributor Author

/ok-to-test sha=0b5b255

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4176613098.
Workflow: Appsmith External Integration Test Workflow.
Commit: 0b5b255.
PR: 18757.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18757&runId=4176613098_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Button/Button_onClickAction_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_Widget_Add_button_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_Widget_Add_button_spec.js

@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/Application/MongoDBShoppingCart_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/BugTests/GitBugs_Spec.ts
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitDiscardChange/DiscardChanges_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/GitImport_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitImport/ImportEmptyRepo_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/Connection_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/DeleteBranch_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/Deploy_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/DisconnectGit_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/GitBugs_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/GitSyncedApps_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/Merge_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/RegenerateSSHKey_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/RepoLimitExceededErrorModal_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/SwitchBranches_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitWithTheming/GitWithTheming_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/IDE/Command_Click_Navigation_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/ThemingTests/Basic_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/AppPageLayout_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/DatasourcePageLayout_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/JSEditorComment_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/TableV2/TableV2_PropertyPane_spec.js
cypress/integration/Regression_TestSuite/ServerSideTests/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js

@Aishwarya-U-R
Copy link
Contributor

/ok-to-test sha=bc3e931

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4177527111.
Workflow: Appsmith External Integration Test Workflow.
Commit: bc3e931.
PR: 18757.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18757&runId=4177527111_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js
cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/AddWidget_spec.js

@keyurparalkar
Copy link
Contributor Author

/ok-to-test sha=bc3e931

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4180491060.
Workflow: Appsmith External Integration Test Workflow.
Commit: bc3e931.
PR: 18757.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18757&runId=4180491060_1

@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/DatasourcePageLayout_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/MemberRoles_Spec.ts
cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js
cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/S3_1_spec.js

@github-actions
Copy link

The following are new failures, please fix them before merging the PR

@github-actions
Copy link

The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts
cypress/integration/Regression_TestSuite/ClientSideTests/VisualTests/DatasourcePageLayout_spec.js
cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/MemberRoles_Spec.ts
cypress/integration/Regression_TestSuite/ClientSideTests/Workspace/MemberRoles_Spec.ts
cypress/integration/Regression_TestSuite/ServerSideTests/QueryPane/Mongo_Spec.js

@Rhitottam
Copy link
Contributor

/perf-test ref=rhito/fix-misc-perf-tests-selector

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4182368997.
Workflow: Performance Tests Workflow.
Commit: ``.
PR: 18757.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-638dd7cd2913ba43778b915e?pr=18757&runId=4182368997_1

@laveena-en laveena-en added the Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable label Feb 15, 2023
@somangshu somangshu merged commit b22ad3a into release Feb 15, 2023
@somangshu somangshu deleted the feat/feat-table-sticky-columns branch February 15, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Medium Issues that frustrate users due to poor UX Table Widget Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add sticky columns to the table widget
10 participants