@websy/websy-designs 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -311,7 +311,7 @@ class PGHelper {
311
311
  if (typeof row[key] === 'string') {
312
312
  row[key] = row[key].replace(/''/gm, `'`).replace(/'/gm, `''`).replace(/\\\\/gm, '\\')
313
313
  }
314
- allValues.push((row[key] === null ? row[key] : `'${row[key]}'`))
314
+ allValues.push((row[key] === null ? row[key] : `${row[key]}`))
315
315
  updates.push(`${key} = $${allValues.length}`)
316
316
  }
317
317
  }
@@ -384,7 +384,7 @@ class PGHelper {
384
384
  }
385
385
  }
386
386
  else {
387
- const placeholders = partValues.map((p, i) => `$${i + startCount + values.length}`).join(', ')
387
+ const placeholders = partValues.map((p, i) => `$${i + 1 + startCount + values.length}`).join(', ')
388
388
  values.push(...partValues)
389
389
  return `${entity ? entity + '.' : ''}${parts[0]} IN (${placeholders})`
390
390
  }
@@ -143,8 +143,7 @@ module.exports = function (options) {
143
143
  }
144
144
  else {
145
145
  let excludedRoutes = process.env.EXCLUDED_ROUTES.split(',')
146
- if (secureRoutes === true) {
147
- // excludedRoutes.push('/resources', '/scripts', '/styles', '/templates', '/fonts')
146
+ if (secureRoutes === true) {
148
147
  excludedRoutes.push('/login')
149
148
  }
150
149
  if (secureRoutes === false && excludedRoutes.indexOf('/' + req.path.split('/')[1]) !== -1) {
@@ -2836,7 +2836,7 @@ class MultiForm {
2836
2836
  `
2837
2837
  newFormEl.innerHTML = html
2838
2838
  el.appendChild(newFormEl)
2839
- let formOptions = Object.assign({}, this.options, { fields: [...this.options.fields.map(f => Object.assign({}, f))] })
2839
+ let formOptions = Object.assign({}, this.options, { rowIndex: this.forms.length, fields: [...this.options.fields.map(f => Object.assign({}, f, { rowIndex: this.forms.length }))] })
2840
2840
  this.forms.push(new WebsyDesigns.Form(`${this.elementId}_${newId}_form`, formOptions))
2841
2841
  if (addEl) {
2842
2842
  addEl.style.display = this.forms.length < this.options.maxRows ? 'flex' : 'none'
@@ -2924,7 +2924,17 @@ class MultiForm {
2924
2924
  el.innerHTML = html
2925
2925
  this.forms = new Array(this.formData.length)
2926
2926
  this.formData.forEach((d, i) => {
2927
- let formOptions = Object.assign({}, this.options, { fields: [...this.options.fields.map(f => Object.assign({}, f))] })
2927
+ let formOptions = Object.assign({}, this.options, {
2928
+ rowIndex: i,
2929
+ fields: [...this.options.fields.map(f => {
2930
+ const newF = Object.assign({}, f)
2931
+ if (!newF.options) {
2932
+ newF.options = {}
2933
+ }
2934
+ newF.options.rowIndex = i
2935
+ return newF
2936
+ })]
2937
+ })
2928
2938
  let formObject = new WebsyDesigns.Form(`${this.elementId}_${d.formId}_form`, formOptions)
2929
2939
  formObject.data = d
2930
2940
  this.forms[i] = formObject