Skip to content

Commit

Permalink
bram requests xoxo
Browse files Browse the repository at this point in the history
  • Loading branch information
DRIESASTER committed May 20, 2024
1 parent dc66f0d commit 815aa3d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 0 additions & 4 deletions frontend/src/components/RequirementsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,9 @@ const addRequirement = () => {
};
watchEffect(() => {
console.log("Current props value:", props.modelValue);
internalRequirements.value = [...props.modelValue];
});
const updateRequirements = () => {
emit("update:modelValue", [...internalRequirements.value]);
};
const validateRequirement = (value) => {
if (!value) {
return t("project.required"); // Check if the input is empty
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/project/DisplayTestFiles.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-card class="file-display-container" outlined>
<v-card-title> Project Files </v-card-title>
<v-card-title>{{ $t("project.testfiles") }}</v-card-title>
<v-card-text>
<v-treeview v-model="tree" :items="treeItems" activatable hoverable open-on-click>
<template v-slot:prepend="{ item }">
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default {
new_submission: "Submit new",
status_submission: "Submission is: {status}",
no_submission_files: "No submissions found",
files_disclaimer: "For info on the usage of testfiles please visit our",
},
submission: {
status: "Submission status:",
Expand Down Expand Up @@ -79,6 +80,8 @@ export default {
forbidden: "Forbidden",
invalid_format:
"Please enter a valid file type, including the extension (e.g., 'image.png')",
files_will_be_overwritten: "By uploading another file current files will be overwritten.",
testfiles: "Testfiles",
},
navigation: {
home: "Home",
Expand Down
1 change: 0 additions & 1 deletion frontend/src/queries/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export function useUpdateProjectMutation(): UseMutationReturnType<
}

export function useProjectFilesQuery(projectId: number): UseQueryReturnType<File[], Error> {
console.log("projectid" + projectId);
return useQuery<File[], Error>({
queryKey: projectFilesQueryKey(projectId),
queryFn: () => fetchProjectFiles(projectId),
Expand Down
14 changes: 12 additions & 2 deletions frontend/src/views/CreateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,19 @@
<v-row>
<v-col cols="12">
<div v-if="isEditMode" class="file-upload-disclaimer">
<v-alert class="custom-alert" dense text>
<v-alert
v-if="filesData && filesData.length > 0"
class="custom-alert"
dense
text
>
{{ $t("project.files_will_be_overwritten") }}
</v-alert>
<v-alert v-else class="custom-alert" dense text>
{{ $t("project.no_files") }}
</v-alert>
</div>

<FilesInput v-model="files" />
</v-col>
<v-col cols="12">
Expand Down Expand Up @@ -275,7 +284,6 @@ async function submitForm() {
} else {
await createProject(projectData);
}
handleFiles(projectData.project_id);
navigateToProject(projectData.project_id);
} catch (error) {
console.error("Error during project or group creation or file upload:", error);
Expand Down Expand Up @@ -303,13 +311,15 @@ async function updateProject(projectData) {
projectId: projectId.value,
projectData,
});
handleFiles(projectId.value);
setSuccessAlert("Project updated successfully.");
}
async function createProject(projectData) {
const createdProjectId = await createProjectMutation.mutateAsync(projectData);
projectData.project_id = createdProjectId;
await handleGroupCreation(createdProjectId);
handleFiles(projectData.project_id);
setSuccessAlert("Project created successfully.");
}
Expand Down

0 comments on commit 815aa3d

Please sign in to comment.