tnx-shared 5.3.313 → 5.3.315

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.
@@ -2567,13 +2567,19 @@
2567
2567
  var LogColumn = /** @class */ (function () {
2568
2568
  function LogColumn(init) {
2569
2569
  this.visible = true;
2570
- this.isHtml = false;
2570
+ this.enumLogType = 1;
2571
2571
  for (var key in init) {
2572
2572
  this[key] = init[key];
2573
2573
  }
2574
2574
  }
2575
2575
  return LogColumn;
2576
2576
  }());
2577
+ exports.EnumLogType = void 0;
2578
+ (function (EnumLogType) {
2579
+ EnumLogType[EnumLogType["Normal"] = 1] = "Normal";
2580
+ EnumLogType[EnumLogType["Html"] = 2] = "Html";
2581
+ EnumLogType[EnumLogType["Table"] = 3] = "Table";
2582
+ })(exports.EnumLogType || (exports.EnumLogType = {}));
2577
2583
  exports.DataType = void 0;
2578
2584
  (function (DataType) {
2579
2585
  DataType["date"] = "date";
@@ -19088,7 +19094,7 @@
19088
19094
  _this.logSetting.arrValueAfterUpdate.push(new LogColumn({
19089
19095
  field: control.field,
19090
19096
  label: control.label,
19091
- valueBefore: control._component.dataSource.map(function (p) { return p.label; }).join(', '),
19097
+ valueBefore: control._component.dataSource.map(function (p) { return p.label; }).join(', ') || _this.logSetting.emptyValue,
19092
19098
  visible: false,
19093
19099
  valueAfter: ''
19094
19100
  }));
@@ -19259,7 +19265,7 @@
19259
19265
  });
19260
19266
  };
19261
19267
  DataFormBase.prototype.getSingleLabel = function (control, dataSource, valueParam) {
19262
- var result = dataSource.find(function (p) { return p.value[control.valueField] == valueParam; });
19268
+ var result = dataSource.find(function (p) { return (p === null || p === void 0 ? void 0 : p.value[control.valueField]) == valueParam; });
19263
19269
  if (!!result) {
19264
19270
  var funcGetLabel = control.funcGetLabel;
19265
19271
  if (funcGetLabel) {
@@ -19355,8 +19361,18 @@
19355
19361
  var oldValue = this.logSetting.valueBeforeUpdate[control.field];
19356
19362
  var newValue = cloneModel[control.field];
19357
19363
  var isMultiple = Array.isArray(oldValue);
19358
- if (!this.isNullOrEmpty(oldValue) || !this.isNullOrEmpty(newValue)) {
19359
- if (control instanceof DropdownControlSchema || control instanceof AutoCompletePickerControlSchema) {
19364
+ if ((!this.isNullOrEmpty(oldValue) || !this.isNullOrEmpty(newValue))
19365
+ && !(control instanceof FileManagerControlSchema)) {
19366
+ if (control instanceof TableSchema) {
19367
+ if (JSON.stringify(oldValue) != JSON.stringify(newValue)) {
19368
+ this.logSetting.arrValueAfterUpdate.push(new LogColumn({
19369
+ field: control.field,
19370
+ label: control.label,
19371
+ enumLogType: exports.EnumLogType.Table
19372
+ }));
19373
+ }
19374
+ }
19375
+ else if (control instanceof DropdownControlSchema || control instanceof AutoCompletePickerControlSchema) {
19360
19376
  if (!isMultiple && oldValue != newValue) {
19361
19377
  this.addSinglePropertyLog(control, oldValue, newValue);
19362
19378
  }
@@ -19372,7 +19388,9 @@
19372
19388
  label: control.label,
19373
19389
  valueBefore: valueBefore,
19374
19390
  valueAfter: valueAfter,
19375
- isHtml: (control instanceof EditorControlSchema || control instanceof TextAreaControlSchema)
19391
+ enumLogType: (control instanceof EditorControlSchema || control instanceof TextAreaControlSchema)
19392
+ ? exports.EnumLogType.Table
19393
+ : exports.EnumLogType.Normal
19376
19394
  }));
19377
19395
  }
19378
19396
  }
@@ -19423,7 +19441,9 @@
19423
19441
  case 4:
19424
19442
  // cấu hình thêm
19425
19443
  _e.sent();
19426
- this.model.data.logMetaData = JSON.stringify(this.logSetting.arrValueAfterUpdate.filter(function (p) { return p.visible; }));
19444
+ this.model.data.logMetaData = this.logSetting.arrValueAfterUpdate.filter(function (p) { return p.visible; }).length
19445
+ ? JSON.stringify(this.logSetting.arrValueAfterUpdate.filter(function (p) { return p.visible; }))
19446
+ : null;
19427
19447
  _e.label = 5;
19428
19448
  case 5: return [4 /*yield*/, this.onBeforeSave()];
19429
19449
  case 6:
@@ -20893,11 +20913,8 @@
20893
20913
  finally { if (e_4) throw e_4.error; }
20894
20914
  }
20895
20915
  }
20896
- if (item.ngaySinh) {
20897
- item.strNgaySinh = this._crudService.renderDate(item.ngaySinh, 'normal');
20898
- }
20899
- else {
20900
- item.strNgaySinh = item.ngaySinh2;
20916
+ if (!item.ngaySinh && item.ngaySinh2) {
20917
+ item.ngaySinh = new Date(item.ngaySinh2);
20901
20918
  }
20902
20919
  item.hocHamHocVi
20903
20920
  = item.idHocHam && item.idHocVi
@@ -20989,7 +21006,8 @@
20989
21006
  }),
20990
21007
  new EntityPickerColumn({
20991
21008
  label: 'Ngày sinh',
20992
- code: 'strNgaySinh',
21009
+ code: 'ngaySinh',
21010
+ dataType: exports.DataType.date,
20993
21011
  isSearchable: true,
20994
21012
  width: '120px',
20995
21013
  notInFields: true,
@@ -21068,8 +21086,9 @@
21068
21086
  }),
21069
21087
  new EntityPickerColumn({
21070
21088
  label: 'Ngày sinh',
21071
- code: 'strNgaySinh',
21089
+ code: 'ngaySinh',
21072
21090
  isSearchable: true,
21091
+ dataType: exports.DataType.date,
21073
21092
  width: '120px',
21074
21093
  notInFields: true,
21075
21094
  textAlign: 1,
@@ -53151,8 +53170,8 @@
53151
53170
  TnAppNotificationComponent.prototype.afterGetNotication = function () {
53152
53171
  return __awaiter(this, void 0, void 0, function () {
53153
53172
  var idsUserCreated, userRes, lstUserInfo;
53154
- return __generator(this, function (_a) {
53155
- switch (_a.label) {
53173
+ return __generator(this, function (_b) {
53174
+ switch (_b.label) {
53156
53175
  case 0:
53157
53176
  idsUserCreated = [];
53158
53177
  this.notifications.forEach(function (element) {
@@ -53166,7 +53185,7 @@
53166
53185
  }
53167
53186
  return [4 /*yield*/, this._userV5Service.getAll([this.newFilter('id', exports.Operator.in, idsUserCreated)], 'avatar,id')];
53168
53187
  case 1:
53169
- userRes = _a.sent();
53188
+ userRes = _b.sent();
53170
53189
  if (!userRes.success || !userRes.data || userRes.data.length === 0) {
53171
53190
  return [2 /*return*/];
53172
53191
  }
@@ -53218,15 +53237,15 @@
53218
53237
  TnAppNotificationComponent.prototype.goToLink = function (item) {
53219
53238
  return __awaiter(this, void 0, void 0, function () {
53220
53239
  var link;
53221
- return __generator(this, function (_a) {
53222
- switch (_a.label) {
53240
+ return __generator(this, function (_b) {
53241
+ switch (_b.label) {
53223
53242
  case 0:
53224
53243
  if (!!this.isReaded(item)) return [3 /*break*/, 2];
53225
53244
  return [4 /*yield*/, this.readById(item)];
53226
53245
  case 1:
53227
- _a.sent();
53246
+ _b.sent();
53228
53247
  this.totalUnRead--;
53229
- _a.label = 2;
53248
+ _b.label = 2;
53230
53249
  case 2:
53231
53250
  // Save current path to go back
53232
53251
  localStorage.setItem('currentUrl', top.location.href);
@@ -53262,8 +53281,9 @@
53262
53281
  this.bounceNoti = false;
53263
53282
  };
53264
53283
  TnAppNotificationComponent.prototype.handleClicked = function () {
53265
- var thongBaoDomain = "/thong-bao";
53266
- window.open(thongBaoDomain);
53284
+ var _a;
53285
+ var appCode = (_a = window['appCode']) !== null && _a !== void 0 ? _a : '';
53286
+ this._router.navigateByUrl("/" + appCode.toLowerCase() + "/thong-bao");
53267
53287
  };
53268
53288
  return TnAppNotificationComponent;
53269
53289
  }(ComponentBase));