@bigbinary/neeto-integrations-frontend 4.0.31 → 4.0.32

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 CHANGED
@@ -1 +1 @@
1
- Built at 2026-05-05T12:29:51.162Z
1
+ Built at 2026-05-06T13:21:30.185Z
package/dist/cjs/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  var Manage = require('./Manage.js');
4
4
  var DisconnectAlert = require('./DisconnectAlert.js');
5
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
6
+ var React = require('react');
5
7
  var Tag = require('@bigbinary/neetoui/Tag');
6
8
  var ramda = require('ramda');
7
9
  var reactI18next = require('react-i18next');
@@ -14,12 +16,12 @@ var GoogleCalendar = require('./GoogleCalendar.js');
14
16
  var Telnyx = require('./Telnyx.js');
15
17
  var Twilio = require('./Twilio.js');
16
18
  var Zoom = require('./Zoom.js');
17
- var query = require('../query-CySi2Ki7.js');
18
19
  var Modal = require('./Modal.js');
19
20
  var Connect = require('./Connect.js');
20
21
  var Demo = require('./Demo.js');
21
22
  var Finish = require('./Finish.js');
22
23
  var WalkthroughModal = require('./WalkthroughModal.js');
24
+ var query = require('../query-CySi2Ki7.js');
23
25
  require('@babel/runtime/helpers/defineProperty');
24
26
  require('@bigbinary/neeto-cist');
25
27
  require('@bigbinary/neeto-commons-frontend/react-utils');
@@ -37,8 +39,6 @@ require('@bigbinary/neeto-commons-frontend/constants');
37
39
  require('axios');
38
40
  require('i18next');
39
41
  require('../useDailiesApi-BjcmweuZ.js');
40
- require('@babel/runtime/helpers/slicedToArray');
41
- require('react');
42
42
  require('@bigbinary/neeto-commons-frontend/utils');
43
43
  require('@bigbinary/neeto-icons/misc/Daily');
44
44
  require('@bigbinary/neeto-molecules/CopyToClipboardButton');
@@ -84,27 +84,27 @@ var IntegrationLinks = function IntegrationLinks(_ref) {
84
84
  var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_ref2) {
85
85
  var _ref2$integrationRout = _ref2.integrationRouteMap,
86
86
  integrationRouteMap = _ref2$integrationRout === void 0 ? {} : _ref2$integrationRout;
87
+ var _useState = React.useState(false),
88
+ _useState2 = _slicedToArray(_useState, 2),
89
+ isClosed = _useState2[0],
90
+ setIsClosed = _useState2[1];
87
91
  reactI18next.useTranslation();
88
92
  var _useFetchDisconnectio = useDisconnectionAlertsApi.useFetchDisconnectionAlerts(),
89
93
  _useFetchDisconnectio2 = _useFetchDisconnectio.data,
90
94
  _useFetchDisconnectio3 = _useFetchDisconnectio2 === void 0 ? {} : _useFetchDisconnectio2,
91
95
  _useFetchDisconnectio4 = _useFetchDisconnectio3.disconnectionAlerts,
92
96
  alerts = _useFetchDisconnectio4 === void 0 ? [] : _useFetchDisconnectio4;
93
- var _useDismissDisconnect = useDisconnectionAlertsApi.useDismissDisconnectionAlerts(),
94
- dismissAlerts = _useDismissDisconnect.mutate;
95
97
  var knownAlerts = alerts.filter(function (alert) {
96
98
  return integrationRouteMap[alert.serviceName];
97
99
  });
98
- if (ramda.isEmpty(knownAlerts)) return null;
100
+ if (isClosed || ramda.isEmpty(knownAlerts)) return null;
99
101
  return /*#__PURE__*/jsxRuntime.jsx(Tag, {
100
102
  className: "neeto-molecules-sticky-ribbon w-full p-2.5 text-center",
101
103
  "data-testid": "disconnected-integrations-ribbon",
102
104
  size: "large",
103
105
  style: "warning",
104
106
  onClose: function onClose() {
105
- return dismissAlerts(knownAlerts.map(function (alert) {
106
- return alert.id;
107
- }));
107
+ return setIsClosed(true);
108
108
  },
109
109
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
110
110
  className: "w-full",
@@ -131,11 +131,11 @@ exports.GoogleCalendar = GoogleCalendar;
131
131
  exports.Telnyx = Telnyx;
132
132
  exports.Twilio = Twilio;
133
133
  exports.Zoom = Zoom;
134
- exports.disconnectionAlertsQueryKey = query.disconnectionAlertsQueryKey;
135
134
  exports.Modal = Modal;
136
135
  exports.Connect = Connect;
137
136
  exports.Demo = Demo;
138
137
  exports.Finish = Finish;
139
138
  exports.WalkthroughModal = WalkthroughModal;
139
+ exports.disconnectionAlertsQueryKey = query.disconnectionAlertsQueryKey;
140
140
  exports.DisconnectedIntegrationsRibbon = DisconnectedIntegrationsRibbon;
141
141
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport {\n useFetchDisconnectionAlerts,\n useDismissDisconnectionAlerts,\n} from \"hooks/reactQuery/useDisconnectionAlertsApi\";\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 className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const { mutate: dismissAlerts } = useDismissDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => dismissAlerts(knownAlerts.map(alert => alert.id))}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults=\"Your <integrations /> integration has been disconnected due to a permission issue. Connect it now.\"\n i18nKey=\"neetoIntegrations.disconnectionRibbon.message\"\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["IntegrationLinks","_ref","alerts","integrationRouteMap","map","alert","index","_integrationRouteMap$","serviceName","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","_useDismissDisconnect","useDismissDisconnectionAlerts","dismissAlerts","mutate","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","count","length","defaults","i18nKey","components","integrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBAAmB;EAAA,OACrDD,MAAM,CAACE,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK,EAAK;AAC3B,IAAA,IAAAC,qBAAA,GAAwBJ,mBAAmB,CAACE,KAAK,CAACG,WAAW,CAAC;MAAtDC,KAAK,GAAAF,qBAAA,CAALE,KAAK;MAAEC,IAAI,GAAAH,qBAAA,CAAJG,IAAI;AACnB,IAAA,IAAMC,QAAQ,GAAGN,KAAK,CAACO,YAAY,IAAIF,IAAI;AAE3C,IAAA,oBACEG,eAAA,CAAA,MAAA,EAAA;MAAAC,QAAA,EAAA,CACGR,KAAK,GAAG,CAAC,IAAI,IAAI,eAClBS,cAAA,CAACC,mBAAI,EAAA;AAACC,QAAAA,SAAS,EAAC,yBAAyB;AAACC,QAAAA,EAAE,EAAEP,QAAS;AAAAG,QAAAA,QAAA,EACpDL;AAAK,OAC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AAE;AAAA,MAAA,CAAA,CAAC,CAAC;IAAA,CAAC;AAAAL,IAAAA,QAAA,eAEjEC,cAAA,CAAA,MAAA,EAAA;AAAME,MAAAA,SAAS,EAAC,QAAQ;MAAAH,QAAA,eACtBC,cAAA,CAAC2B,kBAAK,EAAA;QACJC,KAAK,EAAER,WAAW,CAACS,MAAO;AAC1BC,QAAAA,QAAQ,EAAC,oGAAoG;AAC7GC,QAAAA,OAAO,EAAC,+CAA+C;AACvDC,QAAAA,UAAU,EAAE;UACVC,YAAY,eACVjC,cAAA,CAACf,gBAAgB,EAAA;AACTG,YAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBD,YAAAA,MAAM,EAAEiC;WACT;AAEL;OACD;KACG;AAAC,GACJ,CAAC;AAEV;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\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 className=\"font-semibold underline\" to={linkPath}>\n {label}\n </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 return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults=\"Your <integrations /> integration has been disconnected due to a permission issue. Connect it now.\"\n i18nKey=\"neetoIntegrations.disconnectionRibbon.message\"\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["IntegrationLinks","_ref","alerts","integrationRouteMap","map","alert","index","_integrationRouteMap$","serviceName","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","count","length","defaults","i18nKey","components","integrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBAAmB;EAAA,OACrDD,MAAM,CAACE,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK,EAAK;AAC3B,IAAA,IAAAC,qBAAA,GAAwBJ,mBAAmB,CAACE,KAAK,CAACG,WAAW,CAAC;MAAtDC,KAAK,GAAAF,qBAAA,CAALE,KAAK;MAAEC,IAAI,GAAAH,qBAAA,CAAJG,IAAI;AACnB,IAAA,IAAMC,QAAQ,GAAGN,KAAK,CAACO,YAAY,I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;EAED,IAAImB,QAAQ,IAAIY,aAAO,CAACF,WAAW,CAAC,EAAE,OAAO,IAAI;EAEjD,oBACEtB,cAAA,CAACyB,GAAG,EAAA;AACFvB,IAAAA,SAAS,EAAC,wDAAwD;AAClE,IAAA,aAAA,EAAY,kCAAkC;AAC9CwB,IAAAA,IAAI,EAAC,OAAO;AACZC,IAAAA,KAAK,EAAC,SAAS;IACfC,OAAO,EAAE,SAATA,OAAOA,GAAA;MAAA,OAAQf,WAAW,CAAC,IAAI,CAAC;IAAA,CAAC;AAAAd,IAAAA,QAAA,eAEjCC,cAAA,CAAA,MAAA,EAAA;AAAME,MAAAA,SAAS,EAAC,QAAQ;MAAAH,QAAA,eACtBC,cAAA,CAAC6B,kBAAK,EAAA;QACJC,KAAK,EAAER,WAAW,CAACS,MAAO;AAC1BC,QAAAA,QAAQ,EAAC,oGAAoG;AAC7GC,QAAAA,OAAO,EAAC,+CAA+C;AACvDC,QAAAA,UAAU,EAAE;UACVC,YAAY,eACVnC,cAAA,CAACf,gBAAgB,EAAA;AACTG,YAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBD,YAAAA,MAAM,EAAEmC;WACT;AAEL;OACD;KACG;AAAC,GACJ,CAAC;AAEV;;;;;;;;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  export { default as Manage } from './Manage.js';
2
2
  export { default as DisconnectAlert } from './DisconnectAlert.js';
3
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { useState } from 'react';
3
5
  import Tag from '@bigbinary/neetoui/Tag';
4
6
  import { isEmpty } from 'ramda';
5
7
  import { useTranslation, Trans } from 'react-i18next';
6
8
  import { Link } from 'react-router-dom';
7
- import { u as useFetchDisconnectionAlerts, a as useDismissDisconnectionAlerts } from './useDisconnectionAlertsApi-BnfMKA7s.js';
9
+ import { u as useFetchDisconnectionAlerts } from './useDisconnectionAlertsApi-BnfMKA7s.js';
8
10
  import { jsx, jsxs } from 'react/jsx-runtime';
9
11
  export { default as Daily } from './Daily.js';
10
12
  export { default as DailyForm } from './DailyForm.js';
@@ -12,12 +14,12 @@ export { default as GoogleCalendar } from './GoogleCalendar.js';
12
14
  export { default as Telnyx } from './Telnyx.js';
13
15
  export { default as Twilio } from './Twilio.js';
14
16
  export { default as Zoom } from './Zoom.js';
15
- export { d as disconnectionAlertsQueryKey } from './query-B3RhGrNb.js';
16
17
  export { default as Modal } from './Modal.js';
17
18
  export { default as Connect } from './Connect.js';
18
19
  export { default as Demo } from './Demo.js';
19
20
  export { default as Finish } from './Finish.js';
20
21
  export { default as WalkthroughModal } from './WalkthroughModal.js';
22
+ export { d as disconnectionAlertsQueryKey } from './query-B3RhGrNb.js';
21
23
  import '@babel/runtime/helpers/defineProperty';
22
24
  import '@bigbinary/neeto-cist';
23
25
  import '@bigbinary/neeto-commons-frontend/react-utils';
@@ -35,8 +37,6 @@ import '@bigbinary/neeto-commons-frontend/constants';
35
37
  import 'axios';
36
38
  import 'i18next';
37
39
  import './useDailiesApi-C78LSYFo.js';
38
- import '@babel/runtime/helpers/slicedToArray';
39
- import 'react';
40
40
  import '@bigbinary/neeto-commons-frontend/utils';
41
41
  import '@bigbinary/neeto-icons/misc/Daily';
42
42
  import '@bigbinary/neeto-molecules/CopyToClipboardButton';
@@ -82,27 +82,27 @@ var IntegrationLinks = function IntegrationLinks(_ref) {
82
82
  var DisconnectedIntegrationsRibbon = function DisconnectedIntegrationsRibbon(_ref2) {
83
83
  var _ref2$integrationRout = _ref2.integrationRouteMap,
84
84
  integrationRouteMap = _ref2$integrationRout === void 0 ? {} : _ref2$integrationRout;
85
+ var _useState = useState(false),
86
+ _useState2 = _slicedToArray(_useState, 2),
87
+ isClosed = _useState2[0],
88
+ setIsClosed = _useState2[1];
85
89
  useTranslation();
86
90
  var _useFetchDisconnectio = useFetchDisconnectionAlerts(),
87
91
  _useFetchDisconnectio2 = _useFetchDisconnectio.data,
88
92
  _useFetchDisconnectio3 = _useFetchDisconnectio2 === void 0 ? {} : _useFetchDisconnectio2,
89
93
  _useFetchDisconnectio4 = _useFetchDisconnectio3.disconnectionAlerts,
90
94
  alerts = _useFetchDisconnectio4 === void 0 ? [] : _useFetchDisconnectio4;
91
- var _useDismissDisconnect = useDismissDisconnectionAlerts(),
92
- dismissAlerts = _useDismissDisconnect.mutate;
93
95
  var knownAlerts = alerts.filter(function (alert) {
94
96
  return integrationRouteMap[alert.serviceName];
95
97
  });
96
- if (isEmpty(knownAlerts)) return null;
98
+ if (isClosed || isEmpty(knownAlerts)) return null;
97
99
  return /*#__PURE__*/jsx(Tag, {
98
100
  className: "neeto-molecules-sticky-ribbon w-full p-2.5 text-center",
99
101
  "data-testid": "disconnected-integrations-ribbon",
100
102
  size: "large",
101
103
  style: "warning",
102
104
  onClose: function onClose() {
103
- return dismissAlerts(knownAlerts.map(function (alert) {
104
- return alert.id;
105
- }));
105
+ return setIsClosed(true);
106
106
  },
107
107
  children: /*#__PURE__*/jsx("span", {
108
108
  className: "w-full",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport {\n useFetchDisconnectionAlerts,\n useDismissDisconnectionAlerts,\n} from \"hooks/reactQuery/useDisconnectionAlertsApi\";\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 className=\"font-semibold underline\" to={linkPath}>\n {label}\n </Link>\n </span>\n );\n });\n\nconst DisconnectedIntegrationsRibbon = ({ integrationRouteMap = {} }) => {\n useTranslation();\n\n const { data: { disconnectionAlerts: alerts = [] } = {} } =\n useFetchDisconnectionAlerts();\n\n const { mutate: dismissAlerts } = useDismissDisconnectionAlerts();\n\n const knownAlerts = alerts.filter(\n alert => integrationRouteMap[alert.serviceName]\n );\n\n if (isEmpty(knownAlerts)) return null;\n\n return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => dismissAlerts(knownAlerts.map(alert => alert.id))}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults=\"Your <integrations /> integration has been disconnected due to a permission issue. Connect it now.\"\n i18nKey=\"neetoIntegrations.disconnectionRibbon.message\"\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["IntegrationLinks","_ref","alerts","integrationRouteMap","map","alert","index","_integrationRouteMap$","serviceName","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","_useDismissDisconnect","useDismissDisconnectionAlerts","dismissAlerts","mutate","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","count","length","defaults","i18nKey","components","integrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBAAmB;EAAA,OACrDD,MAAM,CAACE,GAAG,CAAC,UAACC,KAAK,EAAEC,KAAK,EAAK;AAC3B,IAAA,IAAAC,qB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B,CAACE,KAAK,CAACG,WAAW,CAAC;AAAA,EAAA,CACjD,CAAC;AAED,EAAA,IAAI6B,OAAO,CAACF,WAAW,CAAC,EAAE,OAAO,IAAI;EAErC,oBACEpB,GAAA,CAACuB,GAAG,EAAA;AACFrB,IAAAA,SAAS,EAAC,wDAAwD;AAClE,IAAA,aAAA,EAAY,kCAAkC;AAC9CsB,IAAAA,IAAI,EAAC,OAAO;AACZC,IAAAA,KAAK,EAAC,SAAS;IACfC,OAAO,EAAE,SAATA,OAAOA,GAAA;AAAA,MAAA,OAAQR,aAAa,CAACE,WAAW,CAAC/B,GAAG,CAAC,UAAAC,KAAK,EAAA;QAAA,OAAIA,KAAK,CAACc,EAAE;AAAA,MAAA,CAAA,CAAC,CAAC;IAAA,CAAC;AAAAL,IAAAA,QAAA,eAEjEC,GAAA,CAAA,MAAA,EAAA;AAAME,MAAAA,SAAS,EAAC,QAAQ;MAAAH,QAAA,eACtBC,GAAA,CAAC2B,KAAK,EAAA;QACJC,KAAK,EAAER,WAAW,CAACS,MAAO;AAC1BC,QAAAA,QAAQ,EAAC,oGAAoG;AAC7GC,QAAAA,OAAO,EAAC,+CAA+C;AACvDC,QAAAA,UAAU,EAAE;UACVC,YAAY,eACVjC,GAAA,CAACf,gBAAgB,EAAA;AACTG,YAAAA,mBAAmB,EAAnBA,mBAAmB;AACzBD,YAAAA,MAAM,EAAEiC;WACT;AAEL;OACD;KACG;AAAC,GACJ,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../app/javascript/src/components/DisconnectedIntegrationsRibbon/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { useFetchDisconnectionAlerts } from \"hooks/reactQuery/useDisconnectionAlertsApi\";\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 className=\"font-semibold underline\" to={linkPath}>\n {label}\n </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 return (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n data-testid=\"disconnected-integrations-ribbon\"\n size=\"large\"\n style=\"warning\"\n onClose={() => setIsClosed(true)}\n >\n <span className=\"w-full\">\n <Trans\n count={knownAlerts.length}\n defaults=\"Your <integrations /> integration has been disconnected due to a permission issue. Connect it now.\"\n i18nKey=\"neetoIntegrations.disconnectionRibbon.message\"\n components={{\n integrations: (\n <IntegrationLinks\n {...{ integrationRouteMap }}\n alerts={knownAlerts}\n />\n ),\n }}\n />\n </span>\n </Tag>\n );\n};\n\nexport default DisconnectedIntegrationsRibbon;\n"],"names":["IntegrationLinks","_ref","alerts","integrationRouteMap","map","alert","index","_integrationRouteMap$","serviceName","label","path","linkPath","redirectPath","_jsxs","children","_jsx","Link","className","to","id","DisconnectedIntegrationsRibbon","_ref2","_ref2$integrationRout","_useState","useState","_useState2","_slicedToArray","isClosed","setIsClosed","useTranslation","_useFetchDisconnectio","useFetchDisconnectionAlerts","_useFetchDisconnectio2","data","_useFetchDisconnectio3","_useFetchDisconnectio4","disconnectionAlerts","knownAlerts","filter","isEmpty","Tag","size","style","onClose","Trans","count","length","defaults","i18nKey","components","integrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,gBAAgB,GAAG,SA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neeto-integrations-frontend",
3
- "version": "4.0.31",
3
+ "version": "4.0.32",
4
4
  "description": "UI for integrations in neeto products",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/bigbinary/neeto-integrations-nano",
@@ -75,8 +75,8 @@
75
75
  "@bigbinary/eslint-plugin-neeto": "1.9.0",
76
76
  "@bigbinary/neeto-atoms": "latest",
77
77
  "@bigbinary/neeto-cist": "1.0.17",
78
- "@bigbinary/neeto-commons-frontend": "4.13.124",
79
- "@bigbinary/neeto-filters-frontend": "4.3.36",
78
+ "@bigbinary/neeto-commons-frontend": "4.13.125",
79
+ "@bigbinary/neeto-filters-frontend": "4.3.37",
80
80
  "@bigbinary/neeto-icons": "1.20.87",
81
81
  "@bigbinary/neeto-molecules": "4.1.72",
82
82
  "@bigbinary/neetoui": "8.6.0",
@@ -189,8 +189,8 @@
189
189
  "@babel/runtime": "7.29.2",
190
190
  "@bigbinary/neeto-atoms": "latest",
191
191
  "@bigbinary/neeto-cist": "1.0.17",
192
- "@bigbinary/neeto-commons-frontend": "4.13.124",
193
- "@bigbinary/neeto-filters-frontend": "4.3.36",
192
+ "@bigbinary/neeto-commons-frontend": "4.13.125",
193
+ "@bigbinary/neeto-filters-frontend": "4.3.37",
194
194
  "@bigbinary/neeto-icons": "1.20.87",
195
195
  "@bigbinary/neeto-molecules": "4.1.72",
196
196
  "@bigbinary/neetoui": "8.6.0",