awing-library 2.1.30-beta → 2.1.32-beta

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.
@@ -1,3 +1,3 @@
1
- import { IFiltersProps } from "../../interface";
2
- declare const Filters: ({ campaigns, handleFilters, loadingFlags, placeMultiSelectComponent: PlaceMultiSelect, handleExportExcel, }: IFiltersProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { IFiltersProps } from '../../interface';
2
+ declare const Filters: ({ campaigns, handleFilters, loadingFlags, placeMultiSelectComponent: PlaceMultiSelect, handleExportExcel, disabledCampaignFilter, }: IFiltersProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Filters;
@@ -24,90 +24,92 @@ var moment_1 = __importDefault(require("moment"));
24
24
  var react_i18next_1 = require("react-i18next");
25
25
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
26
26
  outlinedInput: {
27
- "& .MuiOutlinedInput-input": {
28
- padding: "10.5px !important",
27
+ '& .MuiOutlinedInput-input': {
28
+ padding: '10.5px !important',
29
29
  },
30
- "& .MuiFormControl-marginNormal": {
30
+ '& .MuiFormControl-marginNormal': {
31
31
  margin: 0,
32
32
  },
33
- "& .MuiOutlinedInput-adornedEnd": {
34
- paddingRight: "0.25rem",
33
+ '& .MuiOutlinedInput-adornedEnd': {
34
+ paddingRight: '0.25rem',
35
35
  },
36
- "& .MuiIconButton-root": {
37
- padding: "0.5rem",
36
+ '& .MuiIconButton-root': {
37
+ padding: '0.5rem',
38
38
  },
39
- "& .MuiAutocomplete-inputRoot": {
40
- padding: "0.125rem",
39
+ '& .MuiAutocomplete-inputRoot': {
40
+ padding: '0.125rem',
41
41
  },
42
- "& .MuiAutocomplete-endAdornment": {
43
- top: "calc(50% - 19px)",
42
+ '& .MuiAutocomplete-endAdornment': {
43
+ top: 'calc(50% - 19px)',
44
44
  },
45
45
  },
46
46
  filterPlaceBtn: {
47
- cursor: "pointer",
48
- "&:hover": {
49
- transform: "scale(1.2)",
47
+ cursor: 'pointer',
48
+ '&:hover': {
49
+ transform: 'scale(1.2)',
50
50
  },
51
51
  },
52
52
  ellipsisPlaceFilter: {
53
- "& .MuiInputBase-input": {
54
- textOverflow: "ellipsis",
53
+ '& .MuiInputBase-input': {
54
+ textOverflow: 'ellipsis',
55
55
  },
56
- display: "flex",
56
+ display: 'flex',
57
57
  },
58
58
  lineInfo: {
59
- paddingBottom: "0.25rem",
60
- display: "flex",
61
- alignItems: "center",
59
+ paddingBottom: '0.25rem',
60
+ display: 'flex',
61
+ alignItems: 'center',
62
62
  // [theme.breakpoints.down('md')]: {
63
63
  // flexDirection: 'column',
64
64
  // },
65
65
  },
66
66
  dateRangePicker: {
67
- "& .MuiInputBase-input": {
68
- height: "1.25rem",
67
+ '& .MuiInputBase-input': {
68
+ height: '1.25rem',
69
69
  },
70
70
  },
71
71
  labelIsNetwork: {
72
- backgroundColor: "#c49f47",
73
- color: "#ffffff",
74
- padding: "0 4px",
75
- marginLeft: "4px",
76
- fontSize: "13px",
72
+ backgroundColor: '#c49f47',
73
+ color: '#ffffff',
74
+ padding: '0 4px',
75
+ marginLeft: '4px',
76
+ fontSize: '13px',
77
77
  },
78
78
  }); });
79
79
  var Filters = function (_a) {
80
80
  var _b, _c;
81
- var campaigns = _a.campaigns, handleFilters = _a.handleFilters, loadingFlags = _a.loadingFlags, PlaceMultiSelect = _a.placeMultiSelectComponent, handleExportExcel = _a.handleExportExcel;
81
+ var campaigns = _a.campaigns, handleFilters = _a.handleFilters, loadingFlags = _a.loadingFlags, PlaceMultiSelect = _a.placeMultiSelectComponent, handleExportExcel = _a.handleExportExcel, _d = _a.disabledCampaignFilter, disabledCampaignFilter = _d === void 0 ? false : _d;
82
82
  var t = (0, react_i18next_1.useTranslation)().t;
83
- var campaignOptions = __assign(__assign({}, campaigns), { 0: { campaignId: 0, name: t("Common.SelectAll") } });
83
+ var campaignOptions = __assign(__assign({}, campaigns), { 0: { campaignId: 0, name: t('Common.SelectAll') } });
84
84
  var classes = useStyles();
85
85
  var handleChangeDateRange = function (value) {
86
- handleFilters("startDate", value.startDate);
87
- handleFilters("endDate", value.endDate);
86
+ handleFilters('startDate', value.startDate);
87
+ handleFilters('endDate', value.endDate);
88
88
  };
89
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, className: classes.dateRangePicker, children: (0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, { isShowCalendarInfo: true, label: "".concat(t("Common.StartDate"), " - ").concat(t("Common.EndDate")), callback: handleChangeDateRange, initialStartDate: (0, moment_1.default)(), initialEndDate: (0, moment_1.default)(), variant: "outlined", textFieldProps: {
89
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: disabledCampaignFilter ? 6 : 4, className: classes.dateRangePicker, children: (0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, { isShowCalendarInfo: true, label: "".concat(t('Common.StartDate'), " - ").concat(t('Common.EndDate')), callback: handleChangeDateRange, initialStartDate: (0, moment_1.default)(), initialEndDate: (0, moment_1.default)(), variant: "outlined", textFieldProps: {
90
90
  fullWidth: true,
91
91
  className: classes.outlinedInput,
92
92
  }, isDayBlocked: function (day) {
93
- var now = (0, moment_1.default)().startOf("day").valueOf();
93
+ if (disabledCampaignFilter)
94
+ return false;
95
+ var now = (0, moment_1.default)().startOf('day').valueOf();
94
96
  if (day.valueOf() < now) {
95
97
  return true;
96
98
  }
97
99
  else {
98
100
  return false;
99
101
  }
100
- } }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { size: "small", disablePortal: true, id: "combo-box-demo", options: (_c = (_b = lodash_1.default.values(campaignOptions)) === null || _b === void 0 ? void 0 : _b.map(function (obj) { return (__assign({}, obj)); })) !== null && _c !== void 0 ? _c : [], getOptionLabel: function (option) { var _a; return (_a = option.name) !== null && _a !== void 0 ? _a : ""; }, isOptionEqualToValue: function (option, value) {
102
+ } }) }), !disabledCampaignFilter && ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { size: "small", disablePortal: true, id: "combo-box-demo", options: (_c = (_b = lodash_1.default.values(campaignOptions)) === null || _b === void 0 ? void 0 : _b.map(function (obj) { return (__assign({}, obj)); })) !== null && _c !== void 0 ? _c : [], getOptionLabel: function (option) { var _a; return (_a = option.name) !== null && _a !== void 0 ? _a : ''; }, isOptionEqualToValue: function (option, value) {
101
103
  return option.Id === value.Id;
102
104
  }, onChange: function (event, campaign) {
103
- handleFilters("campaignId", campaign === null || campaign === void 0 ? void 0 : campaign.id);
104
- }, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t("Schedule.CampaignName"), sx: { backgroundColor: "white" }, variant: "outlined" }))); }, defaultValue: { Id: 0, name: t("Common.SelectAll") } }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 4, className: classes.ellipsisPlaceFilter, children: [(0, jsx_runtime_1.jsx)(PlaceMultiSelect, { isDisplayTextField: true, onChange: function (placeIds) {
105
- return handleFilters("placeIds", placeIds);
105
+ handleFilters('campaignId', campaign === null || campaign === void 0 ? void 0 : campaign.id);
106
+ }, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({}, params, { label: t('Schedule.CampaignName'), sx: { backgroundColor: 'white' }, variant: "outlined" }))); }, defaultValue: { Id: 0, name: t('Common.SelectAll') } }) })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: disabledCampaignFilter ? 6 : 4, className: classes.ellipsisPlaceFilter, children: [(0, jsx_runtime_1.jsx)(PlaceMultiSelect, { isDisplayTextField: true, onChange: function (placeIds) {
107
+ return handleFilters('placeIds', placeIds);
106
108
  } }), (0, jsx_runtime_1.jsx)(material_1.Button, { sx: {
107
- height: "40px",
108
- position: "relative !important",
109
- marginLeft: "1rem",
110
- marginTop: "6px",
111
- }, variant: "contained", onClick: handleExportExcel, title: t("Common.Download"), disabled: loadingFlags === null || loadingFlags === void 0 ? void 0 : loadingFlags.export, color: "inherit", children: (loadingFlags === null || loadingFlags === void 0 ? void 0 : loadingFlags.export) ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsx)(GetApp_1.default, {})) })] })] }));
109
+ height: '40px',
110
+ position: 'relative !important',
111
+ marginLeft: '1rem',
112
+ marginTop: '6px',
113
+ }, variant: "contained", onClick: handleExportExcel, title: t('Common.Download'), disabled: loadingFlags === null || loadingFlags === void 0 ? void 0 : loadingFlags.export, color: "inherit", children: (loadingFlags === null || loadingFlags === void 0 ? void 0 : loadingFlags.export) ? ((0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsx)(GetApp_1.default, {})) })] })] }));
112
114
  };
113
115
  exports.default = Filters;
@@ -32,10 +32,16 @@ var GroupPanel = function (_a) {
32
32
  return __assign(__assign({}, cell), { label: t('Schedule.Campaign') });
33
33
  case Enum_1.HEAD_CELL_IDS.PLACE:
34
34
  return __assign(__assign({}, cell), { label: t('Schedule.Place') });
35
+ case Enum_1.HEAD_CELL_IDS.CAMPAIGN_CAMPAIGN:
36
+ return __assign(__assign({}, cell), { label: t('Schedule.Campaign') });
37
+ case Enum_1.HEAD_CELL_IDS.PLACE_CAMPAIGN:
38
+ return __assign(__assign({}, cell), { label: t('Schedule.Place') });
35
39
  case Enum_1.HEAD_CELL_IDS.DATE:
36
40
  return __assign(__assign({}, cell), { label: t('Schedule.Date') });
37
41
  case Enum_1.HEAD_CELL_IDS.DOMAIN:
38
42
  return __assign(__assign({}, cell), { label: t('Schedule.Domain') });
43
+ case Enum_1.HEAD_CELL_IDS.DOMAIN_CAMPAIGN:
44
+ return __assign(__assign({}, cell), { label: t('Schedule.Domain') });
39
45
  case Enum_1.HEAD_CELL_IDS.RATE:
40
46
  return __assign(__assign({}, cell), { label: "".concat(t('Schedule.Rate'), " (%)") });
41
47
  case Enum_1.HEAD_CELL_IDS.TOTAL:
@@ -1,3 +1,3 @@
1
- import { IControlPanelProps } from "../../interface";
2
- declare const ControlPanel: ({ campaigns, handleFilters, unGroupField, onDragStart, onDragOver, onDrop, handleView, handleExportExcel, loadingFlags, panels, placeMultiSelectComponent, }: IControlPanelProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { IControlPanelProps } from '../../interface';
2
+ declare const ControlPanel: ({ campaigns, handleFilters, unGroupField, onDragStart, onDragOver, onDrop, handleView, handleExportExcel, loadingFlags, panels, placeMultiSelectComponent, disabledCampaignFilter, }: IControlPanelProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ControlPanel;
@@ -10,8 +10,8 @@ var react_i18next_1 = require("react-i18next");
10
10
  var Filter_1 = __importDefault(require("./Filter"));
11
11
  var GroupPanel_1 = __importDefault(require("./GroupPanel"));
12
12
  var ControlPanel = function (_a) {
13
- var campaigns = _a.campaigns, handleFilters = _a.handleFilters, unGroupField = _a.unGroupField, onDragStart = _a.onDragStart, onDragOver = _a.onDragOver, onDrop = _a.onDrop, handleView = _a.handleView, handleExportExcel = _a.handleExportExcel, loadingFlags = _a.loadingFlags, panels = _a.panels, placeMultiSelectComponent = _a.placeMultiSelectComponent;
13
+ var campaigns = _a.campaigns, handleFilters = _a.handleFilters, unGroupField = _a.unGroupField, onDragStart = _a.onDragStart, onDragOver = _a.onDragOver, onDrop = _a.onDrop, handleView = _a.handleView, handleExportExcel = _a.handleExportExcel, loadingFlags = _a.loadingFlags, panels = _a.panels, placeMultiSelectComponent = _a.placeMultiSelectComponent, disabledCampaignFilter = _a.disabledCampaignFilter;
14
14
  var t = (0, react_i18next_1.useTranslation)().t;
15
- return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, sx: { padding: "1rem" }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, item: true, xs: 12, justifyContent: "flex-start", spacing: 2, children: (0, jsx_runtime_1.jsx)(Filter_1.default, { loadingFlags: loadingFlags, campaigns: campaigns, handleFilters: handleFilters, handleExportExcel: handleExportExcel, placeMultiSelectComponent: placeMultiSelectComponent }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: "flex-end", item: true, xs: 12, spacing: 2, sx: { marginTop: "0.125rem" }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { id: "wrap-group-panel", item: true, style: { flexGrow: 1, position: "relative" }, children: (0, jsx_runtime_1.jsx)(GroupPanel_1.default, { panels: panels, unGroupField: unGroupField, onDragStart: onDragStart, onDragOver: onDragOver, onDrop: onDrop }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, sx: { display: "flex" }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { sx: { height: "40px" }, variant: "contained", color: "primary", onClick: handleView, children: t("Common.View") }) })] })] }) }));
15
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, sx: { padding: '1rem' }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, item: true, xs: 12, justifyContent: "flex-start", spacing: 2, children: (0, jsx_runtime_1.jsx)(Filter_1.default, { loadingFlags: loadingFlags, campaigns: campaigns, handleFilters: handleFilters, handleExportExcel: handleExportExcel, placeMultiSelectComponent: placeMultiSelectComponent, disabledCampaignFilter: disabledCampaignFilter }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: "flex-end", item: true, xs: 12, spacing: 2, sx: { marginTop: '0.125rem' }, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { id: "wrap-group-panel", item: true, style: { flexGrow: 1, position: 'relative' }, children: (0, jsx_runtime_1.jsx)(GroupPanel_1.default, { panels: panels, unGroupField: unGroupField, onDragStart: onDragStart, onDragOver: onDragOver, onDrop: onDrop }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, sx: { display: 'flex' }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { sx: { height: '40px' }, variant: "contained", color: "primary", onClick: handleView, children: t('Common.View') }) })] })] }) }));
16
16
  };
17
17
  exports.default = ControlPanel;
@@ -97,6 +97,7 @@ var RowAdvanceComponent = function (_a) {
97
97
  var totalView = (row === null || row === void 0 ? void 0 : row.quantity) !== undefined
98
98
  ? (0, helper_1.roundDecimalNumber)(row === null || row === void 0 ? void 0 : row.quantity)
99
99
  : (0, helper_1.roundDecimalNumber)(row === null || row === void 0 ? void 0 : row.totalQuantity);
100
+ var ctr = (((row === null || row === void 0 ? void 0 : row.click) / (row === null || row === void 0 ? void 0 : row.view)) * 100).toFixed(2);
100
101
  function styledRow(priority) {
101
102
  if ((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 1 && priorityGroupLevel === 1) {
102
103
  return classes.styledSecondaryRow;
@@ -117,7 +118,7 @@ var RowAdvanceComponent = function (_a) {
117
118
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { className: "".concat((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
118
119
  ? classes.styledNormalRow
119
120
  : styledRow(priorityGroupLevel), " ").concat(classes.styledCommonRow), onClick: handleOnClick, children: headCells === null || headCells === void 0 ? void 0 : headCells.map(function (item, index) {
120
- var _a, _b, _c, _d;
121
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
121
122
  switch (item.name) {
122
123
  case Enum_1.HEAD_CELL_NAMES.CONTROL:
123
124
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", colSpan: colSpanFirstCell, className: item.id === Enum_1.HEAD_CELL_IDS.CONTROL
@@ -156,6 +157,33 @@ var RowAdvanceComponent = function (_a) {
156
157
  : totalRate }, item.id));
157
158
  case Enum_1.HEAD_CELL_NAMES.TOTAL:
158
159
  return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: totalView }, item.id));
160
+ case Enum_1.HEAD_CELL_NAMES.IMPRESSION:
161
+ return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: row === null || row === void 0 ? void 0 : row.view }, item.id));
162
+ case Enum_1.HEAD_CELL_NAMES.FINAL_CLICK:
163
+ return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: row === null || row === void 0 ? void 0 : row.click }, item.id));
164
+ case Enum_1.HEAD_CELL_NAMES.CTR:
165
+ return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: ctr }, item.id));
166
+ case Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN:
167
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
168
+ Enum_1.HEAD_CELL_NAMES.CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: (_e = row === null || row === void 0 ? void 0 : row.campaign) === null || _e === void 0 ? void 0 : _e.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
169
+ .slice(0, priorityGroupLevel - 1)
170
+ .indexOf(Enum_1.HEAD_CELL_NAMES.CAMPAIGN) === -1 ? ( // Nếu fieldGroup có index < thằng groupKeyName hiện tại thì hiển thị total hoac name ngược lại phải thụt đầu dòng
171
+ (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledCampaignField, children: (_f = row === null || row === void 0 ? void 0 : row.campaign) === null || _f === void 0 ? void 0 : _f.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
172
+ case Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN:
173
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
174
+ Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: (_g = row === null || row === void 0 ? void 0 : row.domain) === null || _g === void 0 ? void 0 : _g.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groupNames
175
+ .slice(0, priorityGroupLevel - 1)
176
+ .indexOf(Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledDomainField, children: (_h = row === null || row === void 0 ? void 0 : row.domain) === null || _h === void 0 ? void 0 : _h.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
177
+ case Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN:
178
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: fieldNameShowOn ===
179
+ Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: (_j = row === null || row === void 0 ? void 0 : row.place) === null || _j === void 0 ? void 0 : _j.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children:
180
+ // Nếu field hiện tại ko phải groupName đang showOn thì 3Th
181
+ // TH1: field nằm trong groupNames nhưng đúng trước fieldNameShowOn hiển thị name
182
+ // TH2: field nằm sau fieldNameShowOn trong groupNames hiển thi total
183
+ // Th3: field ko trong groupNames hiển thị total hoặ thông tin schedule nếu nó là cấp cuối cùng
184
+ groupNames
185
+ .slice(0, priorityGroupLevel - 1)
186
+ .indexOf(Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN) === -1 ? ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: classes.styledPlaceField, children: (_k = row === null || row === void 0 ? void 0 : row.place) === null || _k === void 0 ? void 0 : _k.name })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })) }, item.id));
159
187
  default:
160
188
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
161
189
  }
@@ -156,18 +156,49 @@ var RowAdvanceContainer = function (_a) {
156
156
  setPages(__assign(__assign({}, pages), { pageSize: parseInt(event.target.value), pageIndex: 0 }));
157
157
  getDetails(filterByOfRowAdvance, groupNames[priorityGroupLevel], parseInt(event.target.value), 0);
158
158
  };
159
- var handleOnClick = function () {
159
+ // const handleOnClick = (value: any) => {
160
+ // debugger
161
+ // console.log('row', row)
162
+ // console.log('filterByOfRowAdvance', filterByOfRowAdvance)
163
+ // if (!expandDisabled) {
164
+ // setOpen(!open)
165
+ // getDetails(
166
+ // filterByOfRowAdvance,
167
+ // groupNames[priorityGroupLevel],
168
+ // pages?.pageSize,
169
+ // pages?.pageIndex
170
+ // )
171
+ // }
172
+ // }
173
+ var handleOnClick = function (value) {
174
+ var _a, _b, _c;
175
+ if (groupNames[priorityGroupLevel - 1] ===
176
+ Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN) {
177
+ filters.placeIds = [(_a = value === null || value === void 0 ? void 0 : value.place) === null || _a === void 0 ? void 0 : _a.placeId];
178
+ }
179
+ if (groupNames[priorityGroupLevel - 1] ===
180
+ Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN) {
181
+ filters.domainId = (_b = value === null || value === void 0 ? void 0 : value.domain) === null || _b === void 0 ? void 0 : _b.domainId;
182
+ }
183
+ if (groupNames[priorityGroupLevel - 1] ===
184
+ Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN) {
185
+ filters.campaignId = (_c = value === null || value === void 0 ? void 0 : value.campaign) === null || _c === void 0 ? void 0 : _c.campaignId;
186
+ }
160
187
  if (!expandDisabled) {
161
188
  setOpen(!open);
162
- getDetails(filterByOfRowAdvance, groupNames[priorityGroupLevel], pages === null || pages === void 0 ? void 0 : pages.pageSize, pages === null || pages === void 0 ? void 0 : pages.pageIndex);
189
+ getDetails(
190
+ // filterByOfRowAdvance
191
+ filters, groupNames[priorityGroupLevel], pages === null || pages === void 0 ? void 0 : pages.pageSize, pages === null || pages === void 0 ? void 0 : pages.pageIndex);
163
192
  }
164
193
  };
165
194
  var expandDisabled = (groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
166
195
  ? true
167
196
  : priorityGroupLevel === (groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) + 1;
168
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(component_1.default, { stt: stt, row: row, options: options, headCells: headCells, priorityGroupLevel: priorityGroupLevel, groupNames: groupNames, handleOnClick: handleOnClick, open: open, expandDisabled: expandDisabled }), open && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loadingPage ? ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, children: (0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {}) }) })) : ((0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { pageSize: pages === null || pages === void 0 ? void 0 : pages.pageSize, pageIndex: pages === null || pages === void 0 ? void 0 : pages.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
197
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(component_1.default, { stt: stt, row: row, options: options, headCells: headCells, priorityGroupLevel: priorityGroupLevel, groupNames: groupNames, handleOnClick: function () { return handleOnClick(row); }, open: open, expandDisabled: expandDisabled }), open && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loadingPage ? ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, children: (0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {}) }) })) : ((0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { pageSize: pages === null || pages === void 0 ? void 0 : pages.pageSize, pageIndex: pages === null || pages === void 0 ? void 0 : pages.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat((groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0
169
198
  ? classes.nomarlPaginations
170
- : styledPagination(priorityGroupLevel + 1)), colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, total: (_b = details === null || details === void 0 ? void 0 : details.totalItemCount) !== null && _b !== void 0 ? _b : 0, children: ((_c = details === null || details === void 0 ? void 0 : details.items) === null || _c === void 0 ? void 0 : _c.length) === 0 ? ((0, jsx_runtime_1.jsx)(NoDataTable_1.default, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, title: t('Common.NoData') })) : ((_d = details === null || details === void 0 ? void 0 : details.items) === null || _d === void 0 ? void 0 : _d.map(function (item, i) {
199
+ : styledPagination(priorityGroupLevel + 1)), colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, total: (_b = ((details === null || details === void 0 ? void 0 : details.totalItemCount)
200
+ ? details === null || details === void 0 ? void 0 : details.totalItemCount
201
+ : details === null || details === void 0 ? void 0 : details.total)) !== null && _b !== void 0 ? _b : 0, children: ((_c = details === null || details === void 0 ? void 0 : details.items) === null || _c === void 0 ? void 0 : _c.length) === 0 ? ((0, jsx_runtime_1.jsx)(NoDataTable_1.default, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, title: t('Common.NoData') })) : ((_d = details === null || details === void 0 ? void 0 : details.items) === null || _d === void 0 ? void 0 : _d.map(function (item, i) {
171
202
  var filterBy = filterById(row === null || row === void 0 ? void 0 : row.groupKeyId, groupNames[priorityGroupLevel], filterByOfRowAdvance);
172
203
  var stt = (pages === null || pages === void 0 ? void 0 : pages.pageSize) * (pages === null || pages === void 0 ? void 0 : pages.pageIndex) +
173
204
  i +
@@ -180,12 +211,17 @@ var RowAdvanceContainer = function (_a) {
180
211
  };
181
212
  var filterById = function (id, groupName, filters) {
182
213
  switch (groupName) {
214
+ case Enum_1.HEAD_CELL_NAMES.DOMAIN_CAMPAIGN:
183
215
  case Enum_1.HEAD_CELL_NAMES.DOMAIN:
184
216
  return __assign(__assign({}, filters), { domainId: id });
185
217
  case Enum_1.HEAD_CELL_NAMES.CAMPAIGN:
186
218
  return __assign(__assign({}, filters), { campaignId: id });
219
+ case Enum_1.HEAD_CELL_NAMES.CAMPAIGN_CAMPAIGN:
220
+ return __assign(__assign({}, filters), { campaignId: id });
187
221
  case Enum_1.HEAD_CELL_NAMES.PLACE:
188
222
  return __assign(__assign({}, filters), { placeIds: [id] });
223
+ case Enum_1.HEAD_CELL_NAMES.PLACE_CAMPAIGN:
224
+ return __assign(__assign({}, filters), { placeIds: [id] });
189
225
  case Enum_1.HEAD_CELL_NAMES.DATE:
190
226
  return __assign(__assign({}, filters), { fromDate: (0, moment_1.default)(id).format('YYYY-MM-DD'), toDate: (0, moment_1.default)(id).format('YYYY-MM-DD') });
191
227
  default:
@@ -1,3 +1,3 @@
1
- import { ITableHeaderDragableProps } from "../interface";
1
+ import { ITableHeaderDragableProps } from '../interface';
2
2
  declare const TableHeaderDragable: ({ headCells, onDragOver, onDragStart, onDrop, }: ITableHeaderDragableProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default TableHeaderDragable;
@@ -11,9 +11,9 @@ var react_i18next_1 = require("react-i18next");
11
11
  var Enum_1 = require("../Enum");
12
12
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
13
13
  root: {
14
- paddingLeft: "1rem",
15
- paddingRight: "1rem",
16
- borderBottom: "1px solid #a3a3a345",
14
+ paddingLeft: '1rem',
15
+ paddingRight: '1rem',
16
+ borderBottom: '1px solid #a3a3a345',
17
17
  },
18
18
  highlight: {},
19
19
  // theme.palette.type === 'light'
@@ -26,29 +26,29 @@ var useStyles = (0, styles_1.makeStyles)(function () { return ({
26
26
  // backgroundColor: theme.palette.secondary.dark,
27
27
  // },
28
28
  title: {
29
- flex: "1 1 100%",
29
+ flex: '1 1 100%',
30
30
  },
31
31
  bold: {
32
- fontWeight: "bold",
32
+ fontWeight: 'bold',
33
33
  },
34
34
  paddingTableHeader: {},
35
35
  styledSttField: {
36
36
  paddingLeft: 0,
37
37
  paddingRight: 0,
38
- maxWidth: "50px",
39
- minWidth: "40px",
38
+ maxWidth: '50px',
39
+ minWidth: '40px',
40
40
  },
41
41
  styledCampaignField: {
42
- minWidth: "100px",
42
+ minWidth: '100px',
43
43
  },
44
44
  styledDomainField: {
45
- minWidth: "50px",
45
+ minWidth: '50px',
46
46
  },
47
47
  styledPlaceField: {
48
- minWidth: "100px",
48
+ minWidth: '100px',
49
49
  },
50
50
  styledDateField: {
51
- minWidth: "100px",
51
+ minWidth: '100px',
52
52
  },
53
53
  }); });
54
54
  var TableHeaderDragable = function (_a) {
@@ -65,10 +65,16 @@ var TableHeaderDragable = function (_a) {
65
65
  return classes.styledDomainField;
66
66
  case Enum_1.HEAD_CELL_IDS.PLACE:
67
67
  return classes.styledPlaceField;
68
+ case Enum_1.HEAD_CELL_IDS.CAMPAIGN_CAMPAIGN:
69
+ return classes.styledCampaignField;
70
+ case Enum_1.HEAD_CELL_IDS.DOMAIN_CAMPAIGN:
71
+ return classes.styledDomainField;
72
+ case Enum_1.HEAD_CELL_IDS.PLACE_CAMPAIGN:
73
+ return classes.styledPlaceField;
68
74
  case Enum_1.HEAD_CELL_IDS.DATE:
69
75
  return classes.styledDateField;
70
76
  default:
71
- return "";
77
+ return '';
72
78
  }
73
79
  };
74
80
  var generateLabelField = function (fieldId) {
@@ -76,22 +82,34 @@ var TableHeaderDragable = function (_a) {
76
82
  case Enum_1.HEAD_CELL_IDS.CONTROL:
77
83
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(UnfoldMore_1.default, {}), "#"] }));
78
84
  case Enum_1.HEAD_CELL_IDS.CAMPAIGN:
79
- return t("Schedule.Campaign");
85
+ return t('Schedule.Campaign');
86
+ case Enum_1.HEAD_CELL_IDS.CAMPAIGN_CAMPAIGN:
87
+ return t('Schedule.Campaign');
80
88
  case Enum_1.HEAD_CELL_IDS.DOMAIN:
81
- return t("Schedule.Domain");
89
+ return t('Schedule.Domain');
90
+ case Enum_1.HEAD_CELL_IDS.DOMAIN_CAMPAIGN:
91
+ return t('Schedule.Domain');
82
92
  case Enum_1.HEAD_CELL_IDS.PLACE:
83
- return t("Schedule.Place");
93
+ return t('Schedule.Place');
94
+ case Enum_1.HEAD_CELL_IDS.PLACE_CAMPAIGN:
95
+ return t('Schedule.Place');
84
96
  case Enum_1.HEAD_CELL_IDS.DATE:
85
- return t("Schedule.Date");
97
+ return t('Schedule.Date');
98
+ case Enum_1.HEAD_CELL_IDS.IMPRESSION:
99
+ return t('Common.Impression');
100
+ case Enum_1.HEAD_CELL_IDS.FINAL_CLICK:
101
+ return t('Common.FinalClick');
102
+ case Enum_1.HEAD_CELL_IDS.CTR:
103
+ return t('CTR (%)');
86
104
  case Enum_1.HEAD_CELL_IDS.RATE:
87
- return "".concat(t("Schedule.Rate"), " (%)");
105
+ return "".concat(t('Schedule.Rate'), " (%)");
88
106
  case Enum_1.HEAD_CELL_IDS.TOTAL:
89
- return "".concat(t("Schedule.Total"), " (").concat(t("Common.Impression"), ")");
107
+ return "".concat(t('Schedule.Total'), " (").concat(t('Common.Impression'), ")");
90
108
  default:
91
- return "";
109
+ return '';
92
110
  }
93
111
  };
94
- return ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { className: classes.title, id: "head-cell", children: headCells === null || headCells === void 0 ? void 0 : headCells.map(function (headCell, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { id: headCell.id, align: headCell.numeric ? "right" : "left", padding: headCell.disablePadding ? "none" : "normal", className: "".concat(classes.bold, " ").concat(classes === null || classes === void 0 ? void 0 : classes.root, " ").concat(classes.paddingTableHeader, " ").concat(styledField(headCell.id)), draggable: true, onDragOver: function (e) {
112
+ return ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { className: classes.title, id: "head-cell", children: headCells === null || headCells === void 0 ? void 0 : headCells.map(function (headCell, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { id: headCell.id, align: headCell.numeric ? 'right' : 'left', padding: headCell.disablePadding ? 'none' : 'normal', className: "".concat(classes.bold, " ").concat(classes === null || classes === void 0 ? void 0 : classes.root, " ").concat(classes.paddingTableHeader, " ").concat(styledField(headCell.id)), draggable: true, onDragOver: function (e) {
95
113
  onDragOver(e);
96
114
  }, onDragStart: function (e) {
97
115
  onDragStart(e);
@@ -9,7 +9,13 @@ export declare enum HEAD_CELL_IDS {
9
9
  TOTAL = "total",
10
10
  GROUP = "group",
11
11
  ESTIMATE = "estimate",
12
- REALITY = "reality"
12
+ REALITY = "reality",
13
+ IMPRESSION = "impression",
14
+ FINAL_CLICK = "finalClick",
15
+ CTR = "ctr",
16
+ PLACE_CAMPAIGN = "placeCampaign",
17
+ DOMAIN_CAMPAIGN = "domainCampaign",
18
+ CAMPAIGN_CAMPAIGN = "campaignCampaign"
13
19
  }
14
20
  export declare enum HEAD_CELL_NAMES {
15
21
  CONTROL = "collapse-stt",
@@ -23,7 +29,13 @@ export declare enum HEAD_CELL_NAMES {
23
29
  ESTIMATE = "estimate",
24
30
  REALITY = "reality",
25
31
  CAMPAIGN_NAME = "campaignName",
26
- PLACE_NAME = "placeName"
32
+ PLACE_NAME = "placeName",
33
+ IMPRESSION = "impression",
34
+ FINAL_CLICK = "finalClick",
35
+ CTR = "ctr",
36
+ PLACE_CAMPAIGN = "placeCampaign",
37
+ DOMAIN_CAMPAIGN = "domainCampaign",
38
+ CAMPAIGN_CAMPAIGN = "campaignCampaign"
27
39
  }
28
40
  export declare enum BACKGROUND_COLOR {
29
41
  PRIMARY = "#F4F4F4",
@@ -17,6 +17,12 @@ var HEAD_CELL_IDS;
17
17
  HEAD_CELL_IDS["GROUP"] = "group";
18
18
  HEAD_CELL_IDS["ESTIMATE"] = "estimate";
19
19
  HEAD_CELL_IDS["REALITY"] = "reality";
20
+ HEAD_CELL_IDS["IMPRESSION"] = "impression";
21
+ HEAD_CELL_IDS["FINAL_CLICK"] = "finalClick";
22
+ HEAD_CELL_IDS["CTR"] = "ctr";
23
+ HEAD_CELL_IDS["PLACE_CAMPAIGN"] = "placeCampaign";
24
+ HEAD_CELL_IDS["DOMAIN_CAMPAIGN"] = "domainCampaign";
25
+ HEAD_CELL_IDS["CAMPAIGN_CAMPAIGN"] = "campaignCampaign";
20
26
  })(HEAD_CELL_IDS || (exports.HEAD_CELL_IDS = HEAD_CELL_IDS = {}));
21
27
  var HEAD_CELL_NAMES;
22
28
  (function (HEAD_CELL_NAMES) {
@@ -32,6 +38,12 @@ var HEAD_CELL_NAMES;
32
38
  HEAD_CELL_NAMES["REALITY"] = "reality";
33
39
  HEAD_CELL_NAMES["CAMPAIGN_NAME"] = "campaignName";
34
40
  HEAD_CELL_NAMES["PLACE_NAME"] = "placeName";
41
+ HEAD_CELL_NAMES["IMPRESSION"] = "impression";
42
+ HEAD_CELL_NAMES["FINAL_CLICK"] = "finalClick";
43
+ HEAD_CELL_NAMES["CTR"] = "ctr";
44
+ HEAD_CELL_NAMES["PLACE_CAMPAIGN"] = "placeCampaign";
45
+ HEAD_CELL_NAMES["DOMAIN_CAMPAIGN"] = "domainCampaign";
46
+ HEAD_CELL_NAMES["CAMPAIGN_CAMPAIGN"] = "campaignCampaign";
35
47
  })(HEAD_CELL_NAMES || (exports.HEAD_CELL_NAMES = HEAD_CELL_NAMES = {}));
36
48
  var BACKGROUND_COLOR;
37
49
  (function (BACKGROUND_COLOR) {
@@ -44,22 +44,23 @@ var useStyles = (0, styles_1.makeStyles)(function () { return ({
44
44
  },
45
45
  }); });
46
46
  var CampaignSchedulesComponent = function (_a) {
47
- var _b, _c, _d, _e, _f;
47
+ var _b, _c, _d, _e;
48
48
  var headCells = _a.headCells, onDragOver = _a.onDragOver, onDragStart = _a.onDragStart, onDrop = _a.onDrop, scheduleGroups = _a.scheduleGroups, page = _a.page, handleChangePage = _a.handleChangePage, handleChangeRowsPerPage = _a.handleChangeRowsPerPage, filters = _a.filters, options = _a.options, serviceCampaignSchedule = _a.serviceCampaignSchedule;
49
49
  var classes = useStyles();
50
50
  var groupLength = (_c = (_b = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (cell) { return cell.grouping; })) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item.name; })) === null || _c === void 0 ? void 0 : _c.length;
51
- return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "Table-advance", children: [(0, jsx_runtime_1.jsx)(TableHeaderDragable_1.default, { headCells: headCells, onDragOver: onDragOver, onDragStart: onDragStart, onDrop: onDrop }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: (0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { total: (_d = scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount) !== null && _d !== void 0 ? _d : 0, pageSize: page === null || page === void 0 ? void 0 : page.pageSize, pageIndex: page === null || page === void 0 ? void 0 : page.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat(groupLength === 0
51
+ return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "Table-advance", children: [(0, jsx_runtime_1.jsx)(TableHeaderDragable_1.default, { headCells: headCells, onDragOver: onDragOver, onDragStart: onDragStart, onDrop: onDrop }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: (0, jsx_runtime_1.jsx)(EnhancedPagination_1.default, { total: (scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount) ? scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.totalItemCount : scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.total, pageSize: page === null || page === void 0 ? void 0 : page.pageSize, pageIndex: page === null || page === void 0 ? void 0 : page.pageIndex, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, className: "".concat(classes.pagination, " ").concat(groupLength === 0
52
52
  ? classes.nomarlPaginations
53
53
  : groupLength === 1
54
54
  ? classes.secondaryPaginations
55
- : classes.primaryPaginations), classes: undefined, colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, children: ((_e = scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.items) === null || _e === void 0 ? void 0 : _e.length) === 0 ? ((0, jsx_runtime_1.jsx)(NoDataTable_1.default, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length })) : ((_f = scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.items) === null || _f === void 0 ? void 0 : _f.map(function (row, index) {
55
+ : classes.primaryPaginations), classes: undefined, colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length, children: ((_d = scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.items) === null || _d === void 0 ? void 0 : _d.length) === 0 ? ((0, jsx_runtime_1.jsx)(NoDataTable_1.default, { colSpan: headCells === null || headCells === void 0 ? void 0 : headCells.length })) : ((_e = scheduleGroups === null || scheduleGroups === void 0 ? void 0 : scheduleGroups.items) === null || _e === void 0 ? void 0 : _e.map(function (row, index) {
56
56
  var _a;
57
57
  var groupNames = (_a = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (cell) { return cell.grouping; })) === null || _a === void 0 ? void 0 : _a.map(function (item) { return item.name; });
58
58
  var filterBy = {
59
- fromDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.startDate).format("YYYY-MM-DD"),
60
- toDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.endDate).format("YYYY-MM-DD"),
59
+ startDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.startDate).format("YYYY-MM-DD"),
60
+ endDate: (0, moment_1.default)(filters === null || filters === void 0 ? void 0 : filters.endDate).format("YYYY-MM-DD"),
61
61
  campaignId: filters === null || filters === void 0 ? void 0 : filters.campaignId,
62
62
  placeIds: filters === null || filters === void 0 ? void 0 : filters.placeIds,
63
+ domainId: filters === null || filters === void 0 ? void 0 : filters.domainId,
63
64
  };
64
65
  return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: (0, jsx_runtime_1.jsx)(RowAdvance_1.default, { headCells: headCells, row: row, priorityGroupLevel: 1, stt: (page === null || page === void 0 ? void 0 : page.pageSize) *
65
66
  (page === null || page === void 0 ? void 0 : page.pageIndex) +
@@ -1,3 +1,3 @@
1
1
  import { ICampaignScheduleContainerProps } from './interface';
2
- declare const CampaignScheduleContainer: ({ initialFilters, initialHeadCells, placeMultiSelectComponent, serviceCampaignSchedule, typeSystemAXN, }: ICampaignScheduleContainerProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const CampaignScheduleContainer: ({ initialFilters, initialHeadCells, placeMultiSelectComponent, serviceCampaignSchedule, typeSystemAXN, title, disabledCampaignFilter, }: ICampaignScheduleContainerProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default CampaignScheduleContainer;
@@ -74,7 +74,7 @@ var Enum_1 = require("./Enum");
74
74
  var component_1 = __importDefault(require("./component"));
75
75
  var CampaignScheduleContainer = function (_a) {
76
76
  var _b;
77
- var initialFilters = _a.initialFilters, initialHeadCells = _a.initialHeadCells, placeMultiSelectComponent = _a.placeMultiSelectComponent, serviceCampaignSchedule = _a.serviceCampaignSchedule, _c = _a.typeSystemAXN, typeSystemAXN = _c === void 0 ? false : _c;
77
+ var initialFilters = _a.initialFilters, initialHeadCells = _a.initialHeadCells, placeMultiSelectComponent = _a.placeMultiSelectComponent, serviceCampaignSchedule = _a.serviceCampaignSchedule, _c = _a.typeSystemAXN, typeSystemAXN = _c === void 0 ? false : _c, title = _a.title, disabledCampaignFilter = _a.disabledCampaignFilter;
78
78
  var t = (0, react_i18next_1.useTranslation)().t;
79
79
  var _d = (0, react_1.useState)(null), dragPlace = _d[0], setDragPlace = _d[1];
80
80
  var _e = (0, react_1.useState)(initialFilters), filters = _e[0], setFilters = _e[1];
@@ -126,7 +126,19 @@ var CampaignScheduleContainer = function (_a) {
126
126
  return __generator(this, function (_b) {
127
127
  switch (_b.label) {
128
128
  case 0:
129
- groupNames = (_a = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (item) { return item.grouping; })) === null || _a === void 0 ? void 0 : _a.map(function (item) { return item.name; });
129
+ groupNames = (_a = headCells === null || headCells === void 0 ? void 0 : headCells.filter(function (item) { return item.grouping; })) === null || _a === void 0 ? void 0 : _a.map(function (item) {
130
+ switch (item.name) {
131
+ case 'placeCampaign':
132
+ return 'placeId';
133
+ case 'domainCampaign':
134
+ return 'domainId';
135
+ case 'campaignCampaign':
136
+ return 'campaignId';
137
+ default:
138
+ return item.name;
139
+ }
140
+ });
141
+ debugger;
130
142
  groupBy = (groupNames === null || groupNames === void 0 ? void 0 : groupNames.length) === 0 ? null : groupNames[0];
131
143
  pageIndex = page.pageIndex;
132
144
  pageSize = page.pageSize;
@@ -181,18 +193,20 @@ var CampaignScheduleContainer = function (_a) {
181
193
  }
182
194
  };
183
195
  var getAllDomains = function () {
184
- handleLoading('domains', true);
185
- domains()
186
- .then(function (res) {
187
- setOptions(function (prevState) { return (__assign(__assign({}, prevState), { domains: lodash_1.default.keyBy(res, 'domainId') })); });
188
- })
189
- .catch(function (error) {
190
- console.log(error);
191
- // snackbar("error");
192
- })
193
- .finally(function () {
194
- handleLoading('domains', false);
195
- });
196
+ if (domains) {
197
+ handleLoading('domains', true);
198
+ domains()
199
+ .then(function (res) {
200
+ setOptions(function (prevState) { return (__assign(__assign({}, prevState), { domains: lodash_1.default.keyBy(res, 'domainId') })); });
201
+ })
202
+ .catch(function (error) {
203
+ console.log(error);
204
+ // snackbar("error");
205
+ })
206
+ .finally(function () {
207
+ handleLoading('domains', false);
208
+ });
209
+ }
196
210
  };
197
211
  var fetchCampaignCurrentRun = function () { return __awaiter(void 0, void 0, void 0, function () {
198
212
  return __generator(this, function (_a) {
@@ -303,8 +317,7 @@ var CampaignScheduleContainer = function (_a) {
303
317
  ], false), panels.slice(indexMatch + 1), true));
304
318
  setPanels(newPanels);
305
319
  }
306
- console.log('scheduleGroups :>> ', scheduleGroups);
307
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_helmet_async_1.HelmetProvider, { children: (0, jsx_runtime_1.jsx)(react_helmet_async_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: t('Schedule.TrafficDistribution') }) }) }), (0, jsx_runtime_1.jsx)(ContentHeader_1.default, { title: t('Schedule.TrafficDistribution') }), (0, jsx_runtime_1.jsxs)(material_1.Paper, { children: [(0, jsx_runtime_1.jsx)(ControlPanel_1.default, { campaigns: (_b = options === null || options === void 0 ? void 0 : options.campaigns) !== null && _b !== void 0 ? _b : {}, panels: panels, unGroupField: unGroupField, onDragStart: onDragStart, onDragOver: onDragOver, onDrop: onDrop, handleView: handleView, handleExportExcel: handleExportExcel, handleFilters: handleFilters, loadingFlags: loadingFlags, placeMultiSelectComponent: placeMultiSelectComponent }), loadingFlags.pages ||
320
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_helmet_async_1.HelmetProvider, { children: (0, jsx_runtime_1.jsx)(react_helmet_async_1.Helmet, { children: (0, jsx_runtime_1.jsx)("title", { children: title }) }) }), (0, jsx_runtime_1.jsx)(ContentHeader_1.default, { title: title }), (0, jsx_runtime_1.jsxs)(material_1.Paper, { children: [(0, jsx_runtime_1.jsx)(ControlPanel_1.default, { campaigns: (_b = options === null || options === void 0 ? void 0 : options.campaigns) !== null && _b !== void 0 ? _b : {}, panels: panels, unGroupField: unGroupField, onDragStart: onDragStart, onDragOver: onDragOver, onDrop: onDrop, handleView: handleView, handleExportExcel: handleExportExcel, handleFilters: handleFilters, loadingFlags: loadingFlags, placeMultiSelectComponent: placeMultiSelectComponent, disabledCampaignFilter: disabledCampaignFilter }), loadingFlags.pages ||
308
321
  loadingFlags.campaigns ||
309
322
  loadingFlags.places ? ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, {}) })) : ((0, jsx_runtime_1.jsx)(component_1.default, { headCells: headCells, onDragOver: onDragOver, onDragStart: onDragStart, onDrop: onDrop, scheduleGroups: scheduleGroups, page: page, handleChangePage: handleChangePage, handleChangeRowsPerPage: handleChangeRowsPerPage, options: options, filters: filters, serviceCampaignSchedule: serviceCampaignSchedule }))] })] }));
310
323
  };
@@ -4,8 +4,17 @@ export interface ICampaignScheduleContainerProps {
4
4
  initialFilters: any;
5
5
  initialHeadCells: IHeadCells[];
6
6
  placeMultiSelectComponent: (p?: any) => JSX.Element;
7
- serviceCampaignSchedule: any;
7
+ serviceCampaignSchedule: {
8
+ pagingGroupBy: any;
9
+ paging: any;
10
+ exportExcel: any;
11
+ placesPermission?: any;
12
+ campaignPlan?: any;
13
+ domains?: any;
14
+ };
8
15
  typeSystemAXN?: boolean;
16
+ title: string;
17
+ disabledCampaignFilter?: boolean;
9
18
  }
10
19
  export interface ILoadingFlags {
11
20
  campaigns?: boolean;
@@ -85,6 +94,7 @@ export interface IFilters {
85
94
  startDate: moment.Moment;
86
95
  endDate: moment.Moment;
87
96
  campaignId: string;
97
+ domainId?: string;
88
98
  placeIds: [];
89
99
  groupBy?: string;
90
100
  }
@@ -93,7 +103,7 @@ export interface ICampaignSchedulesComponentProps {
93
103
  onDragOver: (e: any) => void;
94
104
  onDragStart: (e: any) => void;
95
105
  onDrop: (e: any, i: any) => void;
96
- scheduleGroups: IPagedList_1OfCampaignScheduleGroup;
106
+ scheduleGroups: any;
97
107
  page: {
98
108
  pageSize: number;
99
109
  pageIndex: number;
@@ -173,6 +183,7 @@ export interface IControlPanelProps {
173
183
  panels: IHeadCells[];
174
184
  loadingFlags: ILoadingFlags;
175
185
  placeMultiSelectComponent: (p?: any) => JSX.Element;
186
+ disabledCampaignFilter?: boolean;
176
187
  }
177
188
  export interface IGroupPanelProps {
178
189
  unGroupField: any;
@@ -187,6 +198,7 @@ export interface IFiltersProps {
187
198
  loadingFlags: ILoadingFlags;
188
199
  placeMultiSelectComponent: (p?: any) => JSX.Element;
189
200
  handleExportExcel: () => void;
201
+ disabledCampaignFilter?: boolean;
190
202
  }
191
203
  export interface IOptions {
192
204
  campaigns: any;
@@ -43,14 +43,14 @@ var GeoFencing_1 = __importDefault(require("../../ACM-AXN/GeoFencing"));
43
43
  var i18n_1 = __importDefault(require("../../i18n"));
44
44
  var omit = require('lodash/omit');
45
45
  function DataInput(props) {
46
- var _a, _b, _c, _d, _e, _f, _g, _h;
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
47
  var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18n_1.default }).t;
48
48
  var fieldDefinition = props.fieldDefinition, onChange = props.onChange, value = props.value, error = props.error, disableHelperText = props.disableHelperText;
49
49
  var fieldName = fieldDefinition.fieldName, type = fieldDefinition.type, onValidate = fieldDefinition.onValidate, min = fieldDefinition.min, max = fieldDefinition.max, other = __rest(fieldDefinition, ["fieldName", "type", "onValidate", "min", "max"]);
50
- var _j = react_2.default.useState(t('Common.InvalidData')), errorText = _j[0], setErrorText = _j[1];
50
+ var _k = react_2.default.useState(t('Common.InvalidData')), errorText = _k[0], setErrorText = _k[1];
51
51
  var checkValidationValue = function (fieldDefinition, val) {
52
52
  if (!fieldDefinition.required &&
53
- (val === undefined || val === null || val === '' || val === []))
53
+ (val === undefined || val === null || val === '' || (Array.isArray(val) && val.length === 0)))
54
54
  return true;
55
55
  if (fieldDefinition.onValidate)
56
56
  return fieldDefinition.onValidate(val, fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.length, fieldDefinition === null || fieldDefinition === void 0 ? void 0 : fieldDefinition.pattern);
@@ -63,6 +63,8 @@ function DataInput(props) {
63
63
  else
64
64
  return (0, validation_1.notNullValid)(val);
65
65
  }
66
+ case 'multiple-hierarchical':
67
+ return (0, validation_1.arrayIsNotEmptyValid)(val);
66
68
  case 'month':
67
69
  case 'date':
68
70
  return (0, validation_1.dateValid)(val);
@@ -108,10 +110,10 @@ function DataInput(props) {
108
110
  case 'autocomplete': {
109
111
  return ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { multiple: fieldDefinition.multiple, options: fieldDefinition.options, getOptionLabel: function (option) { var _a, _b; return (_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.text) !== null && _b !== void 0 ? _b : ''; }, isOptionEqualToValue: function (option, value) {
110
112
  return (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value);
111
- }, onChange: function (e, value) {
113
+ }, disableclearable: fieldDefinition.disableClearable, onChange: function (e, value) {
112
114
  var newValue = fieldDefinition.multiple
113
- ? value.map(function (x) { return x.value; })
114
- : value.value;
115
+ ? value.map(function (x) { return x === null || x === void 0 ? void 0 : x.value; })
116
+ : value === null || value === void 0 ? void 0 : value.value;
115
117
  onChange(newValue, checkValidationValue(fieldDefinition, newValue));
116
118
  }, value: fieldDefinition.multiple
117
119
  ? fieldDefinition.options.filter(function (x) {
@@ -155,7 +157,7 @@ function DataInput(props) {
155
157
  }, readOnly: fieldDefinition.readOnly }));
156
158
  }
157
159
  case 'date-range': {
158
- var _k = other, isDayBlocked = _k.isDayBlocked, isOutsideRange = _k.isOutsideRange;
160
+ var _l = other, isDayBlocked = _l.isDayBlocked, isOutsideRange = _l.isOutsideRange;
159
161
  return ((0, jsx_runtime_1.jsx)(AWING_1.DateRangePicker, { noBorder: true, variant: "standard", textFieldProps: __assign({ fullWidth: true, style: { margin: '8px 0px' } }, omit(other, ['isDayBlocked', 'isOutsideRange'])), value: {
160
162
  startDate: (value === null || value === void 0 ? void 0 : value[0]) || null,
161
163
  endDate: (value === null || value === void 0 ? void 0 : value[1]) || null,
@@ -208,6 +210,13 @@ function DataInput(props) {
208
210
  }), { children: (_a = item.label) !== null && _a !== void 0 ? _a : item.text }), "".concat(fieldName.toString(), "-opt-").concat(index)));
209
211
  })] })));
210
212
  }
213
+ case 'multiple-hierarchical': {
214
+ return ((0, jsx_runtime_1.jsx)(AWING_1.MultipleHierarchicalChoice, __assign({}, fieldDefinition, { variant: "standard", value: value, onChange: function (value) {
215
+ onChange(value, checkValidationValue(fieldDefinition, value));
216
+ }, error: error, helperText: !disableHelperText && error
217
+ ? (_h = fieldDefinition.helperText) !== null && _h !== void 0 ? _h : t('Common.InvalidData')
218
+ : '' })));
219
+ }
211
220
  case 'geo-fencing': {
212
221
  var configs = fieldDefinition.configs, label = fieldDefinition.label, initValue = fieldDefinition.initValue, value_1 = fieldDefinition.value, limit = fieldDefinition.limit, isOnlyMap = fieldDefinition.isOnlyMap;
213
222
  return ((0, jsx_runtime_1.jsx)("div", { style: { marginTop: '16px' }, children: (0, jsx_runtime_1.jsx)(GeoFencing_1.default, { configs: configs, label: label, initValue: initValue, value: value_1, limit: limit, isOnlyMap: isOnlyMap, onChange: function (newValue) {
@@ -218,7 +227,7 @@ function DataInput(props) {
218
227
  return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ id: fieldName.toString(), name: fieldName.toString(), type: fieldDefinition.type, fullWidth: true, variant: "standard" }, other, { value: value !== null && value !== void 0 ? value : '', onChange: function (event) {
219
228
  return onChange(event.target.value, checkValidationValue(fieldDefinition, event.target.value));
220
229
  }, error: error, helperText: !disableHelperText && error
221
- ? (_h = fieldDefinition.helperText) !== null && _h !== void 0 ? _h : t('Common.InvalidData')
230
+ ? (_j = fieldDefinition.helperText) !== null && _j !== void 0 ? _j : t('Common.InvalidData')
222
231
  : '' })));
223
232
  }
224
233
  }
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseTextFieldProps } from '@mui/material/TextField';
3
- import { DataObject, MenuOption } from '../../AWING';
3
+ import { DataObject, IMultipleHierarchicalChoiceProps, MenuOption } from '../../AWING';
4
4
  import { IMainObj, IListFunctions } from '../../AWING/LogicExpression/interface';
5
5
  import { GeoFencingValue, IConfig } from '../../ACM-AXN/GeoFencing/interface';
6
6
  import { Moment } from 'moment';
@@ -44,6 +44,7 @@ export type AutocompleteFieldDefinition<T extends DataObject> = BaseFieldDefinit
44
44
  type: 'autocomplete';
45
45
  options: Array<MenuOption>;
46
46
  loading?: boolean;
47
+ disableClearable?: boolean;
47
48
  };
48
49
  export interface CheckBoxFieldDefinition<T extends DataObject> extends BaseFieldDefinition<T> {
49
50
  type: 'checkbox';
@@ -122,5 +123,8 @@ export type SelectFieldDefinition<T extends DataObject> = BaseFieldDefinition<T>
122
123
  row?: Partial<T>;
123
124
  onDisabledSelectItem?: (value: any, row?: Partial<T>) => boolean;
124
125
  };
125
- export type FieldDefinition<T extends DataObject> = AsyncAutocompleteFieldDefinition<T> | AutocompleteFieldDefinition<T> | LogicExpressionDefinition<T> | CheckBoxFieldDefinition<T> | DateTimeFieldDefinition<T> | DateRangeFieldDefinition<T> | NumberFieldDefinition<T> | RadioFieldDefinition<T> | SelectFieldDefinition<T> | TextFieldDefinition<T> | GeoFencingDefinition<T>;
126
+ export type MultipleHierarchicalDefinition<T extends DataObject> = BaseFieldDefinition<T> & Omit<IMultipleHierarchicalChoiceProps, 'defaultValue' | 'onChange'> & {
127
+ type: 'multiple-hierarchical';
128
+ };
129
+ export type FieldDefinition<T extends DataObject> = AsyncAutocompleteFieldDefinition<T> | AutocompleteFieldDefinition<T> | LogicExpressionDefinition<T> | CheckBoxFieldDefinition<T> | DateTimeFieldDefinition<T> | DateRangeFieldDefinition<T> | NumberFieldDefinition<T> | RadioFieldDefinition<T> | SelectFieldDefinition<T> | TextFieldDefinition<T> | GeoFencingDefinition<T> | MultipleHierarchicalDefinition<T>;
126
130
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.30-beta",
3
+ "version": "2.1.32-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",