Skip to content

Add a dropdown for choosing MRVA result format#2743

Merged
shati-patel merged 3 commits intomainfrom
shati-patel/result-format
Aug 24, 2023
Merged

Add a dropdown for choosing MRVA result format#2743
shati-patel merged 3 commits intomainfrom
shati-patel/result-format

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel commented Aug 24, 2023

I've added a new component for picking the format for MRVA results:
image

It follows the style of the existing Sort and Filter dropdowns:
image

Note that I haven't hooked this new component up to the rest of the view yet, so it won't show up anywhere (except in Storybook). See internal linked issue for details!

Checklist

N/A—no user impact yet 🐘

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@shati-patel shati-patel marked this pull request as ready for review August 24, 2023 11:10
@shati-patel shati-patel requested a review from a team as a code owner August 24, 2023 11:10
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for adding a story for it too!

return (
<Dropdown value={value} onInput={handleInput} className={className}>
<Codicon name="table" label="Result format..." slot="indicator" />
<VSCodeOption value={ResultFormat.Alerts}>Alerts</VSCodeOption>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can use the enum values here too since they have the same text as we want.

Suggested change
<VSCodeOption value={ResultFormat.Alerts}>Alerts</VSCodeOption>
<VSCodeOption value={ResultFormat.Alerts}>{ResultFormat.Alerts}</VSCodeOption>

BTW, I don't remember using string enum values with spaces in them 🤔 I've looked in our repo and it doesn't look like we're following any kind of convention though (some are capital case, some lower case, some camel case, some pascal case, and in some rare occasions we have spaces 😓 ).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! And yeah, it looks like we're pretty inconsistent with enums 🙈

@shati-patel shati-patel enabled auto-merge (squash) August 24, 2023 14:25
@shati-patel shati-patel merged commit c38a01e into main Aug 24, 2023
@shati-patel shati-patel deleted the shati-patel/result-format branch August 24, 2023 14:42
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