Allow open by default for field groups

This commit is contained in:
Adria Navarro 2023-06-28 12:11:29 +01:00
parent 352ea72c53
commit 758b4f8254
3 changed files with 11 additions and 2 deletions

View File

@ -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">

View File

@ -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,

View File

@ -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 & {