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 value
export let name export let name
export let config
let dispatch = createEventDispatcher() let dispatch = createEventDispatcher()
@ -20,7 +21,8 @@
</script> </script>
<Accordion <Accordion
initialOpen={Object.values(value).some(properties => !!properties.value)} initialOpen={config?.openByDefault ||
Object.values(value).some(properties => !!properties.value)}
header={name} header={name}
> >
<Layout gap="S"> <Layout gap="S">

View File

@ -85,6 +85,7 @@ const SCHEMA: Integration = {
default: true, default: true,
display: "Configure Active Directory", display: "Configure Active Directory",
hidden: "'{{authType}}' !== 'Active Directory'", hidden: "'{{authType}}' !== 'Active Directory'",
config: { openByDefault: true },
fields: { fields: {
clientId: { clientId: {
type: DatasourceFieldType.STRING, type: DatasourceFieldType.STRING,

View File

@ -118,9 +118,15 @@ interface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {
config: { options: string[] } config: { options: string[] }
} }
interface DatasourceFieldGroupConfig extends DatasourceBasicFieldConfig {
type: DatasourceFieldType.FIELD_GROUP
config: { openByDefault?: boolean }
}
type DatasourceFieldConfig = type DatasourceFieldConfig =
| DatasourceBasicFieldConfig
| DatasourceSelectFieldConfig | DatasourceSelectFieldConfig
| DatasourceFieldGroupConfig
| DatasourceBasicFieldConfig
export interface DatasourceConfig { export interface DatasourceConfig {
[key: string]: DatasourceFieldConfig & { [key: string]: DatasourceFieldConfig & {