front end logic for saving extra fields.
This commit is contained in:
@@ -88,6 +88,10 @@ function getAndValidateCollisionRecordValues() {
|
||||
var addReminderRecord = $("#addReminderCheck").is(":checked");
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (collisionDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#collisionRecordDate").addClass("is-invalid");
|
||||
@@ -124,6 +128,7 @@ function getAndValidateCollisionRecordValues() {
|
||||
files: uploadedFiles,
|
||||
supplies: selectedSupplies,
|
||||
tags: collisionTags,
|
||||
addReminderRecord: addReminderRecord
|
||||
addReminderRecord: addReminderRecord,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,10 @@ function getAndValidateGasRecordValues() {
|
||||
var gasRecordId = getGasRecordModelData().id;
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (gasDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#gasRecordDate").addClass("is-invalid");
|
||||
@@ -134,7 +138,8 @@ function getAndValidateGasRecordValues() {
|
||||
tags: gasTags,
|
||||
isFillToFull: gasIsFillToFull,
|
||||
missedFuelUp: gasIsMissed,
|
||||
notes: gasNotes
|
||||
notes: gasNotes,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,10 @@ function getAndValidateOdometerRecordValues() {
|
||||
var odometerRecordId = getOdometerRecordModelData().id;
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (serviceDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#odometerRecordDate").addClass("is-invalid");
|
||||
@@ -105,6 +109,7 @@ function getAndValidateOdometerRecordValues() {
|
||||
mileage: serviceMileage,
|
||||
notes: serviceNotes,
|
||||
tags: serviceTags,
|
||||
files: uploadedFiles
|
||||
files: uploadedFiles,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,10 @@ function getAndValidatePlanRecordValues() {
|
||||
var planRecordId = getPlanRecordModelData().id;
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (planDescription.trim() == '') {
|
||||
hasError = true;
|
||||
$("#planRecordDescription").addClass("is-invalid");
|
||||
@@ -183,7 +187,8 @@ function getAndValidatePlanRecordValues() {
|
||||
supplies: selectedSupplies,
|
||||
priority: planPriority,
|
||||
progress: planProgress,
|
||||
importMode: planType
|
||||
importMode: planType,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
//drag and drop stuff.
|
||||
|
||||
@@ -88,6 +88,10 @@ function getAndValidateServiceRecordValues() {
|
||||
var addReminderRecord = $("#addReminderCheck").is(":checked");
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (serviceDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#serviceRecordDate").addClass("is-invalid");
|
||||
@@ -124,6 +128,7 @@ function getAndValidateServiceRecordValues() {
|
||||
files: uploadedFiles,
|
||||
supplies: selectedSupplies,
|
||||
tags: serviceTags,
|
||||
addReminderRecord: addReminderRecord
|
||||
addReminderRecord: addReminderRecord,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,10 @@ function getAndValidateSupplyRecordValues() {
|
||||
var supplyRecordId = getSupplyRecordModelData().id;
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (supplyDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#supplyRecordDate").addClass("is-invalid");
|
||||
@@ -125,6 +129,7 @@ function getAndValidateSupplyRecordValues() {
|
||||
notes: supplyNotes,
|
||||
quantity: supplyQuantity,
|
||||
files: uploadedFiles,
|
||||
tags: supplyTags
|
||||
tags: supplyTags,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,10 @@ function getAndValidateTaxRecordValues() {
|
||||
var addReminderRecord = $("#addReminderCheck").is(":checked");
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (taxDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#taxRecordDate").addClass("is-invalid");
|
||||
@@ -157,6 +161,7 @@ function getAndValidateTaxRecordValues() {
|
||||
customMonthInterval: customMonthInterval,
|
||||
tags: taxTags,
|
||||
files: uploadedFiles,
|
||||
addReminderRecord: addReminderRecord
|
||||
addReminderRecord: addReminderRecord,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,10 @@ function getAndValidateUpgradeRecordValues() {
|
||||
var addReminderRecord = $("#addReminderCheck").is(":checked");
|
||||
//validation
|
||||
var hasError = false;
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
if (extraFields.hasError) {
|
||||
hasError = true;
|
||||
}
|
||||
if (upgradeDate.trim() == '') { //eliminates whitespace.
|
||||
hasError = true;
|
||||
$("#upgradeRecordDate").addClass("is-invalid");
|
||||
@@ -124,6 +128,7 @@ function getAndValidateUpgradeRecordValues() {
|
||||
files: uploadedFiles,
|
||||
supplies: selectedSupplies,
|
||||
tags: upgradeTags,
|
||||
addReminderRecord: addReminderRecord
|
||||
addReminderRecord: addReminderRecord,
|
||||
extraFields: extraFields.extraFields
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user