@bigbinary/neeto-approvals-frontend 1.1.0 → 1.2.1

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.
@@ -0,0 +1,188 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants-d561fb6c.js');
4
+ var constants$1 = require('@bigbinary/neeto-commons-frontend/constants');
5
+ var NeetoHeader = require('@bigbinary/neeto-molecules/Header');
6
+ var Container = require('@bigbinary/neeto-molecules/Container');
7
+ var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
8
+ var EditorContent = require('@bigbinary/neeto-editor/EditorContent');
9
+ var Button = require('@bigbinary/neetoui/Button');
10
+ var Callout = require('@bigbinary/neetoui/Callout');
11
+ var Textarea = require('@bigbinary/neetoui/Textarea');
12
+ var Typography = require('@bigbinary/neetoui/Typography');
13
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
14
+ var reactQuery = require('@tanstack/react-query');
15
+ var axios = require('axios');
16
+ var react = require('react');
17
+ var reactRouterDom = require('react-router-dom');
18
+ var reactI18next = require('react-i18next');
19
+ var ramda = require('ramda');
20
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
21
+ var jsxRuntime = require('react/jsx-runtime');
22
+ require('i18next');
23
+ require('@bigbinary/neeto-editor/utils');
24
+ require('yup');
25
+
26
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
27
+
28
+ var NeetoHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoHeader);
29
+ var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
30
+ var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
31
+ var EditorContent__default = /*#__PURE__*/_interopDefaultLegacy(EditorContent);
32
+ var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
33
+ var Callout__default = /*#__PURE__*/_interopDefaultLegacy(Callout);
34
+ var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
35
+ var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
36
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
37
+
38
+ var show = function show(id) {
39
+ return axios__default["default"].get("".concat(constants.BASE_URL, "/public/requests/").concat(id));
40
+ };
41
+ var accept = function accept(_ref) {
42
+ var id = _ref.id,
43
+ note = _ref.note;
44
+ return axios__default["default"].patch("".concat(constants.BASE_URL, "/public/requests/").concat(id, "/accept"), {
45
+ note: note
46
+ });
47
+ };
48
+ var decline = function decline(_ref2) {
49
+ var id = _ref2.id,
50
+ note = _ref2.note;
51
+ return axios__default["default"].patch("".concat(constants.BASE_URL, "/public/requests/").concat(id, "/decline"), {
52
+ note: note
53
+ });
54
+ };
55
+ var publicRequestsApi = {
56
+ show: show,
57
+ accept: accept,
58
+ decline: decline
59
+ };
60
+
61
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
62
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { constants._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
63
+ var useFetchPublicRequest = function useFetchPublicRequest(_ref, options) {
64
+ var requestId = _ref.requestId;
65
+ return reactQuery.useQuery(_objectSpread({
66
+ queryKey: [constants.QUERY_KEYS.SHOW_PUBLIC_REQUEST, requestId],
67
+ queryFn: function queryFn() {
68
+ return publicRequestsApi.show(requestId);
69
+ }
70
+ }, options));
71
+ };
72
+ var useAcceptPendingRequest = function useAcceptPendingRequest(options) {
73
+ return reactUtils.useMutationWithInvalidation(publicRequestsApi.accept, _objectSpread({
74
+ keysToInvalidate: [[constants.QUERY_KEYS.SHOW_PUBLIC_REQUEST], [constants.QUERY_KEYS.REQUESTS], [constants.QUERY_KEYS.VIEWS]]
75
+ }, options));
76
+ };
77
+ var useDeclinePendingRequest = function useDeclinePendingRequest(options) {
78
+ return reactUtils.useMutationWithInvalidation(publicRequestsApi.decline, _objectSpread({
79
+ keysToInvalidate: [[constants.QUERY_KEYS.SHOW_PUBLIC_REQUEST], [constants.QUERY_KEYS.REQUESTS], [constants.QUERY_KEYS.VIEWS]]
80
+ }, options));
81
+ };
82
+
83
+ var Public = function Public() {
84
+ var _t;
85
+ var _useState = react.useState(""),
86
+ _useState2 = constants._slicedToArray(_useState, 2),
87
+ note = _useState2[0],
88
+ setNote = _useState2[1];
89
+ var _useParams = reactRouterDom.useParams(),
90
+ id = _useParams.id;
91
+ var _useTranslation = reactI18next.useTranslation(),
92
+ t = _useTranslation.t;
93
+ var _useFetchPublicReques = useFetchPublicRequest({
94
+ requestId: id
95
+ }),
96
+ data = _useFetchPublicReques.data,
97
+ isLoading = _useFetchPublicReques.isLoading;
98
+ var _ref = data || {},
99
+ _ref$approvalRequest = _ref.approvalRequest,
100
+ approvalRequest = _ref$approvalRequest === void 0 ? {} : _ref$approvalRequest;
101
+ react.useEffect(function () {
102
+ var _data$approvalRequest;
103
+ if (data !== null && data !== void 0 && (_data$approvalRequest = data.approvalRequest) !== null && _data$approvalRequest !== void 0 && _data$approvalRequest.note) {
104
+ setNote(data.approvalRequest.note);
105
+ }
106
+ }, [data]);
107
+ var _useAcceptPendingRequ = useAcceptPendingRequest(),
108
+ acceptPendingRequest = _useAcceptPendingRequ.mutate,
109
+ isAccepting = _useAcceptPendingRequ.isPending;
110
+ var _useDeclinePendingReq = useDeclinePendingRequest(),
111
+ declinePendingRequest = _useDeclinePendingReq.mutate,
112
+ isDeclining = _useDeclinePendingReq.isPending;
113
+ var calloutStyle = approvalRequest.status === constants.STATUSES.approved ? "success" : "danger";
114
+ var hideTextArea = approvalRequest.status !== constants.STATUSES.pending && ramda.isEmpty(note);
115
+ if (isLoading) {
116
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
117
+ className: "h-screen items-center justify-center",
118
+ children: /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {})
119
+ });
120
+ }
121
+ return /*#__PURE__*/jsxRuntime.jsxs(Container__default["default"], {
122
+ children: [/*#__PURE__*/jsxRuntime.jsx(NeetoHeader__default["default"], {
123
+ title: t("neetoApprovals.common.approval", constants$1.PLURAL)
124
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
125
+ className: "flex h-screen w-full flex-col items-center",
126
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
127
+ className: "neeto-ui-shadow-s w-2/5 rounded border p-6",
128
+ children: approvalRequest ? /*#__PURE__*/jsxRuntime.jsxs("div", {
129
+ className: "flex w-full flex-col space-y-6",
130
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
131
+ style: "h2",
132
+ children: approvalRequest.title
133
+ }), /*#__PURE__*/jsxRuntime.jsx(EditorContent__default["default"], {
134
+ content: approvalRequest.message
135
+ }), !hideTextArea && /*#__PURE__*/jsxRuntime.jsx(Textarea__default["default"], {
136
+ label: t("neetoApprovals.common.note"),
137
+ placeholder: t("neetoApprovals.inputs.placeholders.add_", {
138
+ what: (_t = t("neetoApprovals.common.note")) === null || _t === void 0 ? void 0 : _t.toLocaleLowerCase()
139
+ }),
140
+ value: note,
141
+ disabled: approvalRequest.status !== constants.STATUSES.pending,
142
+ onChange: utils.withEventTargetValue(setNote)
143
+ }), approvalRequest.status === constants.STATUSES.pending ? /*#__PURE__*/jsxRuntime.jsxs("div", {
144
+ className: "mx-auto mt-8 flex space-x-6",
145
+ children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
146
+ label: t("neetoApprovals.buttons.approve"),
147
+ onClick: function onClick() {
148
+ return acceptPendingRequest({
149
+ id: approvalRequest.id,
150
+ note: note
151
+ });
152
+ },
153
+ loading: isAccepting
154
+ }), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
155
+ label: t("neetoApprovals.buttons.decline"),
156
+ onClick: function onClick() {
157
+ return declinePendingRequest({
158
+ id: approvalRequest.id,
159
+ note: note
160
+ });
161
+ },
162
+ style: "secondary",
163
+ loading: isDeclining
164
+ })]
165
+ }) : /*#__PURE__*/jsxRuntime.jsx(Callout__default["default"], {
166
+ style: calloutStyle,
167
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
168
+ style: "body1",
169
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
170
+ i18nKey: "neetoApprovals.typography.approvalRequest",
171
+ values: {
172
+ status: approvalRequest.status
173
+ }
174
+ })
175
+ })
176
+ })]
177
+ }) : /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
178
+ style: "h4",
179
+ className: "text-center",
180
+ children: t("neetoApprovals.common.notFound")
181
+ })
182
+ })
183
+ })]
184
+ });
185
+ };
186
+
187
+ module.exports = Public;
188
+ //# sourceMappingURL=Public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Public.js","sources":["../../app/javascript/src/apis/public/requests.js","../../app/javascript/src/hooks/reactQuery/public/requests/useApprovalRequest.js","../../app/javascript/src/components/Approvals/Public/index.jsx"],"sourcesContent":["import axios from \"axios\";\nimport { BASE_URL } from \"common/constants\";\n\nconst show = id => axios.get(`${BASE_URL}/public/requests/${id}`);\n\nconst accept = ({ id, note }) =>\n axios.patch(`${BASE_URL}/public/requests/${id}/accept`, { note });\n\nconst decline = ({ id, note }) =>\n axios.patch(`${BASE_URL}/public/requests/${id}/decline`, { note });\n\nconst publicRequestsApi = { show, accept, decline };\n\nexport default publicRequestsApi;\n","import { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport publicRequestsApi from \"apis/public/requests\";\nimport { QUERY_KEYS } from \"common/queryConstants\";\n\nconst useFetchPublicRequest = ({ requestId }, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.SHOW_PUBLIC_REQUEST, requestId],\n queryFn: () => publicRequestsApi.show(requestId),\n ...options,\n });\n\nconst useAcceptPendingRequest = options =>\n useMutationWithInvalidation(publicRequestsApi.accept, {\n keysToInvalidate: [\n [QUERY_KEYS.SHOW_PUBLIC_REQUEST],\n [QUERY_KEYS.REQUESTS],\n [QUERY_KEYS.VIEWS],\n ],\n ...options,\n });\n\nconst useDeclinePendingRequest = options =>\n useMutationWithInvalidation(publicRequestsApi.decline, {\n keysToInvalidate: [\n [QUERY_KEYS.SHOW_PUBLIC_REQUEST],\n [QUERY_KEYS.REQUESTS],\n [QUERY_KEYS.VIEWS],\n ],\n ...options,\n });\n\nexport {\n useFetchPublicRequest,\n useAcceptPendingRequest,\n useDeclinePendingRequest,\n};\n","import { PLURAL } from \"neetocommons/constants\";\nimport Header from \"neetomolecules/Header\";\nimport Container from \"neetomolecules/Container\";\nimport PageLoader from \"neetomolecules/PageLoader\";\nimport { EditorContent } from \"neetoeditor\";\n\nimport { Button, Callout, Textarea, Typography } from \"neetoui\";\n\nimport {\n useFetchPublicRequest,\n useAcceptPendingRequest,\n useDeclinePendingRequest,\n} from \"hooks/reactQuery/public/requests/useApprovalRequest\";\nimport { useEffect, useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport { STATUSES } from \"../constants\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { isEmpty } from \"ramda\";\nimport { withEventTargetValue } from \"neetocommons/utils\";\n\nconst Public = () => {\n const [note, setNote] = useState(\"\");\n\n const { id } = useParams();\n const { t } = useTranslation();\n\n const { data, isLoading } = useFetchPublicRequest({ requestId: id });\n\n const { approvalRequest = {} } = data || {};\n\n useEffect(() => {\n if (data?.approvalRequest?.note) {\n setNote(data.approvalRequest.note);\n }\n }, [data]);\n\n const { mutate: acceptPendingRequest, isPending: isAccepting } =\n useAcceptPendingRequest();\n const { mutate: declinePendingRequest, isPending: isDeclining } =\n useDeclinePendingRequest();\n\n const calloutStyle =\n approvalRequest.status === STATUSES.approved ? \"success\" : \"danger\";\n const hideTextArea =\n approvalRequest.status !== STATUSES.pending && isEmpty(note);\n\n if (isLoading) {\n return (\n <div className=\"h-screen items-center justify-center\">\n <PageLoader />\n </div>\n );\n }\n\n return (\n <Container>\n <Header title={t(\"neetoApprovals.common.approval\", PLURAL)} />\n <div className=\"flex h-screen w-full flex-col items-center\">\n <div className=\"neeto-ui-shadow-s w-2/5 rounded border p-6\">\n {approvalRequest ? (\n <div className=\"flex w-full flex-col space-y-6\">\n <Typography style=\"h2\">{approvalRequest.title}</Typography>\n <EditorContent content={approvalRequest.message} />\n {!hideTextArea && (\n <Textarea\n label={t(\"neetoApprovals.common.note\")}\n placeholder={t(\"neetoApprovals.inputs.placeholders.add_\", {\n what: t(\"neetoApprovals.common.note\")?.toLocaleLowerCase(),\n })}\n value={note}\n disabled={approvalRequest.status !== STATUSES.pending}\n onChange={withEventTargetValue(setNote)}\n />\n )}\n {approvalRequest.status === STATUSES.pending ? (\n <div className=\"mx-auto mt-8 flex space-x-6\">\n <Button\n label={t(\"neetoApprovals.buttons.approve\")}\n onClick={() =>\n acceptPendingRequest({\n id: approvalRequest.id,\n note,\n })\n }\n loading={isAccepting}\n />\n <Button\n label={t(\"neetoApprovals.buttons.decline\")}\n onClick={() =>\n declinePendingRequest({\n id: approvalRequest.id,\n note,\n })\n }\n style=\"secondary\"\n loading={isDeclining}\n />\n </div>\n ) : (\n <Callout style={calloutStyle}>\n <Typography style=\"body1\">\n <Trans\n i18nKey=\"neetoApprovals.typography.approvalRequest\"\n values={{\n status: approvalRequest.status,\n }}\n />\n </Typography>\n </Callout>\n )}\n </div>\n ) : (\n <Typography style=\"h4\" className=\"text-center\">\n {t(\"neetoApprovals.common.notFound\")}\n </Typography>\n )}\n </div>\n </div>\n </Container>\n );\n};\n\nexport default Public;\n"],"names":["show","id","axios","get","concat","BASE_URL","accept","_ref","note","patch","decline","_ref2","publicRequestsApi","useFetchPublicRequest","options","requestId","useQuery","_objectSpread","queryKey","QUERY_KEYS","SHOW_PUBLIC_REQUEST","queryFn","useAcceptPendingRequest","useMutationWithInvalidation","keysToInvalidate","REQUESTS","VIEWS","useDeclinePendingRequest","Public","_t","_useState","useState","_useState2","_slicedToArray","setNote","_useParams","useParams","_useTranslation","useTranslation","t","_useFetchPublicReques","data","isLoading","_ref$approvalRequest","approvalRequest","useEffect","_data$approvalRequest","_useAcceptPendingRequ","acceptPendingRequest","mutate","isAccepting","isPending","_useDeclinePendingReq","declinePendingRequest","isDeclining","calloutStyle","status","STATUSES","approved","hideTextArea","pending","isEmpty","_jsx","className","children","PageLoader","_jsxs","Container","Header","title","PLURAL","Typography","style","EditorContent","content","message","Textarea","label","placeholder","what","toLocaleLowerCase","value","disabled","onChange","withEventTargetValue","Button","onClick","loading","Callout","Trans","i18nKey","values"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAGC,EAAE,EAAA;AAAA,EAAA,OAAIC,yBAAK,CAACC,GAAG,CAAA,EAAA,CAAAC,MAAA,CAAIC,kBAAQ,EAAA,mBAAA,CAAA,CAAAD,MAAA,CAAoBH,EAAE,CAAE,CAAC,CAAA;AAAA,CAAA,CAAA;AAEjE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMN,EAAE,GAAAM,IAAA,CAAFN,EAAE;IAAEO,IAAI,GAAAD,IAAA,CAAJC,IAAI,CAAA;EAAA,OACxBN,yBAAK,CAACO,KAAK,CAAAL,EAAAA,CAAAA,MAAA,CAAIC,kBAAQ,EAAAD,mBAAAA,CAAAA,CAAAA,MAAA,CAAoBH,EAAE,EAAW,SAAA,CAAA,EAAA;AAAEO,IAAAA,IAAI,EAAJA,IAAAA;AAAK,GAAC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEnE,IAAME,OAAO,GAAG,SA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B,CAAA;OAEX,CAAA;AAAC,KACH,CAAC,CAAA;AAAA,GACG,CAAC,CAAA;AAEhB;;;;"}
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ require('../constants-d561fb6c.js');
4
+ require('react');
5
+ require('@bigbinary/neeto-cist');
6
+ require('@bigbinary/neeto-commons-frontend/utils');
7
+ require('@bigbinary/neeto-editor/EditorContent');
8
+ require('@bigbinary/neetoui/Label');
9
+ require('@bigbinary/neetoui/Pane');
10
+ require('@bigbinary/neetoui/Tag');
11
+ require('@bigbinary/neetoui/Textarea');
12
+ require('@bigbinary/neetoui/Typography');
13
+ require('react-i18next');
14
+ var RequestDetailsPane = require('../index-c6f5a782.js');
15
+ require('react/jsx-runtime');
16
+ require('i18next');
17
+ require('@bigbinary/neeto-editor/utils');
18
+ require('yup');
19
+ require('@tanstack/react-query');
20
+ require('@bigbinary/neeto-commons-frontend/react-utils');
21
+ require('axios');
22
+ require('@bigbinary/neetoui/Button');
23
+ require('dayjs');
24
+ require('dayjs/plugin/timezone');
25
+ require('dayjs/plugin/utc');
26
+ require('@bigbinary/neeto-commons-frontend/constants');
27
+ require('@bigbinary/neeto-commons-frontend/initializers');
28
+
29
+
30
+
31
+ module.exports = RequestDetailsPane.RequestDetailsPane;
32
+ //# sourceMappingURL=RequestDetailsPane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestDetailsPane.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Approvals = require('./Approvals.js');
6
+ var Form = require('./Form.js');
7
+ var Public = require('./Public.js');
8
+ var RequestDetailsPane = require('../index-c6f5a782.js');
9
+ require('../constants-d561fb6c.js');
10
+ require('i18next');
11
+ require('@bigbinary/neeto-editor/utils');
12
+ require('yup');
13
+ require('react');
14
+ require('@bigbinary/neeto-commons-frontend/react-utils');
15
+ require('@bigbinary/neeto-molecules/Container');
16
+ require('react-router-dom');
17
+ require('@bigbinary/neeto-commons-frontend/constants');
18
+ require('@bigbinary/neetoui/Button');
19
+ require('@bigbinary/neeto-cist');
20
+ require('@bigbinary/neeto-molecules/TableWrapper');
21
+ require('@bigbinary/neetoui/Table');
22
+ require('@bigbinary/neetoui/NoData');
23
+ require('ramda');
24
+ require('react-i18next');
25
+ require('@bigbinary/neeto-molecules/DateFormat');
26
+ require('@bigbinary/neetoui/Tag');
27
+ require('react/jsx-runtime');
28
+ require('@bigbinary/neeto-molecules/PageLoader');
29
+ require('@bigbinary/neetoui/Alert');
30
+ require('../useTemplatesApi-5d82bdca.js');
31
+ require('@tanstack/react-query');
32
+ require('@bigbinary/neeto-commons-frontend/utils');
33
+ require('axios');
34
+ require('@bigbinary/neetoui/Pane');
35
+ require('@bigbinary/neetoui/Typography');
36
+ require('@bigbinary/neetoui/formik/ActionBlock');
37
+ require('@bigbinary/neetoui/formik/Form');
38
+ require('formik');
39
+ require('@bigbinary/neeto-molecules/ToggleFeatureCard');
40
+ require('@bigbinary/neetoui/formik/Input');
41
+ require('@bigbinary/neetoui/formik/Textarea');
42
+ require('@bigbinary/neeto-editor/FormikEditor');
43
+ require('@bigbinary/neeto-editor/EditorContent');
44
+ require('@bigbinary/neetoui/Label');
45
+ require('@bigbinary/neeto-molecules/MoreDropdown');
46
+ require('@bigbinary/neeto-molecules/Header');
47
+ require('@bigbinary/neetoui/Tab');
48
+ require('@bigbinary/neeto-commons-frontend/initializers');
49
+ require('@bigbinary/neetoui/Select');
50
+ require('@bigbinary/neetoui/Callout');
51
+ require('@bigbinary/neetoui/Textarea');
52
+ require('dayjs');
53
+ require('dayjs/plugin/timezone');
54
+ require('dayjs/plugin/utc');
55
+
56
+
57
+
58
+ exports.Approvals = Approvals;
59
+ exports.Form = Form;
60
+ exports.Public = Public;
61
+ exports.RequestDetailsPane = RequestDetailsPane.RequestDetailsPane;
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,158 @@
1
+ import { t } from 'i18next';
2
+ import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
3
+ import * as yup from 'yup';
4
+
5
+ function _typeof(o) {
6
+ "@babel/helpers - typeof";
7
+
8
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
9
+ return typeof o;
10
+ } : function (o) {
11
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
12
+ }, _typeof(o);
13
+ }
14
+
15
+ function _toPrimitive(input, hint) {
16
+ if (_typeof(input) !== "object" || input === null) return input;
17
+ var prim = input[Symbol.toPrimitive];
18
+ if (prim !== undefined) {
19
+ var res = prim.call(input, hint || "default");
20
+ if (_typeof(res) !== "object") return res;
21
+ throw new TypeError("@@toPrimitive must return a primitive value.");
22
+ }
23
+ return (hint === "string" ? String : Number)(input);
24
+ }
25
+
26
+ function _toPropertyKey(arg) {
27
+ var key = _toPrimitive(arg, "string");
28
+ return _typeof(key) === "symbol" ? key : String(key);
29
+ }
30
+
31
+ function _defineProperty(obj, key, value) {
32
+ key = _toPropertyKey(key);
33
+ if (key in obj) {
34
+ Object.defineProperty(obj, key, {
35
+ value: value,
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true
39
+ });
40
+ } else {
41
+ obj[key] = value;
42
+ }
43
+ return obj;
44
+ }
45
+
46
+ function _arrayWithHoles(arr) {
47
+ if (Array.isArray(arr)) return arr;
48
+ }
49
+
50
+ function _iterableToArrayLimit(r, l) {
51
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
52
+ if (null != t) {
53
+ var e,
54
+ n,
55
+ i,
56
+ u,
57
+ a = [],
58
+ f = !0,
59
+ o = !1;
60
+ try {
61
+ if (i = (t = t.call(r)).next, 0 === l) {
62
+ if (Object(t) !== t) return;
63
+ f = !1;
64
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
65
+ } catch (r) {
66
+ o = !0, n = r;
67
+ } finally {
68
+ try {
69
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
70
+ } finally {
71
+ if (o) throw n;
72
+ }
73
+ }
74
+ return a;
75
+ }
76
+ }
77
+
78
+ function _arrayLikeToArray(arr, len) {
79
+ if (len == null || len > arr.length) len = arr.length;
80
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
81
+ return arr2;
82
+ }
83
+
84
+ function _unsupportedIterableToArray(o, minLen) {
85
+ if (!o) return;
86
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
87
+ var n = Object.prototype.toString.call(o).slice(8, -1);
88
+ if (n === "Object" && o.constructor) n = o.constructor.name;
89
+ if (n === "Map" || n === "Set") return Array.from(o);
90
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
91
+ }
92
+
93
+ function _nonIterableRest() {
94
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
95
+ }
96
+
97
+ function _slicedToArray(arr, i) {
98
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
99
+ }
100
+
101
+ var BASE_URL = "neeto_approvals";
102
+ var TEMPLATE_URL = "".concat(BASE_URL, "/templates");
103
+
104
+ var QUERY_KEYS = {
105
+ APPROVERS: "neeto-approvals-approvers",
106
+ TEMPLATES: "neeto-approvals-templates",
107
+ REQUESTS: "neeto-approvals-requests",
108
+ SHOW_TEMPLATE: "neeto-approvals-show-template",
109
+ SHOW_PUBLIC_REQUEST: "neeto-approvals-show-public-request",
110
+ VIEWS: "neeto-approvals-views"
111
+ };
112
+
113
+ var DEFAULT_FILTER_VALUES = {
114
+ searchTerm: "",
115
+ sortBy: "",
116
+ orderBy: ""
117
+ };
118
+ var SEARCH_DELAY = 750;
119
+ var STATUSES = {
120
+ approved: "approved",
121
+ rejected: "rejected",
122
+ pending: "pending",
123
+ cancelled: "cancelled"
124
+ };
125
+ var STATUS_TAG_STYLE = {
126
+ pending: "primary",
127
+ approved: "success",
128
+ rejected: "danger",
129
+ cancelled: "warning"
130
+ };
131
+ var APPROVAL_REQUEST_FORM_INITIAL_VALUES = {
132
+ message: "",
133
+ approver: {}
134
+ };
135
+ var STATUS_UPDATED_BY = {
136
+ rejected: t("neetoApprovals.common.rejectedBy"),
137
+ approved: t("neetoApprovals.common.approvedBy"),
138
+ cancelled: t("neetoApprovals.common.cancelledBy")
139
+ };
140
+ var DATA_CY_KEY = "data-cy";
141
+ var SORT_ORDER = {
142
+ ascend: "asc",
143
+ descend: "desc"
144
+ };
145
+ var REQUEST_FORM_VALIDATION_SCHEMA = yup.object().shape({
146
+ message: yup.string().test("message", t("neetoApprovals.validations.required", {
147
+ what: t("neetoApprovals.inputs.labels.message")
148
+ }), function (content) {
149
+ return !isEditorEmpty(content);
150
+ }),
151
+ approver: yup.object().required(t("neetoApprovals.validations.approver"))
152
+ });
153
+ var EVENTS = {
154
+ APPROVAL_TEMPLATE_CREATED: "approval_template_created"
155
+ };
156
+
157
+ export { APPROVAL_REQUEST_FORM_INITIAL_VALUES as A, BASE_URL as B, DEFAULT_FILTER_VALUES as D, EVENTS as E, QUERY_KEYS as Q, REQUEST_FORM_VALIDATION_SCHEMA as R, STATUS_TAG_STYLE as S, TEMPLATE_URL as T, _slicedToArray as _, SEARCH_DELAY as a, STATUSES as b, _defineProperty as c, SORT_ORDER as d, DATA_CY_KEY as e, STATUS_UPDATED_BY as f };
158
+ //# sourceMappingURL=constants-752da2ba.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-752da2ba.js","sources":["../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../app/javascript/src/common/constants.js","../app/javascript/src/common/queryConstants.js","../app/javascript/src/components/Approvals/constants.js"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export const MANAGE_MEMBER_PERMISSIONS = [\n \"members.manage_members\",\n \"agents.manage_agents\",\n];\nexport const DEFAULT_PERMISSION = true; // Until we add permission prop to all neeto apps, this is the default permission.\n\nexport const BASE_URL = \"neeto_approvals\";\nexport const TEMPLATE_URL = `${BASE_URL}/templates`;\n","export const QUERY_KEYS = {\n APPROVERS: \"neeto-approvals-approvers\",\n TEMPLATES: \"neeto-approvals-templates\",\n REQUESTS: \"neeto-approvals-requests\",\n SHOW_TEMPLATE: \"neeto-approvals-show-template\",\n SHOW_PUBLIC_REQUEST: \"neeto-approvals-show-public-request\",\n VIEWS: \"neeto-approvals-views\",\n};\n","import { t } from \"i18next\";\nimport { isEditorEmpty } from \"neetoeditor\";\nimport * as yup from \"yup\";\n\nexport const DEFAULT_RADIX = 10;\n\nexport const DEFAULT_FILTER_VALUES = {\n searchTerm: \"\",\n sortBy: \"\",\n orderBy: \"\",\n};\n\nexport const SEARCH_DELAY = 750;\n\nexport const STATUSES = {\n approved: \"approved\",\n rejected: \"rejected\",\n pending: \"pending\",\n cancelled: \"cancelled\",\n};\n\nexport const STATUS_TAG_STYLE = {\n pending: \"primary\",\n approved: \"success\",\n rejected: \"danger\",\n cancelled: \"warning\",\n};\n\nexport const APPROVAL_REQUEST_FORM_INITIAL_VALUES = {\n message: \"\",\n approver: {},\n};\n\nexport const STATUS_UPDATED_BY = {\n rejected: t(\"neetoApprovals.common.rejectedBy\"),\n approved: t(\"neetoApprovals.common.approvedBy\"),\n cancelled: t(\"neetoApprovals.common.cancelledBy\"),\n};\n\nexport const DATA_CY_KEY = \"data-cy\";\n\nexport const SORT_ORDER = { ascend: \"asc\", descend: \"desc\" };\n\nexport const REQUEST_FORM_VALIDATION_SCHEMA = yup.object().shape({\n message: yup.string().test(\n \"message\",\n t(\"neetoApprovals.validations.required\", {\n what: t(\"neetoApprovals.inputs.labels.message\"),\n }),\n content => !isEditorEmpty(content)\n ),\n approver: yup.object().required(t(\"neetoApprovals.validations.approver\")),\n});\n\nexport const EVENTS = {\n APPROVAL_TEMPLATE_CREATED: \"approval_template_created\",\n};\n"],"names":["toPrimitive","toPropertyKey","arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","BASE_URL","TEMPLATE_URL","concat","QUERY_KEYS","APPROVERS","TEMPLATES","REQUESTS","SHOW_TEMPLATE","SHOW_PUBLIC_REQUEST","VIEWS","DEFAULT_FILTER_VALUES","searchTerm","sortBy","orderBy","SEARCH_DELAY","STATUSES","approved","rejected","pending","cancelled","STATUS_TAG_STYLE","APPROVAL_REQUEST_FORM_INITIAL_VALUES","message","approver","STATUS_UPDATED_BY","t","DATA_CY_KEY","SORT_ORDER","ascend","descend","REQUEST_FORM_VALIDATION_SCHEMA","yup","object","shape","string","test","what","content","isEditorEmpty","required","EVENTS","APPROVAL_TEMPLATE_CREATED"],"mappings":";;;;AAAe,SAAS,OAAO,CAAC,CAAC,EAAE;AACnC,EAAE,yBAAyB,CAAC;AAC5B;AACA,EAAE,OAAO,OAAO,GAAG,UAAU,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE;AACpG,IAAI,OAAO,OAAO,CAAC,CAAC;AACpB,GAAG,GAAG,UAAU,CAAC,EAAE;AACnB,IAAI,OAAO,CAAC,IAAI,UAAU,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,KAAK,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;AACxH,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAChB;;ACPe,SAAS,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;AAClD,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,OAAO,KAAK,CAAC;AAClE,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,EAAE,IAAI,IAAI,KAAK,SAAS,EAAE;AAC1B,IAAI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