@webbio/strapi-plugin-page-builder 0.11.16-platform → 0.12.0-platform
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/admin/src/components/PageFilters/index.tsx +1 -1
- package/dist/package.json +1 -1
- package/dist/server/bootstrap/permissions.js +1 -1
- package/dist/server/content-types/index.js +2 -2
- package/dist/server/content-types/{category → user-categories}/schema.json +4 -4
- package/dist/server/content-types/user-category/schema.json +23 -0
- package/dist/server/services/private-content/page.js +5 -0
- package/dist/server/services/private-content/user.js +11 -1
- package/dist/server/services/sitemap.js +49 -22
- package/dist/tsconfig.server.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/server/bootstrap/permissions.ts +1 -1
- package/server/content-types/index.ts +3 -3
- package/server/content-types/user-category/schema.json +23 -0
- package/server/services/private-content/page.ts +6 -0
- package/server/services/private-content/user.ts +11 -1
- package/server/services/sitemap.ts +51 -22
- package/dist/server/services/private-content/mail-template/txtMail.interface.js +0 -2
- package/server/content-types/category/schema.json +0 -18
|
@@ -10,7 +10,7 @@ import { useHasPlatformRelation } from '../../api/has-platform-relation';
|
|
|
10
10
|
|
|
11
11
|
const PageFiltersContainer = () => {
|
|
12
12
|
const { pathname } = useLocation();
|
|
13
|
-
const uid = pathname.split('/').find((x) => x.startsWith('api::')) || '';
|
|
13
|
+
const uid = pathname.split('/').find((x) => x.startsWith('api::') || x.startsWith('plugin::')) || '';
|
|
14
14
|
const isPageCollectionType = uid === PAGE_UID;
|
|
15
15
|
|
|
16
16
|
const { data: hasPageRelation, isLoading } = useHasPageRelation({
|
package/dist/package.json
CHANGED
|
@@ -18,7 +18,7 @@ exports.default = async ({ strapi }) => {
|
|
|
18
18
|
plugin: 'page-builder',
|
|
19
19
|
name,
|
|
20
20
|
displayName,
|
|
21
|
-
category:
|
|
21
|
+
category: 'Platform',
|
|
22
22
|
handler: async (x) => {
|
|
23
23
|
var _a, _b, _c, _d;
|
|
24
24
|
if (((_a = x === null || x === void 0 ? void 0 : x.permission) === null || _a === void 0 ? void 0 : _a.subject) === 'api::platform.platform') {
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const schema_json_1 = __importDefault(require("./category/schema.json"));
|
|
6
|
+
const schema_json_1 = __importDefault(require("./user-category/schema.json"));
|
|
7
7
|
exports.default = {
|
|
8
|
-
category: {
|
|
8
|
+
'user-category': {
|
|
9
9
|
schema: schema_json_1.default
|
|
10
10
|
}
|
|
11
11
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"kind": "collectionType",
|
|
3
|
-
"collectionName": "categories",
|
|
3
|
+
"collectionName": "user-categories",
|
|
4
4
|
"info": {
|
|
5
|
-
"singularName": "category",
|
|
6
|
-
"pluralName": "categories",
|
|
7
|
-
"displayName": "
|
|
5
|
+
"singularName": "user-category",
|
|
6
|
+
"pluralName": "user-categories",
|
|
7
|
+
"displayName": "User Categories"
|
|
8
8
|
},
|
|
9
9
|
"options": {
|
|
10
10
|
"draftAndPublish": false,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "user-categories",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "user-category",
|
|
6
|
+
"pluralName": "user-categories",
|
|
7
|
+
"displayName": "User Categories"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"draftAndPublish": false,
|
|
11
|
+
"comment": ""
|
|
12
|
+
},
|
|
13
|
+
"attributes": {
|
|
14
|
+
"title": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"platform": {
|
|
18
|
+
"type": "relation",
|
|
19
|
+
"relation": "oneToOne",
|
|
20
|
+
"target": "api::platform.platform"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -56,7 +56,17 @@ const extendUser = () => {
|
|
|
56
56
|
categories: {
|
|
57
57
|
type: 'relation',
|
|
58
58
|
relation: 'oneToMany',
|
|
59
|
-
target: 'plugin::page-builder.category'
|
|
59
|
+
target: 'plugin::page-builder.user-category'
|
|
60
|
+
},
|
|
61
|
+
filteredCategories: {
|
|
62
|
+
pluginOptions: {
|
|
63
|
+
filteredSelect: {
|
|
64
|
+
targetField: 'categories'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
// @ts-expect-error
|
|
68
|
+
type: 'customField',
|
|
69
|
+
customField: 'plugin::page-builder.filtered-select'
|
|
60
70
|
},
|
|
61
71
|
confirmMailSend: {
|
|
62
72
|
type: 'boolean',
|
|
@@ -5,28 +5,10 @@ const constants_1 = require("../../shared/utils/constants");
|
|
|
5
5
|
exports.default = {
|
|
6
6
|
async generateSitemap(domain) {
|
|
7
7
|
try {
|
|
8
|
-
const entities = await
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
platform: {
|
|
14
|
-
domain
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
path: {
|
|
19
|
-
$notNull: true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
publishedAt: {
|
|
24
|
-
$notNull: true
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
});
|
|
8
|
+
const entities = await this.fetchPages(domain);
|
|
9
|
+
if (entities.length === 0) {
|
|
10
|
+
throw new Error('Cannot generate a sitemap with 0 pages');
|
|
11
|
+
}
|
|
30
12
|
const sitemapStream = new sitemap_1.SitemapStream();
|
|
31
13
|
for (const entity of entities) {
|
|
32
14
|
const { path, updatedAt } = entity;
|
|
@@ -47,5 +29,50 @@ exports.default = {
|
|
|
47
29
|
console.error(error);
|
|
48
30
|
throw new Error(`Error generating sitemap for domain ${domain}`);
|
|
49
31
|
}
|
|
32
|
+
},
|
|
33
|
+
async fetchPages(domain) {
|
|
34
|
+
const entities = await strapi.query(constants_1.PAGE_UID).findMany({
|
|
35
|
+
select: ['path', 'updatedAt'],
|
|
36
|
+
where: {
|
|
37
|
+
$and: [
|
|
38
|
+
{
|
|
39
|
+
platform: {
|
|
40
|
+
domain: {
|
|
41
|
+
$eq: domain
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: {
|
|
47
|
+
$notNull: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
publishedAt: {
|
|
52
|
+
$notNull: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
$or: [
|
|
57
|
+
{
|
|
58
|
+
seo: {
|
|
59
|
+
metaRobots: {
|
|
60
|
+
$notContainsi: 'noindex'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
seo: {
|
|
66
|
+
metaRobots: {
|
|
67
|
+
$null: true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return entities;
|
|
50
77
|
}
|
|
51
78
|
};
|