mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
no message
This commit is contained in:
1 parent
399f80e106
commit
3016b6aaa0
5 files changed
+41
-15
No files matched your search
@@ -209,15 +209,17 @@ export default {
|
||||
if (this.$route.name == 'Dashboard - Tasks') {
|
||||
const editedSubtask = {
|
||||
...event.subtask,
|
||||
timeblocks: [
|
||||
...event.subtask.timeblocks,
|
||||
{
|
||||
timeblocks: event.subtask.timeblocks.map((tb) => {
|
||||
if (tb.id === event._timeblock_id) {
|
||||
return {
|
||||
id: event._timeblock_id,
|
||||
is_finished: 0,
|
||||
is_finished: tb.is_finished || 0,
|
||||
start: tmUtils.formatDateTimeForBackend(start),
|
||||
end: tmUtils.formatDateTimeForBackend(end),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
return tb;
|
||||
}),
|
||||
timesheets: event.subtask.timesheets.map((timesheet) => {
|
||||
delete timesheet.employee_name;
|
||||
return timesheet;
|
||||
@@ -245,15 +247,17 @@ export default {
|
||||
const editedSubtask = {
|
||||
...event.subtask,
|
||||
employee_id: split.employee_id,
|
||||
timeblocks: [
|
||||
...event.subtask.timeblocks,
|
||||
{
|
||||
timeblocks: event.subtask.timeblocks.map((tb) => {
|
||||
if (tb.id === event._timeblock_id) {
|
||||
return {
|
||||
id: event._timeblock_id,
|
||||
is_finished: 0,
|
||||
is_finished: tb.is_finished || 0,
|
||||
start: tmUtils.formatDateTimeForBackend(event.start),
|
||||
end: tmUtils.formatDateTimeForBackend(event.end),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
return tb;
|
||||
}),
|
||||
timesheets: event.subtask.timesheets.map((timesheet) => {
|
||||
delete timesheet.employee_name;
|
||||
return timesheet;
|
||||
|
||||
@@ -628,7 +628,9 @@ export default {
|
||||
// Helper: Get timeblocks for specific employee
|
||||
getEmployeeTimeblocks(employeeId) {
|
||||
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) {
|
||||
@@ -1040,13 +1042,18 @@ export default {
|
||||
|
||||
// Convert timeblocks from internal format to BE format for update
|
||||
// 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
|
||||
const timeblocks =
|
||||
this.subtask.is_draft && this.isDraftWithMultipleEmployees
|
||||
? []
|
||||
: this.timeblocks
|
||||
.filter(
|
||||
(timeblock) =>
|
||||
timeblock.date &&
|
||||
timeblock.starts_at_time &&
|
||||
timeblock.ends_at_time &&
|
||||
timeblock.employee_id == this.subtask.employee_id,
|
||||
Number(timeblock.employee_id) ===
|
||||
Number(this.subtask.employee_id),
|
||||
) // Only send complete timeblocks for this employee
|
||||
.map((timeblock) => {
|
||||
const dateStr = moment(timeblock.date).format('YYYY-MM-DD');
|
||||
|
||||
@@ -27,6 +27,11 @@ class SendDeletedSubTaskNotification
|
||||
*/
|
||||
public function handle(SubTaskDeleted $event)
|
||||
{
|
||||
// Neposielame notifikacie pri mazani konceptov (draftov)
|
||||
if ($event->subtask->is_draft) {
|
||||
return;
|
||||
}
|
||||
|
||||
$receiversArray[] = $event->subtask->user->email;
|
||||
$creator = \App\Models\User::find($event->subtask->created_by);
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ class SendEditedSubTaskNotification implements ShouldQueue
|
||||
*/
|
||||
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
|
||||
if ($event->subtask->updated_by == $event->subtask->user_id) {
|
||||
return;
|
||||
|
||||
@@ -31,6 +31,11 @@ class SendNewSubTaskEmailNotification implements ShouldQueue
|
||||
*/
|
||||
public function handle(SubTaskCreated $event)
|
||||
{
|
||||
// Neposielame notifikacie pre koncepty (drafty)
|
||||
if ($event->subtask->is_draft) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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
|
||||
// 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