Skip to content

Commit c6a12a3

Browse files
committed
Rename Select to WizSelect
Signed-off-by: Kevin Cormier <kcormier@redhat.com>
1 parent 40f8e30 commit c6a12a3

File tree

16 files changed

+97
-97
lines changed

16 files changed

+97
-97
lines changed

src/inputs/WizSelect.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface OptionGroup<T> {
3737
options: (Option<T> | string | number)[] | undefined
3838
}
3939

40-
type SelectCommonProps<T> = InputCommonProps<T> & {
40+
type WizSelectCommonProps<T> = InputCommonProps<T> & {
4141
placeholder?: string
4242
footer?: ReactNode
4343
label: string
@@ -50,18 +50,18 @@ type SelectCommonProps<T> = InputCommonProps<T> & {
5050
onCreate?: (value: string) => void
5151
}
5252

53-
interface SingleSelectProps<T> extends SelectCommonProps<T> {
53+
interface WizSelectSingleProps<T> extends WizSelectCommonProps<T> {
5454
variant: 'single'
5555
options?: (Option<T> | string | number)[]
5656
}
5757

58-
export function Select<T>(props: Omit<SingleSelectProps<T>, 'variant'>) {
59-
return <SelectBase<T> {...props} variant="single" />
58+
export function WizSelect<T>(props: Omit<WizSelectSingleProps<T>, 'variant'>) {
59+
return <WizSelectBase<T> {...props} variant="single" />
6060
}
6161

62-
type SelectProps<T> = SingleSelectProps<T>
62+
type SelectProps<T> = WizSelectSingleProps<T>
6363

64-
function SelectBase<T = any>(props: SelectProps<T>) {
64+
function WizSelectBase<T = any>(props: SelectProps<T>) {
6565
const { displayMode: mode, value, setValue, validated, hidden, id, disabled } = useInput(props)
6666

6767
const placeholder = getSelectPlaceholder(props)

wizards/Ansible/AnsibleWizard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Fragment } from 'react'
2-
import { WizKeyValue, Section, Select, Step, WizardCancel, WizardPage, WizardSubmit, WizArrayInput, WizTextInput } from '../../src'
2+
import { WizKeyValue, Section, WizSelect, Step, WizardCancel, WizardPage, WizardSubmit, WizArrayInput, WizTextInput } from '../../src'
33

44
export function AnsibleWizard(props: {
55
onSubmit: WizardSubmit
@@ -30,7 +30,7 @@ export function AnsibleWizard(props: {
3030
description="Automation is accomplished by creating a ClusterCurator resource which can be selected during cluster creation to automate running ansible jobs."
3131
>
3232
<WizTextInput label="Name" id="name" path="metadata.name" required />
33-
<Select
33+
<WizSelect
3434
label="Namespace"
3535
id="namespace"
3636
path="metadata.namespace"
@@ -43,7 +43,7 @@ export function AnsibleWizard(props: {
4343

4444
<Step label="Install" id="install">
4545
<Section id="install" label="Install" prompt="Install Ansible job templates">
46-
<Select
46+
<WizSelect
4747
id="install-secret"
4848
path="spec.install.towerAuthSecret"
4949
label="Ansible credentials"
@@ -82,7 +82,7 @@ export function AnsibleWizard(props: {
8282

8383
<Step label="Upgrade" id="upgrade">
8484
<Section id="upgrade" label="Upgrade" prompt="Upgrade Ansible job templates">
85-
<Select
85+
<WizSelect
8686
id="upgrade-secret"
8787
path="spec.upgrade.towerAuthSecret"
8888
label="Ansible credentials"

wizards/AppWizard/AppWizard.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
WizItemSelector,
33
WizKeyValue,
44
Section,
5-
Select,
5+
WizSelect,
66
Step,
77
WizardCancel,
88
WizardPage,
@@ -65,7 +65,7 @@ export function AppWizard(props: { onSubmit: WizardSubmit; onCancel: WizardCance
6565
>
6666
<WizTextInput id="text-input" path="metadata.name" label="Name" required />
6767
<WizTextInput id="text-input" path="metadata.namespace" label="Namespace" required />
68-
<Select
68+
<WizSelect
6969
id="select"
7070
path="spec.channel"
7171
label="Channel"
@@ -95,7 +95,7 @@ export function AppWizard(props: { onSubmit: WizardSubmit; onCancel: WizardCance
9595
path={`metadata.annotations.apps\\.open-cluster-management\\.io/git-tag`}
9696
label="Tag"
9797
/>
98-
<Select
98+
<WizSelect
9999
id="select"
100100
path={`metadata.annotations.apps\\.open-cluster-management\\.io/reconcile-option`}
101101
label="Reconcile option"
@@ -135,22 +135,22 @@ export function AppWizard(props: { onSubmit: WizardSubmit; onCancel: WizardCance
135135
}}
136136
>
137137
<WizTextInput id="text-input" path="metadata.name" label="Channel name" required />
138-
<Select
138+
<WizSelect
139139
id="type"
140140
path={`spec.type`}
141141
label="Repository type"
142142
options={['Git', 'HelmRepo', 'ObjectBucket']}
143143
required
144144
/>
145145
<WizTextInput id="pathname" path="spec.pathname" label="Repository URL" placeholder="Enter the URL" required />
146-
<Select
146+
<WizSelect
147147
id="type"
148148
path="spec.secretRef.name"
149149
label="Repository secret"
150150
options={['TODO']}
151151
helperText="The secret containing the credentials to access the repository."
152152
/>
153-
<Select
153+
<WizSelect
154154
id="select"
155155
path={`metadata.annotations.apps\\.open-cluster-management\\.io/reconcile-rate`}
156156
label="Repository reconcile rate"

wizards/Application/ApplicationWizard.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Radio,
99
WizRadioGroup,
1010
Section,
11-
Select,
11+
WizSelect,
1212
Step,
1313
WizTextDetail,
1414
Tile,
@@ -143,7 +143,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
143143
</WizTiles>
144144

145145
<WizHidden hidden={(data) => data.repositoryType !== 'SubscriptionGit'}>
146-
<Select
146+
<WizSelect
147147
path="subscription.git.url"
148148
label="URL"
149149
placeholder="Enter or select a Git URL"
@@ -166,15 +166,15 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
166166
placeholder="Enter the Git access token"
167167
labelHelp="The access token if this is a private Git repository and requires connection."
168168
/>
169-
<Select
169+
<WizSelect
170170
path="subscription.git.branch"
171171
label="Branch"
172172
placeholder="Enter or select a branch"
173173
labelHelp="The branch of the Git repository."
174174
options={['branch-1']}
175175
required
176176
/>
177-
<Select
177+
<WizSelect
178178
path="subscription.git.path"
179179
label="Path"
180180
placeholder="Enter or select a repository path"
@@ -196,14 +196,14 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
196196
placeholder="Enter a specific tag"
197197
labelHelp="If you want to subscribe to a specific tag, you need to specify the tag. If both Git desired commit and tag annotations are specified, the tag is ignored. You might need to specify git-clone-depth annotation if your desired commit of the tag is older than the last 20 commits."
198198
/>
199-
<Select
199+
<WizSelect
200200
path="subscription.git.reconcileOption"
201201
label="Reconcile option"
202202
labelHelp="With the Merge option, new fields are added and existing fields are updated in the resource. Choose to merge if resources are updated after the initial deployment. If you choose to replace, the existing resource is replaced with the Git source."
203203
options={reconcileOptions}
204204
required
205205
/>
206-
<Select
206+
<WizSelect
207207
path="subscription.git.reconcileRate"
208208
label="Repository reconcile rate"
209209
labelHelp="The frequency of resource reconciliation that is used as a global repository setting. The medium default setting checks for changes to apply every three minutes and re-applies all resources every 15 minutes, even without a change. Select low to reconcile every hour. Select high to reconcile every two minutes. If you select off, the deployed resources are not automatically reconciled."
@@ -223,7 +223,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
223223
</WizHidden>
224224

225225
<WizHidden hidden={(data) => data.repositoryType !== 'SubscriptionHelm'}>
226-
<Select
226+
<WizSelect
227227
path="subscription.helm.url"
228228
label="URL"
229229
placeholder="Enter or select a Helm repository URL"
@@ -263,7 +263,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
263263
placeholder="Enter the version or versions"
264264
labelHelp="The version or versions for the deployable. You can use a range of versions in the form >1.0, or <3.0."
265265
/>
266-
<Select
266+
<WizSelect
267267
path="subscription.helm.reconcileRate"
268268
label="Repository reconcile rate"
269269
labelHelp="The frequency of resource reconciliation that is used as a global repository setting. The medium default setting checks for changes to apply every three minutes and re-applies all resources every 15 minutes, even without a change. Select low to reconcile every hour. Select high to reconcile every two minutes. If you select off, the deployed resources are not automatically reconciled."
@@ -283,7 +283,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
283283
</WizHidden>
284284

285285
<WizHidden hidden={(data) => data.repositoryType !== 'SubscriptionObjectstorage'}>
286-
<Select
286+
<WizSelect
287287
path="subscription.obj.url"
288288
label="URL"
289289
placeholder="Enter or select an ObjectStore bucket URL"
@@ -327,7 +327,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
327327
<Step id="general" label="General" hidden={(item) => item.deployType !== 'ArgoCD'}>
328328
<Section label="General">
329329
<WizTextInput path="appSetName" label="ApplicationSet name" placeholder="Enter the application set name" required />
330-
<Select
330+
<WizSelect
331331
path="argoServer"
332332
label="Argo server"
333333
placeholder="Select the Argo server"
@@ -336,7 +336,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
336336
required
337337
/>
338338
<ExternalLinkButton id="addClusterSets" icon={<PlusCircleIcon />} href={props.addClusterSets} />
339-
<Select
339+
<WizSelect
340340
path="requeueTime"
341341
label="Requeue time"
342342
options={requeueTimes}
@@ -353,7 +353,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
353353
</WizTiles>
354354
{/* Git repo */}
355355
<WizHidden hidden={(data) => data.repositoryType !== 'Git'}>
356-
<Select
356+
<WizSelect
357357
path="git.url"
358358
label="URL"
359359
labelHelp="The URL path for the Git repository."
@@ -364,14 +364,14 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
364364
}))}
365365
required
366366
/>
367-
<Select
367+
<WizSelect
368368
path="git.revision"
369369
label="Revision"
370370
labelHelp="Refer to a single commit"
371371
placeholder="Enter or select a tracking revision"
372372
options={['Branches', 'Tags']}
373373
/>
374-
<Select
374+
<WizSelect
375375
path="git.path"
376376
label="Path"
377377
labelHelp="The location of the resources on the Git repository."
@@ -381,7 +381,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
381381
</WizHidden>
382382
{/* Helm repo */}
383383
<WizHidden hidden={(data) => data.repositoryType !== 'Helm'}>
384-
<Select
384+
<WizSelect
385385
path="helm.url"
386386
label="URL"
387387
labelHelp="The URL path for the Helm repository."
@@ -429,7 +429,7 @@ export function ApplicationWizard(props: ApplicationWizardProps) {
429429
<WizCheckbox path="syncPolicy.createNamespace" label="Automatically create namespace if it does not exist" />
430430
<WizCheckbox path="syncPolicy.validate" label="Disable kubectl validation" />
431431
<WizCheckbox path="syncPolicy.prunePropagationPolicy" label="Prune propagation policy">
432-
<Select
432+
<WizSelect
433433
path="syncPolicy.propagationPolicy"
434434
label="Propogation policy"
435435
options={['foreground', 'background', 'orphan']}
@@ -467,7 +467,7 @@ export function Placement(props: { placements: string[] }) {
467467
label="Use an existing placement"
468468
labelHelp="If available in the application namespace, you can select a predefined placement configuration"
469469
>
470-
<Select
470+
<WizSelect
471471
path="placement.select"
472472
label="Placement"
473473
placeholder="Select an existing placement"
@@ -483,7 +483,7 @@ export function Placement(props: { placements: string[] }) {
483483
export function AnsibleCredentials(props: { ansibleCredentials: string[] }) {
484484
return (
485485
<Section label="Configure automation for prehook and posthook">
486-
<Select
486+
<WizSelect
487487
path="subscription.git.ansibleSecretName"
488488
label="Ansible Automation Platform credential"
489489
labelHelp="If using Configure automation for prehook and posthook tasks, select the Ansible Automation Platform credential. Click the Add credentials tab to create a new secret."
@@ -532,7 +532,7 @@ export function TimeWindow(props: { timeZone: string[] }) {
532532
required
533533
options={['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']}
534534
/>
535-
<Select path="timeWindow.timezone" label="Time zone" placeholder="Select the time zone" options={props.timeZone} required />
535+
<WizSelect path="timeWindow.timezone" label="Time zone" placeholder="Select the time zone" options={props.timeZone} required />
536536
<WizArrayInput
537537
path="timeWindows"
538538
placeholder="Add time range"
@@ -595,7 +595,7 @@ function DetailsSection(props: { namespaces: string[] }) {
595595
return (
596596
<Section label="Details" prompt="Enter the details of the application">
597597
<WizTextInput path="name" label="Application name" required />
598-
<Select
598+
<WizSelect
599599
path="namespace"
600600
label="Namespace"
601601
placeholder="Select the namespace"

0 commit comments

Comments
 (0)