sf-i-reporting 1.0.45 → 1.0.47

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-reporting",
3
3
  "private": false,
4
- "version": "1.0.45",
4
+ "version": "1.0.47",
5
5
  "description": "Superflows Reporting Component",
6
6
  "main": "sf-i-reporting.js",
7
7
  "module": "sf-i-reporting.js",
@@ -35,7 +35,8 @@ export declare class SfIReporting extends LitElement {
35
35
  formviewclass: string;
36
36
  dataModel: any[];
37
37
  list: any[];
38
- _SfReporting: any;
38
+ published: boolean;
39
+ lastCalendarGenerated: string;
39
40
  selectedItem: any;
40
41
  selectedItemIds: any;
41
42
  static styles: import("lit").CSSResult;
@@ -75,6 +76,7 @@ export declare class SfIReporting extends LitElement {
75
76
  submitConfirmClick: () => void;
76
77
  editClick: () => void;
77
78
  editCancelClick: () => void;
79
+ publishClick: () => void;
78
80
  newClick: () => void;
79
81
  backClick: () => void;
80
82
  deleteClick: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"sf-i-reporting.d.ts","sourceRoot":"","sources":["src/sf-i-reporting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAa,gBAAgB,EAAC,MAAM,KAAK,CAAC;AAO5D,OAAO,EAAC,UAAU,EAAE,eAAe,EAA6D,MAAM,eAAe,CAAC;AAWtH;;;;;;;;;;GAUG;AACH,qBACa,YAAa,SAAQ,UAAU;IAE1C,KAAK,EAAE,MAAM,CAAM;IAGnB,SAAS,EAAE,MAAM,CAAM;IAGvB,WAAW,EAAE,MAAM,CAAM;IAGzB,UAAU,EAAE,MAAM,CAAQ;IAO1B,aAAa,YAGZ;IAGD,kBAAkB,EAAE,MAAM,CAAQ;IAGlC,kBAAkB,YAEjB;IAGD,IAAI,EAAE,MAAM,CAAM;IAGlB,IAAI,EAAE,MAAM,CAAM;IAGlB,IA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AAE,OAAO,CAAC,GAAG,IAAI;IAMnG,iBAAiB;IAIjB,MAAM;CAyJhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
package/sf-i-reporting.js CHANGED
@@ -11,7 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  };
12
12
  import { LitElement, html, css } from 'lit';
13
13
  // import {customElement, query, queryAssignedElements, property} from 'lit/decorators.js';
14
- import { customElement, query, property, queryAssignedElements } from 'lit/decorators.js';
14
+ import { customElement, query, property } from 'lit/decorators.js';
15
15
  // import {customElement, query, property} from 'lit/decorators.js';
16
16
  import Util from './util';
17
17
  // import {LitElement, html, css} from 'lit';
@@ -70,6 +70,8 @@ let SfIReporting = class SfIReporting extends LitElement {
70
70
  this.formviewclass = "flex-col";
71
71
  this.dataModel = [];
72
72
  this.list = [];
73
+ this.published = false;
74
+ this.lastCalendarGenerated = "";
73
75
  // selectedItem: any = {};
74
76
  this.selectedItem = { id: "be121a6c-73e2-49f8-b1c9-bdf45a72da6d" };
75
77
  this.selectedItemIds = [];
@@ -195,6 +197,10 @@ let SfIReporting = class SfIReporting extends LitElement {
195
197
  this.flow = "details";
196
198
  this.loadMode();
197
199
  };
200
+ this.publishClick = () => {
201
+ this.published = !this.published;
202
+ this.submitEdit();
203
+ };
198
204
  this.newClick = () => {
199
205
  console.log('new clicked');
200
206
  this.flow = "new";
@@ -388,24 +394,26 @@ let SfIReporting = class SfIReporting extends LitElement {
388
394
  <div class="d-flex w-100-m-0 justify-between align-center">
389
395
  <button id="button-back" part="button-icon" class="button-icon-click"><span class="material-icons">keyboard_backspace</span></button>
390
396
  <h3 part="results-title" class="m-0">${this.name}</h3>
391
- <div class="d-flex justtify-center">${this.flow == "new" ? `
397
+ <div class="d-flex justify-center align-center">${this.flow == "new" ? `
392
398
  <button class="mrl-5 material-icons invisible" part="button-icon" id="button-submit" disabled>save</button>
393
- <button class="mrl-5 material-icons hide" part="button-icon" id="button-submit-cancel">close</button>
399
+ <button class="mrl-5 material-icons hide" part="button-icon-light" id="button-submit-cancel">close</button>
394
400
  <button class="mrl-5 material-icons hide" part="button-icon" id="button-submit-confirm">check save</button>
395
401
  ` : (this.flow == "details" ? `
402
+ <span class="mrl-5 material-icons" part="span-icon${this.published ? '-light' : ''}" id="span-submit-publish">${this.published ? 'radio_button_checked' : 'radio_button_unchecked'}</span>
396
403
  <button id="button-edit" part="button-icon" class="mrl-5 material-icons button-icon-click">edit</button>
397
404
  <button id="button-delete" part="button-icon" class="mrl-5 material-icons button-icon-click">delete</button>
398
- <button id="button-delete-cancel" part="button-icon" class="mrl-5 material-icons button-icon-click hide">close</button>
405
+ <button id="button-delete-cancel" part="button-icon-light" class="mrl-5 material-icons button-icon-click hide">close</button>
399
406
  <button id="button-delete-confirm" part="button-icon" class="mrl-5 button-icon-click hide"><span class="material-icons">delete</span><span class="material-icons">done</span></button>
400
407
  ` : `
401
- <button id="button-edit-cancel" part="button-icon" class="mrl-5 material-icons button-icon-click">edit_off</button>
408
+ <button class="mrl-5 material-icons" part="button-icon${this.published ? '-light' : ''}" id="button-submit-publish">${this.published ? 'radio_button_unchecked' : 'radio_button_checked'}</button>
409
+ <button id="button-edit-cancel" part="button-icon-light" class="mrl-5 material-icons button-icon-click">edit_off</button>
402
410
  <button class="mrl-5 material-icons hide" part="button-icon" id="button-submit" disabled>save</button>
403
- <button class="mrl-5 material-icons hide" part="button-icon" id="button-submit-cancel">close</button>
411
+ <button class="mrl-5 material-icons hide" part="button-icon-light" id="button-submit-cancel">close</button>
404
412
  <button class="mrl-5 material-icons hide" part="button-icon" id="button-submit-confirm">check save</button>
405
413
  `)}
406
414
  </div>
407
415
  </div>
408
- <div class="progress-bar w-100-m-0 d-flex" part="progress-bar">
416
+ <div class="progress-bar w-100-m-0 d-flex flex-wrap" part="progress-bar">
409
417
  <div class="progress-bar-complete" part="progress-bar-complete"></div>
410
418
  <div class="progress-bar-finished" part="progress-bar-finished"></div>
411
419
  <div class="progress-bar-incomplete" part="progress-bar-incomplete"></div>
@@ -443,6 +451,16 @@ let SfIReporting = class SfIReporting extends LitElement {
443
451
  }
444
452
  }
445
453
  html += "</div>";
454
+ if (this.flow == "new") {
455
+ html += `
456
+ <div part="textarea-container" class="d-flex flex-col flex-grow">
457
+ <label id="input-publish-checkbox-label" part="textarea-label">Publish</label>
458
+ <div class="d-flex">
459
+ <input type="checkbox" id="input-publish-checkbox" class="input-publish-checkbox" part="input-publish-checkbox" ${this.published ? "checked" : ""}>
460
+ </div>
461
+ </div>`;
462
+ console.log('adding publish checkbox', html);
463
+ }
446
464
  this._SfReportingContainer.innerHTML = html;
447
465
  this._SfReportingContainer.style.display = 'block';
448
466
  this.initSectionListeners();
@@ -511,6 +529,12 @@ let SfIReporting = class SfIReporting extends LitElement {
511
529
  // setTimeout(() => {bricks.loadMode()},500)
512
530
  }
513
531
  }
532
+ let checkboxPublish = this._SfReportingContainer.querySelector('#input-publish-checkbox');
533
+ checkboxPublish === null || checkboxPublish === void 0 ? void 0 : checkboxPublish.addEventListener('click', (ev) => {
534
+ let target = ev.target;
535
+ this.published = target.checked;
536
+ console.log('publish checked', this.published);
537
+ });
514
538
  let buttonBack = this._SfReportingContainer.querySelector('#button-back');
515
539
  buttonBack === null || buttonBack === void 0 ? void 0 : buttonBack.addEventListener('click', this.backClick);
516
540
  let buttonSubmit = this._SfReportingContainer.querySelector('#button-submit');
@@ -522,6 +546,11 @@ let SfIReporting = class SfIReporting extends LitElement {
522
546
  buttonSubmitConfirm === null || buttonSubmitConfirm === void 0 ? void 0 : buttonSubmitConfirm.addEventListener('click', this.submitConfirmClick);
523
547
  let buttonSubmitCancel = this._SfReportingContainer.querySelector('#button-submit-cancel');
524
548
  buttonSubmitCancel === null || buttonSubmitCancel === void 0 ? void 0 : buttonSubmitCancel.addEventListener('click', this.submitCancelClick);
549
+ let buttonPublish = this._SfReportingContainer.querySelector('#button-submit-publish');
550
+ buttonPublish === null || buttonPublish === void 0 ? void 0 : buttonPublish.addEventListener('click', () => {
551
+ console.log('publish clicked', this.published);
552
+ this.publishClick();
553
+ });
525
554
  let buttonEdit = this._SfReportingContainer.querySelector('#button-edit');
526
555
  buttonEdit === null || buttonEdit === void 0 ? void 0 : buttonEdit.addEventListener('click', this.editClick);
527
556
  let buttonDelete = this._SfReportingContainer.querySelector('#button-delete');
@@ -694,7 +723,7 @@ let SfIReporting = class SfIReporting extends LitElement {
694
723
  this._SfReportingContainer.querySelector('.progress-bar').style.display = 'none';
695
724
  }
696
725
  else {
697
- this._SfReportingContainer.querySelector('.progress-bar').style.display = 'block';
726
+ this._SfReportingContainer.querySelector('.progress-bar').style.display = 'flex';
698
727
  let progress = Math.floor((filled / total) * 100);
699
728
  if (progress == 100) {
700
729
  this._SfReportingContainer.querySelector('.progress-bar-complete').style.width = "0%";
@@ -1095,9 +1124,9 @@ let SfIReporting = class SfIReporting extends LitElement {
1095
1124
  this.populateList = () => {
1096
1125
  let html = '';
1097
1126
  html += `<div class="d-flex justify-between p-7">`;
1098
- html += `<input part="input-select-all" class="input-select-all" id="input-select-all" type="checkbox"></input>`;
1127
+ html += `<div part="last-calendar-date" class="last-calendar-date" id="last-calendar-date">${this.lastCalendarGenerated == "" ? "" : ("Calendar Generated on \n" + (new Date(parseInt(this.lastCalendarGenerated)).toLocaleDateString('en-IN') + " - " + new Date(parseInt(this.lastCalendarGenerated)).toLocaleTimeString('en-IN')))}</div>`;
1099
1128
  html += `<div class="d-flex justify-end flex-grow">`;
1100
- html += `<button id="button-publish" part="button-icon" class="material-icons hide">campaign</button>`;
1129
+ // html += `<button id="button-publish" part="button-icon" class="material-icons hide">campaign</button>`
1101
1130
  html += `<button id="button-new" part="button-icon" class="material-icons button-icon-click ml-10">add</button>`;
1102
1131
  html += `</div>`;
1103
1132
  html += `</div>`;
@@ -1105,7 +1134,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1105
1134
  for (let [i, item] of this.list.entries()) {
1106
1135
  html += '<tr class="tablerow">';
1107
1136
  let bgClass = i % 2 == 0 ? 'td-light' : 'td-dark';
1108
- html += `<td part="td-action" class="td-action"><input part="input-select" class="input-select" id="input-select-${i}" type="checkbox"></input></td>`;
1137
+ html += `<td part="td-body" class="td-body"><span class="mrl-5 material-icons" part="span-icon${item.published ? '-light' : ''}" id="span-submit-publish">${item.published ? 'radio_button_checked' : 'radio_button_unchecked'}</span></td>`;
1109
1138
  html += `<td part="td-action" class="td-action"><button part="button-icon-smalll" class="material-icons button-details" id="button-details-${i}">open_in_new</button></td>`;
1110
1139
  for (let property of Object.keys(item)) {
1111
1140
  if (this.getIgnoreProjections().indexOf(property) < 0) {
@@ -1128,46 +1157,39 @@ let SfIReporting = class SfIReporting extends LitElement {
1128
1157
  this.loadMode();
1129
1158
  });
1130
1159
  }
1131
- let selectInputs = this._SfReportingContainer.querySelectorAll('.input-select');
1132
- for (let selectInput of selectInputs) {
1133
- selectInput.addEventListener('change', (ev) => {
1134
- let target = ev.target;
1135
- let index = target.id.split('-')[2];
1136
- if (target.checked) {
1137
- if (this.selectedItemIds.indexOf(this.list[index].id) < 0) {
1138
- this.selectedItemIds.push(this.list[index].id);
1139
- }
1140
- }
1141
- else {
1142
- if (this.selectedItemIds.indexOf(this.list[index].id) >= 0) {
1143
- this.selectedItemIds.splice(this.selectedItemIds.indexOf(this.list[index].id), 1);
1144
- }
1145
- }
1146
- if (this.selectedItemIds.length > 0) {
1147
- this._SfReportingContainer.querySelector('#button-publish').style.display = 'flex';
1148
- }
1149
- else {
1150
- this._SfReportingContainer.querySelector('#button-publish').style.display = 'none';
1151
- }
1152
- });
1153
- }
1154
- let inputSelectAll = this._SfReportingContainer.querySelector('#input-select-all');
1155
- inputSelectAll.addEventListener('click', (ev) => {
1156
- let target = ev.target;
1157
- let selectInputs = this._SfReportingContainer.querySelectorAll('.input-select');
1158
- for (let selectInput of selectInputs) {
1159
- selectInput.checked = target.checked;
1160
- var event = document.createEvent("HTMLEvents");
1161
- event.initEvent('change', false, true);
1162
- selectInput.dispatchEvent(event);
1163
- }
1164
- });
1165
- inputSelectAll.style.display = this.list.length > 0 ? 'flex' : 'none';
1166
- let buttonPublish = this._SfReportingContainer.querySelector('#button-publish');
1167
- buttonPublish.addEventListener('click', () => {
1168
- console.log('publish clicked', this.selectedItemIds);
1169
- this.submitPublish();
1170
- });
1160
+ // let selectInputs = (this._SfReportingContainer as HTMLDivElement).querySelectorAll('.input-select') as NodeListOf<HTMLInputElement>
1161
+ // for(let selectInput of selectInputs){
1162
+ // selectInput.addEventListener('change',(ev: any) => {
1163
+ // let target = ev.target
1164
+ // let index = target.id.split('-')[2]
1165
+ // if(target.checked){
1166
+ // if(this.selectedItemIds.indexOf(this.list[index].id) < 0){
1167
+ // this.selectedItemIds.push(this.list[index].id)
1168
+ // }
1169
+ // }else{
1170
+ // if(this.selectedItemIds.indexOf(this.list[index].id) >= 0){
1171
+ // this.selectedItemIds.splice(this.selectedItemIds.indexOf(this.list[index].id), 1)
1172
+ // }
1173
+ // }
1174
+ // if(this.selectedItemIds.length > 0){
1175
+ // ((this._SfReportingContainer as HTMLDivElement).querySelector('#button-publish') as HTMLButtonElement).style.display = 'flex'
1176
+ // }else{
1177
+ // ((this._SfReportingContainer as HTMLDivElement).querySelector('#button-publish') as HTMLButtonElement).style.display = 'none'
1178
+ // }
1179
+ // })
1180
+ // }
1181
+ // let inputSelectAll = (this._SfReportingContainer as HTMLDivElement).querySelector('#input-select-all') as HTMLInputElement
1182
+ // inputSelectAll.addEventListener('click',(ev: any)=>{
1183
+ // let target = ev.target;
1184
+ // let selectInputs = (this._SfReportingContainer as HTMLDivElement).querySelectorAll('.input-select') as NodeListOf<HTMLInputElement>
1185
+ // for(let selectInput of selectInputs){
1186
+ // selectInput.checked = target.checked
1187
+ // var event = document.createEvent("HTMLEvents");
1188
+ // event.initEvent('change', false, true);
1189
+ // selectInput.dispatchEvent(event);
1190
+ // }
1191
+ // })
1192
+ // inputSelectAll.style.display = this.list.length > 0 ? 'flex' : 'none';
1171
1193
  let buttonNew = this._SfReportingContainer.querySelector('#button-new');
1172
1194
  buttonNew.addEventListener('click', () => {
1173
1195
  this.newClick();
@@ -1186,6 +1208,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1186
1208
  this.prepopulateValues();
1187
1209
  }
1188
1210
  else if (this.mode == "new") {
1211
+ this.published = false;
1189
1212
  this.populateDataModel();
1190
1213
  this.populateView();
1191
1214
  }
@@ -1311,6 +1334,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1311
1334
  }
1312
1335
  };
1313
1336
  this.fetchList = async () => {
1337
+ var _a;
1314
1338
  let url = "https://" + this.apiId + "/list";
1315
1339
  let body = { projectid: this.projectid };
1316
1340
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -1320,6 +1344,8 @@ let SfIReporting = class SfIReporting extends LitElement {
1320
1344
  if (xhr.status == 200) {
1321
1345
  const jsonRespose = JSON.parse(xhr.responseText);
1322
1346
  console.log('list response', jsonRespose);
1347
+ console.log('list response', jsonRespose.lastCalendarGenerated);
1348
+ this.lastCalendarGenerated = (_a = jsonRespose.lastCalendarGenerated) !== null && _a !== void 0 ? _a : "";
1323
1349
  this.list = jsonRespose.list;
1324
1350
  this.initListeners();
1325
1351
  this.populateList();
@@ -1330,6 +1356,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1330
1356
  }
1331
1357
  };
1332
1358
  this.fetchDetails = async () => {
1359
+ var _a;
1333
1360
  let url = "https://" + this.apiId + "/details";
1334
1361
  let body = { projectid: this.projectid, noticeid: this.selectedItem.id };
1335
1362
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -1340,6 +1367,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1340
1367
  const jsonRespose = JSON.parse(xhr.responseText);
1341
1368
  console.log('details response', jsonRespose);
1342
1369
  let resultObject = jsonRespose.object;
1370
+ this.published = (_a = resultObject.published) !== null && _a !== void 0 ? _a : false;
1343
1371
  this.configjson = resultObject.schema;
1344
1372
  this.prepopulateValJson = resultObject.object;
1345
1373
  this.populateDataModel();
@@ -1353,7 +1381,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1353
1381
  this.submitNew = async () => {
1354
1382
  console.log('adding', this.selectedValues());
1355
1383
  let url = "https://" + this.apiId + "/add";
1356
- let body = { projectid: this.projectid, object: this.selectedValues(), schema: this.getConfigJson() };
1384
+ let body = { projectid: this.projectid, object: this.selectedValues(), schema: this.getConfigJson(), published: this.published };
1357
1385
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
1358
1386
  const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
1359
1387
  this._SfLoader.innerHTML = '';
@@ -1373,7 +1401,7 @@ let SfIReporting = class SfIReporting extends LitElement {
1373
1401
  };
1374
1402
  this.submitEdit = async () => {
1375
1403
  let url = "https://" + this.apiId + "/update";
1376
- let body = { projectid: this.projectid, noticeid: this.selectedItem.id, object: this.selectedValues(), schema: this.getConfigJson() };
1404
+ let body = { projectid: this.projectid, noticeid: this.selectedItem.id, object: this.selectedValues(), schema: this.getConfigJson(), published: this.published };
1377
1405
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
1378
1406
  const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
1379
1407
  this._SfLoader.innerHTML = '';
@@ -1986,9 +2014,6 @@ __decorate([
1986
2014
  __decorate([
1987
2015
  property()
1988
2016
  ], SfIReporting.prototype, "formviewclass", void 0);
1989
- __decorate([
1990
- queryAssignedElements({ slot: 'reporting' })
1991
- ], SfIReporting.prototype, "_SfReporting", void 0);
1992
2017
  __decorate([
1993
2018
  query('.div-row-error')
1994
2019
  ], SfIReporting.prototype, "_SfRowError", void 0);