adminizer 4.2.0-build.59 → 4.2.0-build.60

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.
@@ -1,8 +1,3 @@
1
- import { SwitchBase } from "./abstractSwitch";
2
- import { InfoBase } from "./abstractInfo";
3
- import { ActionBase } from "./abstractAction";
4
- import { LinkBase } from "./abstractLink";
5
- import { CustomBase } from "./abstractCustom";
6
1
  import * as process from "node:process";
7
2
  export class WidgetHandler {
8
3
  widgets = [];
@@ -40,7 +35,7 @@ export class WidgetHandler {
40
35
  if (this.widgets.length) {
41
36
  let id_key = 0;
42
37
  for (const widget of this.widgets) {
43
- if (widget instanceof SwitchBase) {
38
+ if (widget.widgetType === 'switcher') {
44
39
  if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
45
40
  widgets.push({
46
41
  id: `${widget.id}__${id_key}`,
@@ -54,7 +49,7 @@ export class WidgetHandler {
54
49
  });
55
50
  }
56
51
  }
57
- else if (widget instanceof InfoBase) {
52
+ else if (widget.widgetType === 'info') {
58
53
  if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
59
54
  widgets.push({
60
55
  id: `${widget.id}__${id_key}`,
@@ -68,7 +63,7 @@ export class WidgetHandler {
68
63
  });
69
64
  }
70
65
  }
71
- else if (widget instanceof ActionBase) {
66
+ else if (widget.widgetType === 'action') {
72
67
  if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
73
68
  widgets.push({
74
69
  id: `${widget.id}__${id_key}`,
@@ -82,7 +77,7 @@ export class WidgetHandler {
82
77
  });
83
78
  }
84
79
  }
85
- else if (widget instanceof LinkBase) {
80
+ else if (widget.widgetType === 'link') {
86
81
  if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
87
82
  let links_id_key = 0;
88
83
  for (const link of widget.links) {
@@ -100,7 +95,7 @@ export class WidgetHandler {
100
95
  }
101
96
  }
102
97
  }
103
- else if (widget instanceof CustomBase) {
98
+ else if (widget.widgetType === 'custom') {
104
99
  if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
105
100
  widgets.push({
106
101
  id: `${widget.id}_${id_key}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.2.0-build.59",
4
+ "version": "4.2.0-build.60",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",