Merge branch 'master' into typing/stores-grid-columns
This commit is contained in:
commit
5969c828cd
|
@ -12,6 +12,7 @@
|
||||||
export let name
|
export let name
|
||||||
export let config
|
export let config
|
||||||
export let showModal = () => {}
|
export let showModal = () => {}
|
||||||
|
export let placeholder
|
||||||
|
|
||||||
const selectComponent = type => {
|
const selectComponent = type => {
|
||||||
if (type === "object") {
|
if (type === "object") {
|
||||||
|
@ -40,6 +41,7 @@
|
||||||
{name}
|
{name}
|
||||||
{config}
|
{config}
|
||||||
{showModal}
|
{showModal}
|
||||||
|
{placeholder}
|
||||||
on:blur
|
on:blur
|
||||||
on:change
|
on:change
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -5,11 +5,12 @@
|
||||||
export let name
|
export let name
|
||||||
export let value
|
export let value
|
||||||
export let error
|
export let error
|
||||||
|
export let placeholder
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<Label>{name}</Label>
|
<Label>{name}</Label>
|
||||||
<TextArea on:blur on:change {type} {value} {error} />
|
<TextArea on:blur on:change {type} {value} {error} {placeholder} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
export let value
|
export let value
|
||||||
export let error
|
export let error
|
||||||
export let config
|
export let config
|
||||||
|
export let placeholder
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
@ -17,6 +18,7 @@
|
||||||
{type}
|
{type}
|
||||||
value={value || undefined}
|
value={value || undefined}
|
||||||
{error}
|
{error}
|
||||||
|
{placeholder}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
export let name
|
export let name
|
||||||
export let value
|
export let value
|
||||||
export let error
|
export let error
|
||||||
|
export let placeholder
|
||||||
export let showModal = () => {}
|
export let showModal = () => {}
|
||||||
|
|
||||||
async function handleUpgradePanel() {
|
async function handleUpgradePanel() {
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
type={type === "port" ? "string" : type}
|
type={type === "port" ? "string" : type}
|
||||||
{value}
|
{value}
|
||||||
{error}
|
{error}
|
||||||
|
{placeholder}
|
||||||
variables={$environment.variables}
|
variables={$environment.variables}
|
||||||
environmentVariablesEnabled={$licensing.environmentVariablesEnabled}
|
environmentVariablesEnabled={$licensing.environmentVariablesEnabled}
|
||||||
{showModal}
|
{showModal}
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#each $configStore.validatedConfig as { type, key, value, error, name, hidden, config }}
|
{#each $configStore.validatedConfig as { type, key, value, error, name, hidden, config, placeholder }}
|
||||||
{#if hidden === undefined || !eval(processStringSync(hidden, $configStore.config))}
|
{#if hidden === undefined || !eval(processStringSync(hidden, $configStore.config))}
|
||||||
<ConfigInput
|
<ConfigInput
|
||||||
{type}
|
{type}
|
||||||
|
@ -93,6 +93,7 @@
|
||||||
{error}
|
{error}
|
||||||
{name}
|
{name}
|
||||||
{config}
|
{config}
|
||||||
|
{placeholder}
|
||||||
showModal={() =>
|
showModal={() =>
|
||||||
showModal(newValue => configStore.updateFieldValue(key, newValue))}
|
showModal(newValue => configStore.updateFieldValue(key, newValue))}
|
||||||
on:blur={() => configStore.markFieldActive(key)}
|
on:blur={() => configStore.markFieldActive(key)}
|
||||||
|
|
|
@ -114,6 +114,7 @@ export const createValidatedConfigStore = (integration, config) => {
|
||||||
value: getValue(),
|
value: getValue(),
|
||||||
error: $errorsStore[key],
|
error: $errorsStore[key],
|
||||||
name: capitalise(properties.display || key),
|
name: capitalise(properties.display || key),
|
||||||
|
placeholder: properties.placeholder,
|
||||||
type: properties.type,
|
type: properties.type,
|
||||||
hidden: properties.hidden,
|
hidden: properties.hidden,
|
||||||
config: properties.config,
|
config: properties.config,
|
||||||
|
|
|
@ -141,9 +141,6 @@ export class TableStore extends DerivedBudiStore<
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(table: { _id: string; _rev: string }) {
|
async delete(table: { _id: string; _rev: string }) {
|
||||||
if (!table?._id) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await API.deleteTable(table._id, table._rev)
|
await API.deleteTable(table._id, table._rev)
|
||||||
this.replaceTable(table._id, null)
|
this.replaceTable(table._id, null)
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ interface BuilderViewV2Store {
|
||||||
|
|
||||||
interface DerivedViewV2Store extends BuilderViewV2Store {
|
interface DerivedViewV2Store extends BuilderViewV2Store {
|
||||||
list: ViewV2[]
|
list: ViewV2[]
|
||||||
selected: ViewV2
|
selected?: ViewV2
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ViewV2Store extends DerivedBudiStore<
|
export class ViewV2Store extends DerivedBudiStore<
|
||||||
|
@ -20,20 +20,23 @@ export class ViewV2Store extends DerivedBudiStore<
|
||||||
> {
|
> {
|
||||||
constructor() {
|
constructor() {
|
||||||
const makeDerivedStore = (store: Writable<BuilderViewV2Store>) => {
|
const makeDerivedStore = (store: Writable<BuilderViewV2Store>) => {
|
||||||
return derived([store, tables], ([$store, $tables]) => {
|
return derived(
|
||||||
let list: ViewV2[] = []
|
[store, tables],
|
||||||
$tables.list?.forEach(table => {
|
([$store, $tables]): DerivedViewV2Store => {
|
||||||
const views = Object.values(table?.views || {}).filter(
|
let list: ViewV2[] = []
|
||||||
helpers.views.isV2
|
$tables.list?.forEach(table => {
|
||||||
)
|
const views = Object.values(table?.views || {}).filter(
|
||||||
list = list.concat(views)
|
helpers.views.isV2
|
||||||
})
|
)
|
||||||
return {
|
list = list.concat(views)
|
||||||
...$store,
|
})
|
||||||
list,
|
return {
|
||||||
selected: list.find(view => view.id === $store.selectedViewId),
|
...$store,
|
||||||
|
list,
|
||||||
|
selected: list.find(view => view.id === $store.selectedViewId),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -12,6 +12,7 @@ interface FirebaseConfig {
|
||||||
email: string
|
email: string
|
||||||
privateKey: string
|
privateKey: string
|
||||||
projectId: string
|
projectId: string
|
||||||
|
databaseId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCHEMA: Integration = {
|
const SCHEMA: Integration = {
|
||||||
|
@ -30,12 +31,21 @@ const SCHEMA: Integration = {
|
||||||
},
|
},
|
||||||
privateKey: {
|
privateKey: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
display: "Private Key",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
projectId: {
|
projectId: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
display: "Project ID",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
databaseId: {
|
||||||
|
type: DatasourceFieldType.STRING,
|
||||||
|
display: "Database ID",
|
||||||
|
required: false,
|
||||||
|
default: "(default)",
|
||||||
|
placeholder: "(default)",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
create: {
|
create: {
|
||||||
|
@ -97,6 +107,7 @@ class FirebaseIntegration implements IntegrationBase {
|
||||||
this.config = config
|
this.config = config
|
||||||
this.client = new Firestore({
|
this.client = new Firestore({
|
||||||
projectId: config.projectId,
|
projectId: config.projectId,
|
||||||
|
databaseId: config.databaseId || "(default)",
|
||||||
credentials: {
|
credentials: {
|
||||||
client_email: config.email,
|
client_email: config.email,
|
||||||
private_key: config.privateKey?.replace(/\\n/g, "\n"),
|
private_key: config.privateKey?.replace(/\\n/g, "\n"),
|
||||||
|
|
|
@ -324,7 +324,9 @@ export async function update(
|
||||||
return pickApi(tableId).update(tableId, view)
|
return pickApi(tableId).update(tableId, view)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isV2 = helpers.views.isV2
|
export function isV2(view: View | ViewV2) {
|
||||||
|
return helpers.views.isV2(view)
|
||||||
|
}
|
||||||
|
|
||||||
export async function remove(viewId: string): Promise<ViewV2> {
|
export async function remove(viewId: string): Promise<ViewV2> {
|
||||||
const { tableId } = utils.extractViewInfoFromID(viewId)
|
const { tableId } = utils.extractViewInfoFromID(viewId)
|
||||||
|
|
|
@ -119,6 +119,7 @@ interface DatasourceBasicFieldConfig {
|
||||||
default?: any
|
default?: any
|
||||||
deprecated?: boolean
|
deprecated?: boolean
|
||||||
hidden?: string
|
hidden?: string
|
||||||
|
placeholder?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {
|
interface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {
|
||||||
|
|
Loading…
Reference in New Issue