awing-library 2.1.183-dev → 2.1.185-dev

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.
@@ -348,7 +348,7 @@ function AdList(props) {
348
348
  } }, idx));
349
349
  }) })] })] }), open &&
350
350
  (0, jsx_runtime_1.jsx)(PreviewButton_1.default, { anchorEl: anchorEl, open: open, domainIds: previewId.domainIds, handlePreviewClose: handlePreviewClose, handlePreviewDomain: function (event, domainId) {
351
- handlePreview(event, ads.find(function (x) { return x.loginId === previewId.loginId; }), domainId);
351
+ handlePreview(event, ads.find(function (x) { return x.loginId === previewId.loginId && x.welcomeId === previewId.welcomeId; }), domainId);
352
352
  // handlePreview(previewId, domainId)
353
353
  }, service: service })] }));
354
354
  }
@@ -122,9 +122,7 @@ function SubCampaignDetail(props) {
122
122
  : translationText.helperText
123
123
  : '' }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, style: { padding: 8 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { id: "billingUnit", required: true, select: true, variant: "standard", fullWidth: true, label: translationText.BillingUnit, value: String(subCampaign.billingUnit), onChange: function (e) {
124
124
  onSubCampaignChange(function (pre) { return (__assign(__assign({}, pre), { billingUnit: Number(e.target.value) })); });
125
- }, error: subValid.billingUnit !== undefined &&
126
- !subValid.billingUnit, helperText: subValid.billingUnit !== undefined &&
127
- !subValid.billingUnit
125
+ }, error: !!subValid.billingUnit && !subValid.billingUnit, helperText: !!subValid.billingUnit && !subValid.billingUnit
128
126
  ? translationText.helperText
129
127
  : '', children: Object.values(Enum_2.AnalyticType)
130
128
  .filter(function (item) { return !isNaN(Number(item)); })
@@ -22,7 +22,7 @@ exports.subCampaignDetailValidState = (0, recoil_1.atom)({
22
22
  return (result[sub.campaignGroup.id] =
23
23
  (0, Utils_1.nameValid)(sub.campaignGroup.name) &&
24
24
  (0, Utils_1.groupClassBValid)(sub.campaignGroup) &&
25
- (0, Utils_1.groupClassCValid)(sub));
25
+ (0, Utils_1.groupClassCValid)(sub) && !!sub.campaignGroup.billingUnit);
26
26
  });
27
27
  return result;
28
28
  },
@@ -58,9 +58,10 @@ exports.subCampaignValidState = (0, recoil_1.selector)({
58
58
  var subCampaignAdsValid = get(exports.subCampaignAdsValidState);
59
59
  var result = {};
60
60
  subCampaigns.forEach(function (sub) {
61
+ var _a;
61
62
  return (result[sub.campaignGroup.id] =
62
63
  subCampaignDetailValid[sub.campaignGroup.id] &&
63
- subCampaignAdsValid[sub.campaignGroup.id]);
64
+ subCampaignAdsValid[sub.campaignGroup.id] && Boolean((_a = sub.campaignGroup) === null || _a === void 0 ? void 0 : _a.billingUnit));
64
65
  });
65
66
  return result;
66
67
  },
@@ -111,6 +111,7 @@ export declare const BaseEvent: {
111
111
  readonly 0: "View";
112
112
  readonly 2: "Click";
113
113
  readonly 1: "Authentication";
114
+ readonly 4: "AuthenticationSuccess";
114
115
  };
115
116
  export declare enum CampaignTicket {
116
117
  ACTIVE = 0,
@@ -94,6 +94,7 @@ exports.BaseEvent = (_a = {},
94
94
  _a[Enum_1.AnalyticType.VIEW] = 'View',
95
95
  _a[Enum_1.AnalyticType.CLICK] = 'Click',
96
96
  _a[Enum_1.AnalyticType.AUTHENTICATION] = 'Authentication',
97
+ _a[Enum_1.AnalyticType.AuthenticationSuccess] = 'AuthenticationSuccess',
97
98
  _a);
98
99
  var CampaignTicket;
99
100
  (function (CampaignTicket) {
@@ -55,5 +55,6 @@ export declare enum AnalyticGroupBy {
55
55
  export declare enum AnalyticType {
56
56
  VIEW = 0,// Impression
57
57
  AUTHENTICATION = 1,// Engagement / Spot
58
- CLICK = 2
58
+ CLICK = 2,// Final Click
59
+ AuthenticationSuccess = 4
59
60
  }
@@ -71,4 +71,5 @@ var AnalyticType;
71
71
  AnalyticType[AnalyticType["VIEW"] = 0] = "VIEW";
72
72
  AnalyticType[AnalyticType["AUTHENTICATION"] = 1] = "AUTHENTICATION";
73
73
  AnalyticType[AnalyticType["CLICK"] = 2] = "CLICK";
74
+ AnalyticType[AnalyticType["AuthenticationSuccess"] = 4] = "AuthenticationSuccess";
74
75
  })(AnalyticType || (exports.AnalyticType = AnalyticType = {}));
@@ -52,6 +52,7 @@ var Preview = function (props) {
52
52
  result = result.replace("http://", "https://");
53
53
  return result;
54
54
  }, [configs.CAPTIVE_DOMAIN, configs.TEMPLATE_PREVIEW, domainId]);
55
+ var iframeName = react_1.default.useMemo(function () { return "iframe-demo".concat(viewIndex); }, [viewIndex]);
55
56
  (0, react_1.useEffect)(function () {
56
57
  var handleFormdata = function (_a) {
57
58
  var formData = _a.formData;
@@ -85,6 +86,6 @@ var Preview = function (props) {
85
86
  }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", style: {
86
87
  fontWeight: "bold",
87
88
  textTransform: "uppercase",
88
- }, children: t("ViewTemplate.PreviewTitle") }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t("Common.Refresh") || "", placement: "top", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: function () { return formRef.current.submit(); }, "aria-label": "refresh", style: { float: "right" }, disabled: !validStatus, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }) })] }), (0, jsx_runtime_1.jsx)("form", { action: iframeSrc, method: "post", target: "iframe-demo", ref: formRef }), (0, jsx_runtime_1.jsx)("iframe", { title: "iframe-demo-".concat(viewIndex), id: "iframe-demo", name: "iframe-demo", className: classes.root, width: "100%" })] }));
89
+ }, children: t("ViewTemplate.PreviewTitle") }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t("Common.Refresh") || "", placement: "top", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: function () { return formRef.current.submit(); }, "aria-label": "refresh", style: { float: "right" }, disabled: !validStatus, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }) })] }), (0, jsx_runtime_1.jsx)("form", { action: iframeSrc, method: "post", target: iframeName, ref: formRef }), (0, jsx_runtime_1.jsx)("iframe", { title: iframeName, id: iframeName, name: iframeName, className: classes.root, width: "100%" })] }));
89
90
  };
90
91
  exports.default = Preview;
@@ -15,7 +15,7 @@ export declare enum TIMELINE_TYPE {
15
15
  */
16
16
  export declare function getCookie(name: string): string | undefined;
17
17
  export declare function dateToString(date: moment.MomentInput): string;
18
- export declare function formatNumber<T = number | bigint | string | undefined>(num: T): string;
18
+ export declare function formatNumber(num: number | bigint | string | undefined): string;
19
19
  export declare function getQueryVariable(variable: string): string;
20
20
  export declare function displayLongString(str: string, maxLength: number): string;
21
21
  export declare function generateUUID(): string;
@@ -78,11 +78,9 @@ function dateToString(date) {
78
78
  }
79
79
  exports.dateToString = dateToString;
80
80
  function formatNumber(num) {
81
- if (String(num).includes(','))
82
- return num;
83
81
  var value = Number(Number(num).toFixed(2));
84
82
  if (value || value === 0) {
85
- return new Intl.NumberFormat(i18n_1.default.language === 'vi' ? 'vi-VN' : 'en-US').format(value);
83
+ return new Intl.NumberFormat(localStorage.getItem('i18nextLng') === 'vi' ? 'vi-VN' : 'en-US').format(value);
86
84
  }
87
85
  else
88
86
  return '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.183-dev",
3
+ "version": "2.1.185-dev",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",