@bigbinary/neeto-integrations-frontend 4.0.51 → 4.0.52
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/.ready +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js +31 -12
- package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js.map +1 -1
- package/dist/cjs/v2/index.js +3 -3
- package/dist/index.js +1 -1
- package/dist/useDisconnectionAlertsApi-BYcHEQ9K.js +23 -0
- package/dist/useDisconnectionAlertsApi-BYcHEQ9K.js.map +1 -0
- package/dist/useDisconnectionAlertsApi-OgxKnneU.js +25 -0
- package/dist/useDisconnectionAlertsApi-OgxKnneU.js.map +1 -0
- package/dist/v2/DisconnectedIntegrationsRibbon.js +31 -12
- package/dist/v2/DisconnectedIntegrationsRibbon.js.map +1 -1
- package/dist/v2/index.js +3 -3
- package/package.json +3 -3
- package/dist/useDisconnectionAlertsApi-BOc2pEP_.js +0 -42
- package/dist/useDisconnectionAlertsApi-BOc2pEP_.js.map +0 -1
- package/dist/useDisconnectionAlertsApi-CWMlpOJD.js +0 -45
- package/dist/useDisconnectionAlertsApi-CWMlpOJD.js.map +0 -1
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-10-
|
|
1
|
+
Built at 2026-10-20T12:32:17.828Z
|
package/dist/cjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var Tag = require('@bigbinary/neetoui/Tag');
|
|
|
8
8
|
var ramda = require('ramda');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var reactRouterDom = require('react-router-dom');
|
|
11
|
-
var useDisconnectionAlertsApi = require('../useDisconnectionAlertsApi-
|
|
11
|
+
var useDisconnectionAlertsApi = require('../useDisconnectionAlertsApi-OgxKnneU.js');
|
|
12
12
|
var i18next = require('i18next');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var Daily = require('./Daily.js');
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
+
var React = require('react');
|
|
3
6
|
var StickyRibbon = require('@bigbinary/neeto-molecules/v2/StickyRibbon');
|
|
4
7
|
var ramda = require('ramda');
|
|
5
8
|
var reactI18next = require('react-i18next');
|
|
6
9
|
var reactRouterDom = require('react-router-dom');
|
|
7
|
-
var useDisconnectionAlertsApi = require('../../useDisconnectionAlertsApi-
|
|
10
|
+
var useDisconnectionAlertsApi = require('../../useDisconnectionAlertsApi-OgxKnneU.js');
|
|
8
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
12
|
require('@tanstack/react-query');
|
|
10
13
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
@@ -12,6 +15,24 @@ require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
|
12
15
|
require('axios');
|
|
13
16
|
require('../../query-BF3HFRA7.js');
|
|
14
17
|
|
|
18
|
+
var getHasOnlyUPIIntegration = function getHasOnlyUPIIntegration(alerts) {
|
|
19
|
+
return alerts.length === 1 && alerts[0].serviceName === "eupi";
|
|
20
|
+
};
|
|
21
|
+
var getDisconnectionRibbonMessage = function getDisconnectionRibbonMessage(alerts) {
|
|
22
|
+
if (getHasOnlyUPIIntegration(alerts)) {
|
|
23
|
+
return {
|
|
24
|
+
i18nKey: "neetoIntegrations.disconnectionRibbon.non_permission_message",
|
|
25
|
+
defaults: "Your <integrations /> integration has been disconnected. <connectLink>Connect it now</connectLink>."
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
30
|
+
defaults: alerts.length === 1 ? "Your <integrations /> integration has been disconnected due to a permission issue. <connectLink>Connect it now</connectLink>." : "Your <integrations /> integrations have been disconnected due to a permission issue."
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _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; }
|
|
15
36
|
var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
16
37
|
var alerts = _ref.alerts,
|
|
17
38
|
integrationRouteMap = _ref.integrationRouteMap;
|
|
@@ -31,31 +52,30 @@ var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
|
31
52
|
var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_ref2) {
|
|
32
53
|
var _ref2$integrationRout = _ref2.integrationRouteMap,
|
|
33
54
|
integrationRouteMap = _ref2$integrationRout === void 0 ? {} : _ref2$integrationRout;
|
|
55
|
+
var _useState = React.useState(false),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
isClosed = _useState2[0],
|
|
58
|
+
setIsClosed = _useState2[1];
|
|
34
59
|
reactI18next.useTranslation();
|
|
35
60
|
var _useFetchDisconnectio = useDisconnectionAlertsApi.useFetchDisconnectionAlerts(),
|
|
36
61
|
_useFetchDisconnectio2 = _useFetchDisconnectio.data,
|
|
37
62
|
_useFetchDisconnectio3 = _useFetchDisconnectio2 === void 0 ? {} : _useFetchDisconnectio2,
|
|
38
63
|
_useFetchDisconnectio4 = _useFetchDisconnectio3.disconnectionAlerts,
|
|
39
64
|
alerts = _useFetchDisconnectio4 === void 0 ? [] : _useFetchDisconnectio4;
|
|
40
|
-
var _useDismissDisconnect = useDisconnectionAlertsApi.useDismissDisconnectionAlerts(),
|
|
41
|
-
dismissAlerts = _useDismissDisconnect.mutate;
|
|
42
65
|
var knownAlerts = alerts.filter(function (alert) {
|
|
43
66
|
return integrationRouteMap[alert.serviceName];
|
|
44
67
|
});
|
|
45
|
-
if (ramda.isEmpty(knownAlerts)) return null;
|
|
68
|
+
if (isClosed || ramda.isEmpty(knownAlerts)) return null;
|
|
46
69
|
var singleAlert = knownAlerts.length === 1 ? knownAlerts[0] : null;
|
|
47
70
|
var connectPath = singleAlert ? singleAlert.redirectPath || integrationRouteMap[singleAlert.serviceName].path : "";
|
|
48
71
|
return /*#__PURE__*/jsxRuntime.jsx(StickyRibbon, {
|
|
49
72
|
"data-testid": "disconnected-integrations-ribbon",
|
|
50
73
|
kind: "warning",
|
|
51
74
|
onDismiss: function onDismiss() {
|
|
52
|
-
return
|
|
53
|
-
return alert.id;
|
|
54
|
-
}));
|
|
75
|
+
return setIsClosed(true);
|
|
55
76
|
},
|
|
56
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
77
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread(_objectSpread({}, getDisconnectionRibbonMessage(knownAlerts)), {}, {
|
|
57
78
|
count: knownAlerts.length,
|
|
58
|
-
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
59
79
|
components: {
|
|
60
80
|
integrations: /*#__PURE__*/jsxRuntime.jsx(IntegrationLinks, {
|
|
61
81
|
integrationRouteMap: integrationRouteMap,
|
|
@@ -64,9 +84,8 @@ var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_re
|
|
|
64
84
|
connectLink: /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Link, {
|
|
65
85
|
to: connectPath
|
|
66
86
|
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
})
|
|
87
|
+
}
|
|
88
|
+
}))
|
|
70
89
|
});
|
|
71
90
|
};
|
|
72
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedIntegrationsRibbon.js","sources":["../../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import StickyRibbon from \"
|
|
1
|
+
{"version":3,"file":"DisconnectedIntegrationsRibbon.js","sources":["../../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/utils.js","../../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["const getHasOnlyUPIIntegration = alerts =>\n alerts.length === 1 && alerts[0].serviceName === \"eupi\";\n\nexport const getDisconnectionRibbonMessage = alerts => {\n if (getHasOnlyUPIIntegration(alerts)) {\n return {\n i18nKey: \"neetoIntegrations.disconnectionRibbon.non_permission_message\",\n defaults:\n \"Your <integrations /> integration has been disconnected. <connectLink>Connect it now</connectLink>.\",\n };\n }\n\n return {\n i18nKey: \"neetoIntegrations.disconnectionRibbon.message\",\n defaults:\n alerts.length === 1\n ? \"Your <integrations /> integration has been disconnected due to a permission issue. <connectLink>Connect it now</connectLink>.\"\n : \"Your <integrations /> integrations have been disconnected due to a permission issue.\",\n };\n};\n","import { useState } from \"react\";\n\nimport StickyRibbon from \"neetomolecules/v2/StickyRibbon\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nimport { getDisconnectionRibbonMessage } from \"./utils\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link to={linkPath}>{label}</Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n const singleAlert = knownAlerts.length === 1 ? knownAlerts[0] : null;\n const connectPath = singleAlert\n ? singleAlert.redirectPath ||\n integrationRouteMap[singleAlert.serviceName].path\n : \"\";\n\n return (\n <StickyRibbon\n data-testid=\"disconnected-integrations-ribbon\"\n kind=\"warning\"\n onDismiss={() => setIsClosed(true)}\n >\n <Trans\n {...getDisconnectionRibbonMessage(knownAlerts)}\n count={knownAlerts.length}\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n connectLink: <Link to={connectPath} />,\n }}\n />\n </StickyRibbon>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["getHasOnlyUPIIntegration","alerts","length","serviceName","getDisconnectionRibbonMessage","i18nKey","defaults","IntegrationLinks","_ref","integrationRouteMap","map","alert","index","_integrationRouteMap$","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","singleAlert","connectPath","StickyRibbon","kind","onDismiss","Trans","_objectSpread","count","components","integrations","connectLink"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAGC,MAAM,EAAA;AAAA,EAAA,OACrCA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAID,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,K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AA;MAAA,OAAQhB,WAAW,CAAC,IAAI,CAAC;IAAA,CAAC;AAAAb,IAAAA,QAAA,eAEnCC,cAAA,CAAC6B,kBAAK,EAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACA9C,6BAA6B,CAACqC,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;MAC9CU,KAAK,EAAEV,WAAW,CAACvC,MAAO;AAC1BkD,MAAAA,UAAU,EAAE;QACVC,YAAY,eACVjC,cAAA,CAACb,gBAAgB,EAAA;AACTE,UAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBR,UAAAA,MAAM,EAAEwC;AAAY,SACrB,CACF;QACDa,WAAW,eAAElC,cAAA,CAACC,mBAAI,EAAA;AAACC,UAAAA,EAAE,EAAEuB;SAAc;AACvC;KAAE,CACH;AAAC,GACU,CAAC;AAEnB;;;;"}
|
package/dist/cjs/v2/index.js
CHANGED
|
@@ -22,19 +22,19 @@ require('@bigbinary/neeto-commons-frontend/v2/react-utils');
|
|
|
22
22
|
require('react/jsx-runtime');
|
|
23
23
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
24
24
|
require('@bigbinary/neeto-commons-frontend/v2/react-utils/withT');
|
|
25
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
26
|
+
require('react');
|
|
25
27
|
require('@bigbinary/neeto-molecules/v2/StickyRibbon');
|
|
26
28
|
require('ramda');
|
|
27
29
|
require('react-i18next');
|
|
28
30
|
require('react-router-dom');
|
|
29
|
-
require('../../useDisconnectionAlertsApi-
|
|
31
|
+
require('../../useDisconnectionAlertsApi-OgxKnneU.js');
|
|
30
32
|
require('@tanstack/react-query');
|
|
31
33
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
32
34
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
33
35
|
require('axios');
|
|
34
36
|
require('i18next');
|
|
35
37
|
require('../../useDailiesApi-CEJPknLb.js');
|
|
36
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
37
|
-
require('react');
|
|
38
38
|
require('@bigbinary/neeto-commons-frontend/v2/utils');
|
|
39
39
|
require('@bigbinary/neeto-icons/misc/Daily');
|
|
40
40
|
require('@bigbinary/neeto-molecules/v2/CopyToClipboardButton');
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import Tag from '@bigbinary/neetoui/Tag';
|
|
|
6
6
|
import { isEmpty } from 'ramda';
|
|
7
7
|
import { useTranslation, Trans } from 'react-i18next';
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
|
-
import { u as useFetchDisconnectionAlerts } from './useDisconnectionAlertsApi-
|
|
9
|
+
import { u as useFetchDisconnectionAlerts } from './useDisconnectionAlertsApi-BYcHEQ9K.js';
|
|
10
10
|
import { t } from 'i18next';
|
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
export { default as Daily } from './Daily.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
3
|
+
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
import { D as DISCONNECTION_ALERTS_URL, d as disconnectionAlertsQueryKey } from './query-gurbhBqu.js';
|
|
6
|
+
|
|
7
|
+
var fetch = function fetch() {
|
|
8
|
+
return axios.get(DISCONNECTION_ALERTS_URL);
|
|
9
|
+
};
|
|
10
|
+
var disconnectionAlertsApi = {
|
|
11
|
+
fetch: fetch};
|
|
12
|
+
|
|
13
|
+
var useFetchDisconnectionAlerts = function useFetchDisconnectionAlerts() {
|
|
14
|
+
return useQuery({
|
|
15
|
+
queryKey: disconnectionAlertsQueryKey,
|
|
16
|
+
queryFn: disconnectionAlertsApi.fetch,
|
|
17
|
+
staleTime: DEFAULT_STALE_TIME,
|
|
18
|
+
refetchOnWindowFocus: "always"
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { useFetchDisconnectionAlerts as u };
|
|
23
|
+
//# sourceMappingURL=useDisconnectionAlertsApi-BYcHEQ9K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisconnectionAlertsApi-BYcHEQ9K.js","sources":["../app/javascript/src/apis/disconnection_alerts.js","../app/javascript/src/hooks/reactQuery/useDisconnectionAlertsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { DISCONNECTION_ALERTS_URL } from \"src/constants/urls\";\n\nconst fetch = () => axios.get(DISCONNECTION_ALERTS_URL);\n\nconst destroyAll = ids =>\n axios.delete(`${DISCONNECTION_ALERTS_URL}/destroy_all`, { params: { ids } });\n\nconst disconnectionAlertsApi = { fetch, destroyAll };\n\nexport default disconnectionAlertsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport disconnectionAlertsApi from \"apis/disconnection_alerts\";\nimport { disconnectionAlertsQueryKey } from \"src/constants/query\";\n\nexport const useFetchDisconnectionAlerts = () =>\n useQuery({\n queryKey: disconnectionAlertsQueryKey,\n queryFn: disconnectionAlertsApi.fetch,\n staleTime: DEFAULT_STALE_TIME,\n refetchOnWindowFocus: \"always\",\n });\n\nexport const useDismissDisconnectionAlerts = ({ onSuccess } = {}) =>\n useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {\n keysToInvalidate: [disconnectionAlertsQueryKey],\n onSuccess: () => onSuccess?.(),\n });\n"],"names":["fetch","axios","get","DISCONNECTION_ALERTS_URL","disconnectionAlertsApi","useFetchDisconnectionAlerts","useQuery","queryKey","disconnectionAlertsQueryKey","queryFn","staleTime","DEFAULT_STALE_TIME","refetchOnWindowFocus"],"mappings":";;;;;;AAIA,IAAMA,KAAK,GAAG,SAARA,KAAKA,GAAA;AAAA,EAAA,OAASC,KAAK,CAACC,GAAG,CAACC,wBAAwB,CAAC;AAAA,CAAA;AAKvD,IAAMC,sBAAsB,GAAG;AAAEJ,EAAAA,KAAK,EAALA,KAAkB,CAAC;;ACF7C,IAAMK,2BAA2B,GAAG,SAA9BA,2BAA2BA,GAAA;AAAA,EAAA,OACtCC,QAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAEC,2BAA2B;IACrCC,OAAO,EAAEL,sBAAsB,CAACJ,KAAK;AACrCU,IAAAA,SAAS,EAAEC,kBAAkB;AAC7BC,IAAAA,oBAAoB,EAAE;AACxB,GAAC,CAAC;AAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactQuery = require('@tanstack/react-query');
|
|
4
|
+
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
5
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
6
|
+
var axios = require('axios');
|
|
7
|
+
var query = require('./query-BF3HFRA7.js');
|
|
8
|
+
|
|
9
|
+
var fetch = function fetch() {
|
|
10
|
+
return axios.get(query.DISCONNECTION_ALERTS_URL);
|
|
11
|
+
};
|
|
12
|
+
var disconnectionAlertsApi = {
|
|
13
|
+
fetch: fetch};
|
|
14
|
+
|
|
15
|
+
var useFetchDisconnectionAlerts = function useFetchDisconnectionAlerts() {
|
|
16
|
+
return reactQuery.useQuery({
|
|
17
|
+
queryKey: query.disconnectionAlertsQueryKey,
|
|
18
|
+
queryFn: disconnectionAlertsApi.fetch,
|
|
19
|
+
staleTime: constants.DEFAULT_STALE_TIME,
|
|
20
|
+
refetchOnWindowFocus: "always"
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.useFetchDisconnectionAlerts = useFetchDisconnectionAlerts;
|
|
25
|
+
//# sourceMappingURL=useDisconnectionAlertsApi-OgxKnneU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisconnectionAlertsApi-OgxKnneU.js","sources":["../app/javascript/src/apis/disconnection_alerts.js","../app/javascript/src/hooks/reactQuery/useDisconnectionAlertsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { DISCONNECTION_ALERTS_URL } from \"src/constants/urls\";\n\nconst fetch = () => axios.get(DISCONNECTION_ALERTS_URL);\n\nconst destroyAll = ids =>\n axios.delete(`${DISCONNECTION_ALERTS_URL}/destroy_all`, { params: { ids } });\n\nconst disconnectionAlertsApi = { fetch, destroyAll };\n\nexport default disconnectionAlertsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport disconnectionAlertsApi from \"apis/disconnection_alerts\";\nimport { disconnectionAlertsQueryKey } from \"src/constants/query\";\n\nexport const useFetchDisconnectionAlerts = () =>\n useQuery({\n queryKey: disconnectionAlertsQueryKey,\n queryFn: disconnectionAlertsApi.fetch,\n staleTime: DEFAULT_STALE_TIME,\n refetchOnWindowFocus: \"always\",\n });\n\nexport const useDismissDisconnectionAlerts = ({ onSuccess } = {}) =>\n useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {\n keysToInvalidate: [disconnectionAlertsQueryKey],\n onSuccess: () => onSuccess?.(),\n });\n"],"names":["fetch","axios","get","DISCONNECTION_ALERTS_URL","disconnectionAlertsApi","useFetchDisconnectionAlerts","useQuery","queryKey","disconnectionAlertsQueryKey","queryFn","staleTime","DEFAULT_STALE_TIME","refetchOnWindowFocus"],"mappings":";;;;;;;;AAIA,IAAMA,KAAK,GAAG,SAARA,KAAKA,GAAA;AAAA,EAAA,OAASC,KAAK,CAACC,GAAG,CAACC,8BAAwB,CAAC;AAAA,CAAA;AAKvD,IAAMC,sBAAsB,GAAG;AAAEJ,EAAAA,KAAK,EAALA,KAAkB,CAAC;;ACF7C,IAAMK,2BAA2B,GAAG,SAA9BA,2BAA2BA,GAAA;AAAA,EAAA,OACtCC,mBAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAEC,iCAA2B;IACrCC,OAAO,EAAEL,sBAAsB,CAACJ,KAAK;AACrCU,IAAAA,SAAS,EAAEC,4BAAkB;AAC7BC,IAAAA,oBAAoB,EAAE;AACxB,GAAC,CAAC;AAAA;;;;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import { useState } from 'react';
|
|
1
4
|
import StickyRibbon from '@bigbinary/neeto-molecules/v2/StickyRibbon';
|
|
2
5
|
import { isEmpty } from 'ramda';
|
|
3
6
|
import { useTranslation, Trans } from 'react-i18next';
|
|
4
7
|
import { Link } from 'react-router-dom';
|
|
5
|
-
import { u as useFetchDisconnectionAlerts
|
|
8
|
+
import { u as useFetchDisconnectionAlerts } from '../useDisconnectionAlertsApi-BYcHEQ9K.js';
|
|
6
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
10
|
import '@tanstack/react-query';
|
|
8
11
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
@@ -10,6 +13,24 @@ import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
|
10
13
|
import 'axios';
|
|
11
14
|
import '../query-gurbhBqu.js';
|
|
12
15
|
|
|
16
|
+
var getHasOnlyUPIIntegration = function getHasOnlyUPIIntegration(alerts) {
|
|
17
|
+
return alerts.length === 1 && alerts[0].serviceName === "eupi";
|
|
18
|
+
};
|
|
19
|
+
var getDisconnectionRibbonMessage = function getDisconnectionRibbonMessage(alerts) {
|
|
20
|
+
if (getHasOnlyUPIIntegration(alerts)) {
|
|
21
|
+
return {
|
|
22
|
+
i18nKey: "neetoIntegrations.disconnectionRibbon.non_permission_message",
|
|
23
|
+
defaults: "Your <integrations /> integration has been disconnected. <connectLink>Connect it now</connectLink>."
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
28
|
+
defaults: alerts.length === 1 ? "Your <integrations /> integration has been disconnected due to a permission issue. <connectLink>Connect it now</connectLink>." : "Your <integrations /> integrations have been disconnected due to a permission issue."
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _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; }
|
|
13
34
|
var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
14
35
|
var alerts = _ref.alerts,
|
|
15
36
|
integrationRouteMap = _ref.integrationRouteMap;
|
|
@@ -29,31 +50,30 @@ var IntegrationLinks = function IntegrationLinks(_ref) {
|
|
|
29
50
|
var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_ref2) {
|
|
30
51
|
var _ref2$integrationRout = _ref2.integrationRouteMap,
|
|
31
52
|
integrationRouteMap = _ref2$integrationRout === void 0 ? {} : _ref2$integrationRout;
|
|
53
|
+
var _useState = useState(false),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
isClosed = _useState2[0],
|
|
56
|
+
setIsClosed = _useState2[1];
|
|
32
57
|
useTranslation();
|
|
33
58
|
var _useFetchDisconnectio = useFetchDisconnectionAlerts(),
|
|
34
59
|
_useFetchDisconnectio2 = _useFetchDisconnectio.data,
|
|
35
60
|
_useFetchDisconnectio3 = _useFetchDisconnectio2 === void 0 ? {} : _useFetchDisconnectio2,
|
|
36
61
|
_useFetchDisconnectio4 = _useFetchDisconnectio3.disconnectionAlerts,
|
|
37
62
|
alerts = _useFetchDisconnectio4 === void 0 ? [] : _useFetchDisconnectio4;
|
|
38
|
-
var _useDismissDisconnect = useDismissDisconnectionAlerts(),
|
|
39
|
-
dismissAlerts = _useDismissDisconnect.mutate;
|
|
40
63
|
var knownAlerts = alerts.filter(function (alert) {
|
|
41
64
|
return integrationRouteMap[alert.serviceName];
|
|
42
65
|
});
|
|
43
|
-
if (isEmpty(knownAlerts)) return null;
|
|
66
|
+
if (isClosed || isEmpty(knownAlerts)) return null;
|
|
44
67
|
var singleAlert = knownAlerts.length === 1 ? knownAlerts[0] : null;
|
|
45
68
|
var connectPath = singleAlert ? singleAlert.redirectPath || integrationRouteMap[singleAlert.serviceName].path : "";
|
|
46
69
|
return /*#__PURE__*/jsx(StickyRibbon, {
|
|
47
70
|
"data-testid": "disconnected-integrations-ribbon",
|
|
48
71
|
kind: "warning",
|
|
49
72
|
onDismiss: function onDismiss() {
|
|
50
|
-
return
|
|
51
|
-
return alert.id;
|
|
52
|
-
}));
|
|
73
|
+
return setIsClosed(true);
|
|
53
74
|
},
|
|
54
|
-
children: /*#__PURE__*/jsx(Trans, {
|
|
75
|
+
children: /*#__PURE__*/jsx(Trans, _objectSpread(_objectSpread({}, getDisconnectionRibbonMessage(knownAlerts)), {}, {
|
|
55
76
|
count: knownAlerts.length,
|
|
56
|
-
i18nKey: "neetoIntegrations.disconnectionRibbon.message",
|
|
57
77
|
components: {
|
|
58
78
|
integrations: /*#__PURE__*/jsx(IntegrationLinks, {
|
|
59
79
|
integrationRouteMap: integrationRouteMap,
|
|
@@ -62,9 +82,8 @@ var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_re
|
|
|
62
82
|
connectLink: /*#__PURE__*/jsx(Link, {
|
|
63
83
|
to: connectPath
|
|
64
84
|
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
})
|
|
85
|
+
}
|
|
86
|
+
}))
|
|
68
87
|
});
|
|
69
88
|
};
|
|
70
89
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedIntegrationsRibbon.js","sources":["../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import StickyRibbon from \"
|
|
1
|
+
{"version":3,"file":"DisconnectedIntegrationsRibbon.js","sources":["../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/utils.js","../../app/javascript/src/v2/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["const getHasOnlyUPIIntegration = alerts =>\n alerts.length === 1 && alerts[0].serviceName === \"eupi\";\n\nexport const getDisconnectionRibbonMessage = alerts => {\n if (getHasOnlyUPIIntegration(alerts)) {\n return {\n i18nKey: \"neetoIntegrations.disconnectionRibbon.non_permission_message\",\n defaults:\n \"Your <integrations /> integration has been disconnected. <connectLink>Connect it now</connectLink>.\",\n };\n }\n\n return {\n i18nKey: \"neetoIntegrations.disconnectionRibbon.message\",\n defaults:\n alerts.length === 1\n ? \"Your <integrations /> integration has been disconnected due to a permission issue. <connectLink>Connect it now</connectLink>.\"\n : \"Your <integrations /> integrations have been disconnected due to a permission issue.\",\n };\n};\n","import { useState } from \"react\";\n\nimport StickyRibbon from \"neetomolecules/v2/StickyRibbon\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\n\nimport { getDisconnectionRibbonMessage } from \"./utils\";\n\nconst IntegrationLinks = ({ alerts, integrationRouteMap }) =>\n alerts.map((alert, index) => {\n const { label, path } = integrationRouteMap[alert.serviceName];\n const linkPath = alert.redirectPath || path;\n\n return (\n <span key={alert.id}>\n {index > 0 && \", \"}\n <Link to={linkPath}>{label}</Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n const [isClosed, setIsClosed] = useState(false);\n\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isClosed || isEmpty(knownAlerts)) return null;\n\n const singleAlert = knownAlerts.length === 1 ? knownAlerts[0] : null;\n const connectPath = singleAlert\n ? singleAlert.redirectPath ||\n integrationRouteMap[singleAlert.serviceName].path\n : \"\";\n\n return (\n <StickyRibbon\n data-testid=\"disconnected-integrations-ribbon\"\n kind=\"warning\"\n onDismiss={() => setIsClosed(true)}\n >\n <Trans\n {...getDisconnectionRibbonMessage(knownAlerts)}\n count={knownAlerts.length}\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n connectLink: <Link to={connectPath} />,\n }}\n />\n </StickyRibbon>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["getHasOnlyUPIIntegration","alerts","length","serviceName","getDisconnectionRibbonMessage","i18nKey","defaults","IntegrationLinks","_ref","integrationRouteMap","map","alert","index","_integrationRouteMap$","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","singleAlert","connectPath","StickyRibbon","kind","onDismiss","Trans","_objectSpread","count","components","integrations","connectLink"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAGC,MAAM,EAAA;AAAA,EAAA,OACrCA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAID,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,KAAK,MAAM;AAAA,CAAA;AAElD,IAAMC,6BAA6B,GAAG,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;AAAAb,IAAAA,QAAA,eAEnCC,GAAA,CAAC6B,KAAK,EAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACA9C,6BAA6B,CAACqC,WAAW,CAAC,CAAA,EAAA,EAAA,EAAA;MAC9CU,KAAK,EAAEV,WAAW,CAACvC,MAAO;AAC1BkD,MAAAA,UAAU,EAAE;QACVC,YAAY,eACVjC,GAAA,CAACb,gBAAgB,EAAA;AACTE,UAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBR,UAAAA,MAAM,EAAEwC;AAAY,SACrB,CACF;QACDa,WAAW,eAAElC,GAAA,CAACC,IAAI,EAAA;AAACC,UAAAA,EAAE,EAAEuB;SAAc;AACvC;KAAE,CACH;AAAC,GACU,CAAC;AAEnB;;;;"}
|
package/dist/v2/index.js
CHANGED
|
@@ -20,19 +20,19 @@ import '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
|
20
20
|
import 'react/jsx-runtime';
|
|
21
21
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
22
22
|
import '@bigbinary/neeto-commons-frontend/v2/react-utils/withT';
|
|
23
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
24
|
+
import 'react';
|
|
23
25
|
import '@bigbinary/neeto-molecules/v2/StickyRibbon';
|
|
24
26
|
import 'ramda';
|
|
25
27
|
import 'react-i18next';
|
|
26
28
|
import 'react-router-dom';
|
|
27
|
-
import '../useDisconnectionAlertsApi-
|
|
29
|
+
import '../useDisconnectionAlertsApi-BYcHEQ9K.js';
|
|
28
30
|
import '@tanstack/react-query';
|
|
29
31
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
30
32
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
31
33
|
import 'axios';
|
|
32
34
|
import 'i18next';
|
|
33
35
|
import '../useDailiesApi-aQmuxf-5.js';
|
|
34
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
35
|
-
import 'react';
|
|
36
36
|
import '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
37
37
|
import '@bigbinary/neeto-icons/misc/Daily';
|
|
38
38
|
import '@bigbinary/neeto-molecules/v2/CopyToClipboardButton';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-integrations-frontend",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.52",
|
|
4
4
|
"description": "UI for integrations in neeto products",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-integrations-nano",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@bigbinary/neeto-commons-frontend": "4.14.1",
|
|
79
79
|
"@bigbinary/neeto-filters-frontend": "4.5.1",
|
|
80
80
|
"@bigbinary/neeto-icons": "1.20.89",
|
|
81
|
-
"@bigbinary/neeto-molecules": "5.
|
|
81
|
+
"@bigbinary/neeto-molecules": "5.8.0",
|
|
82
82
|
"@bigbinary/neetoui": "8.8.3",
|
|
83
83
|
"@emotion/is-prop-valid": "1.2.0",
|
|
84
84
|
"@faker-js/faker": "8.2.0",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"@bigbinary/neeto-commons-frontend": "4.14.1",
|
|
193
193
|
"@bigbinary/neeto-filters-frontend": "4.5.1",
|
|
194
194
|
"@bigbinary/neeto-icons": "1.20.89",
|
|
195
|
-
"@bigbinary/neeto-molecules": "5.
|
|
195
|
+
"@bigbinary/neeto-molecules": "5.8.0",
|
|
196
196
|
"@bigbinary/neetoui": "8.8.3",
|
|
197
197
|
"@honeybadger-io/js": "6.10.1",
|
|
198
198
|
"@honeybadger-io/react": "6.1.25",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
3
|
-
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
-
import axios from 'axios';
|
|
5
|
-
import { D as DISCONNECTION_ALERTS_URL, d as disconnectionAlertsQueryKey } from './query-gurbhBqu.js';
|
|
6
|
-
|
|
7
|
-
var fetch = function fetch() {
|
|
8
|
-
return axios.get(DISCONNECTION_ALERTS_URL);
|
|
9
|
-
};
|
|
10
|
-
var destroyAll = function destroyAll(ids) {
|
|
11
|
-
return axios["delete"]("".concat(DISCONNECTION_ALERTS_URL, "/destroy_all"), {
|
|
12
|
-
params: {
|
|
13
|
-
ids: ids
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var disconnectionAlertsApi = {
|
|
18
|
-
fetch: fetch,
|
|
19
|
-
destroyAll: destroyAll
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var useFetchDisconnectionAlerts = function useFetchDisconnectionAlerts() {
|
|
23
|
-
return useQuery({
|
|
24
|
-
queryKey: disconnectionAlertsQueryKey,
|
|
25
|
-
queryFn: disconnectionAlertsApi.fetch,
|
|
26
|
-
staleTime: DEFAULT_STALE_TIME,
|
|
27
|
-
refetchOnWindowFocus: "always"
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var useDismissDisconnectionAlerts = function useDismissDisconnectionAlerts() {
|
|
31
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
32
|
-
_onSuccess = _ref.onSuccess;
|
|
33
|
-
return useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {
|
|
34
|
-
keysToInvalidate: [disconnectionAlertsQueryKey],
|
|
35
|
-
onSuccess: function onSuccess() {
|
|
36
|
-
return _onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { useDismissDisconnectionAlerts as a, useFetchDisconnectionAlerts as u };
|
|
42
|
-
//# sourceMappingURL=useDisconnectionAlertsApi-BOc2pEP_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDisconnectionAlertsApi-BOc2pEP_.js","sources":["../app/javascript/src/apis/disconnection_alerts.js","../app/javascript/src/hooks/reactQuery/useDisconnectionAlertsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { DISCONNECTION_ALERTS_URL } from \"src/constants/urls\";\n\nconst fetch = () => axios.get(DISCONNECTION_ALERTS_URL);\n\nconst destroyAll = ids =>\n axios.delete(`${DISCONNECTION_ALERTS_URL}/destroy_all`, { params: { ids } });\n\nconst disconnectionAlertsApi = { fetch, destroyAll };\n\nexport default disconnectionAlertsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport disconnectionAlertsApi from \"apis/disconnection_alerts\";\nimport { disconnectionAlertsQueryKey } from \"src/constants/query\";\n\nexport const useFetchDisconnectionAlerts = () =>\n useQuery({\n queryKey: disconnectionAlertsQueryKey,\n queryFn: disconnectionAlertsApi.fetch,\n staleTime: DEFAULT_STALE_TIME,\n refetchOnWindowFocus: \"always\",\n });\n\nexport const useDismissDisconnectionAlerts = ({ onSuccess } = {}) =>\n useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {\n keysToInvalidate: [disconnectionAlertsQueryKey],\n onSuccess: () => onSuccess?.(),\n });\n"],"names":["fetch","axios","get","DISCONNECTION_ALERTS_URL","destroyAll","ids","concat","params","disconnectionAlertsApi","useFetchDisconnectionAlerts","useQuery","queryKey","disconnectionAlertsQueryKey","queryFn","staleTime","DEFAULT_STALE_TIME","refetchOnWindowFocus","useDismissDisconnectionAlerts","_ref","arguments","length","undefined","onSuccess","useMutationWithInvalidation","keysToInvalidate"],"mappings":";;;;;;AAIA,IAAMA,KAAK,GAAG,SAARA,KAAKA,GAAA;AAAA,EAAA,OAASC,KAAK,CAACC,GAAG,CAACC,wBAAwB,CAAC;AAAA,CAAA;AAEvD,IAAMC,UAAU,GAAG,SAAbA,UAAU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-frontend/constants');
|
|
5
|
-
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
6
|
-
var axios = require('axios');
|
|
7
|
-
var query = require('./query-BF3HFRA7.js');
|
|
8
|
-
|
|
9
|
-
var fetch = function fetch() {
|
|
10
|
-
return axios.get(query.DISCONNECTION_ALERTS_URL);
|
|
11
|
-
};
|
|
12
|
-
var destroyAll = function destroyAll(ids) {
|
|
13
|
-
return axios["delete"]("".concat(query.DISCONNECTION_ALERTS_URL, "/destroy_all"), {
|
|
14
|
-
params: {
|
|
15
|
-
ids: ids
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
var disconnectionAlertsApi = {
|
|
20
|
-
fetch: fetch,
|
|
21
|
-
destroyAll: destroyAll
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var useFetchDisconnectionAlerts = function useFetchDisconnectionAlerts() {
|
|
25
|
-
return reactQuery.useQuery({
|
|
26
|
-
queryKey: query.disconnectionAlertsQueryKey,
|
|
27
|
-
queryFn: disconnectionAlertsApi.fetch,
|
|
28
|
-
staleTime: constants.DEFAULT_STALE_TIME,
|
|
29
|
-
refetchOnWindowFocus: "always"
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
var useDismissDisconnectionAlerts = function useDismissDisconnectionAlerts() {
|
|
33
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
34
|
-
_onSuccess = _ref.onSuccess;
|
|
35
|
-
return reactUtils.useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {
|
|
36
|
-
keysToInvalidate: [query.disconnectionAlertsQueryKey],
|
|
37
|
-
onSuccess: function onSuccess() {
|
|
38
|
-
return _onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess();
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
exports.useDismissDisconnectionAlerts = useDismissDisconnectionAlerts;
|
|
44
|
-
exports.useFetchDisconnectionAlerts = useFetchDisconnectionAlerts;
|
|
45
|
-
//# sourceMappingURL=useDisconnectionAlertsApi-CWMlpOJD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDisconnectionAlertsApi-CWMlpOJD.js","sources":["../app/javascript/src/apis/disconnection_alerts.js","../app/javascript/src/hooks/reactQuery/useDisconnectionAlertsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { DISCONNECTION_ALERTS_URL } from \"src/constants/urls\";\n\nconst fetch = () => axios.get(DISCONNECTION_ALERTS_URL);\n\nconst destroyAll = ids =>\n axios.delete(`${DISCONNECTION_ALERTS_URL}/destroy_all`, { params: { ids } });\n\nconst disconnectionAlertsApi = { fetch, destroyAll };\n\nexport default disconnectionAlertsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport disconnectionAlertsApi from \"apis/disconnection_alerts\";\nimport { disconnectionAlertsQueryKey } from \"src/constants/query\";\n\nexport const useFetchDisconnectionAlerts = () =>\n useQuery({\n queryKey: disconnectionAlertsQueryKey,\n queryFn: disconnectionAlertsApi.fetch,\n staleTime: DEFAULT_STALE_TIME,\n refetchOnWindowFocus: \"always\",\n });\n\nexport const useDismissDisconnectionAlerts = ({ onSuccess } = {}) =>\n useMutationWithInvalidation(disconnectionAlertsApi.destroyAll, {\n keysToInvalidate: [disconnectionAlertsQueryKey],\n onSuccess: () => onSuccess?.(),\n });\n"],"names":["fetch","axios","get","DISCONNECTION_ALERTS_URL","destroyAll","ids","concat","params","disconnectionAlertsApi","useFetchDisconnectionAlerts","useQuery","queryKey","disconnectionAlertsQueryKey","queryFn","staleTime","DEFAULT_STALE_TIME","refetchOnWindowFocus","useDismissDisconnectionAlerts","_ref","arguments","length","undefined","onSuccess","useMutationWithInvalidation","keysToInvalidate"],"mappings":";;;;;;;;AAIA,IAAMA,KAAK,GAAG,SAAR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