FrankChen021 commented on code in PR #19254:
URL: https://github.com/apache/druid/pull/19254#discussion_r3141492372
##########
web-console/src/dialogs/coordinator-dynamic-config-dialog/coordinator-dynamic-config-dialog.tsx:
##########
@@ -18,30 +18,73 @@
import { Intent } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
-import React, { useState } from 'react';
+import React, { useMemo, useState } from 'react';
-import type { FormJsonTabs } from '../../components';
+import type { Field, FormJsonTabs } from '../../components';
import { AutoForm, ExternalLink, FormJsonSelector, JsonInput, Loader } from
'../../components';
import type { CoordinatorDynamicConfig } from '../../druid-models';
import { COORDINATOR_DYNAMIC_CONFIG_FIELDS } from '../../druid-models';
+import type { Capabilities } from '../../helpers';
import { useQueryManager } from '../../hooks';
import { getLink } from '../../links';
import { Api, AppToaster } from '../../singletons';
-import { getApiArray, getDruidErrorMessage } from '../../utils';
+import { filterMap, getApiArray, getDruidErrorMessage, queryDruidSql } from
'../../utils';
import { SnitchDialog } from '..';
import { COORDINATOR_DYNAMIC_CONFIG_COMPLETIONS } from
'./coordinator-dynamic-config-completions';
+import { ServerMultiSelectDialog } from './server-multi-select-dialog';
+import type { TieredServers } from './tiered-servers';
+import { buildTieredServers } from './tiered-servers';
import './coordinator-dynamic-config-dialog.scss';
export interface CoordinatorDynamicConfigDialogProps {
+ capabilities: Capabilities;
onClose(): void;
}
+function attachServerPickerDialogs(
+ fields: Field<CoordinatorDynamicConfig>[],
+ servers: TieredServers | undefined,
+): Field<CoordinatorDynamicConfig>[] {
+ return fields.map(field => {
+ switch (field.name) {
+ case 'decommissioningNodes':
+ return {
+ ...field,
+ customDialog: ({ value, onValueChange, onClose }) => (
+ <ServerMultiSelectDialog
+ title="Decommissioning nodes"
+ servers={servers}
Review Comment:
[P2] Server picker can stay stuck loading
If the operator clicks edit for decommissioningNodes before the server-list
query finishes, AutoForm stores this custom dialog JSX in its own state with
servers still undefined. When serversState.data later arrives, the stored
dialog element is not recreated, so the dialog keeps showing the Loader until
the user closes and reopens it. Pass a live query state into the dialog or
prevent opening the picker until the server list has resolved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]