adminizer 4.2.0-build.57 → 4.2.0-build.58
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/lib/v4/widgets/abstractAction.d.ts +2 -2
- package/lib/v4/widgets/abstractAction.js +2 -2
- package/lib/v4/widgets/abstractCustom.d.ts +1 -1
- package/lib/v4/widgets/abstractCustom.js +1 -1
- package/lib/v4/widgets/abstractInfo.d.ts +2 -2
- package/lib/v4/widgets/abstractInfo.js +2 -2
- package/lib/v4/widgets/abstractLink.d.ts +2 -2
- package/lib/v4/widgets/abstractLink.js +2 -2
- package/lib/v4/widgets/abstractSwitch.d.ts +2 -2
- package/lib/v4/widgets/abstractSwitch.js +2 -2
- package/lib/v4/widgets/abstractWidgetBase.d.ts +1 -1
- package/lib/v4/widgets/abstractWidgetBase.js +1 -1
- package/lib/v4/widgets/widgetHandler.d.ts +6 -6
- package/lib/v4/widgets/widgetHandler.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseWidget from "./abstractWidgetBase";
|
|
2
|
-
export
|
|
1
|
+
import { BaseWidget } from "./abstractWidgetBase";
|
|
2
|
+
export declare abstract class ActionBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "action";
|
|
4
4
|
/** Widget background css color */
|
|
5
5
|
abstract readonly backgroundCSS: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseWidget from "./abstractWidgetBase";
|
|
2
|
-
export
|
|
1
|
+
import { BaseWidget } from "./abstractWidgetBase";
|
|
2
|
+
export declare abstract class InfoBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "info";
|
|
4
4
|
/** Widget background css color */
|
|
5
5
|
readonly backgroundCSS: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseWidget from "./abstractWidgetBase";
|
|
2
|
-
export
|
|
1
|
+
import { BaseWidget } from "./abstractWidgetBase";
|
|
2
|
+
export class InfoBase extends BaseWidget {
|
|
3
3
|
widgetType = "info";
|
|
4
4
|
/** Widget background css color */
|
|
5
5
|
backgroundCSS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseWidget from "./abstractWidgetBase";
|
|
1
|
+
import { BaseWidget } from "./abstractWidgetBase";
|
|
2
2
|
import { MaterialIcon } from "../../../interfaces/MaaterialIcons";
|
|
3
3
|
export interface Links {
|
|
4
4
|
name: string;
|
|
@@ -8,7 +8,7 @@ export interface Links {
|
|
|
8
8
|
linkType: 'self' | 'blank';
|
|
9
9
|
backgroundCSS: string | null;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export declare abstract class LinkBase extends BaseWidget {
|
|
12
12
|
readonly widgetType = "link";
|
|
13
13
|
readonly abstract links: Links[];
|
|
14
14
|
/** Get info */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BaseWidget from "./abstractWidgetBase";
|
|
2
|
-
export
|
|
1
|
+
import { BaseWidget } from "./abstractWidgetBase";
|
|
2
|
+
export declare abstract class SwitchBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "switcher";
|
|
4
4
|
/** Widget background css color */
|
|
5
5
|
abstract readonly backgroundCSS: string | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export class BaseWidget {
|
|
2
2
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import InfoBase from "./abstractInfo";
|
|
3
|
-
import ActionBase from "./abstractAction";
|
|
4
|
-
import LinkBase from "./abstractLink";
|
|
5
|
-
import CustomBase from "./abstractCustom";
|
|
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
6
|
import { AdminpanelIcon } from "../../../interfaces/adminpanelConfig";
|
|
7
7
|
import { Adminizer } from "../../Adminizer";
|
|
8
8
|
import { UserAP } from "models/UserAP";
|
|
9
9
|
import { I18n } from "../I18n";
|
|
10
|
-
export type WidgetType = (
|
|
10
|
+
export type WidgetType = (SwitchBase | InfoBase | ActionBase | LinkBase | CustomBase);
|
|
11
11
|
export interface WidgetConfig {
|
|
12
12
|
id: string;
|
|
13
13
|
type: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import InfoBase from "./abstractInfo";
|
|
3
|
-
import ActionBase from "./abstractAction";
|
|
4
|
-
import LinkBase from "./abstractLink";
|
|
5
|
-
import CustomBase from "./abstractCustom";
|
|
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
6
|
import * as process from "node:process";
|
|
7
7
|
export class WidgetHandler {
|
|
8
8
|
widgets = [];
|
|
@@ -40,7 +40,7 @@ export class WidgetHandler {
|
|
|
40
40
|
if (this.widgets.length) {
|
|
41
41
|
let id_key = 0;
|
|
42
42
|
for (const widget of this.widgets) {
|
|
43
|
-
if (widget instanceof
|
|
43
|
+
if (widget instanceof SwitchBase) {
|
|
44
44
|
if (this.adminizer.accessRightsHelper.hasPermission(`widget-${widget.id}`, user)) {
|
|
45
45
|
widgets.push({
|
|
46
46
|
id: `${widget.id}__${id_key}`,
|