@bigbinary/neeto-molecules 4.1.29 → 4.1.30

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.
@@ -35,11 +35,10 @@ var useFetchSubscriptions = function useFetchSubscriptions() {
35
35
  };
36
36
 
37
37
  var SubscriptionNotificationsContainer = function SubscriptionNotificationsContainer() {
38
+ var _data$clientAppSubscr;
38
39
  var _useFetchSubscription = useFetchSubscriptions(),
39
- _useFetchSubscription2 = _useFetchSubscription.data,
40
- _useFetchSubscription3 = _useFetchSubscription2 === void 0 ? {} : _useFetchSubscription2,
41
- _useFetchSubscription4 = _useFetchSubscription3.clientAppSubscriptions,
42
- clientAppSubscriptions = _useFetchSubscription4 === void 0 ? [] : _useFetchSubscription4;
40
+ data = _useFetchSubscription.data;
41
+ var clientAppSubscriptions = (_data$clientAppSubscr = data === null || data === void 0 ? void 0 : data.clientAppSubscriptions) !== null && _data$clientAppSubscr !== void 0 ? _data$clientAppSubscr : [];
43
42
  var visibleNotifications = filterBy({
44
43
  status: SUBSCRIPTION_STATUS.past_due
45
44
  }, clientAppSubscriptions);
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../src/components/SubscriptionNotificationsContainer/constants.js","../src/components/SubscriptionNotificationsContainer/api.js","../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data: { clientAppSubscriptions = [] } = {} } =\n useFetchSubscriptions();\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_useFetchSubscription","_useFetchSubscription2","data","_useFetchSubscription3","_useFetchSubscription4","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a","Button","href","rel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AAoB;QAAEC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;MAAA,oBACxCP,GAAA,CAACQ,OAAO,EAAA;AACNC,QAAAA,SAAS,EAAC,yDAAyD;AACnE,QAAA,aAAA,EAAY,4BAA4B;AAExCC,QAAAA,KAAK,EAAC,SAAS;QAAAR,QAAA,eAEfF,GAAA,CAACW,UAAU,EAAA;AAACD,UAAAA,KAAK,EAAC,OAAO;UAAAR,QAAA,eACvBF,GAAA,CAACY,KAAK,EAAA;AACJC,YAAAA,OAAO,EAAC,uDAAuD;AAC/DC,YAAAA,UAAU,EAAE;cACVC,CAAC,eACCf,GAAA,CAACgB,MAAM,EAAA;AACLC,gBAAAA,IAAI,EAAEV,iBAAkB;AACxBW,gBAAAA,GAAG,EAAC,YAAY;AAChBR,gBAAAA,KAAK,EAAC,MAAM;AACZS,gBAAAA,MAAM,EAAC;eACR;aAEH;AACFC,YAAAA,MAAM,EAAE;AACNd,cAAAA,oBAAoB,EAAEe,UAAU,CAACC,IAAI,CAAChB,oBAAoB;AAC5D;WACD;SACS;AAAC,OAAA,EApBRD,KAqBE,CAAC;IAAA,CAEd;AAAC,GACD,CAAC;AAEP;;;;"}
1
+ {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../src/components/SubscriptionNotificationsContainer/constants.js","../src/components/SubscriptionNotificationsContainer/api.js","../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data } = useFetchSubscriptions();\n const clientAppSubscriptions = data?.clientAppSubscriptions ?? [];\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_data$clientAppSubscr","_useFetchSubscription","data","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a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C,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;QAAEC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;MAAA,oBACxCP,GAAA,CAACQ,OAAO,EAAA;AACNC,QAAAA,SAAS,EAAC,yDAAyD;AACnE,QAAA,aAAA,EAAY,4BAA4B;AAExCC,QAAAA,KAAK,EAAC,SAAS;QAAAR,QAAA,eAEfF,GAAA,CAACW,UAAU,EAAA;AAACD,UAAAA,KAAK,EAAC,OAAO;UAAAR,QAAA,eACvBF,GAAA,CAACY,KAAK,EAAA;AACJC,YAAAA,OAAO,EAAC,uDAAuD;AAC/DC,YAAAA,UAAU,EAAE;cACVC,CAAC,eACCf,GAAA,CAACgB,MAAM,EAAA;AACLC,gBAAAA,IAAI,EAAEV,iBAAkB;AACxBW,gBAAAA,GAAG,EAAC,YAAY;AAChBR,gBAAAA,KAAK,EAAC,MAAM;AACZS,gBAAAA,MAAM,EAAC;eACR;aAEH;AACFC,YAAAA,MAAM,EAAE;AACNd,cAAAA,oBAAoB,EAAEe,UAAU,CAACC,IAAI,CAAChB,oBAAoB;AAC5D;WACD;SACS;AAAC,OAAA,EApBRD,KAqBE,CAAC;IAAA,CAEd;AAAC,GACD,CAAC;AAEP;;;;"}
@@ -37,11 +37,10 @@ var useFetchSubscriptions = function useFetchSubscriptions() {
37
37
  };
38
38
 
39
39
  var SubscriptionNotificationsContainer = function SubscriptionNotificationsContainer() {
40
+ var _data$clientAppSubscr;
40
41
  var _useFetchSubscription = useFetchSubscriptions(),
41
- _useFetchSubscription2 = _useFetchSubscription.data,
42
- _useFetchSubscription3 = _useFetchSubscription2 === void 0 ? {} : _useFetchSubscription2,
43
- _useFetchSubscription4 = _useFetchSubscription3.clientAppSubscriptions,
44
- clientAppSubscriptions = _useFetchSubscription4 === void 0 ? [] : _useFetchSubscription4;
42
+ data = _useFetchSubscription.data;
43
+ var clientAppSubscriptions = (_data$clientAppSubscr = data === null || data === void 0 ? void 0 : data.clientAppSubscriptions) !== null && _data$clientAppSubscr !== void 0 ? _data$clientAppSubscr : [];
45
44
  var visibleNotifications = neetoCist.filterBy({
46
45
  status: SUBSCRIPTION_STATUS.past_due
47
46
  }, clientAppSubscriptions);
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../../src/components/SubscriptionNotificationsContainer/constants.js","../../src/components/SubscriptionNotificationsContainer/api.js","../../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data: { clientAppSubscriptions = [] } = {} } =\n useFetchSubscriptions();\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_useFetchSubscription","_useFetchSubscription2","data","_useFetchSubscription3","_useFetchSubscription4","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a","Button","href","rel","target","values","dateFormat","date"],"mappings":";;;;;;;;;;;;;AAAO,IAAMA,UAAU,GAAG;AACxBC,EAAAA,kBAAkB,EAAE;AACtB,CAAC;AAEM,IAAMC,mBAAmB,GAAG;AAAEC,EAAAA,QAAQ,EAAE;AAAW,CAAC;;;;;ACF3D,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,GAAA;AAAA,EAAA,OACtBC,KAAK,CAACC,GAAG,CAAC,uCAAuC,CAAC;AAAA,CAAA;AAEpD,IAAMC,gBAAgB,GAAG;AAAEH,EAAAA,kBAAkB,EAAlBA;AAAmB,CAAC;;ACA/C,IAAQH,kBAAkB,GAAKD,UAAU,CAAjCC,kBAAkB;AAE1B,IAAMO,qBAAqB,GAAG,SAAxBA,qBAAqBA,GAAA;AAAA,EAAA,OACzBC,mBAAQ,CAAC;IACPC,QAAQ,EAAE,CAACT,kBAAkB,CAAC;IAC9BU,OAAO,EA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YAAAA,MAAM,EAAE;AACNd,cAAAA,oBAAoB,EAAEe,gBAAU,CAACC,IAAI,CAAChB,oBAAoB;AAC5D;WACD;SACS;AAAC,OAAA,EApBRD,KAqBE,CAAC;IAAA,CAEd;AAAC,GACD,CAAC;AAEP;;;;"}
1
+ {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../../src/components/SubscriptionNotificationsContainer/constants.js","../../src/components/SubscriptionNotificationsContainer/api.js","../../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data } = useFetchSubscriptions();\n const clientAppSubscriptions = data?.clientAppSubscriptions ?? [];\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_data$clientAppSubscr","_useFetchSubscription","data","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a","Button","href","rel","target","values","dateFormat","date"],"mappings":";;;;;;;;;;;;;AAAO,IAAMA,UAAU,GAAG;AACxBC,EAAAA,kBAAkB,EAAE;AACtB,CAAC;AAEM,IAAMC,mBAAmB,GAAG;AAAEC,EAAAA,QAAQ,EAAE;AAAW,CAAC;;;;;ACF3D,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,GAAA;AAAA,EAAA,OACtBC,KAAK,CAACC,GAAG,CAAC,uCAAuC,CAAC;AAAA,CAAA;AAEpD,IAAMC,gBAAgB,GAAG;AAAEH,EAAAA,kBAAkB,EAAlBA;AAAmB,CAAC;;ACA/C,IAAQH,kBAAkB,GAAKD,UAAU,CAAjCC,kBAAkB;AAE1B,IAAMO,qBAAqB,GAAG,SAAxBA,qBAAqBA,GAAA;AAAA,EAAA,OACzBC,mBAAQ,CAAC;IACPC,QAAQ,EAAE,CAACT,kBAAkB,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AM;AACZS,gBAAAA,MAAM,EAAC;eACR;aAEH;AACFC,YAAAA,MAAM,EAAE;AACNd,cAAAA,oBAAoB,EAAEe,gBAAU,CAACC,IAAI,CAAChB,oBAAoB;AAC5D;WACD;SACS;AAAC,OAAA,EApBRD,KAqBE,CAAC;IAAA,CAEd;AAAC,GACD,CAAC;AAEP;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "4.1.29",
3
+ "version": "4.1.30",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",