PR comments

This commit is contained in:
Martin McKeaveney 2024-10-14 11:06:55 +01:00
parent 5798b42454
commit cf8f7db36d
6 changed files with 19 additions and 13 deletions

View File

@ -18,7 +18,7 @@
export let schema export let schema
export let aiField = {} export let aiField = {}
$: OperationField = OperationFields[aiField.operation] || null $: OperationField = OperationFields[aiField.operation]
$: schemaWithoutRelations = Object.keys(schema).filter( $: schemaWithoutRelations = Object.keys(schema).filter(
key => schema[key].type !== "link" key => schema[key].type !== "link"
) )

View File

@ -1,6 +1,6 @@
<script> <script>
import { viewsV2, rowActions } from "stores/builder" import { viewsV2, rowActions } from "stores/builder"
import { admin, themeStore } from "stores/portal" import { admin, themeStore, licensing } from "stores/portal"
import { Grid } from "@budibase/frontend-core" import { Grid } from "@budibase/frontend-core"
import { API } from "api" import { API } from "api"
import { notifications } from "@budibase/bbui" import { notifications } from "@budibase/bbui"
@ -49,6 +49,7 @@
{buttons} {buttons}
allowAddRows allowAddRows
allowDeleteRows allowDeleteRows
licensing={$licensing}
showAvatars={false} showAvatars={false}
on:updatedatasource={handleGridViewUpdate} on:updatedatasource={handleGridViewUpdate}
isCloud={$admin.cloud} isCloud={$admin.cloud}

View File

@ -7,7 +7,7 @@
appStore, appStore,
rowActions, rowActions,
} from "stores/builder" } from "stores/builder"
import { themeStore, admin } from "stores/portal" import { themeStore, admin, licensing } from "stores/portal"
import { TableNames } from "constants" import { TableNames } from "constants"
import { Grid } from "@budibase/frontend-core" import { Grid } from "@budibase/frontend-core"
import { API } from "api" import { API } from "api"
@ -125,6 +125,7 @@
schemaOverrides={isUsersTable ? userSchemaOverrides : null} schemaOverrides={isUsersTable ? userSchemaOverrides : null}
showAvatars={false} showAvatars={false}
isCloud={$admin.cloud} isCloud={$admin.cloud}
licensing={$licensing}
{buttons} {buttons}
buttonsCollapsed buttonsCollapsed
on:updatedatasource={handleGridTableUpdate} on:updatedatasource={handleGridTableUpdate}

View File

@ -48,6 +48,7 @@
export let darkMode = false export let darkMode = false
export let isCloud = null export let isCloud = null
export let rowConditions = null export let rowConditions = null
export let licensing = null
// Unique identifier for DOM nodes inside this instance // Unique identifier for DOM nodes inside this instance
const gridID = `grid-${Math.random().toString().slice(2)}` const gridID = `grid-${Math.random().toString().slice(2)}`
@ -104,6 +105,7 @@
buttonsCollapsedText, buttonsCollapsedText,
darkMode, darkMode,
isCloud, isCloud,
licensing,
rowConditions, rowConditions,
}) })

View File

@ -26,6 +26,7 @@
$: style = makeStyle($menu) $: style = makeStyle($menu)
$: isNewRow = $focusedRowId === NewRowID $: isNewRow = $focusedRowId === NewRowID
$: budibaseAIEnabled = $config.licensing?.budibaseAIEnabled || $config.licensing?.customAIConfigsEnabled
const makeStyle = menu => { const makeStyle = menu => {
return `left:${menu.left}px; top:${menu.top}px;` return `left:${menu.left}px; top:${menu.top}px;`
@ -168,15 +169,17 @@
> >
Delete row Delete row
</MenuItem> </MenuItem>
<MenuItem {#if budibaseAIEnabled}
icon="MagicWand" <MenuItem
disabled={isNewRow || icon="MagicWand"
!$focusedRow?._rev || disabled={isNewRow ||
!$hasBudibaseIdentifiers} !$focusedRow?._rev ||
on:click={generateAIColumns} !$hasBudibaseIdentifiers}
> on:click={generateAIColumns}
Generate AI Columns >
</MenuItem> Generate AI Columns
</MenuItem>
{/if}
{/if} {/if}
</Menu> </Menu>
</GridPopover> </GridPopover>

View File

@ -119,7 +119,6 @@ export interface FormulaFieldMetadata extends BaseFieldSchema {
export interface AIFieldMetadata extends BaseFieldSchema { export interface AIFieldMetadata extends BaseFieldSchema {
type: FieldType.AI type: FieldType.AI
// formula: string
operation: AIOperationEnum operation: AIOperationEnum
columns?: string[] columns?: string[]
column?: string column?: string