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: Add flexible layout for attribute editor #3123

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

gethinwebster
Copy link
Member

@gethinwebster gethinwebster commented Dec 10, 2024

Description

Allow flexibility of "column" width in attribute editor.

Related links, issue #, if available: CClEAoSKVzvJ

(NB this is a 'dummy' PR against a branch that has some other related PRs already in (#3114, #3118) so that it can be reviewed in isolation but without merge conflicts later)

How has this been tested?

New dev pages and unit tests

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 98.92473% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.42%. Comparing base (f5a88e4) to head (ba48e9a).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/attribute-editor/utils.ts 96.87% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3123    +/-   ##
========================================
  Coverage   96.42%   96.42%            
========================================
  Files         787      789     +2     
  Lines       22195    22255    +60     
  Branches     7209     7636   +427     
========================================
+ Hits        21401    21459    +58     
- Misses        787      789     +2     
  Partials        7        7            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gethinwebster gethinwebster force-pushed the dev-v3-gethinw-attribute-editor branch 3 times, most recently from 9703af9 to 9717155 Compare December 11, 2024 12:58
@gethinwebster gethinwebster force-pushed the dev-v3-gethinw-attribute-editor branch from 9717155 to d628c43 Compare December 11, 2024 13:40
@gethinwebster gethinwebster changed the base branch from main to attribute-editor-pr December 12, 2024 13:45
@gethinwebster gethinwebster marked this pull request as ready for review December 12, 2024 13:46
@gethinwebster gethinwebster requested a review from a team as a code owner December 12, 2024 13:46
@gethinwebster gethinwebster requested review from avinashbot, a team, YueyingLu and georgylobko and removed request for a team, avinashbot and YueyingLu December 12, 2024 13:46

interface ControlProps extends InputProps {
index: number;
setItems?: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

[nitpick] why setItems is any? the input type for this function is defined as Tag[] below

aria-labelledby={`${firstControlId}-label ${firstControlId}`}
>
{definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => {
({ gridColumnStart, gridColumnEnd } = getItemGridColumns(layout, defIndex));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why gridColumnStart and gridColumnEnd are declared in closure?

Copy link
Member Author

Choose a reason for hiding this comment

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

the final value of gridColumnEnd is needed for the remove button

@gethinwebster gethinwebster force-pushed the dev-v3-gethinw-attribute-editor branch 5 times, most recently from 5b9e07c to d9b0bb1 Compare January 3, 2025 08:25
@gethinwebster gethinwebster force-pushed the dev-v3-gethinw-attribute-editor branch from d9b0bb1 to 4a591b4 Compare January 14, 2025 08:43
@gethinwebster gethinwebster changed the base branch from attribute-editor-pr to main January 14, 2025 08:43

useImperativeHandle(ref, () => ({
focus: () => {
itemRef.current?.focus();
buttonRef.current?.focus();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to declare a ref object for every type of the button? Wouldn't it be simpler to leave it as is?

Copy link
Member Author

Choose a reason for hiding this comment

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

the types aren't compatible due to the 2 different focus methods on ButtonDropdownProps.Ref

@gethinwebster gethinwebster added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 28012d5 Jan 21, 2025
39 checks passed
@gethinwebster gethinwebster deleted the dev-v3-gethinw-attribute-editor branch January 21, 2025 11:39
gethinwebster added a commit that referenced this pull request Jan 22, 2025
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.

2 participants