adminizer 4.2.0-build.56 → 4.2.0-build.57
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.
|
@@ -45,7 +45,7 @@ export class AccessRightsHelper {
|
|
|
45
45
|
}
|
|
46
46
|
hasPermission(tokenId, user) {
|
|
47
47
|
if (!tokenId) {
|
|
48
|
-
Adminizer.log.
|
|
48
|
+
Adminizer.log.warn(`AccessRightsHelper > hasPermission no tokenId: ${tokenId}`);
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
tokenId = tokenId.toLowerCase();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import inertiaActionsHelper from "./inertiaActionsHelper";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { isObject } from "./JsUtils";
|
|
4
|
+
import { MediaManagerHandler } from "../lib/media-manager/MediaManagerHandler";
|
|
4
5
|
export default function inertiaAddHelper(req, entity, fields, record, view = false) {
|
|
5
6
|
const actionType = 'add';
|
|
6
7
|
let props = {
|
|
@@ -104,8 +105,14 @@ export default function inertiaAddHelper(req, entity, fields, record, view = fal
|
|
|
104
105
|
options = getControlsOptions(fieldConfig, req, fieldType, 'leaflet');
|
|
105
106
|
}
|
|
106
107
|
if (type === 'mediamanager') {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
let mediaManager = MediaManagerHandler.get('default');
|
|
109
|
+
if (!mediaManager) {
|
|
110
|
+
options = {};
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
fieldType = 'mediamanager';
|
|
114
|
+
options = field.config.options;
|
|
115
|
+
}
|
|
109
116
|
}
|
|
110
117
|
props.fields.push({
|
|
111
118
|
label: label,
|
|
@@ -14,7 +14,7 @@ export class MediaManagerHandler {
|
|
|
14
14
|
}
|
|
15
15
|
if (!instance) {
|
|
16
16
|
Adminizer.log.debug(`MediaManager list ${JSON.stringify(this.managers, null, 2)}`);
|
|
17
|
-
|
|
17
|
+
Adminizer.log.debug(`MediaManager with id ${id} not found`);
|
|
18
18
|
}
|
|
19
19
|
Adminizer.log.debug(`ins`, instance);
|
|
20
20
|
return instance;
|
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@ import { MediaManagerHandler } from "../lib/media-manager/MediaManagerHandler";
|
|
|
3
3
|
import serveStatic from "serve-static";
|
|
4
4
|
import path from "path";
|
|
5
5
|
export default function bindMediaManager(adminizer) {
|
|
6
|
+
if (!adminizer.config.mediamanager)
|
|
7
|
+
return;
|
|
6
8
|
adminizer.emitter.on("adminizer:loaded", async () => {
|
|
7
9
|
try {
|
|
8
10
|
let mediaManager = new DefaultMediaManager(adminizer, 'default', 'media-manager', adminizer.config.mediamanager.fileStoragePath);
|