@licklist/design 0.44.551-dev.8 → 0.44.551
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/date-time-button/DateContent.d.ts +2 -2
- package/dist/date-time-button/DateContent.d.ts.map +1 -1
- package/dist/date-time-button/DateContent.js +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +6 -10
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts +1 -1
- package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts.map +1 -1
- package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts +2 -4
- package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts.map +1 -1
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +2 -4
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts +1 -1
- package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +3 -4
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +4 -3
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +2 -4
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +2 -2
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts +2 -2
- package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/report/index.d.ts +0 -3
- package/dist/report/index.d.ts.map +1 -1
- package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts +1 -4
- package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts.map +1 -1
- package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.js +1 -1
- package/dist/static/switch/BooleanSwitch.d.ts +1 -3
- package/dist/static/switch/BooleanSwitch.d.ts.map +1 -1
- package/dist/static/switch/BooleanSwitch.js +1 -1
- package/dist/styles/date-time-button/DateTimeButton.scss +4 -0
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
- package/dist/styles/iframe-page/PageBody.scss +3 -3
- package/dist/styles/report/_index.scss +1 -3
- package/dist/styles/sales/BookingFilter.scss +1 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/ManualBooking.scss +4 -1
- package/dist/styles/static/Switch.scss +0 -1
- package/dist/table/TableHelperComponent.d.ts +1 -2
- package/dist/table/TableHelperComponent.d.ts.map +1 -1
- package/dist/table/TableHelperComponent.js +1 -1
- package/dist/types/iframe.d.ts +50 -2
- package/dist/types/iframe.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +4 -3
- package/src/date-time-button/DateContent.tsx +9 -27
- package/src/date-time-button/DateTimeButton.stories.tsx +14 -13
- package/src/date-time-button/DateTimeButton.tsx +26 -35
- package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +1 -1
- package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +3 -4
- package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +4 -8
- package/src/iframe/event/event-order-summary/EventOrderSummary.tsx +2 -0
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +31 -46
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +19 -12
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +66 -48
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +4 -3
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -11
- package/src/iframe/order-process/components/CalendarStepsForm/components/Category.tsx +1 -1
- package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx +1 -4
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +1 -4
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -4
- package/src/iframe/order-process/components/utils/useCategoryVerification.ts +2 -3
- package/src/iframe/payment/payment-page/PaymentPage.tsx +6 -5
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +26 -13
- package/src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx +2 -2
- package/src/product-set/control/DateAndRecurrenceInput.tsx +1 -2
- package/src/report/index.ts +0 -3
- package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx +5 -19
- package/src/static/switch/BooleanSwitch.tsx +2 -6
- package/src/styles/date-time-button/DateTimeButton.scss +4 -0
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
- package/src/styles/iframe-page/PageBody.scss +3 -3
- package/src/styles/report/_index.scss +1 -3
- package/src/styles/sales/BookingFilter.scss +1 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/ManualBooking.scss +4 -1
- package/src/styles/static/Switch.scss +0 -1
- package/src/table/TableHelperComponent.tsx +3 -18
- package/src/types/iframe.ts +58 -2
- package/dist/assets/dashboard/info.svg +0 -8
- package/dist/assets/dashboard/info.svg.js +0 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +0 -10
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +0 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +0 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts +0 -2
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts.map +0 -1
- package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts +0 -13
- package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts.map +0 -1
- package/dist/report/DataFieldsSelector/DataFieldsSelector.js +0 -1
- package/dist/report/DataFieldsSelector/index.d.ts +0 -2
- package/dist/report/DataFieldsSelector/index.d.ts.map +0 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +0 -22
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +0 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.js +0 -1
- package/dist/report/ReportRunnerModal/index.d.ts +0 -2
- package/dist/report/ReportRunnerModal/index.d.ts.map +0 -1
- package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts +0 -3
- package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts.map +0 -1
- package/dist/report/ReportTypeSelect/ReportTypeSelect.js +0 -1
- package/dist/report/ReportTypeSelect/index.d.ts +0 -2
- package/dist/report/ReportTypeSelect/index.d.ts.map +0 -1
- package/dist/styles/report/ReportEditorModal.scss +0 -98
- package/dist/styles/report/ReportRunnerModal.scss +0 -95
- package/src/assets/dashboard/info.svg +0 -8
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +0 -43
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts +0 -1
- package/src/report/DataFieldsSelector/DataFieldsSelector.tsx +0 -112
- package/src/report/DataFieldsSelector/index.ts +0 -1
- package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +0 -187
- package/src/report/ReportRunnerModal/index.ts +0 -1
- package/src/report/ReportTypeSelect/ReportTypeSelect.tsx +0 -68
- package/src/report/ReportTypeSelect/index.ts +0 -1
- package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.stories.tsx +0 -48
- package/src/styles/report/ReportEditorModal.scss +0 -98
- package/src/styles/report/ReportRunnerModal.scss +0 -95
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Report, ReportType } from "@licklist/core/dist/DataMapper/Report";
|
|
3
|
-
import { HttpQuery } from "@licklist/plugins/dist/hooks/Api/useHttpQuery";
|
|
4
|
-
import { CachedHttpQueryResponse } from "@licklist/plugins/dist/hooks/Api/useCachedHttpQuery";
|
|
5
|
-
interface ReportField {
|
|
6
|
-
id: number;
|
|
7
|
-
key: string;
|
|
8
|
-
title: string;
|
|
9
|
-
}
|
|
10
|
-
type ReportRunnerModalProps = {
|
|
11
|
-
reportId: Report["id"] | null;
|
|
12
|
-
show: boolean;
|
|
13
|
-
useShowReportFields: (reportType?: ReportType) => CachedHttpQueryResponse<ReportField[], unknown>;
|
|
14
|
-
generate?: HttpQuery<Record<string, string>[] | null>;
|
|
15
|
-
download?: HttpQuery<Blob | null>;
|
|
16
|
-
onHide: () => void;
|
|
17
|
-
onEdit: () => void;
|
|
18
|
-
reports?: Report[] | null;
|
|
19
|
-
};
|
|
20
|
-
export declare const ReportRunnerModal: ({ reportId, show, onHide, useShowReportFields, reports, generate, download, onEdit, }: ReportRunnerModalProps) => JSX.Element;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=ReportRunnerModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportRunnerModal.d.ts","sourceRoot":"","sources":["../../../src/report/ReportRunnerModal/ReportRunnerModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAO3E,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAG9F,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB,EAAE,CACnB,UAAU,CAAC,EAAE,UAAU,KACpB,uBAAuB,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC3B,CAAC;AAOF,eAAO,MAAM,iBAAiB,0FAS3B,sBAAsB,gBA8IxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=require("react"),a=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;require("../../static/loader/LoaderIndicator.js");var n=require("../../static/loader/BlockLoader.js"),o=require("react-i18next"),i=require("react-bootstrap"),l=require("react-hook-form");require("../../static/loader/ButtonLoader.js"),require("../../static/loader/SnippetLoader.js"),require("../../static/loader/PaymentLoader.js");var d=require("lodash"),s=require("@licklist/plugins/dist/utils/report");exports.ReportRunnerModal=function(e){var r,u,c=e.reportId,m=e.show,p=e.onHide,v=e.useShowReportFields,f=e.reports,g=e.generate,E=e.download,F=e.onEdit,b=o.useTranslation(["App","Design"]).t,_=null==f?void 0:f.find((function(e){return e.id===c})),q=v(null==_?void 0:_.type),y=q.data,h=void 0===y?[]:y,w=q.isLoading,k=l.useForm({mode:"onChange"}),L=k.handleSubmit,C=k.register,I=k.formState.errors,D=k.reset,j=(0,k.watch)("dateFrom"),B=L((function(e){E.execute(t.__assign(t.__assign({},e),{reportId:c,type:null==_?void 0:_.type}))})),N=L((function(e){return t.__awaiter(void 0,void 0,void 0,(function(){var r;return t.__generator(this,(function(a){switch(a.label){case 0:return[4,g.execute(t.__assign(t.__assign({},e),{reportId:c}))];case 1:return r=a.sent(),_&&r&&!g.isError?(s.openOnlineViewer({type:_.type,dateFrom:e.dateFrom,dateTo:e.dateTo,data:r}),[2]):[2]}}))}))})),R=function(){D(),p()},T=g.isLoading||E.isLoading||w;return a.createElement(i.Modal,{show:m,onHide:R,className:"report-runner-modal",centered:!0},a.createElement("header",null,a.createElement("h5",null,b("generateReport")),a.createElement(i.Button,{variant:"","data-testid":"cancel-button",onClick:R},b("cancel"))),T&&a.createElement(n.BlockLoader,null),!T&&a.createElement("div",null,a.createElement("div",{className:"report-type-label"},d.capitalize(null==_?void 0:_.type)),a.createElement("div",null,null==_?void 0:_.name),a.createElement("div",{className:"data-fields"},null==_?void 0:_.reportFieldValues.map((function(e){var t=null==h?void 0:h.find((function(t){return t.id===e.reportFieldId}));return t?a.createElement("span",{key:e.id},t.title):null}))),a.createElement(i.Button,{className:"edit-button",type:"button",variant:"","data-testid":"edit-button",onClick:F},b("Design:edit")),a.createElement("form",{noValidate:!0},a.createElement("div",{className:"controls"},a.createElement(i.Form.Group,{controlId:"from-input"},a.createElement(i.Form.Label,null,b("Design:from")),a.createElement(i.Form.Control,t.__assign({type:"datetime-local","data-testid":"date-from-input",isInvalid:!!I.dateFrom},C("dateFrom",{required:{value:!0,message:"".concat(b("Validation:fieldRequired",{attribute:b("Design:to")}))}}))),a.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(r=I.dateFrom)||void 0===r?void 0:r.message)),a.createElement(i.Form.Group,{controlId:"to-input"},a.createElement(i.Form.Label,null,b("Design:to")),a.createElement(i.Form.Control,t.__assign({type:"datetime-local","data-testid":"date-to-input",isInvalid:!!I.dateTo},C("dateTo",{required:"".concat(b("Validation:fieldRequired",{attribute:b("Design:to")})),validate:function(e){return!j||(e>j||b("toDateAfterFrom"))}}))),a.createElement(i.Form.Control.Feedback,{type:"invalid"},null===(u=I.dateTo)||void 0===u?void 0:u.message))),a.createElement("div",{className:"controls"},a.createElement(i.Button,{"data-testid":"download-button",onClick:B},b("generateDownload")),a.createElement(i.Button,{"data-testid":"view-button",onClick:N},b("generateView"))))))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/report/ReportRunnerModal/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportTypeSelect.d.ts","sourceRoot":"","sources":["../../../src/report/ReportTypeSelect/ReportTypeSelect.tsx"],"names":[],"mappings":";AAQA,eAAO,MAAM,gBAAgB,mBA2D5B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-i18next"),l=require("react-bootstrap"),n=require("react-hook-form"),i=require("lodash"),p=require("@licklist/core/dist/DataMapper/Report"),s=require("../../assets/dashboard/info.svg.js");exports.ReportTypeSelect=function(){var e,r=a.useTranslation(["App","Design"]).t,c=n.useFormContext(),u=c.register,m=c.formState.errors,d=c.setValue;return o.createElement(l.Row,null,o.createElement(l.Col,{lg:6,className:"mt-4"},o.createElement(l.Form.Group,{controlId:"typeSelect"},o.createElement(l.Form.Label,null,r("reportType")),o.createElement(l.Form.Control,t.__assign({as:"select","data-testid":"report-type-select",isInvalid:!!m.type},u("type",{required:{value:!0,message:"".concat(r("Validation:fieldRequired",{attribute:r("reportType")}))}}),{onChange:function(e){u("type").onChange(e),d("reportFieldValues",[])}}),p.reportTypes.map((function(e){return o.createElement("option",{key:e,value:e},i.capitalize(e))}))),o.createElement(l.Form.Control.Feedback,{type:"invalid"},null===(e=m.type)||void 0===e?void 0:e.message),o.createElement(l.OverlayTrigger,{trigger:"hover",overlay:o.createElement(l.Popover,{id:"report-type-popover"},o.createElement(l.Popover.Content,{className:"reports-popover"},r("reportTypeSelectInfo")))},o.createElement(s.ReactComponent,{className:"info-icon"})))))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/report/ReportTypeSelect/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
.report-builder {
|
|
2
|
-
.modal-dialog {
|
|
3
|
-
@include media-breakpoint-up(sm) {
|
|
4
|
-
max-width: 45rem;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.modal-content {
|
|
9
|
-
max-width: 45rem;
|
|
10
|
-
margin: 0 auto;
|
|
11
|
-
padding: 1.25rem 1.5rem;
|
|
12
|
-
|
|
13
|
-
header {
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
align-items: center;
|
|
17
|
-
margin-bottom: 1rem;
|
|
18
|
-
border-bottom: 2px solid #dcdcdc;
|
|
19
|
-
|
|
20
|
-
h5 {
|
|
21
|
-
margin-bottom: 0;
|
|
22
|
-
font-size: 1.125rem;
|
|
23
|
-
font-weight: 500;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
button {
|
|
27
|
-
padding-top: 0.5rem;
|
|
28
|
-
padding-bottom: 0.5rem;
|
|
29
|
-
font-size: 0.875rem;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
color: #0e8ce2;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.data-fields {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-wrap: wrap;
|
|
38
|
-
|
|
39
|
-
span {
|
|
40
|
-
position: relative;
|
|
41
|
-
font-size: 0.875rem;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
|
|
44
|
-
&:after {
|
|
45
|
-
content: "|";
|
|
46
|
-
margin: 0 0.25rem;
|
|
47
|
-
color: #dcdcdc;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:last-child:after {
|
|
51
|
-
display: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.edit-button {
|
|
57
|
-
padding: 0;
|
|
58
|
-
font-size: 0.875rem;
|
|
59
|
-
font-weight: 600;
|
|
60
|
-
color: #0e8ce2;
|
|
61
|
-
text-decoration: underline;
|
|
62
|
-
|
|
63
|
-
&:focus {
|
|
64
|
-
box-shadow: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
input {
|
|
69
|
-
border-radius: 0.5rem;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
form {
|
|
73
|
-
margin-top: 1.25rem;
|
|
74
|
-
|
|
75
|
-
.controls {
|
|
76
|
-
display: flex;
|
|
77
|
-
gap: 2rem;
|
|
78
|
-
align-items: flex-start;
|
|
79
|
-
flex-wrap: wrap;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.form-group {
|
|
83
|
-
flex: 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
button[type="submit"] {
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.loader {
|
|
92
|
-
height: 10rem;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
button[type="submit"] {
|
|
96
|
-
margin-top: 1.5rem;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.report-runner-modal {
|
|
2
|
-
.modal-dialog {
|
|
3
|
-
@include media-breakpoint-up(sm) {
|
|
4
|
-
max-width: 45rem;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.modal-content {
|
|
9
|
-
max-width: 45rem;
|
|
10
|
-
margin: 0 auto;
|
|
11
|
-
padding: 1.25rem 1.5rem;
|
|
12
|
-
|
|
13
|
-
header {
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
align-items: center;
|
|
17
|
-
margin-bottom: 1rem;
|
|
18
|
-
border-bottom: 2px solid #dcdcdc;
|
|
19
|
-
|
|
20
|
-
h5 {
|
|
21
|
-
margin-bottom: 0;
|
|
22
|
-
font-size: 1.125rem;
|
|
23
|
-
font-weight: 500;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
button {
|
|
27
|
-
padding-top: 0.5rem;
|
|
28
|
-
padding-bottom: 0.5rem;
|
|
29
|
-
font-size: 0.875rem;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
color: #0e8ce2;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.data-fields {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-wrap: wrap;
|
|
38
|
-
|
|
39
|
-
span {
|
|
40
|
-
position: relative;
|
|
41
|
-
font-size: 0.875rem;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
|
|
44
|
-
&:after {
|
|
45
|
-
content: "|";
|
|
46
|
-
margin: 0 0.25rem;
|
|
47
|
-
color: #dcdcdc;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:last-child:after {
|
|
51
|
-
display: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.edit-button {
|
|
57
|
-
padding: 0;
|
|
58
|
-
font-size: 0.875rem;
|
|
59
|
-
font-weight: 600;
|
|
60
|
-
color: #0e8ce2;
|
|
61
|
-
text-decoration: underline;
|
|
62
|
-
|
|
63
|
-
&:focus {
|
|
64
|
-
box-shadow: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
input {
|
|
69
|
-
border-radius: 0.5rem;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
form {
|
|
73
|
-
margin-top: 1.25rem;
|
|
74
|
-
|
|
75
|
-
.controls {
|
|
76
|
-
display: flex;
|
|
77
|
-
gap: 2rem;
|
|
78
|
-
align-items: flex-start;
|
|
79
|
-
flex-wrap: wrap;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.form-group {
|
|
83
|
-
flex: 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
button[type="submit"] {
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.loader {
|
|
92
|
-
height: 10rem;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<g id="Info icon">
|
|
4
|
-
<circle id="Oval" cx="10" cy="6" r="1.25" fill="#0E8CE2"/>
|
|
5
|
-
<rect id="Rectangle" x="9" y="8" width="2" height="7" fill="#0E8CE2"/>
|
|
6
|
-
<circle id="Oval_2" cx="10" cy="10" r="9" stroke="#0E8CE2" stroke-width="2"/>
|
|
7
|
-
</g>
|
|
8
|
-
</svg>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useIntl } from "react-intl";
|
|
4
|
-
import * as Config from "@licklist/core/dist/Config";
|
|
5
|
-
import { OrderItem } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
|
|
6
|
-
|
|
7
|
-
type ProductSummaryProps = {
|
|
8
|
-
name?: string;
|
|
9
|
-
productQuantityError?: string;
|
|
10
|
-
orderProduct: OrderItem;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const ProductSummary = ({
|
|
14
|
-
name,
|
|
15
|
-
productQuantityError,
|
|
16
|
-
orderProduct,
|
|
17
|
-
}: ProductSummaryProps) => {
|
|
18
|
-
const { t } = useTranslation("Design");
|
|
19
|
-
const { formatNumber } = useIntl();
|
|
20
|
-
|
|
21
|
-
const price = formatNumber(
|
|
22
|
-
(orderProduct?.deposit || orderProduct?.price || 0) *
|
|
23
|
-
orderProduct?.quantity,
|
|
24
|
-
{ style: "currency", currency: Config.Currency.GBP }
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="product">
|
|
29
|
-
<p className="m-0 name">{name ?? orderProduct?.name}</p>
|
|
30
|
-
<div className="d-flex justify-content-between">
|
|
31
|
-
<p className="m-0">
|
|
32
|
-
{t("shortQuantity")}: {orderProduct?.quantity}
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
<p className="price">{price}</p>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
{productQuantityError && (
|
|
39
|
-
<p className="iframe-event__message-error">{productQuantityError}</p>
|
|
40
|
-
)}
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ProductSummary";
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import React, { ChangeEvent } from "react";
|
|
2
|
-
import { useId } from "@react-aria/utils";
|
|
3
|
-
import { xor } from "lodash";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Form, Row, Col } from "react-bootstrap";
|
|
6
|
-
import { Controller, useFormContext } from "react-hook-form";
|
|
7
|
-
import { LoaderIndicator } from "../../static/loader/LoaderIndicator";
|
|
8
|
-
|
|
9
|
-
type ReportField = {
|
|
10
|
-
id: number;
|
|
11
|
-
key: string;
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
interface DataFieldsSelectorType {
|
|
16
|
-
reportFields: ReportField[];
|
|
17
|
-
isLoading?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const DataFieldsSelector = ({
|
|
21
|
-
reportFields,
|
|
22
|
-
isLoading,
|
|
23
|
-
}: DataFieldsSelectorType) => {
|
|
24
|
-
const { t } = useTranslation(["App", "Design"]);
|
|
25
|
-
const {
|
|
26
|
-
control,
|
|
27
|
-
formState: { errors },
|
|
28
|
-
} = useFormContext();
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<>
|
|
32
|
-
{isLoading && (
|
|
33
|
-
<div className="report-fields-loader">
|
|
34
|
-
<LoaderIndicator />
|
|
35
|
-
</div>
|
|
36
|
-
)}
|
|
37
|
-
|
|
38
|
-
{!isLoading && (
|
|
39
|
-
<>
|
|
40
|
-
<Form.Label className="mt-4">{t("dataFields")}</Form.Label>
|
|
41
|
-
<Row>
|
|
42
|
-
<Controller
|
|
43
|
-
name="reportFieldValues"
|
|
44
|
-
data-testid="report-field-values-select"
|
|
45
|
-
control={control}
|
|
46
|
-
rules={{
|
|
47
|
-
validate: (value) => {
|
|
48
|
-
if (value.length > 0) return true;
|
|
49
|
-
return t("dataFieldRequired") as string;
|
|
50
|
-
},
|
|
51
|
-
}}
|
|
52
|
-
render={({ field }) => {
|
|
53
|
-
const onChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
54
|
-
// xor adds value if not present, removes if present
|
|
55
|
-
field.onChange(xor(field.value, [Number(e.target.value)]));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<>
|
|
60
|
-
{reportFields?.map((reportField) => (
|
|
61
|
-
<Col key={reportField.id} lg={6}>
|
|
62
|
-
<Checkbox
|
|
63
|
-
value={reportField.id}
|
|
64
|
-
onChange={onChange}
|
|
65
|
-
label={reportField.title}
|
|
66
|
-
checked={field.value.includes(reportField.id)}
|
|
67
|
-
/>
|
|
68
|
-
</Col>
|
|
69
|
-
))}
|
|
70
|
-
</>
|
|
71
|
-
);
|
|
72
|
-
}}
|
|
73
|
-
/>
|
|
74
|
-
</Row>
|
|
75
|
-
|
|
76
|
-
{errors.reportFieldValues?.message && (
|
|
77
|
-
<Row>
|
|
78
|
-
<Col>
|
|
79
|
-
<div className="invalid-feedback field-values-error">
|
|
80
|
-
{errors.reportFieldValues?.message}
|
|
81
|
-
</div>
|
|
82
|
-
</Col>
|
|
83
|
-
</Row>
|
|
84
|
-
)}
|
|
85
|
-
</>
|
|
86
|
-
)}
|
|
87
|
-
</>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
type CheckboxProps = {
|
|
92
|
-
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
93
|
-
value: number;
|
|
94
|
-
label: string;
|
|
95
|
-
checked: boolean;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const Checkbox = ({ onChange, value, label, checked }: CheckboxProps) => {
|
|
99
|
-
const checkboxId = useId();
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<Form.Group controlId={checkboxId} className="custom-checkbox">
|
|
103
|
-
<Form.Check
|
|
104
|
-
label={label}
|
|
105
|
-
value={value}
|
|
106
|
-
onChange={onChange}
|
|
107
|
-
checked={checked}
|
|
108
|
-
custom
|
|
109
|
-
/>
|
|
110
|
-
</Form.Group>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DataFieldsSelector";
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { Report, ReportType } from "@licklist/core/dist/DataMapper/Report";
|
|
2
|
-
import { capitalize } from "lodash";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Button, Form, Modal } from "react-bootstrap";
|
|
5
|
-
import { useForm } from "react-hook-form";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import { openOnlineViewer } from "@licklist/plugins/dist/utils/report";
|
|
8
|
-
import { HttpQuery } from "@licklist/plugins/dist/hooks/Api/useHttpQuery";
|
|
9
|
-
import { CachedHttpQueryResponse } from "@licklist/plugins/dist/hooks/Api/useCachedHttpQuery";
|
|
10
|
-
import { BlockLoader } from "../../static/loader";
|
|
11
|
-
|
|
12
|
-
interface ReportField {
|
|
13
|
-
id: number;
|
|
14
|
-
key: string;
|
|
15
|
-
title: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type ReportRunnerModalProps = {
|
|
19
|
-
reportId: Report["id"] | null;
|
|
20
|
-
show: boolean;
|
|
21
|
-
useShowReportFields: (
|
|
22
|
-
reportType?: ReportType
|
|
23
|
-
) => CachedHttpQueryResponse<ReportField[], unknown>;
|
|
24
|
-
generate?: HttpQuery<Record<string, string>[] | null>;
|
|
25
|
-
download?: HttpQuery<Blob | null>;
|
|
26
|
-
onHide: () => void;
|
|
27
|
-
onEdit: () => void;
|
|
28
|
-
reports?: Report[] | null;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type FormValues = {
|
|
32
|
-
dateFrom: string;
|
|
33
|
-
dateTo: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const ReportRunnerModal = ({
|
|
37
|
-
reportId,
|
|
38
|
-
show,
|
|
39
|
-
onHide,
|
|
40
|
-
useShowReportFields,
|
|
41
|
-
reports,
|
|
42
|
-
generate,
|
|
43
|
-
download,
|
|
44
|
-
onEdit,
|
|
45
|
-
}: ReportRunnerModalProps) => {
|
|
46
|
-
const { t } = useTranslation(["App", "Design"]);
|
|
47
|
-
const report = reports?.find((report) => report.id === reportId);
|
|
48
|
-
|
|
49
|
-
const { data: reportFields = [], isLoading: isLoadingReportFields } =
|
|
50
|
-
useShowReportFields(report?.type);
|
|
51
|
-
|
|
52
|
-
const {
|
|
53
|
-
handleSubmit,
|
|
54
|
-
register,
|
|
55
|
-
formState: { errors },
|
|
56
|
-
reset,
|
|
57
|
-
watch,
|
|
58
|
-
} = useForm<FormValues>({ mode: "onChange" });
|
|
59
|
-
const dateFrom = watch("dateFrom");
|
|
60
|
-
|
|
61
|
-
const onDownload = handleSubmit((values) => {
|
|
62
|
-
download.execute({ ...values, reportId, type: report?.type });
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const onViewOnline = handleSubmit(async (values) => {
|
|
66
|
-
const data = await generate.execute({
|
|
67
|
-
...values,
|
|
68
|
-
reportId,
|
|
69
|
-
});
|
|
70
|
-
if (!report || !data || generate.isError) return;
|
|
71
|
-
|
|
72
|
-
openOnlineViewer({
|
|
73
|
-
type: report.type,
|
|
74
|
-
dateFrom: values.dateFrom,
|
|
75
|
-
dateTo: values.dateTo,
|
|
76
|
-
data,
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const onClose = () => {
|
|
81
|
-
reset();
|
|
82
|
-
onHide();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const isLoading =
|
|
86
|
-
generate.isLoading || download.isLoading || isLoadingReportFields;
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<Modal
|
|
90
|
-
show={show}
|
|
91
|
-
onHide={onClose}
|
|
92
|
-
className="report-runner-modal"
|
|
93
|
-
centered
|
|
94
|
-
>
|
|
95
|
-
<header>
|
|
96
|
-
<h5>{t("generateReport")}</h5>
|
|
97
|
-
<Button variant="" data-testid="cancel-button" onClick={onClose}>
|
|
98
|
-
{t("cancel")}
|
|
99
|
-
</Button>
|
|
100
|
-
</header>
|
|
101
|
-
|
|
102
|
-
{isLoading && <BlockLoader />}
|
|
103
|
-
|
|
104
|
-
{!isLoading && (
|
|
105
|
-
<div>
|
|
106
|
-
<div className="report-type-label">{capitalize(report?.type)}</div>
|
|
107
|
-
<div>{report?.name}</div>
|
|
108
|
-
<div className="data-fields">
|
|
109
|
-
{report?.reportFieldValues.map((fieldValue) => {
|
|
110
|
-
const field = reportFields?.find(
|
|
111
|
-
(field) => field.id === fieldValue.reportFieldId
|
|
112
|
-
);
|
|
113
|
-
if (!field) return null;
|
|
114
|
-
return <span key={fieldValue.id}>{field.title}</span>;
|
|
115
|
-
})}
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<Button
|
|
119
|
-
className="edit-button"
|
|
120
|
-
type="button"
|
|
121
|
-
variant=""
|
|
122
|
-
data-testid="edit-button"
|
|
123
|
-
onClick={onEdit}
|
|
124
|
-
>
|
|
125
|
-
{t("Design:edit")}
|
|
126
|
-
</Button>
|
|
127
|
-
|
|
128
|
-
<form noValidate>
|
|
129
|
-
<div className="controls">
|
|
130
|
-
<Form.Group controlId="from-input">
|
|
131
|
-
<Form.Label>{t("Design:from")}</Form.Label>
|
|
132
|
-
<Form.Control
|
|
133
|
-
type="datetime-local"
|
|
134
|
-
data-testid="date-from-input"
|
|
135
|
-
isInvalid={!!errors.dateFrom}
|
|
136
|
-
{...register("dateFrom", {
|
|
137
|
-
required: {
|
|
138
|
-
value: true,
|
|
139
|
-
message: `${t("Validation:fieldRequired", {
|
|
140
|
-
attribute: t("Design:to"),
|
|
141
|
-
})}`,
|
|
142
|
-
},
|
|
143
|
-
})}
|
|
144
|
-
/>
|
|
145
|
-
<Form.Control.Feedback type="invalid">
|
|
146
|
-
{errors.dateFrom?.message}
|
|
147
|
-
</Form.Control.Feedback>
|
|
148
|
-
</Form.Group>
|
|
149
|
-
|
|
150
|
-
<Form.Group controlId="to-input">
|
|
151
|
-
<Form.Label>{t("Design:to")}</Form.Label>
|
|
152
|
-
<Form.Control
|
|
153
|
-
type="datetime-local"
|
|
154
|
-
data-testid="date-to-input"
|
|
155
|
-
isInvalid={!!errors.dateTo}
|
|
156
|
-
{...register("dateTo", {
|
|
157
|
-
required: `${t("Validation:fieldRequired", {
|
|
158
|
-
attribute: t("Design:to"),
|
|
159
|
-
})}`,
|
|
160
|
-
validate(value) {
|
|
161
|
-
if (!dateFrom) return true;
|
|
162
|
-
if (value > dateFrom) return true;
|
|
163
|
-
return t("toDateAfterFrom") as string;
|
|
164
|
-
},
|
|
165
|
-
})}
|
|
166
|
-
/>
|
|
167
|
-
<Form.Control.Feedback type="invalid">
|
|
168
|
-
{errors.dateTo?.message}
|
|
169
|
-
</Form.Control.Feedback>
|
|
170
|
-
</Form.Group>
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
<div className="controls">
|
|
174
|
-
<Button data-testid="download-button" onClick={onDownload}>
|
|
175
|
-
{t("generateDownload")}
|
|
176
|
-
</Button>
|
|
177
|
-
|
|
178
|
-
<Button data-testid="view-button" onClick={onViewOnline}>
|
|
179
|
-
{t("generateView")}
|
|
180
|
-
</Button>
|
|
181
|
-
</div>
|
|
182
|
-
</form>
|
|
183
|
-
</div>
|
|
184
|
-
)}
|
|
185
|
-
</Modal>
|
|
186
|
-
);
|
|
187
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ReportRunnerModal";
|