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(rollouts/rules): UI for rollout/rule editing of segments #1953

Merged
merged 6 commits into from
Aug 8, 2023

Conversation

yquansah
Copy link
Contributor

@yquansah yquansah commented Aug 4, 2023

UI For edits/updates to rule/rollout segments.

test-edit-rollout-quick
test-rule-edit-segments

test-edit-rollout-normal

Completes FLI-537

@yquansah yquansah requested a review from a team as a code owner August 4, 2023 18:16
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #1953 (0eb7379) into segment-anding (47a8dd8) will not change coverage.
The diff coverage is n/a.

❗ Current head 0eb7379 differs from pull request most recent head c612516. Consider uploading reports for the commit c612516 to get more accurate results

@@               Coverage Diff               @@
##           segment-anding    #1953   +/-   ##
===============================================
  Coverage           70.85%   70.85%           
===============================================
  Files                  67       67           
  Lines                6681     6681           
===============================================
  Hits                 4734     4734           
  Misses               1672     1672           
  Partials              275      275           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

looking good!

ui/src/components/forms/SegmentsPicker.tsx Show resolved Hide resolved
@yquansah yquansah force-pushed the segment-anding branch 3 times, most recently from e2f936a to 8c1d4bc Compare August 7, 2023 02:50
@@ -51,7 +54,9 @@ export default function Combobox<T extends IFilterable>(
<div className="relative flex w-full flex-row">
<C.Input
id={id}
className="text-gray-900 bg-gray-50 border-gray-300 w-full rounded-md border py-2 pl-3 pr-10 shadow-sm focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500 sm:text-sm"
className={twMerge(
Copy link
Collaborator

Choose a reason for hiding this comment

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

does twMerge replace the classNames util helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markphelps I think so? Was the classNames util helper for handling overrides of tailwind styles as well? If so, it didn't seem to be working for me for some reason 🤔. This article explains why twMerge should be used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think twMerge is like the functionality of classNames + handles tailwind specifically. classNames is just a way to dynamically apply classes given a boolean condition. so it might make sense for us to favor twMerge instead of classNames in the future as it has the added ability of working with tw classes like we might expect (last one wins).

So maybe the rule should be, if we find ourselves needing to use classNames + twMerge then just use twMerge as it can do both I think?

Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

couple minor questions/comments!

@@ -22,6 +24,7 @@ export default function Combobox<T extends IFilterable>(
const {
id,
className,
inputClassNames,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
inputClassNames,
inputClassName,

@@ -14,6 +15,7 @@ type ComboboxProps<T extends IFilterable> = {
setSelected?: (v: T | null) => void;
disabled?: boolean;
className?: string;
inputClassNames?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
inputClassNames?: string;
inputClassName?: string;

{(!editing || parentSegments.length === 0) && (
<div className="w-full">
<div className="w-5/6">
<Combobox<FilterableSegment>
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we set disabled=${readOnly} here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean like this?

Or something else?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yah, nvm i see that the above is only rendered when in 'editing' mode

Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

amazing!!

@yquansah yquansah merged commit 3f81765 into segment-anding Aug 8, 2023
20 checks passed
@yquansah yquansah deleted the edit-segment-anding branch August 8, 2023 00:32
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