@websy/websy-designs 1.11.13 → 1.11.15

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.
@@ -121,13 +121,13 @@ class AuthHelper {
121
121
  })
122
122
  }
123
123
  isLoggedIn (req, res, next) {
124
- // console.log(req.session)
124
+ console.log(req.session)
125
125
  if (req.session && req.session.user && req.session.user.isAnonymous !== true) {
126
- // console.log('in condition D')
126
+ console.log('in condition D')
127
127
  next()
128
128
  }
129
129
  else {
130
- // console.log('in condition E')
130
+ console.log('in condition E')
131
131
  res.redirect('/login')
132
132
  }
133
133
  }
@@ -151,23 +151,23 @@ module.exports = function (options) {
151
151
  }
152
152
  else {
153
153
  let excludedRoutes = process.env.EXCLUDED_ROUTES.split(',')
154
- // console.log('secure routes', secureRoutes)
155
- // console.log('excluded routes', excludedRoutes)
156
- // console.log('path', req.path)
157
- // console.log('index of', excludedRoutes.indexOf(req.path))
154
+ console.log('secure routes', secureRoutes)
155
+ console.log('excluded routes', excludedRoutes)
156
+ console.log('path', req.path)
157
+ console.log('index of', excludedRoutes.indexOf(req.path))
158
158
  if (secureRoutes === true) {
159
159
  excludedRoutes.push('/resources', '/scripts', '/styles', '/external', '/templates', '/fonts')
160
160
  }
161
161
  if (secureRoutes === false && excludedRoutes.indexOf('/' + req.path.split('/')[1]) !== -1) {
162
- // console.log('in condition A')
162
+ console.log('in condition A')
163
163
  app.authHelper.isLoggedIn(req, res, next)
164
164
  }
165
165
  else if (secureRoutes === true && excludedRoutes.indexOf('/' + req.path.split('/')[1]) === -1) {
166
- // console.log('in condition B')
166
+ console.log('in condition B')
167
167
  app.authHelper.isLoggedIn(req, res, next)
168
168
  }
169
169
  else {
170
- // console.log('in condition C')
170
+ console.log('in condition C')
171
171
  next()
172
172
  }
173
173
  // secureRoutes === false && excludedRoutes.indexOf(req.path) !== -1 && app.authHelper.isLoggedIn(req, res, next)
@@ -4165,7 +4165,7 @@ class WebsyResultList {
4165
4165
  }
4166
4166
  this.options = Object.assign({}, DEFAULTS, options)
4167
4167
  this.elementId = elementId
4168
- this.rows = []
4168
+ this.rows = this.options.data || []
4169
4169
  this.apiService = new WebsyDesigns.APIService('/api')
4170
4170
  this.templateService = new WebsyDesigns.APIService('')
4171
4171
  this.activeTemplate = ''
@@ -4197,6 +4197,9 @@ class WebsyResultList {
4197
4197
  const html = this.buildHTML(d, startIndex)
4198
4198
  const el = document.getElementById(this.elementId)
4199
4199
  el.innerHTML += html.replace(/\n/g, '')
4200
+ if (this.options.onAppend) {
4201
+ this.options.onAppend()
4202
+ }
4200
4203
  }
4201
4204
  buildHTML (d = [], startIndex = 0, inputTemplate, locator = []) {
4202
4205
  let html = ``
@@ -4435,7 +4438,10 @@ class WebsyResultList {
4435
4438
  resize () {
4436
4439
  const html = this.buildHTML(this.rows)
4437
4440
  const el = document.getElementById(this.elementId)
4438
- el.innerHTML = html.replace(/\n/g, '')
4441
+ el.innerHTML = html.replace(/\n/g, '')
4442
+ if (this.options.onResize) {
4443
+ this.options.onResize()
4444
+ }
4439
4445
  }
4440
4446
  }
4441
4447
 
@@ -5906,7 +5912,7 @@ class WebsyTable {
5906
5912
  }
5907
5913
  }
5908
5914
  hideLoading () {
5909
- this.loadingDialog.hide()
5915
+ this.loadingDialog && this.loadingDialog.hide()
5910
5916
  }
5911
5917
  internalSort (column, colIndex) {
5912
5918
  this.options.columns.forEach((c, i) => {
@@ -6052,7 +6058,7 @@ class WebsyTable {
6052
6058
  this._isRendered = true
6053
6059
  }
6054
6060
  showLoading (options) {
6055
- this.loadingDialog.show(options)
6061
+ this.loadingDialog && this.loadingDialog.show(options)
6056
6062
  }
6057
6063
  }
6058
6064
 
@@ -3929,7 +3929,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3929
3929
  };
3930
3930
  this.options = _extends({}, DEFAULTS, options);
3931
3931
  this.elementId = elementId;
3932
- this.rows = [];
3932
+ this.rows = this.options.data || [];
3933
3933
  this.apiService = new WebsyDesigns.APIService('/api');
3934
3934
  this.templateService = new WebsyDesigns.APIService('');
3935
3935
  this.activeTemplate = '';
@@ -3962,6 +3962,9 @@ var WebsyResultList = /*#__PURE__*/function () {
3962
3962
  var html = this.buildHTML(d, startIndex);
3963
3963
  var el = document.getElementById(this.elementId);
3964
3964
  el.innerHTML += html.replace(/\n/g, '');
3965
+ if (this.options.onAppend) {
3966
+ this.options.onAppend();
3967
+ }
3965
3968
  }
3966
3969
  }, {
3967
3970
  key: "buildHTML",
@@ -4217,6 +4220,9 @@ var WebsyResultList = /*#__PURE__*/function () {
4217
4220
  var html = this.buildHTML(this.rows);
4218
4221
  var el = document.getElementById(this.elementId);
4219
4222
  el.innerHTML = html.replace(/\n/g, '');
4223
+ if (this.options.onResize) {
4224
+ this.options.onResize();
4225
+ }
4220
4226
  }
4221
4227
  }]);
4222
4228
  return WebsyResultList;
@@ -5743,7 +5749,7 @@ var WebsyTable = /*#__PURE__*/function () {
5743
5749
  }, {
5744
5750
  key: "hideLoading",
5745
5751
  value: function hideLoading() {
5746
- this.loadingDialog.hide();
5752
+ this.loadingDialog && this.loadingDialog.hide();
5747
5753
  }
5748
5754
  }, {
5749
5755
  key: "internalSort",
@@ -5877,7 +5883,7 @@ var WebsyTable = /*#__PURE__*/function () {
5877
5883
  }, {
5878
5884
  key: "showLoading",
5879
5885
  value: function showLoading(options) {
5880
- this.loadingDialog.show(options);
5886
+ this.loadingDialog && this.loadingDialog.show(options);
5881
5887
  }
5882
5888
  }]);
5883
5889
  return WebsyTable;