Adjust page-layout struct and expression variables
This commit is contained in:
@@ -330,13 +330,17 @@ export default {
|
||||
userAgent: navigator.userAgent,
|
||||
breakpoint: this.getBreakpoint(), // This is from a global mixin uiHelpers
|
||||
},
|
||||
layout: this.layout || {},
|
||||
oldLayout: this.layout,
|
||||
layout: undefined,
|
||||
}
|
||||
|
||||
this.layouts.forEach(({ pageLayoutID, config }) => {
|
||||
this.layouts.forEach(layout => {
|
||||
const { config = {} } = layout
|
||||
if (!config.visibility.expression) return
|
||||
|
||||
expressions[pageLayoutID] = config.visibility.expression
|
||||
variables.layout = layout
|
||||
|
||||
expressions[layout.pageLayoutID] = config.visibility.expression
|
||||
})
|
||||
|
||||
return this.$SystemAPI.expressionEvaluate({ variables, expressions }).catch(() => {
|
||||
|
||||
@@ -217,13 +217,17 @@ export default {
|
||||
breakpoint: this.getBreakpoint(), // This is from a global mixin uiHelpers
|
||||
},
|
||||
user: this.$auth.user,
|
||||
layout: this.layout || {},
|
||||
oldLayout: this.layout,
|
||||
layout: undefined,
|
||||
}
|
||||
|
||||
this.layouts.forEach(({ pageLayoutID, config }) => {
|
||||
this.layouts.forEach(layout => {
|
||||
const { config = {} } = layout
|
||||
if (!config.visibility.expression) return
|
||||
|
||||
expressions[pageLayoutID] = config.visibility.expression
|
||||
variables.layout = layout
|
||||
|
||||
expressions[layout.pageLayoutID] = config.visibility.expression
|
||||
})
|
||||
|
||||
return this.$SystemAPI.expressionEvaluate({ variables, expressions }).catch(() => {
|
||||
|
||||
@@ -20,6 +20,7 @@ interface PageLayoutConfig {
|
||||
|
||||
interface Action {
|
||||
kind: string;
|
||||
enabled: boolean;
|
||||
placement: string;
|
||||
params: unknown;
|
||||
meta: ActionMeta;
|
||||
@@ -27,6 +28,9 @@ interface Action {
|
||||
|
||||
interface ActionMeta {
|
||||
label: string;
|
||||
style: {
|
||||
variant: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface Visibility {
|
||||
|
||||
Reference in New Issue
Block a user