mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
399f80e106
commit
3016b6aaa0
5 files changed
+62
-36
No files matched your search
@@ -209,15 +209,17 @@ export default {
|
|||||||
if (this.$route.name == 'Dashboard - Tasks') {
|
if (this.$route.name == 'Dashboard - Tasks') {
|
||||||
const editedSubtask = {
|
const editedSubtask = {
|
||||||
...event.subtask,
|
...event.subtask,
|
||||||
timeblocks: [
|
timeblocks: event.subtask.timeblocks.map((tb) => {
|
||||||
...event.subtask.timeblocks,
|
if (tb.id === event._timeblock_id) {
|
||||||
{
|
return {
|
||||||
id: event._timeblock_id,
|
id: event._timeblock_id,
|
||||||
is_finished: 0,
|
is_finished: tb.is_finished || 0,
|
||||||
start: tmUtils.formatDateTimeForBackend(start),
|
start: tmUtils.formatDateTimeForBackend(start),
|
||||||
end: tmUtils.formatDateTimeForBackend(end),
|
end: tmUtils.formatDateTimeForBackend(end),
|
||||||
},
|
};
|
||||||
],
|
}
|
||||||
|
return tb;
|
||||||
|
}),
|
||||||
timesheets: event.subtask.timesheets.map((timesheet) => {
|
timesheets: event.subtask.timesheets.map((timesheet) => {
|
||||||
delete timesheet.employee_name;
|
delete timesheet.employee_name;
|
||||||
return timesheet;
|
return timesheet;
|
||||||
@@ -245,15 +247,17 @@ export default {
|
|||||||
const editedSubtask = {
|
const editedSubtask = {
|
||||||
...event.subtask,
|
...event.subtask,
|
||||||
employee_id: split.employee_id,
|
employee_id: split.employee_id,
|
||||||
timeblocks: [
|
timeblocks: event.subtask.timeblocks.map((tb) => {
|
||||||
...event.subtask.timeblocks,
|
if (tb.id === event._timeblock_id) {
|
||||||
{
|
return {
|
||||||
id: event._timeblock_id,
|
id: event._timeblock_id,
|
||||||
is_finished: 0,
|
is_finished: tb.is_finished || 0,
|
||||||
start: tmUtils.formatDateTimeForBackend(event.start),
|
start: tmUtils.formatDateTimeForBackend(event.start),
|
||||||
end: tmUtils.formatDateTimeForBackend(event.end),
|
end: tmUtils.formatDateTimeForBackend(event.end),
|
||||||
},
|
};
|
||||||
],
|
}
|
||||||
|
return tb;
|
||||||
|
}),
|
||||||
timesheets: event.subtask.timesheets.map((timesheet) => {
|
timesheets: event.subtask.timesheets.map((timesheet) => {
|
||||||
delete timesheet.employee_name;
|
delete timesheet.employee_name;
|
||||||
return timesheet;
|
return timesheet;
|
||||||
|
|||||||
@@ -628,7 +628,9 @@ export default {
|
|||||||
// Helper: Get timeblocks for specific employee
|
// Helper: Get timeblocks for specific employee
|
||||||
getEmployeeTimeblocks(employeeId) {
|
getEmployeeTimeblocks(employeeId) {
|
||||||
if (!this.timeblocks) return [];
|
if (!this.timeblocks) return [];
|
||||||
return this.timeblocks.filter((tb) => tb.employee_id == employeeId);
|
return this.timeblocks.filter(
|
||||||
|
(tb) => Number(tb.employee_id) === Number(employeeId),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateEmployeeTimeblocks(updatedTimeblocks, employeeId) {
|
updateEmployeeTimeblocks(updatedTimeblocks, employeeId) {
|
||||||
@@ -1040,23 +1042,28 @@ export default {
|
|||||||
|
|
||||||
// Convert timeblocks from internal format to BE format for update
|
// Convert timeblocks from internal format to BE format for update
|
||||||
// Filter out completely empty timeblocks AND timeblocks without all required fields
|
// Filter out completely empty timeblocks AND timeblocks without all required fields
|
||||||
const timeblocks = this.timeblocks
|
// Pre draft s multiple employees preskočiť - timeblocks sú v employees array
|
||||||
.filter(
|
const timeblocks =
|
||||||
(timeblock) =>
|
this.subtask.is_draft && this.isDraftWithMultipleEmployees
|
||||||
timeblock.date &&
|
? []
|
||||||
timeblock.starts_at_time &&
|
: this.timeblocks
|
||||||
timeblock.ends_at_time &&
|
.filter(
|
||||||
timeblock.employee_id == this.subtask.employee_id,
|
(timeblock) =>
|
||||||
) // Only send complete timeblocks for this employee
|
timeblock.date &&
|
||||||
.map((timeblock) => {
|
timeblock.starts_at_time &&
|
||||||
const dateStr = moment(timeblock.date).format('YYYY-MM-DD');
|
timeblock.ends_at_time &&
|
||||||
return {
|
Number(timeblock.employee_id) ===
|
||||||
id: timeblock.id || null,
|
Number(this.subtask.employee_id),
|
||||||
start: `${dateStr} ${timeblock.starts_at_time}:00`,
|
) // Only send complete timeblocks for this employee
|
||||||
end: `${dateStr} ${timeblock.ends_at_time}:00`,
|
.map((timeblock) => {
|
||||||
is_finished: timeblock.is_finished || 0,
|
const dateStr = moment(timeblock.date).format('YYYY-MM-DD');
|
||||||
};
|
return {
|
||||||
});
|
id: timeblock.id || null,
|
||||||
|
start: `${dateStr} ${timeblock.starts_at_time}:00`,
|
||||||
|
end: `${dateStr} ${timeblock.ends_at_time}:00`,
|
||||||
|
is_finished: timeblock.is_finished || 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const payload = { ...this.subtask, timesheets, timeblocks };
|
const payload = { ...this.subtask, timesheets, timeblocks };
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ class SendDeletedSubTaskNotification
|
|||||||
*/
|
*/
|
||||||
public function handle(SubTaskDeleted $event)
|
public function handle(SubTaskDeleted $event)
|
||||||
{
|
{
|
||||||
|
// Neposielame notifikacie pri mazani konceptov (draftov)
|
||||||
|
if ($event->subtask->is_draft) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$receiversArray[] = $event->subtask->user->email;
|
$receiversArray[] = $event->subtask->user->email;
|
||||||
$creator = \App\Models\User::find($event->subtask->created_by);
|
$creator = \App\Models\User::find($event->subtask->created_by);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ class SendEditedSubTaskNotification implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(SubTaskEdited $event)
|
public function handle(SubTaskEdited $event)
|
||||||
{
|
{
|
||||||
|
// Neposielame notifikacie pre koncepty (drafty)
|
||||||
|
if ($event->subtask->is_draft) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// emailova notifikacia sa posiela len ak subtask bol upraveny inym uzivatelom
|
// emailova notifikacia sa posiela len ak subtask bol upraveny inym uzivatelom
|
||||||
if ($event->subtask->updated_by == $event->subtask->user_id) {
|
if ($event->subtask->updated_by == $event->subtask->user_id) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ class SendNewSubTaskEmailNotification implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle(SubTaskCreated $event)
|
public function handle(SubTaskCreated $event)
|
||||||
{
|
{
|
||||||
|
// Neposielame notifikacie pre koncepty (drafty)
|
||||||
|
if ($event->subtask->is_draft) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// flag na urovni subtasku - notification_sent
|
// flag na urovni subtasku - notification_sent
|
||||||
// ak existuje este nejaky subtask v ramci master tasku, co ma prazdnu notification_sent, tak mu nastavim 0 a skippujem posielanie emailu
|
// ak existuje este nejaky subtask v ramci master tasku, co ma prazdnu notification_sent, tak mu nastavim 0 a skippujem posielanie emailu
|
||||||
// az ked neexistuje uz iny subtask, co ma flag prazdny, tak poslem email a nastavim notification_sent na 1
|
// az ked neexistuje uz iny subtask, co ma flag prazdny, tak poslem email a nastavim notification_sent na 1
|
||||||
|
|||||||
Reference in new issue
Block a user