Merge pull request #9548 from Budibase/fix/peter-fixes

Fixes for multiple issues
This commit is contained in:
Peter Clement 2023-02-06 19:54:13 +00:00 committed by GitHub
commit ac9247cb66
4 changed files with 13 additions and 10 deletions

View File

@ -25,7 +25,7 @@
let open = false let open = false
//eslint-disable-next-line //eslint-disable-next-line
const STRIP_NAME_REGEX = /(?<=\.)(.*?)(?=\ })/g const STRIP_NAME_REGEX = /(\w+?)(?=\ })/g
// Strips the name out of the value which is {{ env.Variable }} resulting in an array like ["Variable"] // Strips the name out of the value which is {{ env.Variable }} resulting in an array like ["Variable"]
$: hbsValue = String(value)?.match(STRIP_NAME_REGEX) || [] $: hbsValue = String(value)?.match(STRIP_NAME_REGEX) || []

View File

@ -70,7 +70,7 @@
return Number(value) return Number(value)
} }
if (type === "options") { if (type === "options") {
return [value] return value
} }
if (type === "array") { if (type === "array") {
if (Array.isArray(value)) { if (Array.isArray(value)) {

View File

@ -1,6 +1,7 @@
import { writable } from "svelte/store" import { writable, get } from "svelte/store"
import { API } from "api" import { API } from "api"
import { Constants } from "@budibase/frontend-core" import { Constants } from "@budibase/frontend-core"
import { licensing } from "stores/portal"
export function createEnvironmentStore() { export function createEnvironmentStore() {
const { subscribe, update } = writable({ const { subscribe, update } = writable({
@ -17,6 +18,7 @@ export function createEnvironmentStore() {
} }
async function loadVariables() { async function loadVariables() {
if (get(licensing).environmentVariablesEnabled) {
const envVars = await API.fetchEnvironmentVariables() const envVars = await API.fetchEnvironmentVariables()
const mappedVars = envVars.variables.map(name => ({ name })) const mappedVars = envVars.variables.map(name => ({ name }))
update(store => { update(store => {
@ -24,6 +26,7 @@ export function createEnvironmentStore() {
return store return store
}) })
} }
}
async function createVariable(data) { async function createVariable(data) {
await API.createEnvironmentVariable(data) await API.createEnvironmentVariable(data)

View File

@ -112,7 +112,7 @@ export default class AppApi {
async delete(appId: string): Promise<Response> { async delete(appId: string): Promise<Response> {
const response = await this.api.del(`/applications/${appId}`) const response = await this.api.del(`/applications/${appId}`)
expect(response).toHaveStatusCode(204) expect(response).toHaveStatusCode(200)
return response return response
} }