@mattisvensson/strapi-plugin-webatlas 0.2.3 → 0.2.5

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.
Files changed (41) hide show
  1. package/dist/_chunks/EmptyBox-7D4LrvdH.mjs.map +1 -0
  2. package/dist/_chunks/EmptyBox-DT6D5gcf.js.map +1 -0
  3. package/dist/_chunks/_baseConvert-CDjccxdO.mjs +859 -0
  4. package/dist/_chunks/_baseConvert-CDjccxdO.mjs.map +1 -0
  5. package/dist/_chunks/_baseConvert-DVIhGQH6.js +858 -0
  6. package/dist/_chunks/_baseConvert-DVIhGQH6.js.map +1 -0
  7. package/dist/_chunks/en-B4KWt_jN.js.map +1 -0
  8. package/dist/_chunks/en-Byx4XI2L.mjs.map +1 -0
  9. package/dist/_chunks/index-1VNPebOd.mjs +45 -0
  10. package/dist/_chunks/index-1VNPebOd.mjs.map +1 -0
  11. package/dist/_chunks/{index-BLQ7k9G6.js → index-B-ABW-o6.js} +1 -1
  12. package/dist/_chunks/{index-rvOUYDZ4.mjs → index-B5ilx6DT.mjs} +1 -1
  13. package/dist/_chunks/{index-C9tlbXg0.js → index-B7vKSyAn.js} +15 -51
  14. package/dist/_chunks/index-B7vKSyAn.js.map +1 -0
  15. package/dist/_chunks/{index-C4EZHacG.mjs → index-BjbgWZrg.mjs} +4 -4
  16. package/dist/_chunks/{index-C3a42qmP.mjs → index-BxuR805w.mjs} +2 -32
  17. package/dist/_chunks/{index-CnY7liYv.js → index-CAjBRbaH.js} +4 -4
  18. package/dist/_chunks/index-CPE1Ne_e.js +4102 -0
  19. package/dist/_chunks/index-CPE1Ne_e.js.map +1 -0
  20. package/dist/_chunks/index-ChOgKZGK.mjs +9924 -0
  21. package/dist/_chunks/index-ChOgKZGK.mjs.map +1 -0
  22. package/dist/_chunks/index-Cs_oxZfX.js +17134 -0
  23. package/dist/_chunks/index-CuMn96qA.js +9924 -0
  24. package/dist/_chunks/index-CuMn96qA.js.map +1 -0
  25. package/dist/_chunks/{index-BDCJSjey.mjs → index-D_OdzeaU.mjs} +1 -1
  26. package/dist/_chunks/index-Djk_-mU6.js +45 -0
  27. package/dist/_chunks/index-Djk_-mU6.js.map +1 -0
  28. package/dist/_chunks/index-HHBjOGX5.mjs +17130 -0
  29. package/dist/_chunks/index-HHBjOGX5.mjs.map +1 -0
  30. package/dist/_chunks/{index-B_a-qtdq.js → index-kz3NL7uv.js} +1 -1
  31. package/dist/_chunks/index-yLrZAFVv.mjs +4086 -0
  32. package/dist/_chunks/index-yLrZAFVv.mjs.map +1 -0
  33. package/dist/admin/index.js +1 -1
  34. package/dist/admin/index.js.map +1 -0
  35. package/dist/admin/index.mjs +1 -1
  36. package/dist/admin/index.mjs.map +1 -0
  37. package/dist/server/index.js +14 -6
  38. package/dist/server/index.js.map +1 -0
  39. package/dist/server/index.mjs +14 -6
  40. package/dist/server/index.mjs.map +1 -0
  41. package/package.json +1 -1
@@ -19,7 +19,7 @@ function transformToUrl(input) {
19
19
  input = input.replace(/-+/g, "-");
20
20
  return input;
21
21
  }
22
- const version = "0.2.3";
22
+ const version = "0.2.5";
23
23
  const keywords = [];
24
24
  const type = "commonjs";
25
25
  const exports = {
@@ -205,6 +205,7 @@ const bootstrap = async ({ strapi: strapi2 }) => {
205
205
  if (!config2?.selectedContentTypes) return;
206
206
  strapi2.db?.lifecycles.subscribe({
207
207
  models: [waNavItem],
208
+ // TODO: is beforeDelete needed?
208
209
  async beforeDelete(event) {
209
210
  const id = event.params.where["id"];
210
211
  if (!id) return;
@@ -215,6 +216,7 @@ const bootstrap = async ({ strapi: strapi2 }) => {
215
216
  },
216
217
  populate: ["route"]
217
218
  });
219
+ if (!navItem || !navItem.route) return;
218
220
  event.state = navItem.route.id && !navItem.route.internal ? { id: navItem.route.id } : null;
219
221
  } catch (err) {
220
222
  console.log(err);
@@ -247,6 +249,12 @@ const bootstrap = async ({ strapi: strapi2 }) => {
247
249
  webatlas_override
248
250
  } = event.params.data;
249
251
  if (!webatlas_path) return;
252
+ const relatedRoute = await strapi2.db?.query(waRoute).findOne({
253
+ where: {
254
+ relatedDocumentId: event.result.documentId
255
+ }
256
+ });
257
+ if (relatedRoute) return;
250
258
  const title = ctSettings?.default ? event.params.data[ctSettings.default] : "";
251
259
  const path = await duplicateCheck(transformToUrl(webatlas_path));
252
260
  await strapi2.documents(waRoute).create({
@@ -296,8 +304,6 @@ const bootstrap = async ({ strapi: strapi2 }) => {
296
304
  }
297
305
  });
298
306
  } else {
299
- console.log("updating route", relatedRoute.documentId);
300
- console.log("with data", routeData);
301
307
  await strapi2.documents(waRoute).update({
302
308
  documentId: relatedRoute.documentId,
303
309
  data: {
@@ -870,7 +876,6 @@ const register = ({ strapi: strapi2 }) => {
870
876
  const { attributes } = contentType;
871
877
  const fieldSettings = {
872
878
  writable: true,
873
- private: true,
874
879
  configurable: false,
875
880
  editable: false,
876
881
  visible: true,
@@ -878,11 +883,13 @@ const register = ({ strapi: strapi2 }) => {
878
883
  };
879
884
  set$1(attributes, "webatlas_path", {
880
885
  ...fieldSettings,
881
- type: "string"
886
+ type: "string",
887
+ private: false
882
888
  });
883
889
  set$1(attributes, "webatlas_override", {
884
890
  ...fieldSettings,
885
- type: "boolean"
891
+ type: "boolean",
892
+ private: true
886
893
  });
887
894
  });
888
895
  };
@@ -5836,3 +5843,4 @@ const index = {
5836
5843
  export {
5837
5844
  index as default
5838
5845
  };
5846
+ //# sourceMappingURL=index.mjs.map