Skip to content

Commit

Permalink
feat(secret): add css to make field widths consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinandan13jan committed May 20, 2024
1 parent c14ebb6 commit 4af54fd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Secrets/SecretTypeSelector.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.secret-type-selector {
&__dropdown {
max-width: 750px;
}
}
2 changes: 2 additions & 0 deletions src/components/Secrets/SecretTypeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useFormikContext } from 'formik';
import { DropdownField } from '../../shared';
import { DropdownItemObject } from '../../shared/components/dropdown/BasicDropdown';
import { SecretFormValues, SecretTypeDropdownLabel } from '../../types';
import './SecretTypeSelector.scss';

type SecretTypeSelectorProps = {
onChange: (type: string) => void;
Expand Down Expand Up @@ -32,6 +33,7 @@ const SecretTypeSelector: React.FC<React.PropsWithChildren<SecretTypeSelectorPro
<DropdownField
name="type"
label="Secret type"
className="secret-type-selector__dropdown"
data-testid="secret-type-selector"
helpText="Tell us the secret type you want to add"
items={dropdownItems}
Expand Down
1 change: 1 addition & 0 deletions src/components/Secrets/SecretsForm/ImagePullSecretForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ImagePullSecretForm: React.FC<React.PropsWithChildren<unknown>> = (
{ key: 'uploadConfigFile', value: ImagePullSecretType.UploadConfigFile },
]}
required
className="secret-type-subform__dropdown"
validateOnChange
/>
{type === ImagePullSecretType.ImageRegistryCreds ? (
Expand Down
5 changes: 5 additions & 0 deletions src/components/Secrets/SecretsForm/SecretTypeSubForm.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.secret-type-subform {
&__dropdown {
max-width: 750px;
}
}
2 changes: 2 additions & 0 deletions src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { ImagePullSecretForm } from './ImagePullSecretForm';
import { KeyValueSecretForm } from './KeyValueSecretForm';
import { SourceSecretForm } from './SourceSecretForm';
import './SecretTypeSubForm.scss';

const secretTypes = [
{
Expand Down Expand Up @@ -119,6 +120,7 @@ export const SecretTypeSubForm: React.FC<React.PropsWithChildren<unknown>> = ()
variant={SelectVariant.typeahead}
options={options}
isCreatable
className="secret-type-subform__dropdown"
isInputValuePersisted
hasOnCreateOption
required
Expand Down
1 change: 1 addition & 0 deletions src/components/Secrets/SecretsForm/SourceSecretForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const SourceSecretForm: React.FC<React.PropsWithChildren<unknown>> = () =
{ key: 'ssh', value: SourceSecretType.ssh },
]}
required
className="secret-type-subform__dropdown"
/>
<InputField name="source.host" label="Host" helpText="Host for the secret" />
<InputField name="source.repo" label="Repository" helpText="Repository for the secret" />
Expand Down

0 comments on commit 4af54fd

Please sign in to comment.