Skip to content

Commit a526fec

Browse files
authored
disabling next untill user selects a license (#1014)
1 parent f8e3d84 commit a526fec

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

frontend/src/components/datasets/ChooseLicenseModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,16 @@ export const ChooseLicenseModal: React.FC<ChooseLicenseModalProps> = (
119119
setLicenseModalOpen={setLicenseModalOpen}
120120
setLicenseRequestForm={setLicenseRequestForm}
121121
handleNext={handleNext}
122+
handleCloseModal={handleCloseModal}
122123
/>
123124
</DialogContent>
124125
</Dialog>
125126
<Box>
126-
<Button variant="contained" onClick={handleNext}>
127+
<Button
128+
disabled={!selectedLicense}
129+
variant="contained"
130+
onClick={handleNext}
131+
>
127132
Next
128133
</Button>
129134
<Button onClick={handleBack} sx={{ mt: 1, ml: 1 }}>

frontend/src/components/datasets/CreateLicenseModal.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ type CreateLicenseModalProps = {
1919
setLicenseModalOpen: any;
2020
setLicenseRequestForm: any;
2121
handleNext: any;
22+
handleCloseModal: any;
2223
};
2324

2425
export const CreateLicenseModal = (props: CreateLicenseModalProps) => {
25-
const { setLicenseModalOpen, setLicenseRequestForm, handleNext } = props;
26+
const {
27+
setLicenseModalOpen,
28+
setLicenseRequestForm,
29+
handleNext,
30+
handleCloseModal,
31+
} = props;
2632

2733
const addLicense = (formData: FormData) => {
2834
setLicenseRequestForm(formData);
@@ -46,7 +52,7 @@ export const CreateLicenseModal = (props: CreateLicenseModalProps) => {
4652
</Button>
4753
<Button
4854
onClick={() => {
49-
setLicenseModalOpen(false);
55+
handleCloseModal();
5056
}}
5157
sx={{ marginLeft: "0.5em" }}
5258
>

0 commit comments

Comments
 (0)