Repository navigation
Conversation
| export interface TClusterConfigFeatureFlag { | ||
| Name: string; | ||
| Current?: boolean; | ||
| Default?: boolean; | ||
| } | ||
|
|
||
| export interface TClusterConfigDb { | ||
| Name: string; | ||
| FeatureFlags: TClusterConfigFeatureFlag[]; | ||
| } | ||
|
|
||
| export interface TClusterConfigs { | ||
| Databases: TClusterConfigDb[]; | ||
| } |
There was a problem hiding this comment.
In types/api types are grouped by endpoints or entites. Please, create a separate file for configs, they don't connected with TClusterInfo - /viewer/cluster response
| const featureFlagsFilter = useTypedSelector( | ||
| (state) => state.tenant.featureFlagsFilter, | ||
| )?.toLocaleLowerCase(); |
There was a problem hiding this comment.
Do we really need this state in the store?
There was a problem hiding this comment.
yes. in some other tabs search filter is saved between tab navigation
There was a problem hiding this comment.
But current solution is not good, we have two sources of truth. On other tabs behavior is different. For example, on Top queries tab the search is saved only in the store, and on Nodes and Storage tabs the search is saved only in query params.
There was a problem hiding this comment.
I suggested to have same UX in such cases - sync btw store and url, others agreed.
Why do you think it's not good?
There was a problem hiding this comment.
discussed in pm, fixed
| ]; | ||
|
|
||
| interface Props { | ||
| path: string; |
|
|
||
| return ( | ||
| <TableWithControlsLayout> | ||
| <TableWithControlsLayout.Controls>{renderControls()}</TableWithControlsLayout.Controls> |
There was a problem hiding this comment.
Why not inline controls here?
| <TableWithControlsLayout> | ||
| <TableWithControlsLayout.Controls>{renderControls()}</TableWithControlsLayout.Controls> | ||
| <TableWithControlsLayout.Table loading={isFetching}> | ||
| {renderContent()} |
There was a problem hiding this comment.
Let's extract this to another component
| export interface TConfigFeatureFlag { | ||
| Name: string; | ||
| Current?: boolean; | ||
| Default?: boolean; | ||
| } | ||
|
|
||
| export interface TConfigDb { | ||
| Name: string; | ||
| FeatureFlags: TConfigFeatureFlag[]; | ||
| } | ||
|
|
||
| export interface TConfigs { | ||
| Databases: TConfigDb[]; | ||
| } |
There was a problem hiding this comment.
Not a request, but for you information: types are called TSomething and ESomething to match with names from Swagger or backend types, you may not follow the same pattern for your own types
Co-authored-by: Valerii Sidorenko <balepas@nebius.com>
| placeholder={i18n('search-placeholder')} | ||
| /> | ||
| </TableWithControlsLayout.Controls> | ||
| <TableWithControlsLayout.Table loading={isFetching}> |
There was a problem hiding this comment.
Let's move this and fetching and filtering data to the FeatureFlagsList.
There was a problem hiding this comment.
Why? Now Configs component includes logic and FeatureFlagsList is stupid (and is not very necessary imho). After moving logic Config will be almost redundant
There was a problem hiding this comment.
discussed in pm, fixed
| const featureFlagsFilter = useTypedSelector( | ||
| (state) => state.tenant.featureFlagsFilter, | ||
| )?.toLocaleLowerCase(); |
There was a problem hiding this comment.
But current solution is not good, we have two sources of truth. On other tabs behavior is different. For example, on Top queries tab the search is saved only in the store, and on Nodes and Storage tabs the search is saved only in query params.
| <ResizeableDataTable | ||
| columnsWidthLSKey={FEATURE_FLAGS_COLUMNS_WIDTH_LS_KEY} | ||
| columns={columns} | ||
| data={featureFlags} | ||
| settings={DEFAULT_TABLE_SETTINGS} | ||
| /> |
There was a problem hiding this comment.
| <ResizeableDataTable | |
| columnsWidthLSKey={FEATURE_FLAGS_COLUMNS_WIDTH_LS_KEY} | |
| columns={columns} | |
| data={featureFlags} | |
| settings={DEFAULT_TABLE_SETTINGS} | |
| /> | |
| <ResizeableDataTable | |
| columnsWidthLSKey={FEATURE_FLAGS_COLUMNS_WIDTH_LS_KEY} | |
| columns={columns} | |
| data={featureFlags} | |
| settings={DEFAULT_TABLE_SETTINGS} | |
| emptyDataMessage={i18n(featureFlagsFilter ? 'search-empty' : 'no-data')} | |
| /> |
|
|
||
| const FeatureFlagsList = ({isError, featureFlags, featureFlagsFilter}: FeatureFlagsListsProps) => { | ||
| if (isError) { | ||
| return i18n('error-msg'); |
There was a problem hiding this comment.
Why not a real error from query?
| return i18n('error-msg'); | |
| return <ResponseError error={error} />; |
| providesTags: ['All'], | ||
| }), | ||
| getClusterConfig: builder.query({ | ||
| queryFn: async ({database}: {database?: string}, {signal}) => { |
There was a problem hiding this comment.
| queryFn: async ({database}: {database?: string}, {signal}) => { | |
| queryFn: async ({database}: {database: string}, {signal}) => { |
Demo
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: 🔺
Current: 78.93 MB | Main: 78.92 MB
Diff: +0.01 MB (0.02%)
ℹ️ CI Information