Skip to content

feat: migrate query input components#3555

Merged
Mnickii merged 10 commits intofeat/fluent-v9-upgradefrom
feat/fluent-v9-query-input
Feb 10, 2025
Merged

feat: migrate query input components#3555
Mnickii merged 10 commits intofeat/fluent-v9-upgradefrom
feat/fluent-v9-query-input

Conversation

@ElinorW
Copy link
Contributor

@ElinorW ElinorW commented Jan 29, 2025

Overview

fixes #3550
fixes #3551

Demo

Optional. Screenshots, curl examples, etc.

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

  • How to test this PR
  • Prefer bulleted description
  • Start after checking out this branch
  • Include any setup required, such as bundling scripts, restarting services, etc.
  • Include test case, and expected output

@ElinorW ElinorW marked this pull request as ready for review February 3, 2025 09:30
@ElinorW ElinorW requested a review from a team as a code owner February 3, 2025 09:30
@ElinorW ElinorW changed the title feat; migrate query input components feat: migrate query input components Feb 3, 2025
This was linked to issues Feb 3, 2025
Copy link
Contributor

@Mnickii Mnickii left a comment

Choose a reason for hiding this comment

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

LGTM

@Mnickii
Copy link
Contributor

Mnickii commented Feb 5, 2025

I've just realized that the GET and the version area are much larger than in the design, and the methods are not color coded.

Design
Screenshot_5-2-2025_112849_www figma com
Current look
screenshot-1738744052414

Copy link
Contributor

@musale musale left a comment

Choose a reason for hiding this comment

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

The share query dialog looks fixed on one side. Just improve the symmetry here

image

@musale
Copy link
Contributor

musale commented Feb 5, 2025

I've just realized that the GET and the version area are much larger than in the design, and the methods are not color coded.

hehe, I like the compressed one for sure. Also with long queries, the long dropdowns are taking up unnecessary space. What do you all think?

@ElinorW
Copy link
Contributor Author

ElinorW commented Feb 6, 2025

I've just realized that the GET and the version area are much larger than in the design, and the methods are not color coded.

Design Screenshot_5-2-2025_112849_www figma com Current look screenshot-1738744052414

Yeah! In fact I've been trying to reduce the sizes and add the colors but fluent doesn't support that. There's actually no way to reduce the size of the dropdown

@ElinorW
Copy link
Contributor Author

ElinorW commented Feb 6, 2025

The share query dialog looks fixed on one side. Just improve the symmetry here

image

Yeah, I needed the Dialog work to be merged so that I could fix this

@musale
Copy link
Contributor

musale commented Feb 6, 2025

Yeah, I needed the Dialog work to be merged so that I could fix this

Merged it in. It is good to go.

@ElinorW ElinorW requested a review from Mnickii February 10, 2025 08:50
placeholder='Select method'
value={sampleQuery.selectedVerb}
className={classes.smallDropdown}
onOptionSelect={(event, data) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use the button slot to style the dropdown value color to match the badge colors

Suggested change
onOptionSelect={(event, data) => {
button={{ style: { color: selectedBadgeColor } }}
onOptionSelect={(event, data) => {

then define the selected badge color as
const selectedMethod = sampleQuery.selectedVerb; const selectedBadgeColor = getStyleFor(selectedMethod);

Then update the getStyleFor method to use v9 tokens

export function getStyleFor(method: string) {
  method = method?.toUpperCase();
  const styles: Record<string, string> = {
    GET: tokens.colorBrandBackground,
    POST: tokens.colorStatusSuccessForeground1,
    PUT: tokens.colorStatusWarningForeground2,
    PATCH: tokens.colorStatusWarningForeground3,
    DELETE: tokens.colorStatusDangerForeground1
  };

  return styles[method] || tokens.colorNeutralForeground1;
}

@Mnickii Mnickii merged commit 6f85162 into feat/fluent-v9-upgrade Feb 10, 2025
15 of 17 checks passed
@sonarqubecloud
Copy link

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.

Migrate query share and documentation Migrate Query runner

3 participants