diff --git a/frontend/src/components/submissions/DownloadCard.vue b/frontend/src/components/submissions/DownloadCard.vue new file mode 100644 index 00000000..1ea3c57b --- /dev/null +++ b/frontend/src/components/submissions/DownloadCard.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/frontend/src/main.scss b/frontend/src/main.scss index 0e48c47e..3d898adc 100644 --- a/frontend/src/main.scss +++ b/frontend/src/main.scss @@ -26,6 +26,7 @@ body { a { text-decoration: none; + color: inherit; } .p-toast{ diff --git a/frontend/src/views/submissions/SubmissionView.vue b/frontend/src/views/submissions/SubmissionView.vue index 5260dbb1..6e6f3280 100644 --- a/frontend/src/views/submissions/SubmissionView.vue +++ b/frontend/src/views/submissions/SubmissionView.vue @@ -10,12 +10,12 @@ import { computed, ref, watch } from 'vue'; import { useRoute } from 'vue-router'; import { useFeedback } from '@/composables/services/feedback.service.ts'; import { type Feedback } from '@/types/Feedback.ts'; -import { User } from '@/types/users/User.ts'; import moment from 'moment/moment'; import { PrimeIcons } from 'primevue/api'; import { useSubmission } from '@/composables/services/submission.service.ts'; -import { useProject } from '@/composables/services/project.service.ts'; -import { useExtraCheck } from '@/composables/services/extra_checks.service.ts'; +import DownloadCard from '@/components/submissions/DownloadCard.vue'; +import { watchImmediate } from '@vueuse/core'; +import Loading from '@/components/Loading.vue'; /* Composable injections */ const route = useRoute(); @@ -23,8 +23,6 @@ const { t } = useI18n(); const { user } = storeToRefs(useAuthStore()); const { submission, getSubmissionByID } = useSubmission(); const { feedbacks, getFeedbackBySubmission, createFeedback, updateFeedback } = useFeedback(); -const { project, getProjectByID } = useProject(); -const { extraChecks, getExtraChecksByProject } = useExtraCheck(); /* Feedback content */ const feedbackTextValue = ref(''); @@ -65,26 +63,24 @@ const structureAndExtraFaults = computed(() => { return [...structureFaults, ...extraFaults].filter((fault) => fault); }); -const showLogsAndArtifacts = computed(() => { - const extraChecksResults = submission.value?.extraCheckResults ?? []; - let results: string[] = []; - if (project.value != null && extraChecks.value != null) { - const visibleLogs = extraChecksResults - .filter((check) => { - return extraChecks.value?.find((extraCheck) => extraCheck.id === check.extra_check)?.show_log; - }) - .map((check) => check.log_file); +const artifacts = computed(() => { + if (submission.value != null) { + return submission.value.extraCheckResults + .filter((extraCheck) => extraCheck.artifact) + .map((extraCheck) => extraCheck.artifact); + } - const visibleArtifacts = extraChecksResults - .filter((check) => { - return extraChecks.value?.find((extraCheck) => extraCheck.id === check.extra_check)?.show_artifact; - }) - .map((check) => check.artifact); + return null; +}); - results = [...visibleLogs, ...visibleArtifacts]; +const logs = computed(() => { + if (submission.value != null) { + return submission.value.extraCheckResults + .filter((extraCheck) => extraCheck.log_file) + .map((extraCheck) => extraCheck.log_file); } - return results; + return null; }); /* Watchers */ @@ -98,15 +94,12 @@ watch( ); // A watch on submissionId url parameter to get the feedbacks -watch( +watchImmediate( () => route.params.submissionId, (submissionId) => { - getSubmissionByID(submissionId as string); - getFeedbackBySubmission(submissionId as string); - getProjectByID(route.params.projectId as string); - getExtraChecksByProject(route.params.projectId as string); + getSubmissionByID(submissionId.toString()); + getFeedbackBySubmission(submissionId.toString()); }, - { immediate: true }, ); @@ -120,95 +113,114 @@ watch( link /> -
- -
- -
- Status -
-

{{ t('views.submissions.passed') }}

-
- {{ t('views.submissions.failed') }} -
    -
  • {{ t(fault) }}
  • -
+