Allow open by default for field groups
This commit is contained in:
parent
352ea72c53
commit
758b4f8254
|
@ -4,6 +4,7 @@
|
|||
|
||||
export let value
|
||||
export let name
|
||||
export let config
|
||||
|
||||
let dispatch = createEventDispatcher()
|
||||
|
||||
|
@ -20,7 +21,8 @@
|
|||
</script>
|
||||
|
||||
<Accordion
|
||||
initialOpen={Object.values(value).some(properties => !!properties.value)}
|
||||
initialOpen={config?.openByDefault ||
|
||||
Object.values(value).some(properties => !!properties.value)}
|
||||
header={name}
|
||||
>
|
||||
<Layout gap="S">
|
||||
|
|
|
@ -85,6 +85,7 @@ const SCHEMA: Integration = {
|
|||
default: true,
|
||||
display: "Configure Active Directory",
|
||||
hidden: "'{{authType}}' !== 'Active Directory'",
|
||||
config: { openByDefault: true },
|
||||
fields: {
|
||||
clientId: {
|
||||
type: DatasourceFieldType.STRING,
|
||||
|
|
|
@ -118,9 +118,15 @@ interface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {
|
|||
config: { options: string[] }
|
||||
}
|
||||
|
||||
interface DatasourceFieldGroupConfig extends DatasourceBasicFieldConfig {
|
||||
type: DatasourceFieldType.FIELD_GROUP
|
||||
config: { openByDefault?: boolean }
|
||||
}
|
||||
|
||||
type DatasourceFieldConfig =
|
||||
| DatasourceBasicFieldConfig
|
||||
| DatasourceSelectFieldConfig
|
||||
| DatasourceFieldGroupConfig
|
||||
| DatasourceBasicFieldConfig
|
||||
|
||||
export interface DatasourceConfig {
|
||||
[key: string]: DatasourceFieldConfig & {
|
||||
|
|
Loading…
Reference in New Issue