ode-explorer 1.3.3-develop.202402221755 → 1.3.3-develop.202402281829

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/index.js CHANGED
@@ -62463,50 +62463,38 @@ function useHasWorkflow(workflow) {
62463
62463
  }, [workflow, mock]), state;
62464
62464
  }
62465
62465
  const useConversation = () => {
62466
- const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [messages2, setMessages] = reactExports.useState(0), [msgLink, setMsgLink] = reactExports.useState(""), refreshMails = reactExports.useCallback(async () => {
62467
- if (zimbraWorkflow)
62468
- try {
62469
- const response = await odeServices.http().get("/zimbra/count/INBOX", {
62470
- queryParams: {
62471
- unread: true,
62472
- _: (/* @__PURE__ */ new Date()).getTime()
62473
- }
62474
- });
62475
- response.status !== 200 && setMessages(0), setMessages(response.count);
62476
- } catch {
62477
- console.error("error"), setMessages(0);
62478
- }
62479
- else
62480
- try {
62481
- const response = await odeServices.http().get("/conversation/count/INBOX", {
62482
- queryParams: {
62483
- unread: true,
62484
- _: (/* @__PURE__ */ new Date()).getTime()
62485
- }
62486
- });
62487
- setMessages(response.count);
62488
- } catch {
62489
- console.error("error"), setMessages(0);
62490
- }
62491
- }, [zimbraWorkflow]), goToMessagerie = reactExports.useCallback(() => {
62492
- let messagerieLink = "";
62493
- odeServices.http().get("/userbook/preference/zimbra").then((data) => {
62494
- try {
62495
- data.preference && JSON.parse(data.preference).modeExpert && zimbraPreauth ? messagerieLink = "/zimbra/preauth" : messagerieLink = window.location.origin + "/zimbra/zimbra";
62496
- } catch {
62497
- messagerieLink = "/zimbra/zimbra";
62498
- }
62499
- }), setMsgLink(messagerieLink);
62500
- }, [zimbraPreauth]);
62466
+ const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [messages2, setMessages] = reactExports.useState(0), [msgLink, setMsgLink] = reactExports.useState(""), queryParams = {
62467
+ unread: true,
62468
+ _: (/* @__PURE__ */ new Date()).getTime()
62469
+ }, refreshMails = reactExports.useCallback(async () => {
62470
+ const url = zimbraWorkflow ? "/zimbra/count/INBOX" : "/conversation/count/INBOX";
62471
+ try {
62472
+ const {
62473
+ status,
62474
+ count: count2
62475
+ } = await odeServices.http().get(url, {
62476
+ queryParams
62477
+ });
62478
+ setMessages(status === 200 ? count2 : 0);
62479
+ } catch (error) {
62480
+ console.error(error), setMessages(0);
62481
+ }
62482
+ }, [zimbraWorkflow]), goToMessagerie = reactExports.useCallback(async () => {
62483
+ const defaultLink = "/zimbra/zimbra";
62484
+ try {
62485
+ const {
62486
+ preference
62487
+ } = await odeServices.http().get("/userbook/preference/zimbra"), isExpertMode = preference ? JSON.parse(preference).modeExpert : false;
62488
+ setMsgLink(isExpertMode && zimbraPreauth ? "/zimbra/preauth" : window.location.origin + defaultLink);
62489
+ } catch (error) {
62490
+ console.error(error), setMsgLink(window.location.origin + defaultLink);
62491
+ }
62492
+ }, []);
62501
62493
  return reactExports.useEffect(() => {
62502
- (async () => {
62503
- try {
62504
- await refreshMails();
62505
- } catch (error) {
62506
- console.error(error);
62507
- }
62508
- })(), goToMessagerie();
62509
- }, [goToMessagerie, refreshMails]), {
62494
+ zimbraWorkflow && refreshMails();
62495
+ }, [zimbraWorkflow, refreshMails]), reactExports.useEffect(() => {
62496
+ zimbraPreauth && goToMessagerie();
62497
+ }, [zimbraPreauth, goToMessagerie]), {
62510
62498
  messages: messages2,
62511
62499
  msgLink,
62512
62500
  zimbraWorkflow
@@ -65788,7 +65776,7 @@ function ShareBlog({
65788
65776
  appCode
65789
65777
  } = useOdeClient(), {
65790
65778
  t: t2
65791
- } = useTranslation(appCode), publishType = resource && resource["publish-type"], [radioPublicationValue, setRadioPublicationValue] = reactExports.useState(publishType), handleRadioPublicationChange = async (event) => {
65779
+ } = useTranslation(appCode), publishType = resource && resource["publish-type"], [radioPublicationValue, setRadioPublicationValue] = reactExports.useState(publishType ?? "RESTRAINT"), handleRadioPublicationChange = async (event) => {
65792
65780
  const value = event.target.value;
65793
65781
  (async () => {
65794
65782
  const params = {
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 22/02/2024 17:55:51
1
+ ode-explorer=1.0-b2school-SNAPSHOT 28/02/2024 18:29:34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.3.3-develop.202402221755",
3
+ "version": "1.3.3-develop.202402281829",
4
4
  "description": "Open Digital Education Explorer",
5
5
  "homepage": "https://github.com/opendigitaleducation/explorer#readme",
6
6
  "bugs": {
@@ -74,7 +74,7 @@
74
74
  "eslint-plugin-react": "7.33.2",
75
75
  "eslint-plugin-react-hooks": "4.6.0",
76
76
  "eslint-plugin-react-refresh": "0.4.5",
77
- "husky": "8.0.3",
77
+ "husky": "9.0.7",
78
78
  "lint-staged": "15.2.0",
79
79
  "prettier": "3.2.4",
80
80
  "typescript": "5.3.3",