Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-18903: The Auto save date is updated without making any changes #7342

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Controllers/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function edit(ProcessRequestToken $task, string $preview = '')
$task->allow_interstitial = $interstitial['allow_interstitial'];
$task->definition = $task->getDefinition();
$task->requestor = $task->processRequest->user;
$task->draft = $task->draft();
$task->draft = $task->draft;
$element = $task->getDefinition(true);
$screenFields = $screenVersion ? $screenVersion->screenFilteredFields() : [];
$taskDraftsEnabled = TaskDraft::draftsEnabled();
Expand Down
12 changes: 9 additions & 3 deletions resources/views/tasks/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ class="btn d-block mr-0 ml-auto button-collapse"
<div class="card collapse-content">
<ul class="list-group list-group-flush w-100">
<li class="list-group-item">
<div class="row justify-content-start pb-1">
<div
v-if="taskDraftsEnabled"
class="row justify-content-start pb-1"
>
<task-save-notification
:options="options"
:task="task"
Expand Down Expand Up @@ -395,6 +398,7 @@ class="multiselect__tag-icon"></i>
);

const task = @json($task);
let draftTask = task.draft;
const userHasAccessToTask = {{ Auth::user()->can('update', $task) ? "true": "false" }};
const userIsAdmin = {{ Auth::user()->is_administrator ? "true": "false" }};
const userIsProcessManager = {{ Auth::user()->id === $task->process?->manager_id ? "true": "false" }};
Expand Down Expand Up @@ -428,6 +432,7 @@ class="multiselect__tag-icon"></i>
filter: "",
showReassignment: false,
task,
draftTask,
userHasAccessToTask,
selectedUser: [],
hasErrors: false,
Expand Down Expand Up @@ -461,8 +466,8 @@ class="multiselect__tag-icon"></i>
history.replaceState(null, null, `/tasks/${task.id}/edit`);
}
if (task.draft) {
this.lastAutosave = moment(task.draft.updated_at).format("DD MMMM YYYY | HH:mm");
this.lastAutosaveNav = moment(task.draft.updated_at).format("MMM DD, YYYY / HH:mm");
this.lastAutosave = moment(this.draftTask.updated_at).format("DD MMMM YYYY | HH:mm");
this.lastAutosaveNav = moment(this.draftTask.updated_at).format("MMM DD, YYYY / HH:mm");
} else {
this.lastAutosave = "-";
this.lastAutosaveNav = "-"
Expand Down Expand Up @@ -720,6 +725,7 @@ class="multiselect__tag-icon"></i>
this.task.draft,
response.data
);
this.draftTask = structuredClone(response.data);
})
.catch(() => {
this.errorAutosave = true;
Expand Down
Loading