Skip to content

Commit ad185de

Browse files
committed
Merge branch 'staging' of github.com:UNICEFECAR/USupport-cms
2 parents 4bcfefb + 7e161b0 commit ad185de

6 files changed

Lines changed: 2208 additions & 1 deletion

File tree

config/ckeditor.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/* eslint-disable */
2+
const CKEConfig = () => ({
3+
presets: {
4+
markdown: {
5+
field: {
6+
key: "markdown",
7+
value: "markdown",
8+
metadatas: {
9+
intlLabel: {
10+
id: "ckeditor.preset.markdown.label",
11+
defaultMessage: "Markdown output",
12+
},
13+
},
14+
},
15+
editorConfig: {
16+
placeholder: "Markdown editor",
17+
plugins: [
18+
globalThis.SH_CKE.Essentials,
19+
globalThis.SH_CKE.Autoformat,
20+
globalThis.SH_CKE.BlockQuote,
21+
globalThis.SH_CKE.Bold,
22+
globalThis.SH_CKE.Heading,
23+
globalThis.SH_CKE.Image,
24+
globalThis.SH_CKE.ImageCaption,
25+
globalThis.SH_CKE.ImageStyle,
26+
globalThis.SH_CKE.ImageToolbar,
27+
globalThis.SH_CKE.ImageUpload,
28+
globalThis.SH_CKE.Indent,
29+
globalThis.SH_CKE.Italic,
30+
globalThis.SH_CKE.Link,
31+
globalThis.SH_CKE.List,
32+
globalThis.SH_CKE.MediaEmbed,
33+
globalThis.SH_CKE.Paragraph,
34+
globalThis.SH_CKE.Table,
35+
globalThis.SH_CKE.TableCaption,
36+
globalThis.SH_CKE.TableCellProperties,
37+
globalThis.SH_CKE.TableColumnResize,
38+
globalThis.SH_CKE.TableProperties,
39+
globalThis.SH_CKE.TableToolbar,
40+
globalThis.SH_CKE.SourceEditing,
41+
globalThis.SH_CKE.StrapiMediaLib,
42+
globalThis.SH_CKE.StrapiUploadAdapter,
43+
globalThis.SH_CKE.Markdown,
44+
globalThis.SH_CKE.Strikethrough,
45+
globalThis.SH_CKE.HorizontalLine,
46+
globalThis.SH_CKE.FontFamily,
47+
globalThis.SH_CKE.FontSize,
48+
globalThis.SH_CKE.FontColor,
49+
globalThis.SH_CKE.FontBackgroundColor,
50+
],
51+
toolbar: {
52+
items: [
53+
"heading",
54+
"fontFamily",
55+
"fontSize",
56+
"fontColor",
57+
"fontBackgroundColor",
58+
"|",
59+
"bold",
60+
"italic",
61+
"strikethrough",
62+
"link",
63+
"|",
64+
"bulletedList",
65+
"numberedList",
66+
"|",
67+
"insertTable",
68+
"setTableRowHeader",
69+
"setTableColumnHeader",
70+
"|",
71+
"uploadImage",
72+
"strapiMediaLib",
73+
"blockQuote",
74+
"horizontalLine",
75+
"-",
76+
"sourceEditing",
77+
"|",
78+
"outdent",
79+
"indent",
80+
"|",
81+
"undo",
82+
"redo",
83+
],
84+
shouldNotGroupWhenFull: true,
85+
},
86+
table: {
87+
contentToolbar: [
88+
"tableColumn",
89+
"tableRow",
90+
"mergeTableCells",
91+
"tableProperties",
92+
"tableCellProperties",
93+
"toggleTableCaption",
94+
],
95+
},
96+
image: {
97+
toolbar: [
98+
"imageStyle:inline",
99+
"imageStyle:block",
100+
"imageStyle:side",
101+
"|",
102+
"toggleImageCaption",
103+
"imageTextAlternative",
104+
],
105+
},
106+
},
107+
},
108+
},
109+
});

src/api/assessment-result/content-types/assessment-result/schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@
8181
"type": "relation",
8282
"relation": "oneToMany",
8383
"target": "api::video.video"
84+
},
85+
"summary_ck": {
86+
"pluginOptions": {
87+
"i18n": {
88+
"localized": true
89+
}
90+
},
91+
"type": "customField",
92+
"options": {
93+
"preset": "markdown"
94+
},
95+
"customField": "plugin::ckeditor5.CKEditor"
8496
}
8597
}
8698
}

src/api/privacy-policy/content-types/privacy-policy/schema.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,50 @@
6565
},
6666
"type": "boolean",
6767
"default": false
68+
},
69+
"test": {
70+
"pluginOptions": {
71+
"i18n": {
72+
"localized": true
73+
}
74+
},
75+
"type": "blocks"
76+
},
77+
"website_ck": {
78+
"pluginOptions": {
79+
"i18n": {
80+
"localized": true
81+
}
82+
},
83+
"type": "customField",
84+
"options": {
85+
"preset": "markdown"
86+
},
87+
"customField": "plugin::ckeditor5.CKEditor"
88+
},
89+
"client_ck": {
90+
"pluginOptions": {
91+
"i18n": {
92+
"localized": true
93+
}
94+
},
95+
"type": "customField",
96+
"options": {
97+
"preset": "markdown"
98+
},
99+
"customField": "plugin::ckeditor5.CKEditor"
100+
},
101+
"provider_ck": {
102+
"pluginOptions": {
103+
"i18n": {
104+
"localized": true
105+
}
106+
},
107+
"type": "customField",
108+
"options": {
109+
"preset": "markdown"
110+
},
111+
"customField": "plugin::ckeditor5.CKEditor"
68112
}
69113
}
70114
}

src/api/privacy-policy/controllers/privacy-policy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = createCoreController(
2222
.findMany({ where: { locale: query.locale } });
2323

2424
let result = null;
25+
let data = null;
2526
for (let i = 0; i < privacyPolicies.length; i++) {
2627
const currentData = privacyPolicies[i];
2728
if (currentData.country === query.country) {
@@ -31,12 +32,14 @@ module.exports = createCoreController(
3132
query.filters?.is_playandheal
3233
) {
3334
result = currentData[query.platform];
35+
data = currentData;
3436
} else if (currentData.global && query.filters?.global) {
3537
result = currentData[query.platform];
38+
data = currentData;
3639
}
3740
}
3841

39-
ctx.body = result;
42+
ctx.body = data.ck_editor;
4043
} catch (err) {
4144
console.log(err);
4245
ctx.status = 500;

types/generated/components.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { Attribute, Schema } from '@strapi/strapi';
2+
3+
declare module '@strapi/types' {
4+
export module Shared {}
5+
}

0 commit comments

Comments
 (0)