diff --git a/src/i18n/en-ca/index.ts b/src/i18n/en-ca/index.ts index d2d1823..1ab309c 100644 --- a/src/i18n/en-ca/index.ts +++ b/src/i18n/en-ca/index.ts @@ -295,7 +295,7 @@ export default { add: "Add Shift", edit: "Edit shift", delete: "Delete shift", - delete_confirmation_msg: "Do you want to delete this shift completly?", + delete_confirmation_msg: "Delete this shift?", }, types: { label: "Shift`s Type", diff --git a/src/i18n/fr-ca/index.ts b/src/i18n/fr-ca/index.ts index 70c5d95..98c795b 100644 --- a/src/i18n/fr-ca/index.ts +++ b/src/i18n/fr-ca/index.ts @@ -295,7 +295,7 @@ export default { add: "Ajouter un Quart", edit: "Modifier un Quart", delete: "Supprimer un Quart", - delete_confirmation_msg: "Voulez-vous complètement supprimer ce quart?", + delete_confirmation_msg: "Supprimer ce quart?", }, types: { label: "Type de Quart", diff --git a/src/modules/timesheet-approval/components/details-dialog.vue b/src/modules/timesheet-approval/components/details-dialog.vue index ccd539d..825eb35 100644 --- a/src/modules/timesheet-approval/components/details-dialog.vue +++ b/src/modules/timesheet-approval/components/details-dialog.vue @@ -22,6 +22,7 @@ full-height transition-show="jump-down" transition-hide="jump-down" + backdrop-filter="blur(6px)" @show="is_dialog_open = true" @hide="is_dialog_open = false" > diff --git a/src/modules/timesheets/components/expense-dialog-list-item.vue b/src/modules/timesheets/components/expense-dialog-list-item.vue index 7003990..5b29602 100644 --- a/src/modules/timesheets/components/expense-dialog-list-item.vue +++ b/src/modules/timesheets/components/expense-dialog-list-item.vue @@ -199,7 +199,7 @@ /> diff --git a/src/modules/timesheets/components/shift-list-day-row.vue b/src/modules/timesheets/components/shift-list-day-row.vue index 41613bb..6193188 100644 --- a/src/modules/timesheets/components/shift-list-day-row.vue +++ b/src/modules/timesheets/components/shift-list-day-row.vue @@ -2,12 +2,15 @@ setup lang="ts" > + import { useI18n } from 'vue-i18n'; import { onMounted, ref } from 'vue'; - import { QSelect, QInput } from 'quasar'; + import { QSelect, QInput, useQuasar } from 'quasar'; import { useUiStore } from 'src/stores/ui-store'; import { SHIFT_OPTIONS } from 'src/modules/timesheets/utils/shift.util'; import type { Shift } from 'src/modules/timesheets/models/shift.models'; + const q = useQuasar(); + const { t } = useI18n(); const ui_store = useUiStore(); const COMMENT_LENGTH_MAX = 280; @@ -16,6 +19,7 @@ const shift_type_selected = ref(SHIFT_OPTIONS.find(option => option.value == shift.value.type)); const select_ref = ref(null); const error_message = ref(); + const is_showing_delete_confirm = ref(false); const { errorMessage = undefined, isTimesheetApproved = false, holiday = false } = defineProps<{ dense?: boolean; @@ -24,6 +28,24 @@ holiday?: boolean | undefined; }>(); + const time_input_props = { + dense: true, + borderless: shift.value.is_approved && isTimesheetApproved, + readonly: shift.value.is_approved && isTimesheetApproved, + standout: q.dark.isActive ? 'bg-blue-grey-3' : 'bg-blue-grey-9', + labelSlot: true, + lazyRules: true, + noErrorIcon: true, + hideBottomSpace: true, + error: shift.value.has_error, + errorMessage: errorMessage ? t(errorMessage) : (error_message.value ? t(error_message.value) : undefined), + labelColor: shift.value.is_approved ? 'white' : (holiday ? 'purple-5' : 'accent'), + class: `col rounded-5 bg-dark q-mx-xs ${shift.value.id === -2 ? 'bg-negative' : ''} ${shift.value.is_approved || isTimesheetApproved ? 'cursor-not-allowed inset-shadow' : ''}`, + inputClass: `text-weight-medium ${shift.value.id === -2 ? 'text-white ' : ' '} ${shift.value.is_approved ? 'text-white cursor-not-allowed q-px-sm' : ''}`, + style: shift.value.is_approved ? (holiday ? 'background-color: #7b1fa2 !important' : 'background-color: #0a7d32 !important;') : '', + inputStyle: "font-size: 1.2em;" + } + const emit = defineEmits<{ 'requestDelete': [void]; 'onTimeFieldBlur': [void]; @@ -37,7 +59,7 @@ shift.value.has_error = false; error_message.value = undefined; emit('onTimeFieldBlur'); - } + } } const onBlurShiftTypeSelect = () => { @@ -48,6 +70,11 @@ } }; + const onConfirmDelete = () => { + is_showing_delete_confirm.value = false; + emit('requestDelete'); + } + const getCommentCounterColor = (comment_length: number) => { if (comment_length < 200) return 'primary'; if (comment_length < 250) return 'warning'; @@ -66,6 +93,37 @@