Skip to content

Commit

Permalink
Merge pull request #28 from ssciwr/fix_12_conditions_of_use_checkbox
Browse files Browse the repository at this point in the history
Add conditions of use modal
  • Loading branch information
lkeegan authored Oct 21, 2024
2 parents 0b4a6a3 + e1efd3f commit c09d3c2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
10 changes: 5 additions & 5 deletions frontend/src/components/AccountComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ref, computed } from "vue";
import { apiClient, logout } from "@/utils/api-client";
import { validate_password } from "@/utils/validation";
import { useUserStore } from "@/stores/user";
import ListItem from "@/components/ListItem.vue";
import CardComponent from "@/components/CardComponent.vue";
import { FwbInput, FwbButton, FwbAlert } from "flowbite-vue";
const userStore = useUserStore();
const current_email = ref("");
Expand Down Expand Up @@ -51,7 +51,7 @@ function do_change_password() {
</script>

<template v-if="userStore.user != null">
<ListItem title="My account">
<CardComponent title="My account">
<p>You are currently logged in as {{ current_email }}</p>
<p>
<fwb-button
Expand All @@ -64,8 +64,8 @@ function do_change_password() {
Logout
</fwb-button>
</p>
</ListItem>
<ListItem title="Change password">
</CardComponent>
<CardComponent title="Change password">
<fwb-input
v-model="current_password"
label="Current password"
Expand Down Expand Up @@ -128,5 +128,5 @@ function do_change_password() {
<fwb-alert type="info" v-if="response_message.length > 0">
{{ response_message }}
</fwb-alert>
</ListItem>
</CardComponent>
</template>
33 changes: 32 additions & 1 deletion frontend/src/views/SamplesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
FwbFileInput,
FwbInput,
FwbAlert,
FwbModal,
FwbCheckbox,
} from "flowbite-vue";
const tumor_types = [
Expand All @@ -25,6 +27,16 @@ const sources = [
];
const required_columns = ["barcode", "cdr3", "chain"];
function closeModalSubmit() {
agree_to_conditions.value = false;
showModalSubmit.value = false;
}
function openModalSubmit() {
showModalSubmit.value = true;
}
const showModalSubmit = ref(false);
const agree_to_conditions = ref(false);
const sample_name = ref("");
const tumor_type = ref("lung");
const source = ref("TIL");
Expand Down Expand Up @@ -162,6 +174,7 @@ function add_sample() {
}
new_sample_error_message.value = error.response.data.message;
});
closeModalSubmit();
sample_name.value = "";
selected_h5_file.value = null;
h5_file_input_key.value++;
Expand Down Expand Up @@ -225,7 +238,7 @@ function add_sample() {
class="mb-2"
/>
<fwb-button
@click="add_sample"
@click="openModalSubmit"
:disabled="
selected_h5_file === null ||
selected_csv_file === null ||
Expand Down Expand Up @@ -253,4 +266,22 @@ function add_sample() {
</ListItem>
</ListComponent>
</main>

<fwb-modal size="md" v-if="showModalSubmit" @close="closeModalSubmit">
<template #header>
<div class="flex items-center text-lg">Conditions of use</div>
</template>
<template #body>
This service is provided for non-commercial use only, and is not to be
used for training models.
<fwb-checkbox
v-model="agree_to_conditions"
label="I agree to the conditions of use"
class="py-4"
/>
<fwb-button @click="add_sample" :disabled="!agree_to_conditions"
>Submit</fwb-button
>
</template>
</fwb-modal>
</template>

0 comments on commit c09d3c2

Please sign in to comment.