Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixing quickfill signature issue
  • Loading branch information
CarliPinell committed Jun 7, 2024
commit 714d388c0848591d48a7744f129030a0f3bca4ca
10 changes: 6 additions & 4 deletions resources/js/tasks/components/QuickFillPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ export default {
const draftData = {};
this.screenFields.forEach((field) => {
const existingValue = _.get(dataToUse, field, null);

if(this.validateBase64(existingValue)) {
_.set(draftData, field, existingValue);
return;
}
let quickFillValue;
if (existingValue) {
// If the value exists in the task data (or task draft data), don't overwrite it
Expand All @@ -288,10 +293,7 @@ export default {
// use the value from the quick fill
quickFillValue = _.get(quickFillData, field, null);
}
if(this.validateBase64(quickFillValue)) {
return;
}
// Set the value. This handles nested values using dot notation in 'field' string

_.set(draftData, field, quickFillValue);
});

Expand Down
10 changes: 5 additions & 5 deletions resources/views/tasks/preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,14 @@ class="card border-0"

window.addEventListener('fillData', event => {
const newData = {};
console.log("Event Detail: ", event.detail);
console.log("screenFields: ", screenFields);
screenFields.forEach((field) => {

const existingValue = _.get(this.formData, field, null);

if(this.validateBase64(existingValue)) {
_.set(newData, field, existingValue);
return;
}
let quickFillValue;

if (existingValue) {
Expand All @@ -456,9 +459,6 @@ class="card border-0"
// use the value from the quick fill(event.detail)
quickFillValue = _.get(event.detail, field, null);
}
if(this.validateBase64(quickFillValue)) {
return;
}
// Set the value. This handles nested values using dot notation in 'field' string
_.set(newData, field, quickFillValue);
});
Expand Down