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

AJ-954 - Add capability to edit a cell in Data table view in Azure #4588

Merged
merged 25 commits into from
Feb 6, 2024

Conversation

yuliadub
Copy link
Contributor

@yuliadub yuliadub commented Jan 12, 2024

Jira Ticket: https://broadworkbench.atlassian.net/browse/AJ-594

This is a draft PR to check if my edits so far look good, I still need to add tests and verify all options but strings when it comes to an edit.

Summary of changes:

Adding editing capabilities to WDS data table view, reusing existing GCP components that are already in the code.

Out of scope for this ticket:

  • editing of the primary key entity
  • deleting value from column and clearing column (GCP features)
  • editing a whole row
  • types other then string, number, boolean, json

Why

  • create parity between Azure and GCP workspaces data tables

Testing strategy

  • Work in progress
test.max.workspace.2.-.Data.-.Google.Chrome.2024-01-30.16-24-34.mp4

json edit:

test.max.workspace.2.-.Data.-.Google.Chrome.2024-01-30.16-33-24.mp4

types that are not yet supported:
image

@yuliadub yuliadub changed the title Aj 954 wds edit cell AJ-954 - Add capability to edit a cell in Data table view in Azure Jan 12, 2024
Copy link

@bethsheets bethsheets left a comment

Choose a reason for hiding this comment

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

I was comparing current GCP UI with WDS datatypes (https://support.terra.bio/hc/en-us/articles/12553682382363-Data-tables-Additional-resources). I think Reference should be updated to Relation, and then we have a few missing datatypes (date, datetime, float). Is there a max number of items for that pop-up modal? Can you fit them in there or should I ask UX for help with expanding? These other datatypes could be a followup ticket if you like.

@yuliadub
Copy link
Contributor Author

I was comparing current GCP UI with WDS datatypes (https://support.terra.bio/hc/en-us/articles/12553682382363-Data-tables-Additional-resources). I think Reference should be updated to Relation, and then we have a few missing datatypes (date, datetime, float). Is there a max number of items for that pop-up modal? Can you fit them in there or should I ask UX for help with expanding? These other datatypes could be a followup ticket if you like.

In Azure, you actually cant change a type of just a single cell, so that option shouldn't be there ( I removed it). That will be reflected in the "change column type" UI which is a different ticket. (but I am sure this context will be really helpful for it so I added a link to this in there)

@broadbot broadbot requested a deployment to pr-1 January 29, 2024 17:42 Abandoned
Copy link
Contributor

@nawatts nawatts left a comment

Choose a reason for hiding this comment

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

It would be nice if new code was TypeScript instead of JavaScript.

src/libs/ajax/WorkspaceDataService.ts Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/SingleEntityEditorWds.js Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/WDSContent.js Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/attribute-utils.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this maybe came up earlier as a design decision...so apologies if I'm revisiting, but did you decide that the existing Entity editor logic was divergent enough from what we'll support in WDS that WDS needs its own component?

My instinct would be to attempt to author as little novel component code for this change as possible, and reuse all the existing stuff where provided (providing override seams in the DataTableProvider as needed)...but I get it if it's just too different from what WDS can use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, this is something Nick and I were chatting about earlier. My first stab was to try and use them for both.

The main reason why I didnt is because the GCP editor lets the user change the type of any column type, which is just not something we support in Azure at all. (and that applies to each value) PLus Azure has different types that we'd need to support too. it seemed like making the UI work for both given that constraint was just going to be too messy. as I have gotten more familiar with the code, I'll revisit though!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

after revisiting sticking with a different modal still seems like the way to go vs trying to make the two work together side by side.

@yuliadub yuliadub marked this pull request as ready for review February 2, 2024 16:50
@yuliadub yuliadub requested a review from a team as a code owner February 2, 2024 16:50
@yuliadub
Copy link
Contributor Author

yuliadub commented Feb 6, 2024

per suggestions during today's demo, changing the edit Modal title. fyi @nawatts @bethsheets
image

src/libs/ajax/data-table-providers/DataTableProvider.ts Outdated Show resolved Hide resolved
src/libs/ajax/data-table-providers/WdsDataTableProvider.ts Outdated Show resolved Hide resolved
src/workspace-data/data-table/shared/AttributeInput.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

It's really nice that this could be shared between entity service and WDS tables.

src/workspace-data/data-table/shared/DataTable.js Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/SingleEntityEditorWds.ts Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/attribute-utils.test.ts Outdated Show resolved Hide resolved
src/workspace-data/data-table/wds/attribute-utils.ts Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
41.8% Coverage on New Code
4.1% Duplication on New Code

See analysis details on SonarCloud

@jladieu
Copy link
Contributor

jladieu commented Feb 6, 2024

Nice work, this was a biggie'!

@yuliadub yuliadub added this pull request to the merge queue Feb 6, 2024
Merged via the queue into dev with commit 2bdca50 Feb 6, 2024
7 checks passed
@yuliadub yuliadub deleted the aj-954-wds-edit-cell branch February 6, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants