Type screenTemplating inline
This commit is contained in:
parent
81a37c2e7d
commit
c608243c40
|
@ -3,7 +3,7 @@ import { cloneDeep } from "lodash/fp"
|
||||||
|
|
||||||
export class BaseStructure<T extends Document> {
|
export class BaseStructure<T extends Document> {
|
||||||
private _isScreen: boolean
|
private _isScreen: boolean
|
||||||
private _children: Component[]
|
private _children: (Component | BaseStructure<any>)[]
|
||||||
_json: T
|
_json: T
|
||||||
|
|
||||||
constructor(isScreen: boolean, initialDoc: T) {
|
constructor(isScreen: boolean, initialDoc: T) {
|
||||||
|
@ -12,7 +12,7 @@ export class BaseStructure<T extends Document> {
|
||||||
this._json = initialDoc
|
this._json = initialDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
addChild(child: Component) {
|
addChild(child: Component | BaseStructure<any>) {
|
||||||
this._children.push(child)
|
this._children.push(child)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { componentStore } from "@/stores/builder"
|
import { componentStore } from "@/stores/builder"
|
||||||
import { getRowActionButtonTemplates } from "@/templates/rowActions"
|
import { getRowActionButtonTemplates } from "@/templates/rowActions"
|
||||||
import { Helpers } from "@budibase/bbui"
|
import { Helpers } from "@budibase/bbui"
|
||||||
import { Screen as ScreenDoc } from "@budibase/types"
|
import { Screen as ScreenDoc, UIPermissions } from "@budibase/types"
|
||||||
import { Component } from "../Component"
|
import { Component } from "../Component"
|
||||||
import getValidRoute from "./getValidRoute"
|
import getValidRoute from "./getValidRoute"
|
||||||
import { Screen } from "./Screen"
|
import { Screen } from "./Screen"
|
||||||
|
@ -24,10 +24,7 @@ export const getTypeSpecificRoute = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRole = (
|
const getRole = (permissions: UIPermissions, type: FormType) => {
|
||||||
permissions: { read: string; write: string },
|
|
||||||
type: FormType
|
|
||||||
) => {
|
|
||||||
if (type === "view") {
|
if (type === "view") {
|
||||||
return permissions.read
|
return permissions.read
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
import { Screen } from "../Screen"
|
|
||||||
import { Component } from "../../Component"
|
|
||||||
import { capitalise } from "@/helpers"
|
import { capitalise } from "@/helpers"
|
||||||
import getValidRoute from "../getValidRoute"
|
import { SourceOption } from "@/pages/builder/app/[application]/design/_components/NewScreen/utils"
|
||||||
import { getRowActionButtonTemplates } from "@/templates/rowActions"
|
import { getRowActionButtonTemplates } from "@/templates/rowActions"
|
||||||
|
import { Screen as ScreenDoc, UIPermissions } from "@budibase/types"
|
||||||
|
import { Component } from "../../Component"
|
||||||
|
import getValidRoute from "../getValidRoute"
|
||||||
|
import { Screen } from "../Screen"
|
||||||
|
|
||||||
const inline = async ({ tableOrView, permissions, screens }) => {
|
const inline = async ({
|
||||||
|
tableOrView,
|
||||||
|
permissions,
|
||||||
|
screens,
|
||||||
|
}: {
|
||||||
|
tableOrView: SourceOption
|
||||||
|
permissions: UIPermissions
|
||||||
|
screens: ScreenDoc[]
|
||||||
|
}) => {
|
||||||
const heading = new Component("@budibase/standard-components/textv2")
|
const heading = new Component("@budibase/standard-components/textv2")
|
||||||
.instanceName("Table heading")
|
.instanceName("Table heading")
|
||||||
.customProps({
|
.customProps({
|
|
@ -1,8 +1,9 @@
|
||||||
export * from "./stores"
|
|
||||||
export * from "./bindings"
|
export * from "./bindings"
|
||||||
|
export * from "./BudibaseApp"
|
||||||
|
export * from "./common"
|
||||||
export * from "./components"
|
export * from "./components"
|
||||||
export * from "./dataFetch"
|
export * from "./dataFetch"
|
||||||
export * from "./datasource"
|
export * from "./datasource"
|
||||||
export * from "./common"
|
|
||||||
export * from "./BudibaseApp"
|
|
||||||
export * from "./fields"
|
export * from "./fields"
|
||||||
|
export * from "./permissions"
|
||||||
|
export * from "./stores"
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
export interface UIPermissions {
|
||||||
|
read: string
|
||||||
|
write: string
|
||||||
|
}
|
Loading…
Reference in New Issue