Skip to content

Commit

Permalink
Merge branch 'master' into automation-duplicate-name
Browse files Browse the repository at this point in the history
  • Loading branch information
shogunpurple authored Dec 30, 2024
2 parents 4339bf1 + a759b46 commit 19bc30a
Show file tree
Hide file tree
Showing 42 changed files with 1,176 additions and 726 deletions.
1 change: 1 addition & 0 deletions packages/bbui/src/Form/Core/DatePicker/NumberInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}
input.hide-arrows {
-moz-appearance: textfield;
appearance: textfield;
}
input[type="time"]::-webkit-calendar-picker-indicator {
display: none;
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Form/Core/Slider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
padding: 0;
margin: 0;
-webkit-appearance: none;
appearance: none;
background: transparent;
}
input::-webkit-slider-thumb {
Expand Down
2 changes: 0 additions & 2 deletions packages/bbui/src/Tabs/Tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@
.spectrum-Tabs-selectionIndicator.emphasized {
background-color: var(--spectrum-global-color-blue-400);
}
.spectrum-Tabs--horizontal .spectrum-Tabs-selectionIndicator {
}
.noHorizPadding {
padding: 0;
}
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Tooltip/AbsTooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
.spectrum-Tooltip-label {
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 12px;
Expand Down
1 change: 1 addition & 0 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@sveltejs/vite-plugin-svelte": "1.4.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/svelte": "^4.1.0",
"@types/shortid": "^2.2.0",
"babel-jest": "^29.6.2",
"identity-obj-proxy": "^3.0.0",
"jest": "29.7.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/builder/src/dataBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,12 @@ export const updateReferencesInObject = ({

// Migrate references
// Switch all bindings to reference their ids
export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => {
export const migrateReferencesInObject = ({
obj,
label = "steps",
steps,
originalIndex,
}) => {
const stepIndexRegex = new RegExp(`{{\\s*${label}\\.(\\d+)\\.`, "g")
const updateActionStep = (str, index, replaceWith) =>
str.replace(`{{ ${label}.${index}.`, `{{ ${label}.${replaceWith}.`)
Expand All @@ -1528,6 +1533,7 @@ export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => {
migrateReferencesInObject({
obj: obj[key],
steps,
originalIndex,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
import { API } from "api"
import { BudiStore } from "../BudiStore"
import {
App,
AppFeatures,
AppIcon,
AutomationSettings,
Plugin,
} from "@budibase/types"

export const INITIAL_APP_META_STATE = {
interface ClientFeatures {
spectrumThemes: boolean
intelligentLoading: boolean
deviceAwareness: boolean
state: boolean
rowSelection: boolean
customThemes: boolean
devicePreview: boolean
messagePassing: boolean
continueIfAction: boolean
showNotificationAction: boolean
sidePanel: boolean
}

interface TypeSupportPresets {
[key: string]: any
}

interface AppMetaState {
appId: string
name: string
url: string
libraries: string[]
clientFeatures: ClientFeatures
typeSupportPresets: TypeSupportPresets
features: AppFeatures
clientLibPath: string
hasLock: boolean
appInstance: { _id: string } | null
initialised: boolean
hasAppPackage: boolean
usedPlugins: Plugin[] | null
automations: AutomationSettings
routes: { [key: string]: any }
version?: string
revertableVersion?: string
upgradableVersion?: string
icon?: AppIcon
}

export const INITIAL_APP_META_STATE: AppMetaState = {
appId: "",
name: "",
url: "",
Expand Down Expand Up @@ -34,32 +81,36 @@ export const INITIAL_APP_META_STATE = {
routes: {},
}

export class AppMetaStore extends BudiStore {
export class AppMetaStore extends BudiStore<AppMetaState> {
constructor() {
super(INITIAL_APP_META_STATE)
}

reset() {
reset(): void {
this.store.set({ ...INITIAL_APP_META_STATE })
}

syncAppPackage(pkg) {
syncAppPackage(pkg: {
application: App
clientLibPath: string
hasLock: boolean
}): void {
const { application: app, clientLibPath, hasLock } = pkg

this.update(state => ({
...state,
name: app.name,
appId: app.appId,
url: app.url,
url: app.url || "",
hasLock,
clientLibPath,
libraries: app.componentLibraries,
version: app.version,
appInstance: app.instance,
revertableVersion: app.revertableVersion,
upgradableVersion: app.upgradableVersion,
usedPlugins: app.usedPlugins,
icon: app.icon || {},
usedPlugins: app.usedPlugins || null,
icon: app.icon,
features: {
...INITIAL_APP_META_STATE.features,
...app.features,
Expand All @@ -70,7 +121,7 @@ export class AppMetaStore extends BudiStore {
}))
}

syncClientFeatures(features) {
syncClientFeatures(features: Partial<ClientFeatures>): void {
this.update(state => ({
...state,
clientFeatures: {
Expand All @@ -80,14 +131,14 @@ export class AppMetaStore extends BudiStore {
}))
}

syncClientTypeSupportPresets(typeSupportPresets) {
syncClientTypeSupportPresets(typeSupportPresets: TypeSupportPresets): void {
this.update(state => ({
...state,
typeSupportPresets,
}))
}

async syncAppRoutes() {
async syncAppRoutes(): Promise<void> {
const resp = await API.fetchAppRoutes()
this.update(state => ({
...state,
Expand All @@ -96,7 +147,7 @@ export class AppMetaStore extends BudiStore {
}

// Returned from socket
syncMetadata(metadata) {
syncMetadata(metadata: { name: string; url: string; icon?: AppIcon }): void {
const { name, url, icon } = metadata
this.update(state => ({
...state,
Expand Down
Loading

0 comments on commit 19bc30a

Please sign in to comment.