@reldens/cms 0.42.0 → 0.44.0
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.
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
if(window.trustedTypes?.createPolicy){
|
|
8
|
-
trustedTypes.createPolicy('default', {
|
|
8
|
+
trustedTypes.createPolicy('default', {
|
|
9
|
+
createHTML: s => s,
|
|
10
|
+
createScriptURL: s => s
|
|
11
|
+
});
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
window.addEventListener('DOMContentLoaded', () => {
|
|
@@ -198,7 +201,7 @@ window.addEventListener('DOMContentLoaded', () => {
|
|
|
198
201
|
let ids = [];
|
|
199
202
|
for(let checkbox of checkboxes){
|
|
200
203
|
if(checkbox.checked){
|
|
201
|
-
ids.push(
|
|
204
|
+
ids.push(checkbox.value);
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
207
|
if(0 === ids.length){
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes, viewport-fit=cover"/>
|
|
8
8
|
<!-- favicons -->
|
|
9
9
|
<meta name="msapplication-config" content="/assets/favicons/default/browserconfig.xml"/>
|
|
10
|
-
<link rel="icon" href="/assets/favicons/default/favicon.ico" type="image/x-icon"/>
|
|
11
|
-
<link rel="shortcut icon" href="/assets/favicons/default/favicon.ico" type="image/x-icon">
|
|
10
|
+
<link rel="shortcut icon" href="/assets/favicons/default/favicon.ico" type="image/x-icon"/>
|
|
12
11
|
<link rel="manifest" href="/assets/favicons/default/site.webmanifest"/>
|
|
13
12
|
<!-- CSS and JS -->
|
|
14
13
|
<link crossorigin rel="preconnect" href="https://fonts.googleapis.com"/>
|
package/lib/mysql-installer.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
const { execSync } = require('child_process');
|
|
8
8
|
const { FileHandler } = require('@reldens/server-utils');
|
|
9
|
-
const { Logger } = require('@reldens/utils');
|
|
9
|
+
const { Logger, sc } = require('@reldens/utils');
|
|
10
10
|
|
|
11
11
|
class MySQLInstaller
|
|
12
12
|
{
|
|
@@ -43,18 +43,33 @@ class MySQLInstaller
|
|
|
43
43
|
return '';
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
static normalizePrismaProvider(client)
|
|
47
|
+
{
|
|
48
|
+
if(-1 !== client.indexOf('mysql')){
|
|
49
|
+
return 'mysql';
|
|
50
|
+
}
|
|
51
|
+
if('postgresql' === client || 'postgres' === client){
|
|
52
|
+
return 'postgresql';
|
|
53
|
+
}
|
|
54
|
+
if('mongodb' === client){
|
|
55
|
+
return 'mongodb';
|
|
56
|
+
}
|
|
57
|
+
return client;
|
|
58
|
+
}
|
|
59
|
+
|
|
46
60
|
static async generateMinimalPrismaClient(dbConfig, projectRoot)
|
|
47
61
|
{
|
|
48
62
|
let prismaPath = FileHandler.joinPaths(projectRoot, 'prisma');
|
|
49
63
|
let schemaPath = FileHandler.joinPaths(prismaPath, 'schema.prisma');
|
|
50
64
|
FileHandler.createFolder(prismaPath);
|
|
65
|
+
let provider = MySQLInstaller.normalizePrismaProvider(sc.get(dbConfig, 'client', 'mysql'));
|
|
51
66
|
let schemaContent = 'generator client {\n'
|
|
52
67
|
+ ' provider = "prisma-client-js"\n'
|
|
53
68
|
+ ' output = "./client"\n'
|
|
54
69
|
+ '}\n'
|
|
55
70
|
+ '\n'
|
|
56
71
|
+ 'datasource db {\n'
|
|
57
|
-
+ ' provider = "'
|
|
72
|
+
+ ' provider = "'+provider+'"\n'
|
|
58
73
|
+ ' url = env("RELDENS_DB_URL")\n'
|
|
59
74
|
+ '}';
|
|
60
75
|
FileHandler.writeFile(schemaPath, schemaContent);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reldens/cms",
|
|
3
3
|
"scope": "@reldens",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"description": "Reldens - CMS",
|
|
6
6
|
"author": "Damian A. Pastorini",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"url": "https://github.com/damian-pastorini/reldens-cms/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@reldens/server-utils": "^0.
|
|
37
|
-
"@reldens/storage": "^0.
|
|
36
|
+
"@reldens/server-utils": "^0.41.0",
|
|
37
|
+
"@reldens/storage": "^0.80.0",
|
|
38
38
|
"@reldens/utils": "^0.54.0",
|
|
39
39
|
"dotenv": "17.2.3",
|
|
40
40
|
"mustache": "4.2.0"
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
function getCookie(name)
|
|
8
8
|
{
|
|
9
|
-
let value =
|
|
10
|
-
let parts = value.split(
|
|
9
|
+
let value = '; '+document.cookie;
|
|
10
|
+
let parts = value.split('; '+name+'=');
|
|
11
11
|
if(2 === parts.length){
|
|
12
|
-
return parts.pop().split(';').shift()
|
|
12
|
+
return parts.pop().split(';').shift();
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function deleteCookie(name)
|
|
17
17
|
{
|
|
18
|
-
document.cookie = name
|
|
18
|
+
document.cookie = name+'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function escapeHTML(str)
|
|
22
22
|
{
|
|
23
|
-
return str.replace(/&/g,
|
|
24
|
-
.replace(/</g,
|
|
25
|
-
.replace(/>/g,
|
|
26
|
-
.replace(/"/g,
|
|
27
|
-
.replace(/'/g,
|
|
23
|
+
return str.replace(/&/g, '&')
|
|
24
|
+
.replace(/</g, '<')
|
|
25
|
+
.replace(/>/g, '>')
|
|
26
|
+
.replace(/"/g, '"')
|
|
27
|
+
.replace(/'/g, ''');
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function cloneElement(element)
|
|
@@ -35,7 +35,7 @@ function cloneElement(element)
|
|
|
35
35
|
clonedCanvas.height = element.height;
|
|
36
36
|
let ctx = clonedCanvas.getContext('2d');
|
|
37
37
|
ctx.drawImage(element, 0, 0);
|
|
38
|
-
return clonedCanvas
|
|
38
|
+
return clonedCanvas;
|
|
39
39
|
}
|
|
40
40
|
return element.cloneNode(true);
|
|
41
41
|
}
|
|
@@ -68,7 +68,7 @@ function showConfirmDialog(callback)
|
|
|
68
68
|
function activateExpandCollapse()
|
|
69
69
|
{
|
|
70
70
|
let expandCollapseButtons = document.querySelectorAll('[data-expand-collapse]');
|
|
71
|
-
if(expandCollapseButtons){
|
|
71
|
+
if(!expandCollapseButtons){
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
for(let expandCollapseButton of expandCollapseButtons){
|