Merge pull request #9548 from Budibase/fix/peter-fixes
Fixes for multiple issues
This commit is contained in:
commit
ac9247cb66
|
@ -25,7 +25,7 @@
|
|||
let open = false
|
||||
|
||||
//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"]
|
||||
$: hbsValue = String(value)?.match(STRIP_NAME_REGEX) || []
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
return Number(value)
|
||||
}
|
||||
if (type === "options") {
|
||||
return [value]
|
||||
return value
|
||||
}
|
||||
if (type === "array") {
|
||||
if (Array.isArray(value)) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { writable } from "svelte/store"
|
||||
import { writable, get } from "svelte/store"
|
||||
import { API } from "api"
|
||||
import { Constants } from "@budibase/frontend-core"
|
||||
import { licensing } from "stores/portal"
|
||||
|
||||
export function createEnvironmentStore() {
|
||||
const { subscribe, update } = writable({
|
||||
|
@ -17,6 +18,7 @@ export function createEnvironmentStore() {
|
|||
}
|
||||
|
||||
async function loadVariables() {
|
||||
if (get(licensing).environmentVariablesEnabled) {
|
||||
const envVars = await API.fetchEnvironmentVariables()
|
||||
const mappedVars = envVars.variables.map(name => ({ name }))
|
||||
update(store => {
|
||||
|
@ -24,6 +26,7 @@ export function createEnvironmentStore() {
|
|||
return store
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function createVariable(data) {
|
||||
await API.createEnvironmentVariable(data)
|
||||
|
|
|
@ -112,7 +112,7 @@ export default class AppApi {
|
|||
|
||||
async delete(appId: string): Promise<Response> {
|
||||
const response = await this.api.del(`/applications/${appId}`)
|
||||
expect(response).toHaveStatusCode(204)
|
||||
expect(response).toHaveStatusCode(200)
|
||||
return response
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue