Skip to content

Commit

Permalink
Fixed tests on LaunchTaskForm.test
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Porter <[email protected]>
  • Loading branch information
jsonporter committed Dec 29, 2021
1 parent 67d14f6 commit 519af33
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 251 deletions.
8 changes: 6 additions & 2 deletions src/components/Launch/LaunchForm/LaunchRoleInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export const LaunchRoleInputImpl: React.RefForwardingComponent<
</Typography>
</div>
<TextField
id={`launchform-role-${AuthRoleStrings[AuthRoleTypes.IAM]}`}
id={`launchform-role-${
AuthRoleStrings[AuthRoleTypes.IAM].inputLabel
}`}
helperText={AuthRoleStrings[AuthRoleTypes.IAM].helperText}
fullWidth={true}
label={AuthRoleStrings[AuthRoleTypes.IAM].inputLabel}
Expand All @@ -126,7 +128,9 @@ export const LaunchRoleInputImpl: React.RefForwardingComponent<
</Typography>
</div>
<TextField
id={`launchform-role-${AuthRoleStrings[AuthRoleTypes.k8]}`}
id={`launchform-role-${
AuthRoleStrings[AuthRoleTypes.k8].inputLabel
}`}
helperText={AuthRoleStrings[AuthRoleTypes.k8].helperText}
fullWidth={true}
label={AuthRoleStrings[AuthRoleTypes.k8].inputLabel}
Expand Down
1 change: 1 addition & 0 deletions src/components/Launch/LaunchForm/LaunchTaskForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const LaunchTaskForm: React.FC<LaunchTaskFormProps> = props => {
// TODO: We removed all loading indicators here. Decide if we want skeletons
// instead.
// https://github.com/lyft/flyte/issues/666

return (
<>
<LaunchFormHeader title={state.context.sourceId?.name} />
Expand Down
38 changes: 16 additions & 22 deletions src/components/Launch/LaunchForm/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { BlobDimensionality, SimpleType } from 'models/Common/types';
import {
BlobValue,
InputType,
RoleType,
AuthRoleTypes,
AuthRoleMeta
} from './types';
import { BlobValue, InputType, AuthRoleTypes, AuthRoleMeta } from './types';

export const formStrings = {
cancel: 'Cancel',
Expand All @@ -18,21 +12,21 @@ export const formStrings = {
launchPlan: 'Launch Plan'
};

type RoleTypesKey = 'iamRole' | 'k8sServiceAccount';
export const roleTypes: { [k in RoleTypesKey]: RoleType } = {
iamRole: {
helperText: 'example: arn:aws:iam::12345678:role/defaultrole',
inputLabel: 'role urn',
label: 'IAM Role',
value: 'assumableIamRole'
},
k8sServiceAccount: {
helperText: 'example: default-service-account',
inputLabel: 'service account name',
label: 'Kubernetes Service Account',
value: 'kubernetesServiceAccount'
}
};
// type RoleTypesKey = 'iamRole' | 'k8sServiceAccount';
// export const roleTypes: { [k in RoleTypesKey]: RoleType } = {
// iamRole: {
// helperText: 'example: arn:aws:iam::12345678:role/defaultrole',
// inputLabel: 'role urn',
// label: 'IAM Role',
// value: 'assumableIamRole'
// },
// k8sServiceAccount: {
// helperText: 'example: default-service-account',
// inputLabel: 'service account name',
// label: 'Kubernetes Service Account',
// value: 'kubernetesServiceAccount'
// }
// };

export const AuthRoleStrings: { [k in AuthRoleTypes]: AuthRoleMeta } = {
[AuthRoleTypes.k8]: {
Expand Down
Loading

0 comments on commit 519af33

Please sign in to comment.