Merge pull request 'dev/nicolas/staging-prep' (#54) from dev/nicolas/staging-prep into main
Reviewed-on: Targo/targo_frontend#54
This commit is contained in:
commit
29b6d0ef6a
|
|
@ -15,7 +15,7 @@
|
||||||
const shift = defineModel<Shift>('shift', { required: true });
|
const shift = defineModel<Shift>('shift', { required: true });
|
||||||
const shift_type_selected = ref(SHIFT_OPTIONS.find(option => option.value == shift.value.type));
|
const shift_type_selected = ref(SHIFT_OPTIONS.find(option => option.value == shift.value.type));
|
||||||
const select_ref = ref<QSelect | null>(null);
|
const select_ref = ref<QSelect | null>(null);
|
||||||
const error_message = ref('');
|
const error_message = ref<string | undefined>();
|
||||||
|
|
||||||
const { errorMessage = undefined, isTimesheetApproved = false, holiday = false } = defineProps<{
|
const { errorMessage = undefined, isTimesheetApproved = false, holiday = false } = defineProps<{
|
||||||
dense?: boolean;
|
dense?: boolean;
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
error_message.value = 'timesheet.errors.SHIFT_TIME_REQUIRED'
|
error_message.value = 'timesheet.errors.SHIFT_TIME_REQUIRED'
|
||||||
} else {
|
} else {
|
||||||
shift.value.has_error = false;
|
shift.value.has_error = false;
|
||||||
error_message.value = '';
|
error_message.value = undefined;
|
||||||
emit('onTimeFieldBlur');
|
emit('onTimeFieldBlur');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -61,9 +61,6 @@
|
||||||
shift_type_selected.value = undefined;
|
shift_type_selected.value = undefined;
|
||||||
ui_store.focus_next_component = false;
|
ui_store.focus_next_component = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorMessage)
|
|
||||||
error_message.value = errorMessage;
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -191,7 +188,7 @@
|
||||||
no-error-icon
|
no-error-icon
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:error="shift.has_error"
|
:error="shift.has_error"
|
||||||
:error-message="errorMessage || error_message !== '' ? $t(errorMessage ?? error_message) : ''"
|
:error-message="errorMessage ? $t(errorMessage) : (error_message ? $t(error_message) : undefined)"
|
||||||
:label-color="!shift.is_approved ? (holiday? 'purple-5' : 'accent') : 'white'"
|
:label-color="!shift.is_approved ? (holiday? 'purple-5' : 'accent') : 'white'"
|
||||||
class="col rounded-5 bg-dark q-mx-xs"
|
class="col rounded-5 bg-dark q-mx-xs"
|
||||||
:class="(shift.id === -2 ? 'bg-negative ' : ' ') + (!shift.is_approved && !isTimesheetApproved ? '' : 'cursor-not-allowed inset-shadow')"
|
:class="(shift.id === -2 ? 'bg-negative ' : ' ') + (!shift.is_approved && !isTimesheetApproved ? '' : 'cursor-not-allowed inset-shadow')"
|
||||||
|
|
@ -222,7 +219,7 @@
|
||||||
no-error-icon
|
no-error-icon
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:error="shift.has_error"
|
:error="shift.has_error"
|
||||||
:error-message="errorMessage || error_message !== '' ? $t(errorMessage ?? error_message) : ''"
|
:error-message="errorMessage ? $t(errorMessage) : (error_message ? $t(error_message) : undefined)"
|
||||||
:label-color="!shift.is_approved ? (holiday? 'purple-5' : 'accent') : 'white'"
|
:label-color="!shift.is_approved ? (holiday? 'purple-5' : 'accent') : 'white'"
|
||||||
:input-class="'text-weight-medium ' + (shift.id === -2 ? 'text-white ' : ' ') + (shift.is_approved ? 'text-white cursor-not-allowed q-px-sm' : '')"
|
:input-class="'text-weight-medium ' + (shift.id === -2 ? 'text-white ' : ' ') + (shift.is_approved ? 'text-white cursor-not-allowed q-px-sm' : '')"
|
||||||
input-style="font-size: 1.2em;"
|
input-style="font-size: 1.2em;"
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,13 @@
|
||||||
if (shift.id <= 0) {
|
if (shift.id <= 0) {
|
||||||
shift.id = 0;
|
shift.id = 0;
|
||||||
emit('deleteUnsavedShift');
|
emit('deleteUnsavedShift');
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
await shift_api.deleteShiftById(shift.id);
|
await shift_api.deleteShiftById(shift.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (day.shifts.length < 2 && shift_error_message.value !== undefined) {
|
||||||
|
onTimeFieldBlur();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onTimeFieldBlur = () => {
|
const onTimeFieldBlur = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user