@mattisvensson/strapi-plugin-webatlas 0.2.6 → 0.3.1
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/README.md +2 -3
- package/dist/_chunks/de-4tL_cJTC.js +104 -0
- package/dist/_chunks/de-C8PE3n3B.mjs +104 -0
- package/dist/_chunks/en-Bg4z3fR7.js +104 -0
- package/dist/_chunks/en-CR1YZvJo.mjs +104 -0
- package/dist/_chunks/{index-D4IHmUrH.js → index-BAqGJ3TM.js} +298 -91
- package/dist/_chunks/{index-BMQSVj43.mjs → index-BBL_eQ0G.mjs} +167 -78
- package/dist/_chunks/{index-B_RPO9ty.mjs → index-BOq-WidK.mjs} +57 -17
- package/dist/_chunks/{index-DIyVy-8D.js → index-C4ou6MTp.js} +57 -17
- package/dist/_chunks/{index-DrlYDm6a.js → index-CKoxbSC0.js} +166 -77
- package/dist/_chunks/{index-uoH_HJQr.mjs → index-CwHhwtOU.mjs} +296 -89
- package/dist/_chunks/index-DZmhgSeq.mjs +92 -0
- package/dist/_chunks/{index-BvXbuF1E.js → index-DsTyLL2l.js} +56 -8
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/URLInfo.d.ts +2 -1
- package/dist/admin/src/components/modals/NavModal.d.ts +2 -1
- package/dist/admin/src/utils/getRouteType.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +2 -1
- package/dist/server/index.js +15 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +15 -2
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/_chunks/index-BMlQpLGa.mjs +0 -44
package/dist/server/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function transformToUrl(input) {
|
|
|
19
19
|
input = input.replace(/-+/g, "-");
|
|
20
20
|
return input;
|
|
21
21
|
}
|
|
22
|
-
const version = "0.
|
|
22
|
+
const version = "0.3.1";
|
|
23
23
|
const keywords = [];
|
|
24
24
|
const type = "commonjs";
|
|
25
25
|
const exports = {
|
|
@@ -238,9 +238,11 @@ const bootstrap = async ({ strapi: strapi2 }) => {
|
|
|
238
238
|
});
|
|
239
239
|
strapi2.db?.lifecycles.subscribe({
|
|
240
240
|
models: config2.selectedContentTypes.map((type2) => type2.uid),
|
|
241
|
-
async beforeCreate() {
|
|
241
|
+
async beforeCreate(event) {
|
|
242
242
|
const validContentTypes = config2.selectedContentTypes.filter((type2) => strapi2.contentTypes[type2.uid]);
|
|
243
243
|
await pluginStore.set({ key: "config", value: { selectedContentTypes: validContentTypes } });
|
|
244
|
+
if (!event.params.data.webatlas_path) return;
|
|
245
|
+
event.params.data.webatlas_path = transformToUrl(event.params.data.webatlas_path);
|
|
244
246
|
},
|
|
245
247
|
async afterCreate(event) {
|
|
246
248
|
const ctSettings = config2.selectedContentTypes.find((type2) => type2.uid === event.model.uid);
|
|
@@ -1481,6 +1483,7 @@ const sortItems = (items) => {
|
|
|
1481
1483
|
function extractRouteAndItems(items) {
|
|
1482
1484
|
return items.map((item) => {
|
|
1483
1485
|
const route2 = { ...item.route };
|
|
1486
|
+
if (!route2) return null;
|
|
1484
1487
|
if (item.depth) {
|
|
1485
1488
|
route2.depth = item.depth;
|
|
1486
1489
|
}
|
|
@@ -5665,6 +5668,16 @@ const admin = ({ strapi: strapi2 }) => ({
|
|
|
5665
5668
|
},
|
|
5666
5669
|
async deleteNavigation(documentId) {
|
|
5667
5670
|
try {
|
|
5671
|
+
const navigation2 = await strapi2.documents(waNavigation).findOne({
|
|
5672
|
+
documentId,
|
|
5673
|
+
populate: ["items"]
|
|
5674
|
+
});
|
|
5675
|
+
if (!navigation2) throw new Error("Navigation not found");
|
|
5676
|
+
for (const item of navigation2.items) {
|
|
5677
|
+
await strapi2.documents(waNavItem).delete({
|
|
5678
|
+
documentId: item.documentId
|
|
5679
|
+
});
|
|
5680
|
+
}
|
|
5668
5681
|
return await strapi2.documents(waNavigation).delete({
|
|
5669
5682
|
documentId
|
|
5670
5683
|
});
|