@cakemail-org/ui-components-v2 2.2.3 → 2.2.4

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/dist/cjs/index.js CHANGED
@@ -16696,7 +16696,7 @@ function ResourceEdit(_a) {
16696
16696
  title,
16697
16697
  " ",
16698
16698
  status && React.createElement(material.Box, { className: "statusCheckmark ".concat(status || "") },
16699
- React.createElement(Icon, { name: status === "valid" ? "Checkmark10" : "X14", color: "white" }))),
16699
+ React.createElement(Icon, { name: "Checkmark10", color: "white" }))),
16700
16700
  desc && React.createElement(material.Typography, { variant: "body1", color: "shade500.main" }, desc)),
16701
16701
  editable && React.createElement(material.Box, null,
16702
16702
  React.createElement(Button, { onClick: handleToggleOpen, color: "body1", variant: 'outlined', iconOnly: true },
@@ -17071,12 +17071,11 @@ var AutomationModel = /** @class */ (function () {
17071
17071
  AutomationModel.prototype.set = function (property, value) {
17072
17072
  modelSet(this, property, value);
17073
17073
  };
17074
+ // note: fetch automation before saving if on a listings page
17074
17075
  AutomationModel.prototype.save = function (automation) {
17075
17076
  return __awaiter(this, void 0, void 0, function () {
17076
- var dataToUpdate;
17077
17077
  return __generator(this, function (_a) {
17078
- dataToUpdate = automation || this.toJson();
17079
- return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
17078
+ return [2 /*return*/, updateAnyAutomation({ id: this.id, data: automation, v1: this.v1 }).then(function (data) {
17080
17079
  trackEvent(exports.EEvents.AUTOMATION_UPDATED);
17081
17080
  return new AutomationModel(data.data);
17082
17081
  })];
@@ -17104,12 +17103,14 @@ var AutomationModel = /** @class */ (function () {
17104
17103
  });
17105
17104
  };
17106
17105
  AutomationModel.getContent = function (contentId) {
17107
- return __awaiter(this, void 0, void 0, function () {
17108
- return __generator(this, function (_a) {
17109
- return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17110
- return data.data;
17111
- })];
17106
+ if (contentId === "scratchBee1") {
17107
+ return Promise.resolve({
17108
+ id: "scratchBee1",
17109
+ thumbnail: "/assets/images/campaigns/beeTemplate.png",
17112
17110
  });
17111
+ }
17112
+ return getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17113
+ return data;
17113
17114
  });
17114
17115
  };
17115
17116
  return AutomationModel;
@@ -46,7 +46,7 @@ export declare class AutomationModel {
46
46
  });
47
47
  toJson(): any;
48
48
  set<T extends keyof this>(property: T, value: this[T]): void;
49
- save(automation?: Partial<TAutomation>): Promise<AutomationModel>;
49
+ save(automation: Partial<TAutomation>): Promise<AutomationModel>;
50
50
  delete(): Promise<TDeleteApiResource>;
51
51
  getStats({ path }: {
52
52
  path: string;
package/dist/esm/index.js CHANGED
@@ -16676,7 +16676,7 @@ function ResourceEdit(_a) {
16676
16676
  title,
16677
16677
  " ",
16678
16678
  status && React__default.createElement(Box, { className: "statusCheckmark ".concat(status || "") },
16679
- React__default.createElement(Icon, { name: status === "valid" ? "Checkmark10" : "X14", color: "white" }))),
16679
+ React__default.createElement(Icon, { name: "Checkmark10", color: "white" }))),
16680
16680
  desc && React__default.createElement(Typography$1, { variant: "body1", color: "shade500.main" }, desc)),
16681
16681
  editable && React__default.createElement(Box, null,
16682
16682
  React__default.createElement(Button, { onClick: handleToggleOpen, color: "body1", variant: 'outlined', iconOnly: true },
@@ -17051,12 +17051,11 @@ var AutomationModel = /** @class */ (function () {
17051
17051
  AutomationModel.prototype.set = function (property, value) {
17052
17052
  modelSet(this, property, value);
17053
17053
  };
17054
+ // note: fetch automation before saving if on a listings page
17054
17055
  AutomationModel.prototype.save = function (automation) {
17055
17056
  return __awaiter(this, void 0, void 0, function () {
17056
- var dataToUpdate;
17057
17057
  return __generator(this, function (_a) {
17058
- dataToUpdate = automation || this.toJson();
17059
- return [2 /*return*/, updateAnyAutomation({ id: this.id, data: dataToUpdate, v1: this.v1 }).then(function (data) {
17058
+ return [2 /*return*/, updateAnyAutomation({ id: this.id, data: automation, v1: this.v1 }).then(function (data) {
17060
17059
  trackEvent(EEvents.AUTOMATION_UPDATED);
17061
17060
  return new AutomationModel(data.data);
17062
17061
  })];
@@ -17084,12 +17083,14 @@ var AutomationModel = /** @class */ (function () {
17084
17083
  });
17085
17084
  };
17086
17085
  AutomationModel.getContent = function (contentId) {
17087
- return __awaiter(this, void 0, void 0, function () {
17088
- return __generator(this, function (_a) {
17089
- return [2 /*return*/, getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17090
- return data.data;
17091
- })];
17086
+ if (contentId === "scratchBee1") {
17087
+ return Promise.resolve({
17088
+ id: "scratchBee1",
17089
+ thumbnail: "/assets/images/campaigns/beeTemplate.png",
17092
17090
  });
17091
+ }
17092
+ return getAutomationEmailContent({ contentId: contentId }).then(function (data) {
17093
+ return data;
17093
17094
  });
17094
17095
  };
17095
17096
  return AutomationModel;
@@ -46,7 +46,7 @@ export declare class AutomationModel {
46
46
  });
47
47
  toJson(): any;
48
48
  set<T extends keyof this>(property: T, value: this[T]): void;
49
- save(automation?: Partial<TAutomation>): Promise<AutomationModel>;
49
+ save(automation: Partial<TAutomation>): Promise<AutomationModel>;
50
50
  delete(): Promise<TDeleteApiResource>;
51
51
  getStats({ path }: {
52
52
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",