ublo-lib 1.38.37 → 1.38.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"client-links.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/espace-prive/admin/client-links.js"],"names":[],"mappings":"AAUA,+EA2DC"}
1
+ {"version":3,"file":"client-links.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/espace-prive/admin/client-links.js"],"names":[],"mappings":"AAYA,+EA8DC"}
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useUbloContext } from "ublo/with-ublo";
4
+ import { useSnackbar } from "dt-design-system/es/snackbar";
4
5
  import * as Services from "../services/links";
5
6
  import LinkRow from "./link-row";
6
7
  import LinkForm from "./link-form";
7
8
  import Config from "./config";
8
9
  import Message from "../message";
10
+ import { snackbarMessage } from "../utils/snackbar-message";
9
11
  import { useContext } from "../context";
10
12
  import styles from "./client-links.module.css";
11
13
  export default function ClientLinks() {
@@ -13,6 +15,7 @@ export default function ClientLinks() {
13
15
  const { domains } = config;
14
16
  const { apiURL, partnerID, cmsToken } = useContext();
15
17
  const relativeURL = `https://${domains.fr}${path}`;
18
+ const snackbar = useSnackbar();
16
19
  const [links, setLinks] = React.useState([]);
17
20
  const getExistingLinks = React.useCallback(async () => {
18
21
  const existingLinks = await Services.getLinks(apiURL, partnerID, cmsToken);
@@ -25,9 +28,11 @@ export default function ClientLinks() {
25
28
  try {
26
29
  await Services.deleteLink(apiURL, id, cmsToken);
27
30
  setLinks((prevState) => prevState.filter((link) => link.id !== id));
31
+ snackbarMessage(snackbar, lang, "link-deleted", "success");
28
32
  }
29
33
  catch (e) {
30
34
  console.error(e);
35
+ snackbarMessage(snackbar, lang, "link-deleted-error", "error");
31
36
  }
32
37
  };
33
38
  return (_jsxs("div", { className: styles.container, children: [links.length > 0 && (_jsxs("table", { className: styles.table, children: [_jsx("thead", { className: styles.head, children: _jsxs("tr", { children: [_jsx("th", { className: styles.cell, scope: "col", children: _jsx(Message, { id: "table-head-emails" }) }), _jsx("th", { className: styles.cell, scope: "col", children: _jsx(Message, { id: "table-head-links" }) }), _jsx("th", { className: styles.cell, scope: "col", children: _jsx(Message, { id: "table-head-actions" }) })] }) }), _jsx("tbody", { children: links.map((link, i) => (_jsx(LinkRow, { path: relativeURL, onDelete: () => onDeleteLink(link.id), ...link }, i))) })] })), _jsx(LinkForm, { path: relativeURL, getExistingLinks: getExistingLinks }), _jsx(Config, {})] }));
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/message.js"],"names":[],"mappings":"AAiFO,iDAIN;AAEM;;QAGN"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/message.js"],"names":[],"mappings":"AAsFO,iDAIN;AAEM;;QAGN"}
@@ -33,6 +33,8 @@ const messages = {
33
33
  "mail-template-placeholder": "Bonjour,\n\nVous trouverez en bas de ce mail un lien vous permettant d'accéder à l'espace partenaire\n\nCordialement,\nL'équipe",
34
34
  "mail-pattern-error": "Un ou plusieurs e-mail ne respectent pas le bon format",
35
35
  "intermediary-error": "Une erreur est survenue lors de la récupération du code intermédiaire, veuillez contacter l'école.",
36
+ "link-deleted": "Le lien a bien été supprimé",
37
+ "link-deleted-error": "Une erreur est survenue lors de la suppression du lien",
36
38
  },
37
39
  en: {
38
40
  "partner-space-login-title": "Partner space",
@@ -67,6 +69,8 @@ const messages = {
67
69
  "mail-template-placeholder": "Hello,\n\nYou will find at the bottom of this email a link allowing you to access the partner space\n\nBest regards,\nThe team",
68
70
  "mail-pattern-error": "One or more emails do not respect the correct format",
69
71
  "intermediary-error": "An error occurred while retrieving the intermediary code, please contact the school.",
72
+ "link-deleted": "The link has been successfully deleted",
73
+ "link-deleted-error": "An error occurred while deleting the link",
70
74
  },
71
75
  };
72
76
  export const message = (lang, id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.38.37",
3
+ "version": "1.38.38",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.10.8",
6
6
  "leaflet": "^1.9.1",