-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from IV1201-Group-2/feature/handle-application…
…-view Feature/handle application view
- Loading branch information
Showing
11 changed files
with
268 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<script setup lang="ts"> | ||
import { computed, ref } from "vue"; | ||
import { useI18n } from "vue-i18n"; | ||
const { t } = useI18n(); | ||
type StatusKeys = "accepted" | "pending" | "rejected"; | ||
type Statuses = { | ||
[status in StatusKeys]: { | ||
i18nPath: string; | ||
icon: string; | ||
color: string; | ||
}; | ||
}; | ||
const basePath = "recruiter.handle-application."; | ||
const statusPath = basePath + "status."; | ||
const actionsPath = statusPath + "actions."; | ||
const undoMsgPath = statusPath + "undo-message."; | ||
const statuses: Statuses = { | ||
accepted: { | ||
i18nPath: "accepted", | ||
icon: "mdi-check-circle", | ||
color: "success" | ||
}, | ||
pending: { | ||
i18nPath: "pending", | ||
icon: "mdi-minus-circle", | ||
color: "orange" | ||
}, | ||
rejected: { | ||
i18nPath: "rejected", | ||
icon: "mdi-close-circle", | ||
color: "red" | ||
} | ||
}; | ||
const status = ref(statuses.pending); | ||
const isHandled = computed(() => status.value.i18nPath !== statuses.pending.i18nPath); | ||
const dialogIsVisible = ref(false); | ||
const undoMsgBody = computed(() => t(undoMsgPath + "body")); | ||
function accept() { | ||
status.value = statuses.accepted; | ||
} | ||
function reject() { | ||
status.value = statuses.rejected; | ||
} | ||
function undo() { | ||
status.value = statuses.pending; | ||
hideDialog(); | ||
} | ||
function showDialog() { | ||
dialogIsVisible.value = true; | ||
} | ||
function hideDialog() { | ||
dialogIsVisible.value = false; | ||
} | ||
</script> | ||
|
||
<template> | ||
<v-card variant="outlined" max-width="200" class="ml-3"> | ||
<template #title> | ||
{{ $t(statusPath + "header") }} | ||
</template> | ||
<v-card-item> | ||
<v-chip :color="status.color" :append-icon="status.icon"> | ||
{{ $t(statusPath + status.i18nPath) }} | ||
</v-chip> | ||
</v-card-item> | ||
<v-card-actions> | ||
<v-dialog v-if="isHandled" v-model="dialogIsVisible" width="auto"> | ||
<template #activator="{ props }"> | ||
<v-btn v-bind="props" @click="showDialog"> | ||
{{ $t(actionsPath + "undo") }} | ||
</v-btn> | ||
</template> | ||
|
||
<v-card> | ||
<v-card-title> | ||
{{ $t(undoMsgPath + "header") }} | ||
</v-card-title> | ||
<v-card-text class="text-center"> | ||
<div v-html="undoMsgBody" /> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn color="red" @click="hideDialog">{{ $t(undoMsgPath + "no") }}</v-btn> | ||
<v-btn color="success" @click="undo">{{ $t(undoMsgPath + "yes") }}</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
<v-btn v-if="!isHandled" color="red" class="mr-2" @click="reject">{{ $t(actionsPath + "reject") }}</v-btn> | ||
<v-btn v-if="!isHandled" color="success" @click="accept">{{ $t(actionsPath + "accept") }}</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,85 @@ | ||
<script setup lang="ts"></script> | ||
<script setup lang="ts"> | ||
import PersonalInformation from "@/components/generic/PersonalInformation.vue"; | ||
import ItemList from "@/components/generic/ItemList.vue"; | ||
import StatusCard from "@/components/handle_application/StatusCard.vue"; | ||
import type { AvailabilityList, CompetenceList } from "@/components/generic/types"; | ||
const basePath = "recruiter.handle-application."; | ||
const itemListPath = basePath + "item-list."; | ||
const competencePath = basePath + "competence."; | ||
const availabilityPath = basePath + "availability."; | ||
const testAvailabilityList: AvailabilityList = { | ||
__typename: "AvailabilityList", | ||
data: [ | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
}, | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
}, | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
}, | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
}, | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
}, | ||
{ | ||
start: new Date().toISOString().substring(0, 10), | ||
end: new Date().toISOString().substring(0, 10) | ||
} | ||
] | ||
}; | ||
const testCompetenceList: CompetenceList = { | ||
__typename: "CompetenceList", | ||
data: [ | ||
{ | ||
areaOfExpertise: "lotteries", | ||
yearsOfExperience: 3 | ||
}, | ||
{ | ||
areaOfExpertise: "ticket-sales", | ||
yearsOfExperience: 3 | ||
} | ||
] | ||
}; | ||
</script> | ||
|
||
<template> | ||
<main style="height: 30rem"> | ||
<div class="text-h3 text-center mb-10">Handle Application</div> | ||
<div class="text-h3 text-center mb-10">{{ $t(basePath + "header") }}</div> | ||
<v-sheet class="d-flex"> | ||
<v-sheet> | ||
<PersonalInformation :base-path="basePath" /> | ||
<StatusCard /> | ||
</v-sheet> | ||
<v-sheet class="d-flex flex-column justify-space-between"> | ||
<v-sheet class="d-flex"> | ||
<ItemList | ||
:header-i18n-key="itemListPath + 'competence-header'" | ||
:first-column-i18n-key="competencePath + 'area-of-expertise'" | ||
:second-column-i18n-key="competencePath + 'years-of-experience'" | ||
:disable-delete="true" | ||
v-model:list="testCompetenceList" | ||
/> | ||
<ItemList | ||
:header-i18n-key="itemListPath + 'availability-header'" | ||
:first-column-i18n-key="availabilityPath + 'start-date'" | ||
:second-column-i18n-key="availabilityPath + 'end-date'" | ||
:disable-delete="true" | ||
v-model:list="testAvailabilityList" | ||
/> | ||
</v-sheet> | ||
</v-sheet> | ||
</v-sheet> | ||
</main> | ||
</template> |