Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditions of use modal #28

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
FwbFileInput,
FwbInput,
FwbAlert,
FwbModal,
FwbCheckbox,
} from "flowbite-vue";

const tumor_types = [
Expand All @@ -25,6 +27,16 @@
];
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 @@ -151,7 +163,7 @@
"Content-Type": "multipart/form-data",
},
})
.then((response) => {

Check warning on line 166 in frontend/src/views/SamplesView.vue

View workflow job for this annotation

GitHub Actions / Frontend :: node 22

'response' is defined but never used
update_samples();
update_submit_message();
new_sample_error_message.value = "";
Expand All @@ -162,6 +174,7 @@
}
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 @@
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 @@
</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>
Loading