Skip to content

Commit ee4355c

Browse files
committed
TSJR-314 fixes to skills modal
1 parent 498d687 commit ee4355c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/apps/admin/src/skills-manager/components/skill-modal/SkillModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const SkillModal: FC<SkillModalProps> = props => {
6868

6969
const formValue = useMemo(() => ({
7070
...(props.skill as any),
71-
categoryId: props.skill.category.id,
71+
categoryId: props.skill.category?.id,
7272
} as FormValue), [props.skill])
7373

7474
function renderForm(): ReactNode {

src/apps/admin/src/skills-manager/components/skill-modal/skill-form.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ export const skillFormDef = (
2121
buttons: {
2222
primaryGroup: [
2323
{
24-
buttonStyle: 'secondary',
24+
buttonLight: true,
25+
buttonStyle: 'primary',
2526
isSubmit: false,
2627
label: 'Cancel',
2728
onClick: onCancelClick,
2829
size: 'lg',
2930
type: 'button',
3031
},
31-
{
32+
...(action === 'add' ? [{
3233
buttonStyle: 'secondary',
3334
isSubmit: true,
3435
label: 'Save and add another',
3536
size: 'lg',
3637
type: 'submit',
37-
},
38+
}] : []),
3839
{
3940
buttonStyle: 'primary',
4041
isSubmit: true,
@@ -80,6 +81,7 @@ export const skillFormDef = (
8081
],
8182
},
8283
{
84+
creatable: true,
8385
label: 'Skill Category',
8486
name: SkillFormField.category,
8587
options: mapCategoryToSelectOption(categories ?? []),

0 commit comments

Comments
 (0)