@licklist/design 0.78.4-stage.1 → 0.78.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.
@@ -19,7 +19,6 @@ export interface EditEventFormValues extends IntervalInputValues {
19
19
  saleDeadline: number | null;
20
20
  integrationUrl: string | null;
21
21
  recurrenceEndAt?: string;
22
- duplicatedFromId?: number | null;
23
22
  editedProductSet?: ProductSetFormValues;
24
23
  }
25
24
  export interface EditEventFormProps extends HasPermissionProp {
@@ -40,7 +39,6 @@ export interface EditEventFormProps extends HasPermissionProp {
40
39
  disabledRecurrent?: boolean;
41
40
  isCopyCreate?: boolean;
42
41
  isBooked?: boolean;
43
- duplicatedInfo?: string | null;
44
42
  }
45
- export declare const EditEventForm: ({ disabled, categories, title, hasPermission, duplicatedInfo, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, disabledRecurrent, isCopyCreate, isBooked, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const EditEventForm: ({ disabled, categories, title, hasPermission, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, disabledRecurrent, isCopyCreate, isBooked, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
46
44
  //# sourceMappingURL=EditEventForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAA;AAO7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAExF,O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,mBAAmB,KAAK,IAAI,CAAA;IACtD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAOD,eAAO,MAAM,aAAa,8RAmBvB,kBAAkB,4CAqZpB,CAAA"}
1
+ {"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAA;AAO7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAS5D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAIlF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;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} from 'react';
3
3
  import { IMAGE_TYPE_MAP, IMAGE_TYPE_IMAGE, IMAGE_TYPE_COVER } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
4
4
  import { useId } from '@react-aria/utils';
5
- import { Badge, Modal, Form, Accordion, Button } from 'react-bootstrap';
5
+ import { Modal, Form, Accordion, Button } from 'react-bootstrap';
6
6
  import { isEqual } from 'lodash';
7
7
  import { useForm, FormProvider, Controller } from 'react-hook-form';
8
8
  import { DateTime } from 'luxon';
@@ -136,7 +136,7 @@ var eventImageTypes = {
136
136
  uploadCover: IMAGE_TYPE_MAP[IMAGE_TYPE_COVER]
137
137
  };
138
138
  var EditEventForm = function(param) {
139
- var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, duplicatedInfo = param.duplicatedInfo, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate, _param_isBooked = param.isBooked, isBooked = _param_isBooked === void 0 ? false : _param_isBooked;
139
+ var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate, _param_isBooked = param.isBooked, isBooked = _param_isBooked === void 0 ? false : _param_isBooked;
140
140
  var _defaultEventValues_rrule, _defaultEventValues_rrule1, _errors_name, _errors_externalPaymentLink, _errors_integrationUrl;
141
141
  var t = useTranslation([
142
142
  'Design',
@@ -228,20 +228,7 @@ var EditEventForm = function(param) {
228
228
  onApprove: onApproveDialog,
229
229
  onDecline: onDeclineDialog
230
230
  }),
231
- duplicatedInfo ? /*#__PURE__*/ jsxs("div", {
232
- className: "d-flex justify-content-between",
233
- children: [
234
- /*#__PURE__*/ jsx("h5", {
235
- className: "edit-event-modal-title highlited-primary-title",
236
- children: title
237
- }),
238
- /*#__PURE__*/ jsx(Badge, {
239
- className: "duplicate-badge",
240
- variant: "success",
241
- children: duplicatedInfo
242
- })
243
- ]
244
- }) : /*#__PURE__*/ jsx("h5", {
231
+ /*#__PURE__*/ jsx("h5", {
245
232
  className: "edit-event-modal-title highlited-primary-title",
246
233
  children: title
247
234
  }),
@@ -2,9 +2,10 @@ export declare const SALE_DEADLINE_NAME_CATEGORY = "saleDeadlineCategory";
2
2
  export declare const SALE_DEADLINE_NAME = "saleDeadline";
3
3
  export declare const DEADLINE_NAME: readonly ["saleDeadlineCategory", "saleDeadline"];
4
4
  export type DeadLineNameType = (typeof DEADLINE_NAME)[number];
5
- export declare const SaleDeadline: ({ disabled, onlyBefore, deadLineCategory, }: {
5
+ export declare const SaleDeadline: ({ disabled, onlyBefore, isProductSet, deadLineCategory, }: {
6
6
  disabled?: boolean;
7
7
  onlyBefore?: boolean;
8
+ isProductSet?: boolean;
8
9
  deadLineCategory?: string;
9
10
  }) => import("react/jsx-runtime").JSX.Element;
10
11
  //# sourceMappingURL=SaleDeadline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaleDeadline.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,2BAA2B,yBAAyB,CAAA;AACjE,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAWhD,eAAO,MAAM,aAAa,mDAGhB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAU7D,eAAO,MAAM,YAAY,gDAItB;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,4CA8JA,CAAA"}
1
+ {"version":3,"file":"SaleDeadline.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,2BAA2B,yBAAyB,CAAA;AACjE,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAWhD,eAAO,MAAM,aAAa,mDAGhB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAU7D,eAAO,MAAM,YAAY,8DAKtB;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,4CAoKA,CAAA"}
@@ -67,7 +67,7 @@ var SALE_DEADLINES_EVENT_START_TYPES = [
67
67
  }
68
68
  ];
69
69
  var SaleDeadline = function(param) {
70
- var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_onlyBefore = param.onlyBefore, onlyBefore = _param_onlyBefore === void 0 ? false : _param_onlyBefore, deadLineCategory = param.deadLineCategory;
70
+ var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_onlyBefore = param.onlyBefore, onlyBefore = _param_onlyBefore === void 0 ? false : _param_onlyBefore, _param_isProductSet = param.isProductSet, isProductSet = _param_isProductSet === void 0 ? false : _param_isProductSet, deadLineCategory = param.deadLineCategory;
71
71
  var _errors_root;
72
72
  var t = useTranslation([
73
73
  'Design'
@@ -133,9 +133,10 @@ var SaleDeadline = function(param) {
133
133
  name: "sale-deadline",
134
134
  options: SALE_DEADLINES_EVENT_START_TYPES.map(function(param) {
135
135
  var type = param.type;
136
+ var salesDeadlineTitle = type === SALE_DEADLINE_BEFORE_TYPE && isProductSet ? 'beforeProductSet' : type;
136
137
  return {
137
138
  id: type,
138
- value: t("Design:".concat(type))
139
+ value: t("Design:".concat(salesDeadlineTitle))
139
140
  };
140
141
  }),
141
142
  value: deadlineType,
@@ -1,6 +1,5 @@
1
1
  import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission';
2
2
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper';
3
- import { EventMetadata } from '@licklist/core/dist/DataMapper/Provider/EventMetadatMapper';
4
3
  import { Sale } from '../../types/bookings';
5
4
  export interface EventCardProps extends HasPermissionProp {
6
5
  name: string;
@@ -14,11 +13,11 @@ export interface EventCardProps extends HasPermissionProp {
14
13
  onRemove: () => void;
15
14
  onOpenQrCode: () => void;
16
15
  eventStatistic?: EventStatistic | null;
17
- eventMetadata?: EventMetadata | null;
18
16
  onStatistic: () => void;
19
17
  titleId?: string;
18
+ descriptionId?: string;
20
19
  productSetName?: string;
21
20
  eventID?: string;
22
21
  }
23
- export declare function EventCard({ name, date, imageUrl, sales, onPreview, onEdit, onCopy, eventMetadata, onRemove, onOpenQrCode, hasPermission, productSetName, onStatistic, eventStatistic, titleId, eventID, }: EventCardProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function EventCard({ name, description, date, imageUrl, sales, onPreview, onEdit, onCopy, onRemove, onOpenQrCode, hasPermission, productSetName, onStatistic, eventStatistic, titleId, descriptionId, eventID, }: EventCardProps): import("react/jsx-runtime").JSX.Element;
24
23
  //# sourceMappingURL=EventCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,4DAA4D,CAAA;AAS1F,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAI3C,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IACtC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IACpC,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,aAAoB,EACpB,cAAc,EACd,WAAW,EACX,cAAc,EACd,OAAO,EACP,OAAO,GACR,EAAE,cAAc,2CAsKhB"}
1
+ {"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AASjG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQ3C,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IACtC,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,aAAoB,EACpB,cAAc,EACd,WAAW,EACX,cAAc,EACd,OAAO,EACP,aAAa,EACb,OAAO,GACR,EAAE,cAAc,2CA0JhB"}
@@ -1,11 +1,12 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
2
3
  import { Card, Badge, ProgressBar, OverlayTrigger, Popover } from 'react-bootstrap';
3
4
  import { useIntl } from 'react-intl';
4
5
  import clsx from 'clsx';
5
6
  import { useTranslation } from 'react-i18next';
6
7
  import * as Config from '@licklist/core/dist/Config';
7
8
  import { FaEye, FaQrcode, FaExternalLinkAlt, FaEdit, FaCopy, FaTrashAlt } from 'react-icons/fa';
8
- import { getStatisticInfo } from './utils.js';
9
+ import { getStatisticInfo, formatContent, EVENT_DESCRIPTION_SIZE } from './utils.js';
9
10
  import { ReactComponent as SvgChartBar } from '../../assets/dashboard/chartBar.svg.js';
10
11
 
11
12
  function _object_without_properties(source, excluded) {
@@ -36,16 +37,17 @@ function _object_without_properties_loose(source, excluded) {
36
37
  return target;
37
38
  }
38
39
  function EventCard(param) {
39
- var name = param.name, date = param.date, imageUrl = param.imageUrl, sales = param.sales, onPreview = param.onPreview, onEdit = param.onEdit, onCopy = param.onCopy, eventMetadata = param.eventMetadata, onRemove = param.onRemove, onOpenQrCode = param.onOpenQrCode, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, productSetName = param.productSetName, onStatistic = param.onStatistic, eventStatistic = param.eventStatistic, titleId = param.titleId, eventID = param.eventID;
40
+ var name = param.name, description = param.description, date = param.date, imageUrl = param.imageUrl, sales = param.sales, onPreview = param.onPreview, onEdit = param.onEdit, onCopy = param.onCopy, onRemove = param.onRemove, onOpenQrCode = param.onOpenQrCode, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, productSetName = param.productSetName, onStatistic = param.onStatistic, eventStatistic = param.eventStatistic, titleId = param.titleId; param.descriptionId; var eventID = param.eventID;
40
41
  var t = useTranslation('Design').t;
41
42
  var _useIntl = useIntl(), formatNumber = _useIntl.formatNumber, formatDate = _useIntl.formatDate;
42
43
  var _getStatisticInfo = getStatisticInfo(eventStatistic, date), totalViews = _getStatisticInfo.totalViews, statistics = _object_without_properties(_getStatisticInfo, [
43
44
  "totalViews"
44
45
  ]);
45
- var duplicatedInfo = (eventMetadata === null || eventMetadata === void 0 ? void 0 : eventMetadata.duplicatedFromId) ? t('Design:duplicatedInfo', {
46
- ID: eventMetadata === null || eventMetadata === void 0 ? void 0 : eventMetadata.duplicatedFromId,
47
- name: eventMetadata === null || eventMetadata === void 0 ? void 0 : eventMetadata.editorName
48
- }) : null;
46
+ useMemo(function() {
47
+ return formatContent(description, EVENT_DESCRIPTION_SIZE);
48
+ }, [
49
+ description
50
+ ]);
49
51
  return /*#__PURE__*/ jsxs(Card, {
50
52
  className: "d-flex flex-column event-card h-100",
51
53
  children: [
@@ -74,30 +76,18 @@ function EventCard(param) {
74
76
  }),
75
77
  /*#__PURE__*/ jsxs(Card.Body, {
76
78
  children: [
77
- /*#__PURE__*/ jsxs(Card.Title, {
79
+ /*#__PURE__*/ jsx(Card.Title, {
78
80
  id: titleId,
79
- children: [
80
- eventID ? /*#__PURE__*/ jsxs("div", {
81
- className: "d-flex",
82
- children: [
83
- name,
84
- /*#__PURE__*/ jsx("p", {
85
- className: "text-secondary ml-2",
86
- children: "(ID:".concat(eventID, ")")
87
- })
88
- ]
89
- }) : name,
90
- duplicatedInfo && /*#__PURE__*/ jsx("div", {
91
- className: "mt-2 ml-2",
92
- children: /*#__PURE__*/ jsx("div", {
93
- className: "event-card-sale",
94
- children: /*#__PURE__*/ jsx("span", {
95
- className: "event-card-sale-name text-success",
96
- children: duplicatedInfo
97
- })
81
+ children: eventID ? /*#__PURE__*/ jsxs("div", {
82
+ className: "d-flex",
83
+ children: [
84
+ name,
85
+ /*#__PURE__*/ jsx("p", {
86
+ className: "text-secondary ml-2",
87
+ children: "(ID:".concat(eventID, ")")
98
88
  })
99
- })
100
- ]
89
+ ]
90
+ }) : name
101
91
  }),
102
92
  /*#__PURE__*/ jsxs("div", {
103
93
  className: "flex-grow-1",
@@ -122,7 +112,7 @@ function EventCard(param) {
122
112
  }, key);
123
113
  })
124
114
  }),
125
- sales === null || sales === void 0 ? void 0 : sales.map(function(sale) {
115
+ sales && sales.map(function(sale) {
126
116
  return /*#__PURE__*/ jsxs("div", {
127
117
  className: "event-card-sale",
128
118
  children: [
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAKrG,UAAU,aAAc,SAAQ,SAAS;IACvC,qBAAqB,CAAC,EAAG,sBAAsB,EAAE,GAAG,IAAI,CAAC;CAC1D;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,4CAyCrB,CAAA"}
1
+ {"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAIrG,UAAU,aAAc,SAAQ,SAAS;IACvC,qBAAqB,CAAC,EAAG,sBAAsB,EAAE,GAAG,IAAI,CAAC;CAC1D;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,4CAyCrB,CAAA"}
@@ -184,7 +184,8 @@ function ProductSetControl(param) {
184
184
  })
185
185
  }),
186
186
  /*#__PURE__*/ jsx(SaleDeadline, {
187
- disabled: false
187
+ disabled: false,
188
+ isProductSet: true
188
189
  }),
189
190
  /*#__PURE__*/ jsx("div", {
190
191
  className: "divider"
@@ -46,13 +46,6 @@
46
46
  }
47
47
  }
48
48
 
49
- .duplicate-badge {
50
- height: max-content;
51
- width: 35%;
52
- white-space: break-spaces;
53
- margin-top: 3rem;
54
- }
55
-
56
49
  .highlited-primary-title {
57
50
  font-weight: 600;
58
51
  background-color: $light-blue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.78.4-stage.1",
3
+ "version": "0.78.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -42,9 +42,9 @@
42
42
  ]
43
43
  },
44
44
  "peerDependencies": {
45
- "@licklist/core": "0.34.3-stage.5",
45
+ "@licklist/core": "0.35.2",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.35.6-stage.2",
47
+ "@licklist/plugins": "0.35.10",
48
48
  "lodash": "4.17.21",
49
49
  "luxon": "3.5.0",
50
50
  "react": "17.0.2",
@@ -61,9 +61,9 @@
61
61
  "@dnd-kit/utilities": "2.0.0",
62
62
  "@fortawesome/fontawesome-svg-core": "1.2.34",
63
63
  "@fortawesome/free-solid-svg-icons": "5.15.2",
64
- "@licklist/core": "0.34.3-stage.5",
64
+ "@licklist/core": "0.35.2",
65
65
  "@licklist/eslint-config": "0.5.6",
66
- "@licklist/plugins": "0.35.6-stage.2",
66
+ "@licklist/plugins": "0.35.10",
67
67
  "@mantine/core": "6.0.22",
68
68
  "@mantine/hooks": "6.0.22",
69
69
  "@mdx-js/react": "1.6.22",
@@ -209,6 +209,5 @@
209
209
  "volta": {
210
210
  "node": "20.9.0",
211
211
  "yarn": "4.4.0"
212
- },
213
- "stableVersion": "0.71.19-stage.1"
212
+ }
214
213
  }
@@ -7,7 +7,7 @@ import {
7
7
  Image,
8
8
  } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
9
9
  import { useId } from '@react-aria/utils'
10
- import { Accordion, Badge, Button, Form, Modal } from 'react-bootstrap'
10
+ import { Accordion, Button, Form, Modal } from 'react-bootstrap'
11
11
  import { isEqual } from 'lodash'
12
12
  import { FormProvider, useForm, Controller } from 'react-hook-form'
13
13
  import { DateTime } from 'luxon'
@@ -50,7 +50,6 @@ export interface EditEventFormValues extends IntervalInputValues {
50
50
  saleDeadline: number | null
51
51
  integrationUrl: string | null
52
52
  recurrenceEndAt?: string
53
- duplicatedFromId?: number | null
54
53
  editedProductSet?: ProductSetFormValues
55
54
  }
56
55
 
@@ -72,7 +71,6 @@ export interface EditEventFormProps extends HasPermissionProp {
72
71
  disabledRecurrent?: boolean
73
72
  isCopyCreate?: boolean
74
73
  isBooked?: boolean
75
- duplicatedInfo?: string | null
76
74
  }
77
75
 
78
76
  const eventImageTypes = {
@@ -85,7 +83,6 @@ export const EditEventForm = ({
85
83
  categories,
86
84
  title,
87
85
  hasPermission = true,
88
- duplicatedInfo,
89
86
  defaultEventValues,
90
87
  serverErrors,
91
88
  onSaveEvent,
@@ -221,21 +218,9 @@ export const EditEventForm = ({
221
218
  onApprove={onApproveDialog}
222
219
  onDecline={onDeclineDialog}
223
220
  />
224
- {duplicatedInfo ? (
225
- <div className='d-flex justify-content-between'>
226
- <h5 className='edit-event-modal-title highlited-primary-title'>
227
- {title}
228
- </h5>
229
- <Badge className='duplicate-badge' variant='success'>
230
- {duplicatedInfo}
231
- </Badge>
232
- </div>
233
- ) : (
234
- <h5 className='edit-event-modal-title highlited-primary-title'>
235
- {title}
236
- </h5>
237
- )}
238
-
221
+ <h5 className='edit-event-modal-title highlited-primary-title'>
222
+ {title}
223
+ </h5>
239
224
  <FormProvider {...form}>
240
225
  <Modal.Body
241
226
  as='form'
@@ -39,10 +39,12 @@ type SaleDeadlineType =
39
39
  export const SaleDeadline = ({
40
40
  disabled = false,
41
41
  onlyBefore = false,
42
+ isProductSet = false,
42
43
  deadLineCategory,
43
44
  }: {
44
45
  disabled?: boolean
45
46
  onlyBefore?: boolean
47
+ isProductSet?: boolean
46
48
  deadLineCategory?: string
47
49
  }) => {
48
50
  const { t } = useTranslation(['Design'])
@@ -140,10 +142,16 @@ export const SaleDeadline = ({
140
142
  <Switch
141
143
  name='sale-deadline'
142
144
  options={SALE_DEADLINES_EVENT_START_TYPES.map(
143
- ({ type }) => ({
144
- id: type,
145
- value: t(`Design:${type}`),
146
- }),
145
+ ({ type }) => {
146
+ const salesDeadlineTitle =
147
+ type === SALE_DEADLINE_BEFORE_TYPE && isProductSet
148
+ ? 'beforeProductSet'
149
+ : type
150
+ return {
151
+ id: type,
152
+ value: t(`Design:${salesDeadlineTitle}`),
153
+ }
154
+ },
147
155
  )}
148
156
  value={deadlineType}
149
157
  onChange={changeValueByType}
@@ -69,13 +69,16 @@ export const Default: Story<EventCardProps> = () => {
69
69
  console.log('onStatistic')
70
70
  }}
71
71
  titleId='titleId'
72
+ descriptionId='descriptionId'
72
73
  />
73
74
  </div>
74
75
  )
75
76
  }
76
77
 
77
- export const Skeleton: Story<EventCardProps> = () => (
78
- <div style={{ maxWidth: '34rem' }}>
79
- <EventCardSkeleton />
80
- </div>
81
- )
78
+ export const Skeleton: Story<EventCardProps> = () => {
79
+ return (
80
+ <div style={{ maxWidth: '34rem' }}>
81
+ <EventCardSkeleton />
82
+ </div>
83
+ )
84
+ }
@@ -1,3 +1,4 @@
1
+ import { useMemo } from 'react'
1
2
  import {
2
3
  Badge,
3
4
  Card,
@@ -11,7 +12,6 @@ import { useTranslation } from 'react-i18next'
11
12
  import * as Config from '@licklist/core/dist/Config'
12
13
  import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
13
14
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
14
- import { EventMetadata } from '@licklist/core/dist/DataMapper/Provider/EventMetadatMapper'
15
15
  import {
16
16
  FaEye,
17
17
  FaExternalLinkAlt,
@@ -21,7 +21,11 @@ import {
21
21
  FaQrcode,
22
22
  } from 'react-icons/fa'
23
23
  import { Sale } from '../../types/bookings'
24
- import { getStatisticInfo } from './utils'
24
+ import {
25
+ EVENT_DESCRIPTION_SIZE,
26
+ formatContent,
27
+ getStatisticInfo,
28
+ } from './utils'
25
29
  import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
26
30
 
27
31
  export interface EventCardProps extends HasPermissionProp {
@@ -36,22 +40,22 @@ export interface EventCardProps extends HasPermissionProp {
36
40
  onRemove: () => void
37
41
  onOpenQrCode: () => void
38
42
  eventStatistic?: EventStatistic | null
39
- eventMetadata?: EventMetadata | null
40
43
  onStatistic: () => void
41
44
  titleId?: string
45
+ descriptionId?: string
42
46
  productSetName?: string
43
47
  eventID?: string
44
48
  }
45
49
 
46
50
  export function EventCard({
47
51
  name,
52
+ description,
48
53
  date,
49
54
  imageUrl,
50
55
  sales,
51
56
  onPreview,
52
57
  onEdit,
53
58
  onCopy,
54
- eventMetadata,
55
59
  onRemove,
56
60
  onOpenQrCode,
57
61
  hasPermission = true,
@@ -59,18 +63,16 @@ export function EventCard({
59
63
  onStatistic,
60
64
  eventStatistic,
61
65
  titleId,
66
+ descriptionId,
62
67
  eventID,
63
68
  }: EventCardProps) {
64
69
  const { t } = useTranslation('Design')
65
70
  const { formatNumber, formatDate } = useIntl()
66
71
  const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
67
-
68
- const duplicatedInfo = eventMetadata?.duplicatedFromId
69
- ? t('Design:duplicatedInfo', {
70
- ID: eventMetadata?.duplicatedFromId,
71
- name: eventMetadata?.editorName,
72
- })
73
- : null
72
+ const memoedContent = useMemo(
73
+ () => formatContent(description, EVENT_DESCRIPTION_SIZE),
74
+ [description],
75
+ )
74
76
 
75
77
  return (
76
78
  <Card className='d-flex flex-column event-card h-100'>
@@ -104,15 +106,6 @@ export function EventCard({
104
106
  ) : (
105
107
  name
106
108
  )}
107
- {duplicatedInfo && (
108
- <div className='mt-2 ml-2'>
109
- <div className='event-card-sale'>
110
- <span className='event-card-sale-name text-success'>
111
- {duplicatedInfo}
112
- </span>
113
- </div>
114
- </div>
115
- )}
116
109
  </Card.Title>
117
110
  <div className='flex-grow-1'>
118
111
  <div className='mt-2 ml-2'>
@@ -131,23 +124,23 @@ export function EventCard({
131
124
  ))}
132
125
  </div>
133
126
 
134
- {sales?.map((sale) => (
135
- <div className='event-card-sale' key={sale.id}>
136
- {/* TODO: make it an i18n message instead */}
137
- <div className='event-card-sale-text'>
138
- <span className='event-card-sale-name'>{sale.name}</span>{' '}
139
- <span className='event-card-sale-quantity'>
140
- {[sale.current, sale.max]
141
- .map((value) => formatNumber(value))
142
- .join(' / ')}
143
- </span>
127
+ {sales &&
128
+ sales.map((sale) => (
129
+ <div className='event-card-sale' key={sale.id}>
130
+ {/* TODO: make it an i18n message instead */}
131
+ <div className='event-card-sale-text'>
132
+ <span className='event-card-sale-name'>{sale.name}</span>{' '}
133
+ <span className='event-card-sale-quantity'>
134
+ {[sale.current, sale.max]
135
+ .map((value) => formatNumber(value))
136
+ .join(' / ')}
137
+ </span>
138
+ </div>
139
+ <ProgressBar now={sale.current} max={sale.max} />
144
140
  </div>
145
- <ProgressBar now={sale.current} max={sale.max} />
146
- </div>
147
- ))}
141
+ ))}
148
142
  </div>
149
143
  </Card.Body>
150
-
151
144
  <Card.Footer className='flex-column'>
152
145
  {productSetName && (
153
146
  <OverlayTrigger
@@ -177,6 +170,7 @@ export function EventCard({
177
170
  </button>
178
171
  <div className='event-card-views'>
179
172
  <FaEye />
173
+
180
174
  <span>{formatNumber(totalViews)}</span>
181
175
  </div>
182
176
  </div>
@@ -195,7 +189,6 @@ export function EventCard({
195
189
  >
196
190
  <FaExternalLinkAlt />
197
191
  </button>
198
-
199
192
  {hasPermission && (
200
193
  <>
201
194
  <button
@@ -3,7 +3,6 @@ import { useIntl } from 'react-intl'
3
3
  import * as Config from '@licklist/core/dist/Config'
4
4
  import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
5
5
  import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
6
- import { calculateTotalModifiersPrice } from '../../utils'
7
6
  import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier'
8
7
 
9
8
 
@@ -227,7 +227,7 @@ export function ProductSetControl({
227
227
  </>
228
228
  )}
229
229
 
230
- <SaleDeadline disabled={false} />
230
+ <SaleDeadline disabled={false} isProductSet />
231
231
 
232
232
  <div className='divider' />
233
233
 
@@ -46,13 +46,6 @@
46
46
  }
47
47
  }
48
48
 
49
- .duplicate-badge {
50
- height: max-content;
51
- width: 35%;
52
- white-space: break-spaces;
53
- margin-top: 3rem;
54
- }
55
-
56
49
  .highlited-primary-title {
57
50
  font-weight: 600;
58
51
  background-color: $light-blue;