sails-adminpanel
Advanced tools
Comparing version 1.2.7 to 1.2.8
@@ -38,2 +38,5 @@ 'use strict'; | ||
for(let prop in reqData){ | ||
if (Number.isNaN(reqData[prop]) || reqData[prop] === undefined || reqData[prop] === null) { | ||
delete reqData[prop] | ||
} | ||
if(fields[prop] && fields[prop].model && fields[prop].model.type === 'json' && reqData[prop] !== ''){ | ||
@@ -40,0 +43,0 @@ try{ |
@@ -58,2 +58,5 @@ 'use strict'; | ||
for(let prop in reqData){ | ||
if (Number.isNaN(reqData[prop]) || reqData[prop] === undefined || reqData[prop] === null) { | ||
delete reqData[prop] | ||
} | ||
if(fields[prop] && fields[prop].model && fields[prop].model.type === 'json' && reqData[prop] !== ''){ | ||
@@ -67,7 +70,7 @@ try{ | ||
} | ||
// callback before save instance | ||
if(typeof instance.config.edit.instanceModifier === "function"){ | ||
reqData = instance.config.edit.instanceModifier(reqData); | ||
} | ||
} | ||
@@ -74,0 +77,0 @@ |
@@ -6,2 +6,3 @@ class EditSchedule { | ||
this.dataInput = config.data; | ||
this.supportOldVersion = config.supportOldVersion || false; | ||
this.counter = 0; | ||
@@ -11,5 +12,5 @@ let defaultPropertyList = { | ||
type: "string", | ||
title: "Title", | ||
description: "this is the title", | ||
required: "true", | ||
title: "Title", | ||
description: "this is the title", | ||
required: "true", | ||
}, | ||
@@ -36,3 +37,3 @@ link: { | ||
// add main hint | ||
// add main hint | ||
$(`#form-${this.field}`).before( | ||
@@ -68,2 +69,5 @@ '<div class="admin-panel__title">\n' + | ||
let dataInput = JSON.parse(this.dataInput); | ||
if (!dataInput) { | ||
dataInput = []; | ||
} | ||
for (let i = 0; i < dataInput.length; i++) { | ||
@@ -98,2 +102,7 @@ // generating schedule frames | ||
} else { | ||
// optional support of worktime's old version | ||
if (dataInput[i].start && dataInput[i].stop && this.supportOldVersion) { | ||
dataInput[i].timeStart = dataInput[i].start; | ||
dataInput[i].timeStop = dataInput[i].stop; | ||
} | ||
if (dataInput[i].timeStart && dataInput[i].timeStop) { | ||
@@ -123,3 +132,4 @@ let timeStart = dataInput[i].timeStart || ""; | ||
// choosing date | ||
if (!this.permutations.date) { | ||
// optional support worktime's old version that does not have dateStart and dateStop | ||
if (!this.permutations.date && !this.supportOldVersion) { | ||
$(".add_schedule__date").last().remove(); | ||
@@ -226,23 +236,23 @@ } else { | ||
'<div class="modal fade navigation-popup" id="popUp">' + | ||
'<div class="modal-dialog modal-dialog-centered navigation-modal" role="dialog">' + | ||
'<div class="modal-content">' + | ||
'<div class="modal-header navigation-header">' + | ||
'Options' + | ||
'</div>' + | ||
'<div class="modal-body">' + | ||
'<div class="navigation-block">' + | ||
'<div class="navigation-wrap">' + | ||
'<label for="propertyAdder navigation-text">Add option</label>' + | ||
'<select class="form-select navigation-select" id="propertyAdder" aria-label="Default select example">' + | ||
'</select>' + | ||
'</div>' + | ||
'<a class="addProperty navigation-plus" href="#"><i class="las la-plus"></i></a>' + | ||
'</div>' + | ||
'</div>' + | ||
'<div class="modal-footer navigation-footer">' + | ||
'<a class="editItem btn btn-success" data-dismiss="modal" itemid="" href="#">Save</a>' + | ||
'<a class="close-btn btn btn-danger" data-dismiss="modal" href="#">Cancel</a>' + | ||
'</div>' + | ||
'</div>' + | ||
'</div>' + | ||
'<div class="modal-dialog modal-dialog-centered navigation-modal" role="dialog">' + | ||
'<div class="modal-content">' + | ||
'<div class="modal-header navigation-header">' + | ||
'Options' + | ||
'</div>' + | ||
'<div class="modal-body">' + | ||
'<div class="navigation-block">' + | ||
'<div class="navigation-wrap">' + | ||
'<label for="propertyAdder navigation-text">Add option</label>' + | ||
'<select class="form-select navigation-select" id="propertyAdder" aria-label="Default select example">' + | ||
'</select>' + | ||
'</div>' + | ||
'<a class="addProperty navigation-plus" href="#"><i class="las la-plus"></i></a>' + | ||
'</div>' + | ||
'</div>' + | ||
'<div class="modal-footer navigation-footer">' + | ||
'<a class="editItem btn btn-success" data-dismiss="modal" itemid="" href="#">Save</a>' + | ||
'<a class="close-btn btn btn-danger" data-dismiss="modal" href="#">Cancel</a>' + | ||
'</div>' + | ||
'</div>' + | ||
'</div>' + | ||
'</div>'; | ||
@@ -452,2 +462,7 @@ $(`#form-${this.field}`).after(modal); | ||
} | ||
if (this.supportOldVersion) { | ||
container.start = timeStart; | ||
container.stop = timeStop; | ||
} | ||
container.timeStart = timeStart; | ||
@@ -506,4 +521,4 @@ container.timeStop = timeStop; | ||
`<div class="navigation-inner">` + | ||
`<label for="item${capitalizedKey}">${capitalizedKey}</label>` + | ||
`<input type=${typeRecognition.inputType} id="item${capitalizedKey}">` + | ||
`<label for="item${capitalizedKey}">${capitalizedKey}</label>` + | ||
`<input type=${typeRecognition.inputType} id="item${capitalizedKey}">` + | ||
`</div>` + | ||
@@ -563,4 +578,4 @@ '<a href="#" class="deleteProp navigation-del"><i class="las la-times"></i></a>' + | ||
`<div class="navigation-inner">` + | ||
`<label for="item${capitalizedKey}">${capitalizedKey}</label>` + | ||
`<input type=${typeRecognition.inputType} id="item${capitalizedKey}">` + | ||
`<label for="item${capitalizedKey}">${capitalizedKey}</label>` + | ||
`<input type=${typeRecognition.inputType} id="item${capitalizedKey}">` + | ||
`</div>` + | ||
@@ -567,0 +582,0 @@ '<a href="#" class="deleteProp navigation-del"><i class="las la-times"></i></a>' + |
@@ -49,3 +49,3 @@ { | ||
}, | ||
"version": "1.2.7" | ||
"version": "1.2.8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9231646
94254