@licklist/design 0.44.551-dev.1 → 0.44.551-dev.3

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 +1 @@
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,CAAE;IACvD,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,gBA0IxB,CAAC"}
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 +1 @@
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,g=e.reports,E=e.generate,f=e.download,b=e.onEdit,F=o.useTranslation(["App","Design"]).t,_=null==g?void 0:g.find((function(e){return e.id===c})),q=v(null==_?void 0:_.type),y=q.data,h=void 0===y?[]:y,k=q.isLoading,w=l.useForm({mode:"onChange"}),L=w.handleSubmit,C=w.register,I=w.formState.errors,j=w.reset,B=L((function(e){f.execute(t.__assign(t.__assign({},e),{reportId:c,type:null==_?void 0:_.type}))})),D=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,E.execute(t.__assign(t.__assign({},e),{reportId:c}))];case 1:return r=a.sent(),_&&r&&!E.isError?(s.openOnlineViewer({type:_.type,dateFrom:e.dateFrom,dateTo:e.dateTo,data:r}),[2]):[2]}}))}))})),N=function(){j(),p()},R=E.isLoading||f.isLoading||k;return a.createElement(i.Modal,{show:m,onHide:N,className:"report-runner-modal",centered:!0},a.createElement("header",null,a.createElement("h5",null,F("generateReport")),a.createElement(i.Button,{variant:"","data-testid":"cancel-button",onClick:N},F("cancel"))),R&&a.createElement(n.BlockLoader,null),!R&&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:b},F("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,F("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(F("Validation:fieldRequired",{attribute:F("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,F("Design:to")),a.createElement(i.Form.Control,t.__assign({type:"datetime-local","data-testid":"date-to-input",isInvalid:!!I.dateTo},C("dateTo",{required:{value:!0,message:"".concat(F("Validation:fieldRequired",{attribute:F("Design:to")}))}}))),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},F("generateDownload")),a.createElement(i.Button,{"data-testid":"view-button",onClick:D},F("generateView"))))))};
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 +1 @@
1
- {"version":3,"file":"ReportTypeSelect.d.ts","sourceRoot":"","sources":["../../../src/report/ReportTypeSelect/ReportTypeSelect.tsx"],"names":[],"mappings":";AAOA,eAAO,MAAM,gBAAgB,mBA2D5B,CAAC"}
1
+ {"version":3,"file":"ReportTypeSelect.d.ts","sourceRoot":"","sources":["../../../src/report/ReportTypeSelect/ReportTypeSelect.tsx"],"names":[],"mappings":";AAQA,eAAO,MAAM,gBAAgB,mBA2D5B,CAAC"}
@@ -1 +1 @@
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("@licklist/core/dist/DataMapper/Report"),p=require("../../assets/dashboard/info.svg.js");exports.ReportTypeSelect=function(){var e,r=a.useTranslation(["App","Design"]).t,s=n.useFormContext(),c=s.register,u=s.formState.errors,m=s.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:!!u.type},c("type",{required:{value:!0,message:"".concat(r("Validation:fieldRequired",{attribute:r("reportType")}))}}),{onChange:function(e){c("type").onChange(e),m("reportFieldValues",[])}}),i.reportTypes.map((function(e){return o.createElement("option",{key:e,value:e},e)}))),o.createElement(l.Form.Control.Feedback,{type:"invalid"},null===(e=u.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(p.ReactComponent,{className:"info-icon"})))))};
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"})))))};
@@ -60,9 +60,9 @@
60
60
 
61
61
  .left-block-container {
62
62
  height: calc(100svh - 12rem);
63
- scrollbar-width: none;
64
- overflow: scroll;
65
-
63
+ overflow-y: scroll;
64
+ overflow-x: hidden;
65
+ scrollbar-width: thin;
66
66
  .iframe-event-card {
67
67
  border-bottom: 2px solid $separator-color;
68
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.551-dev.1",
3
+ "version": "0.44.551-dev.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -13,7 +13,7 @@ interface ReportField {
13
13
  id: number;
14
14
  key: string;
15
15
  title: string;
16
- };
16
+ }
17
17
 
18
18
  type ReportRunnerModalProps = {
19
19
  reportId: Report["id"] | null;
@@ -21,7 +21,7 @@ type ReportRunnerModalProps = {
21
21
  useShowReportFields: (
22
22
  reportType?: ReportType
23
23
  ) => CachedHttpQueryResponse<ReportField[], unknown>;
24
- generate?: HttpQuery<Record<string, string>[] | null> ;
24
+ generate?: HttpQuery<Record<string, string>[] | null>;
25
25
  download?: HttpQuery<Blob | null>;
26
26
  onHide: () => void;
27
27
  onEdit: () => void;
@@ -54,7 +54,9 @@ export const ReportRunnerModal = ({
54
54
  register,
55
55
  formState: { errors },
56
56
  reset,
57
+ watch,
57
58
  } = useForm<FormValues>({ mode: "onChange" });
59
+ const dateFrom = watch("dateFrom");
58
60
 
59
61
  const onDownload = handleSubmit((values) => {
60
62
  download.execute({ ...values, reportId, type: report?.type });
@@ -152,12 +154,14 @@ export const ReportRunnerModal = ({
152
154
  data-testid="date-to-input"
153
155
  isInvalid={!!errors.dateTo}
154
156
  {...register("dateTo", {
155
- required: {
156
- value: true,
157
- message: `${t("Validation:fieldRequired", {
158
- attribute: t("Design:to"),
159
- })}`,
160
- },
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
+ }
161
165
  })}
162
166
  />
163
167
  <Form.Control.Feedback type="invalid">
@@ -1,4 +1,5 @@
1
1
  import { reportTypes } from "@licklist/core/dist/DataMapper/Report";
2
+ import { capitalize } from "lodash";
2
3
  import React from "react";
3
4
  import { Row, Col, Form, OverlayTrigger, Popover } from "react-bootstrap";
4
5
  import { useFormContext } from "react-hook-form";
@@ -39,7 +40,7 @@ export const ReportTypeSelect = () => {
39
40
  >
40
41
  {reportTypes.map((reportType) => (
41
42
  <option key={reportType} value={reportType}>
42
- {reportType}
43
+ {capitalize(reportType)}
43
44
  </option>
44
45
  ))}
45
46
  </Form.Control>
@@ -60,9 +60,9 @@
60
60
 
61
61
  .left-block-container {
62
62
  height: calc(100svh - 12rem);
63
- scrollbar-width: none;
64
- overflow: scroll;
65
-
63
+ overflow-y: scroll;
64
+ overflow-x: hidden;
65
+ scrollbar-width: thin;
66
66
  .iframe-event-card {
67
67
  border-bottom: 2px solid $separator-color;
68
68
  }