@adminforth/rich-editor 1.2.3 → 1.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/.woodpecker/release.yml +0 -2
- package/build.log +2 -2
- package/custom/quillEditor.vue +4 -2
- package/dist/custom/quillEditor.vue +4 -2
- package/dist/index.js +4 -2
- package/index.ts +4 -2
- package/package.json +1 -1
package/.woodpecker/release.yml
CHANGED
package/build.log
CHANGED
|
@@ -10,5 +10,5 @@ custom/package.json
|
|
|
10
10
|
custom/quillEditor.vue
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
|
|
13
|
-
sent
|
|
14
|
-
total size is 20,
|
|
13
|
+
sent 21,044 bytes received 115 bytes 42,318.00 bytes/sec
|
|
14
|
+
total size is 20,627 speedup is 0.97
|
package/custom/quillEditor.vue
CHANGED
|
@@ -26,7 +26,9 @@ import adminforth from '@/adminforth';
|
|
|
26
26
|
import AsyncQueue from './async-queue';
|
|
27
27
|
import Quill from "quill";
|
|
28
28
|
import "quill/dist/quill.snow.css";
|
|
29
|
+
import { useI18n } from 'vue-i18n';
|
|
29
30
|
|
|
31
|
+
const { t } = useI18n();
|
|
30
32
|
function dbg(title: string,...args: any[]) {
|
|
31
33
|
// return; // comment for debug
|
|
32
34
|
console.log(title, ...args.map(a =>JSON.stringify(a, null, 1)));
|
|
@@ -130,7 +132,7 @@ async function saveToServer(file: File) {
|
|
|
130
132
|
|
|
131
133
|
if (error) {
|
|
132
134
|
adminforth.alert({
|
|
133
|
-
message:
|
|
135
|
+
message: `${t('File was not uploaded because of error:')} ${error}`,
|
|
134
136
|
variant: 'danger'
|
|
135
137
|
});
|
|
136
138
|
return;
|
|
@@ -155,7 +157,7 @@ async function saveToServer(file: File) {
|
|
|
155
157
|
});
|
|
156
158
|
if (!success) {
|
|
157
159
|
adminforth.alert({
|
|
158
|
-
messageHtml: `<div
|
|
160
|
+
messageHtml: `<div>${t('Sorry but the file was not uploaded because of S3 Request Error:')} </div>
|
|
159
161
|
<pre style="white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;">${
|
|
160
162
|
xhr.responseText.replace(/</g, '<').replace(/>/g, '>')
|
|
161
163
|
}</pre>`,
|
|
@@ -26,7 +26,9 @@ import adminforth from '@/adminforth';
|
|
|
26
26
|
import AsyncQueue from './async-queue';
|
|
27
27
|
import Quill from "quill";
|
|
28
28
|
import "quill/dist/quill.snow.css";
|
|
29
|
+
import { useI18n } from 'vue-i18n';
|
|
29
30
|
|
|
31
|
+
const { t } = useI18n();
|
|
30
32
|
function dbg(title: string,...args: any[]) {
|
|
31
33
|
// return; // comment for debug
|
|
32
34
|
console.log(title, ...args.map(a =>JSON.stringify(a, null, 1)));
|
|
@@ -130,7 +132,7 @@ async function saveToServer(file: File) {
|
|
|
130
132
|
|
|
131
133
|
if (error) {
|
|
132
134
|
adminforth.alert({
|
|
133
|
-
message:
|
|
135
|
+
message: `${t('File was not uploaded because of error:')} ${error}`,
|
|
134
136
|
variant: 'danger'
|
|
135
137
|
});
|
|
136
138
|
return;
|
|
@@ -155,7 +157,7 @@ async function saveToServer(file: File) {
|
|
|
155
157
|
});
|
|
156
158
|
if (!success) {
|
|
157
159
|
adminforth.alert({
|
|
158
|
-
messageHtml: `<div
|
|
160
|
+
messageHtml: `<div>${t('Sorry but the file was not uploaded because of S3 Request Error:')} </div>
|
|
159
161
|
<pre style="white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;">${
|
|
160
162
|
xhr.responseText.replace(/</g, '<').replace(/>/g, '>')
|
|
161
163
|
}</pre>`,
|
package/dist/index.js
CHANGED
|
@@ -51,9 +51,11 @@ export default class RichEditorPlugin extends AdminForthPlugin {
|
|
|
51
51
|
if (!plugin) {
|
|
52
52
|
throw new Error(`Plugin for attachment field '${this.options.attachments.attachmentFieldName}' not found in resource '${this.options.attachments.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments.attachmentFieldName}`);
|
|
53
53
|
}
|
|
54
|
-
if (plugin.pluginOptions.
|
|
54
|
+
if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
|
|
55
55
|
throw new Error(`Upload Plugin for attachment field '${this.options.attachments.attachmentFieldName}' in resource '${this.options.attachments.attachmentResource}'
|
|
56
|
-
|
|
56
|
+
uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
|
|
57
|
+
Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
|
|
58
|
+
`);
|
|
57
59
|
}
|
|
58
60
|
this.uploadPlugin = plugin;
|
|
59
61
|
}
|
package/index.ts
CHANGED
|
@@ -57,9 +57,11 @@ export default class RichEditorPlugin extends AdminForthPlugin {
|
|
|
57
57
|
throw new Error(`Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (plugin.pluginOptions.
|
|
60
|
+
if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
|
|
61
61
|
throw new Error(`Upload Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' in resource '${this.options.attachments!.attachmentResource}'
|
|
62
|
-
|
|
62
|
+
uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
|
|
63
|
+
Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
|
|
64
|
+
`);
|
|
63
65
|
}
|
|
64
66
|
this.uploadPlugin = plugin;
|
|
65
67
|
}
|