@social-mail/social-mail-hosted-web 1.0.21 → 1.0.23

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.
@@ -18113,11 +18113,11 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
18113
18113
  execute: function () {
18114
18114
  _export("default", DnsRecordEditorPage = class DnsRecordEditorPage extends PopupWindowPage {
18115
18115
  init() {
18116
- var _a, _b, _c, _d;
18116
+ var _a, _b, _c, _d, _e;
18117
18117
  return __awaiter(this, void 0, void 0, function* () {
18118
- this.title = "Add New Record";
18119
- const zone = this.zone = (_a = this.parameters) === null || _a === void 0 ? void 0 : _a.zone;
18120
- (_b = this.model) !== null && _b !== void 0 ? _b : this.model = (_d = (_c = this.parameters) === null || _c === void 0 ? void 0 : _c.model) !== null && _d !== void 0 ? _d : DnsZoneRecord.create({
18118
+ this.title = ((_a = this.parameters) === null || _a === void 0 ? void 0 : _a.model) ? "Edit Record" : "Add New Record";
18119
+ const zone = this.zone = (_b = this.parameters) === null || _b === void 0 ? void 0 : _b.zone;
18120
+ (_c = this.model) !== null && _c !== void 0 ? _c : this.model = (_e = (_d = this.parameters) === null || _d === void 0 ? void 0 : _d.model) !== null && _e !== void 0 ? _e : DnsZoneRecord.create({
18121
18121
  ttl: 600,
18122
18122
  type: "A",
18123
18123
  name: "@",
@@ -18161,11 +18161,12 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
18161
18161
  model: {
18162
18162
  name,
18163
18163
  type,
18164
- value
18164
+ value,
18165
+ recordID
18165
18166
  }
18166
18167
  } = this;
18167
18168
  const records = (_a = zone.records) !== null && _a !== void 0 ? _a : zone.records = [];
18168
- if (records.find(x => x.type === type && x.name === name && x.value === value)) {
18169
+ if (records.find(x => x.type === type && x.name === name && x.value === value && recordID && x.recordID !== recordID)) {
18169
18170
  throw new Error(`${name} ${type} ${value} already exists.`);
18170
18171
  }
18171
18172
  return this.model;
@@ -18264,7 +18265,12 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
18264
18265
  text: item.ttl
18265
18266
  }), XNode.create("label", {
18266
18267
  text: item.value
18267
- }), XNode.create("br", null), item.disabled ? XNode.create("button", {
18268
+ }), XNode.create("br", null), XNode.create("button", {
18269
+ "data-click-event": "edit-item",
18270
+ "data-layout": "icon-button"
18271
+ }, XNode.create("i", {
18272
+ class: "fas fa-edit"
18273
+ }), "Edit"), item.disabled ? XNode.create("button", {
18268
18274
  "data-click-event": "enable-item",
18269
18275
  "data-layout": "icon-button"
18270
18276
  }, XNode.create("i", {
@@ -18305,6 +18311,17 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
18305
18311
  this.sort();
18306
18312
  });
18307
18313
  }
18314
+ editItem(model) {
18315
+ return __awaiter(this, void 0, void 0, function* () {
18316
+ const zone = this.model;
18317
+ model = yield PageNavigator.pushPageForResult(DnsRecordEditorPage, {
18318
+ model,
18319
+ zone
18320
+ });
18321
+ yield this.dnsZoneService.saveRecord(model);
18322
+ this.sort();
18323
+ });
18324
+ }
18308
18325
  addNewRecord() {
18309
18326
  return __awaiter(this, void 0, void 0, function* () {
18310
18327
  const zone = this.model;
@@ -18330,6 +18347,9 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
18330
18347
  onEvent: "enable-item",
18331
18348
  confirm: "Are you sure you want to enable the record?"
18332
18349
  }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise)], DnsZoneEditorPage.prototype, "enableItem", null);
18350
+ __decorate([Action({
18351
+ onEvent: "edit-item"
18352
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise)], DnsZoneEditorPage.prototype, "editItem", null);
18333
18353
  __decorate([Action({
18334
18354
  onEvent: "add-new-record"
18335
18355
  }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], DnsZoneEditorPage.prototype, "addNewRecord", null);