Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support empty config entries #1441

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/pages/topics/Topic.List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function makeCreateTopicModal(parent: TopicList) {
const tryGetBrokerConfig = (configName: string): string | undefined => {
return api.clusterInfo?.brokers?.find(_ => true)
?.config.configs
.find(x => x.name === configName)?.value ?? undefined;
?.find(x => x.name === configName)?.value ?? undefined;
};

const getRetentionTimeFinalValue = (value: number | undefined, unit: RetentionTimeUnit) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/state/backendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ const apiStore = {
// add 'type' to each synonym entry
for (const broker of v.clusterInfo.brokers)
if (broker.config && !broker.config.error)
prepareSynonyms(broker.config.configs);
prepareSynonyms(broker.config.configs ?? []);

// don't assign if the value didn't change
// we'd re-trigger all observers!
Expand All @@ -720,7 +720,7 @@ const apiStore = {
if (b.config.error)
this.brokerConfigs.set(b.brokerId, b.config.error);
else
this.brokerConfigs.set(b.brokerId, b.config.configs);
this.brokerConfigs.set(b.brokerId, b.config.configs ?? []);
});
}
}, addError);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/state/restInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export interface Broker {
config: BrokerConfig;
}
export interface BrokerConfig {
configs: ConfigEntry[];
configs: ConfigEntry[] | undefined;
error: string | undefined;
}

Expand Down
Loading