Skip to content

Commit

Permalink
Update configuration on category/advanced configurations in configView
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-shelkovnikov committed Oct 9, 2024
1 parent ee4815a commit c301c6b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ export const ConnectorConfigurationForm: React.FC<ConnectorConfigurationForm> =
items={category.configEntries}
hasDocumentLevelSecurityEnabled={hasDocumentLevelSecurity}
setConfigEntry={(key, value) => {
const entry = localConfig[key];
if (entry && !isCategoryEntry(entry)) {
const newConfiguration: ConnectorConfiguration = {
...localConfig,
[key]: { ...entry, value },
};
setLocalConfig(newConfiguration);
}

const categories = configView.categories;
categories[index] = { ...categories[index], [key]: value };
setConfigView({
Expand Down Expand Up @@ -136,6 +145,15 @@ export const ConnectorConfigurationForm: React.FC<ConnectorConfigurationForm> =
items={configView.advancedConfigurations}
hasDocumentLevelSecurityEnabled={hasDocumentLevelSecurity}
setConfigEntry={(key, value) => {
const entry = localConfig[key];
if (entry && !isCategoryEntry(entry)) {
const newConfiguration: ConnectorConfiguration = {
...localConfig,
[key]: { ...entry, value },
};
setLocalConfig(newConfiguration);
}

setConfigView({
...configView,
advancedConfigurations: configView.advancedConfigurations.map((config) =>
Expand Down

0 comments on commit c301c6b

Please sign in to comment.