Merge branch 'task001/add-labels' of bitbucket.org:studiotem/jandl-taskmanager-app

This commit is contained in:
Matej Glasnák committed 2025-12-03 14:46:14 +01:00
commit 4edc33c316
26 files changed
+380 -756

No files matched your search

+60 -124
View File
@@ -4,6 +4,7 @@
:width="modalWidth"
:height="modalHeight"
persistent
:retain-focus="false"
>
<W-loadable :content="subtask" class="h-100">
<v-card
@@ -28,7 +29,6 @@
class="modal-input"
variant="solo"
disabled
@focus="onInputFocus"
></v-text-field>
<v-autocomplete
@@ -43,7 +43,6 @@
variant="solo"
class="modal-input"
clearable
@focus="onInputFocus"
/>
<v-text-field
@@ -51,7 +50,6 @@
class="modal-input"
label="Názov subtasku"
variant="solo"
@focus="onInputFocus"
></v-text-field>
<div class="splitted-inputs">
@@ -71,7 +69,6 @@
placeholder="Deadline"
:class="{ error: v$.subtask.deadline.$errors?.length }"
:validations="v$.subtask.deadline"
@open="onDateOpen"
/>
</div>
@@ -88,7 +85,6 @@
? errorUtils.parseErrors(v$.subtask._deadline_time.$errors)
: null
"
@focus="onInputFocus"
/>
</div>
@@ -159,7 +155,6 @@
label="Časový odhad"
:class="{ error: employeeValidations[0]?.duration }"
append-inner-icon="mdi-clock-outline"
@focus="onInputFocus"
@update:model-value="
employeeValidations[0]
? (employeeValidations[0].duration = false)
@@ -221,7 +216,6 @@
label="Časový odhad"
append-inner-icon="mdi-clock-outline"
:class="{ error: employeeValidations[index]?.duration }"
@focus="onInputFocus"
@update:model-value="
employeeValidations[index]
? (employeeValidations[index].duration = false)
@@ -239,12 +233,9 @@
:timeblock="timeblock"
:deletable="index > 0"
:editable="true"
:prevent-input-focus="preventInputFocus"
:on-input-focus="onInputFocus"
:on-date-open="onDateOpen"
:index="index"
@updateTimeblock="(val) => updateTimeblock(val, index)"
@removeTimeblock="removeTimeblock(index)"
@update-timeblock="(val) => updateTimeblock(val, index)"
@remove-timeblock="removeTimeblock(index)"
/>
<div v-if="!subtask.id" class="end-button w-100">
<button @click="addTimeblock">Pridať časový blok</button>
@@ -351,7 +342,6 @@ import useVuelidate from '@vuelidate/core';
import { required } from '@vuelidate/validators';
import errorUtils from '@/plugins/lib@auth/_utils/error.utils';
import { QuillEditor } from '@vueup/vue-quill';
import VuetifyFixFocusMixin from '@/plugins/tm@modal/_mixins/vuetify-fix-focus';
import SelectsMixin from '../master-task/_mixins/selects.mixin';
import tmUtils from '@/plugins/tm@_utils/tm.utils';
import moment from 'moment';
@@ -367,6 +357,7 @@ import AResetSizeButton from '@/plugins/tm@modal/_components/a-reset-size-button
import ACloseButton from '@/plugins/tm@modal/_components/a-close-button.vue';
export default {
components: {
ZTaskReadonlyInfo,
ATimeblock,
@@ -378,7 +369,7 @@ export default {
AResetSizeButton,
ACloseButton,
},
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin, modalMixin],
mixins: [SelectsMixin, AutocompleteMixin, modalMixin],
emits: ['close', 'refresh'],
data() {
@@ -446,6 +437,61 @@ export default {
};
},
watch: {
'subtask.employee_id'(value, oldValue) {
if (!value || !oldValue) return;
this.subtask.timeblocks = [];
this.subtask._employee = this.enrichedEmployees.find(
(employee) => employee.id == this.subtask.employee_id,
);
},
'subtask.employees': {
handler() {
if (!this.subtask?.employees) return;
const lastEmployee =
this.subtask.employees[this.subtask.employees.length - 1];
if (lastEmployee?.id || lastEmployee?.duration)
this.subtask.employees.push({});
},
deep: true,
},
'subtask.master_task_id'(value) {
if (!value) return;
this.subtask._master_task = this.mastertasks.find(
(mastertask) => mastertask.id == this.subtask.master_task_id,
);
this.subtask.project_code =
this.subtask._master_task?.project_code || null;
},
editMode() {
this.$nextTick(() => {
this.$refs['description']?.setHTML(this.subtask.description || '');
});
},
subtask: {
handler(val) {
if (this.editMode && !this.subtask?.id) {
const employees = val?.employees?.filter(
(employee) => employee?.id || employee?.duration,
) || [{}];
const subtaskData = {
...val,
employees: employees && employees.length > 0 ? employees : [{}],
};
localStorage.setItem('subtaskData', JSON.stringify(subtaskData));
}
},
deep: true,
},
},
mounted() {
this.$events.on('add-timeblock', (timeblock) => {
if (!this.subtask?.timeblocks) {
@@ -507,29 +553,6 @@ export default {
},
methods: {
// Override onDateOpen from VuetifyFixFocusMixin to add logging
onDateOpen($event) {
// Call the parent mixin's onDateOpen method
if (
VuetifyFixFocusMixin.methods &&
VuetifyFixFocusMixin.methods.onDateOpen
) {
VuetifyFixFocusMixin.methods.onDateOpen.call(this, $event);
}
},
// Override onInputFocus from VuetifyFixFocusMixin to add logging
onInputFocus($event) {
const target = $event?.target;
// Call the parent mixin's onInputFocus method
if (
VuetifyFixFocusMixin.methods &&
VuetifyFixFocusMixin.methods.onInputFocus
) {
VuetifyFixFocusMixin.methods.onInputFocus.call(this, $event);
}
},
toggleEditMode() {
if (this.subtask.type == 'office365')
return this.$events.emit('show-unable-to-edit-office-task-modal', {
@@ -599,7 +622,6 @@ export default {
];
this.$nextTick(() => {
this.v$.$reset();
this.setFocusEvent();
// Reset after modal is fully rendered and v-dialog autofocus has been blocked
setTimeout(() => {
@@ -671,13 +693,6 @@ export default {
throw new Error('subtaskData is null or undefined');
}
} catch (error) {
/* eslint-disable */ /* eslint-disable */console.error(
...oo_tx(`721229222_674_33_680_13_11`,...oo_tx(
`3261980582_640_12_640_62_11`,
'Error parsing subtaskData:',
error,
)),
);
this.subtask = {
master_task: mastertask,
employees: [{}],
@@ -706,15 +721,6 @@ export default {
this.editMode = editMode || !this.subtask.id;
} catch (error) {
this.$toast.error(this.$parseError(error));
if (process.env.NODE_ENV === 'development')
/* eslint-disable */ /* eslint-disable */console.log(
...oo_oo(`721229222_711_31_717_11_4`,...oo_oo(
`3261980582_671_10_671_58_4`,
'[z-task-modal.vue] Error: ',
error,
)),
);
}
},
@@ -837,15 +843,6 @@ export default {
this.closeModal();
} catch (error) {
this.$toast.error(this.$parseError(error));
if (process.env.NODE_ENV === 'development')
/* eslint-disable */ /* eslint-disable */console.log(
...oo_oo(`721229222_842_31_848_11_4`,...oo_oo(
`3261980582_788_10_788_58_4`,
'[z-task-modal.vue] Error: ',
error,
)),
);
} finally {
this.isSaving = false;
}
@@ -878,9 +875,6 @@ export default {
_mergeDeadlineTimeDate() {
const date = new Date(this.subtask.deadline);
/* eslint-disable */ /* eslint-disable */console.log(
...oo_oo(`721229222_881_27_883_7_4`,...oo_oo(`3261980582_821_6_821_47_4`, 'z-task-modal', this.subtask)),
);
const timeParts = this.subtask._deadline_time.split(':');
date.setHours(parseInt(timeParts[0]));
@@ -971,64 +965,6 @@ export default {
};
},
},
watch: {
'subtask.employee_id'(value, oldValue) {
if (!value || !oldValue) return;
this.subtask.timeblocks = [];
this.subtask._employee = this.enrichedEmployees.find(
(employee) => employee.id == this.subtask.employee_id,
);
},
'subtask.employees': {
handler() {
if (!this.subtask?.employees) return;
const lastEmployee =
this.subtask.employees[this.subtask.employees.length - 1];
if (lastEmployee?.id || lastEmployee?.duration)
this.subtask.employees.push({});
},
deep: true,
},
'subtask.master_task_id'(value) {
if (!value) return;
this.subtask._master_task = this.mastertasks.find(
(mastertask) => mastertask.id == this.subtask.master_task_id,
);
this.subtask.project_code =
this.subtask._master_task?.project_code || null;
},
editMode() {
this.$nextTick(() => {
this.$refs['description']?.setHTML(this.subtask.description || '');
});
},
subtask: {
handler(val) {
if (this.editMode && !this.subtask?.id) {
const employees = val?.employees?.filter(
(employee) => employee?.id || employee?.duration,
) || [{}];
const subtaskData = {
...val,
employees: employees && employees.length > 0 ? employees : [{}],
};
/* eslint-disable */ /* eslint-disable */console.log(
...oo_oo(`721229222_1023_31_1025_11_4`,...oo_oo(`3261980582_961_10_961_49_4`, 'subtaskData', subtaskData)),
);
localStorage.setItem('subtaskData', JSON.stringify(subtaskData));
}
},
deep: true,
},
},
};
</script>