-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: eval rollout segment ui (#1839)
* feat(wip): start * feat(ui): finish segment rollout creation form
- Loading branch information
1 parent
9339254
commit 64dbe40
Showing
17 changed files
with
145 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Combobox from '~/components/forms/Combobox'; | ||
import { FilterableSegment, ISegment } from '~/types/Segment'; | ||
import { truncateKey } from '~/utils/helpers'; | ||
|
||
type SegmentRuleFormInputsProps = { | ||
segments: ISegment[]; | ||
selectedSegment: FilterableSegment | null; | ||
setSelectedSegment: (v: FilterableSegment | null) => void; | ||
}; | ||
|
||
export default function SegmentRuleFormInputs( | ||
props: SegmentRuleFormInputsProps | ||
) { | ||
const { segments, selectedSegment, setSelectedSegment } = props; | ||
|
||
return ( | ||
<> | ||
<div className="space-y-1 px-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:space-y-0 sm:px-6 sm:py-5"> | ||
<div> | ||
<label | ||
htmlFor="segmentKey" | ||
className="block text-sm font-medium text-gray-900 sm:mt-px sm:pt-2" | ||
> | ||
Segment | ||
</label> | ||
</div> | ||
<div className="sm:col-span-2"> | ||
<Combobox<FilterableSegment> | ||
id="segmentKey" | ||
name="segmentKey" | ||
placeholder="Select or search for a segment" | ||
values={segments.map((s) => ({ | ||
...s, | ||
filterValue: truncateKey(s.key), | ||
displayValue: s.name | ||
}))} | ||
selected={selectedSegment} | ||
setSelected={setSelectedSegment} | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.