05444 save content of form in browser storage if not submitted (#26)

* Save content of form in browser storage if not submitted

* Rename key form + fix tests
This commit is contained in:
Chirag
2022-11-16 15:50:28 +05:30
committed by GitHub
parent 0c0a9f1349
commit 310df29e73
4 changed files with 30 additions and 2 deletions

View File

@@ -166,6 +166,14 @@ class Form extends Model
return ($this->closes_at && now()->gt($this->closes_at));
}
public function getFormPendingSubmissionKeyAttribute()
{
if ($this->updated_at?->timestamp) {
return "openform-" . $this->id . "-pending-submission-" . substr($this->updated_at?->timestamp, -6);
}
return null;
}
public function getMaxNumberOfSubmissionsReachedAttribute()
{
return ($this->max_submissions_count && $this->max_submissions_count <= $this->submissions_count);