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

fix: Add Display as property to the select column in Table Widget #26855

Closed
wants to merge 8 commits into from

Conversation

keyurparalkar
Copy link
Contributor

@keyurparalkar keyurparalkar commented Sep 1, 2023

Description

This PR introduces a new property called Display As for the select column type in table widget so that it fixes the bug mentioned below. This change has the following expectations:

  • Whenever a column is set to select, by default we show labels and not values.
  • For existing tables, since we have created this problem we ensure we don't break their apps. We will give an option called "Display As" as suggested in the original issue and for new select columns, it will be Label and for existing columns, it will be Value.
  • We make it clear that the computed value here refers to the default value/display value. Displaying this as the helper text below the computed value property only for select column type.
  • Added a helper text below the computed value field that indicates that the computed value here is a default value/display value
  • Added select option field validation. The validation is as such: When computed value is not present in the select option then we throw an error in select option. This is irrespective of displayAs property.
  • For new row select options, there is no validation of computed value. Since are adding new data into the table and it has to adhere to the select options that we provide.
  • For displaying value in cell,
    • When display as is set to label, we show empty values for missing labels in the widget
    • When display as is set to value, we show the computed value as it is even if labels are missing
  • When computed value is not present in the select options, we still make the select options available. We do this because its not the select options that has issue but its computed value.
  • Sorting, filtering and searching works on the data that is present in the table. For select column type, we store select option's value in the table. Hence all these operations happens on select option's value property.

PR fixes following issue(s)

Fixes #26188

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Testing

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration.
Delete anything that is not relevant

  • Manual
    • For new added row, there are no validations of computed value
    • Check if the sorting, filtering and searching is happening based on the select cell's value property.
  • JUnit
  • Jest
    • Added unit test that checks if selectDisplayAs = value for migrated select table columns
  • Cypress
    • Check if the property displayAs is available whenever column type is select.
    • Check if the computed value helperText is present.
    • Check that while editing a cell in displayAs = label, the select's value is set in the table's data rather than the actual label
    • Check that while editing a cell in displayAs = value, the select's value appears in the table's data always.
    • Check that select options value are being present on table when displayAs = value
    • Check that select options label are being present for that respective value when displayAs = label
    • When computed value is not present in the select options then we show the error in the select option field with the row number where the error has occured
    • When computed value is not present in the select options and displayAs = label, then table cell should show empty cell.
    • When computed value is not present in the select options and displayAs = value, then table cell should have that select' value property.
    • When display as is set to value, we show the computed value as it is even if labels are missing
    • When computed value is not select options, we show error in computed value but still the parsed=select options

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

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:

  • Speedbreak features have been covered
  • Test plan covers all impacted features and areas of interest
  • Test plan has been peer reviewed by project stakeholders and other QA members
  • Manually tested functionality on DP
  • We had an implementation alignment call with stakeholders post QA Round 2
  • Cypress test cases have been added and approved by SDET/manual QA
  • Added Test Plan Approved label after Cypress tests were reviewed
  • Added Test Plan Approved label after JUnit tests were reviewed

@github-actions github-actions bot added the Bug Something isn't working label Sep 1, 2023
@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/6045797498.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 26855.
recreate: .

@ghost
Copy link

ghost commented Sep 1, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Deploy-Preview-URL: https://ce-26855.dp.appsmith.com

* select item selection logic=
* enhancement to the select validation
* updated test for DSL migration.test.ts
@github-actions github-actions bot added Widgets Product This label groups issues related to widgets High This issue blocks a user from building or impacts a lot of users Needs Triaging Needs attention from maintainers to triage Table Widget labels Sep 1, 2023
@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

1 similar comment
@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/6047760460.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 26855.
recreate: .

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Deploy-Preview-URL: https://ce-26855.dp.appsmith.com

@keyurparalkar keyurparalkar changed the title fix: add displayAs property to the select column fix: Add Display as property to the select column in Table Widget Sep 5, 2023
@keyurparalkar keyurparalkar marked this pull request as ready for review September 5, 2023 07:57
@keyurparalkar keyurparalkar requested review from a team, aswathkk and sbalaji1192 and removed request for a team September 5, 2023 07:57
@keyurparalkar
Copy link
Contributor Author

/ok-to-test

@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

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

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/6081809756.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 26855.
recreate: .

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/6081809633.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/ClientSide/Widgets/TableV2/columnTypes/Select3_spec.ts

  2. cypress/e2e/Onboarding/SignpostingDiscovery_spec.ts
  3. cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts
To know the list of identified flaky tests - Refer here

@keyurparalkar
Copy link
Contributor Author

/ok-to-test

@keyurparalkar
Copy link
Contributor Author

/build-deploy-preview

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

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

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/6107710860.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 26855.
recreate: .

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Deploy-Preview-URL: https://ce-26855.dp.appsmith.com

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/6107709491.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/ClientSide/AppNavigation/SidebarCollapse_spec.ts

  2. cypress/e2e/ClientSide/BugTests/AbortAction_Spec.ts
  3. cypress/e2e/ClientSide/DynamicHeight/List_Resizing_spec.ts
  4. cypress/e2e/ClientSide/EmbedSettings/EmbedSettings_spec.js
  5. cypress/e2e/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts
  6. cypress/e2e/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts
  7. cypress/e2e/ClientSide/Widgets/List/ListWidgetLintErrorValidation.js
  8. cypress/e2e/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js
  9. cypress/e2e/ClientSide/Widgets/TableV2/TableV2_misc.js
  10. cypress/e2e/ClientSide/Workspace/CreateSameAppInDiffWorkspace_spec.js
  11. cypress/e2e/ClientSide/Workspace/UpdateWorkspaceTests_spec.js
  12. cypress/e2e/Regression/ClientSide/BugTests/Bug26716_Spec.ts
  13. cypress/e2e/ServerSide/GenerateCRUD/MongoURI_Spec.ts
To know the list of identified flaky tests - Refer here

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/6107709491.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@github-actions
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Sep 19, 2023
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Oct 8, 2023
@sapusi
Copy link

sapusi commented May 17, 2024

Hey @keyurparalkar and @sbalaji1192 ,

is this PR ready for productive deployment and can it be merged into release?

Can you please launch that process to close #21993 and #26188 ?

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Needs Triaging Needs attention from maintainers to triage Stale Table Widget Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Select widget should display label instead of value while editing a table cell
3 participants