Unverified Commit 38c3734d authored by Jim Ehrismann's avatar Jim Ehrismann Committed by GitHub
Browse files

the select all checkbox should not select disabled items (#2151)


* the select all checkbox should not select disabled items
Signed-off-by: default avatarJim Ehrismann <jehrismann@mirantis.com>

* remove improper bullet-proofing
Signed-off-by: default avatarJim Ehrismann <jehrismann@mirantis.com>

* added default for customizeTableRowProps
Signed-off-by: default avatarJim Ehrismann <jehrismann@mirantis.com>
parent f18d8618
master allowed-resources api-manager-claenup asdasd ban-circular-deps better-release-script bug/port-forward-missing build-flatpak bundled-extensions-update catalog-entity-detail-registry cleanup-pod-details-container cleanup-shell-session cleanup-terminal consolidate-running-of-setups-on-application-start dependabot/npm_and_yarn/react-select-5.3.2 dependabot/npm_and_yarn/react-window-1.8.7 dependabot/npm_and_yarn/types/node-14.18.16 dependabot/npm_and_yarn/types/webpack-env-1.16.4 di-stores disposer-for-singletons docs/api-all-exported electron-11.4.3 electron-12 enhancement-node-vertical-metric-bars enhancement/group-app-preferences-by-extension ensure-listref-current entity-settings extension-auto-update extension-dir extension-discovery-changes extension-startup extensions/lens-version-check feat/add-bg-to-cluster-status feat/add-tests-for-main-extension-api-and-catalog-entity-registry feat/capture-logger-error feat/capture-winston-logger feat/lazy-load-compoment feat/new-api feature/auto-update feature/catalog-helm-repos feature/context-providers feature/kube-api-manager feature/navigate-back-ui-button fix-NamespaceSelect-gradients fix-change-os-theme-crash fix-concurrent-access fix-lint-error fix-linter-errors fix-local-shell-session fix-namespace-filter-select fix-optimise-update-events-from-buffer fix-reload-list-items-on-mount fix-remove-watch-flush-headers fix-reseting-select-value fix-resource-applier fix-spelling fix-sync-open fix/allown-entity-id fix/blank-disabled-select-option fix/consistent-inputs fix/log-store-loading fix/no-ui fix/node-shell-fail fix/ns-selector-performance-issue fix/pod-logs-storage fix/rewatch-if-resume fix/search_input_autofocus front-end-routes-ocp front-end-routes-ocp-2 front-end-routes-ocp-3 fuzz-tests global-watch hackweek/multiple-windows helm-repo-cleanup helm-repo-manager helm-repo-manager-removal helm-routes improve-metrics-queries improve-workspace-validation improved-categories issue-1432 issue-1759 issue-1909 issue-2293 issue-2549 issue-2648 issue-2727 issue-3126 issue-3232 issue-3276 issue-3374 issue-3498 issue-3797 issue-3896 issue-4633 issue-4766 issue-4829 issue-4997 issue-5141 issue-5165 issue-5173 issue-5177 issue-5238 lockdown-ownership menu_enhancement mobx-6.2 more-places-to-check-for-updates move-docs native-menus port-forward-pod-deleted prometheus/victoria-metrics-single reactive-table refactor-settings-layout-styles release/v4.2 release/v4.2.0-alpha.0 release/v5.0.0-rc.0 release/v5.2 release/v5.2.4 release/v5.2.7-beta.0 release/v5.3 release/v5.4 remove-font-icons remove-in-app-release-notes remove-unused-telemetry resizable_table_columns run-npm-publish-master-always set-build-version show-extension-preferences-in-separate-page single-logger squashed-update-injectable strict-mode temporary-manual-update-notification test/remove-sentry testing/issue-4314 testing/virtual-select tidy-hiddenTableColumns top-bar-registry turn-on-strict ui-table-empty-state-lines ui-tweaks update-bundled-extensions update-electon-builder-to-3-0-8 update-locks upgrade-typedoc-to-0.20 validate-cluster-model verify-quit-events websocket-catalog-sync welcome-banners-rounded-corners welcome-menu-registry workspace-overview-bug-test 4.2.0-beta.1 v5.5.0-beta.0 v5.4.6 v5.4.5 v5.4.4 v5.4.3 v5.4.2 v5.4.1 v5.4.0 v5.4.0-beta.5 v5.4.0-beta.4 v5.4.0-beta.3 v5.4.0-beta.2 v5.4.0-beta.1 v5.4.0-beta.0 v5.4.0-alpha.1 v5.4.0-alpha.0 v5.3.4 v5.3.3 v5.3.2 v5.3.1 v5.3.0 v5.3.0-beta.4 v5.3.0-beta.3 v5.3.0-beta.2 v5.3.0-beta.1 v5.3.0-beta.0 v5.3.0-alpha.11 v5.3.0-alpha.10 v5.3.0-alpha.9 v5.3.0-alpha.8 v5.3.0-alpha.7 v5.3.0-alpha.6 v5.3.0-alpha.5 v5.3.0-alpha.4 v5.3.0-alpha.3 v5.3.0-alpha.2 v5.3.0-alpha.1 v5.3.0-alpha.0 v5.2.7 v5.2.6 v5.2.6-beta.1 v5.2.6-beta.0 v5.2.5 v5.2.4 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.2.0-rc.1 v5.2.0-beta.4 v5.2.0-beta.3 v5.2.0-beta.2 v5.2.0-beta.1 v5.1.3 v5.1.2 v5.1.1 v5.1.0 v5.1.0-beta.2 v5.1.0-beta.1 v5.0.2 v5.0.1 v5.0.0 v5.0.0-rc.0 v5.0.0-beta.13 v5.0.0-beta.12 v5.0.0-beta.11 v5.0.0-beta.10 v5.0.0-beta.9 v5.0.0-beta.8 v5.0.0-beta.7 v5.0.0-beta.6 v5.0.0-beta.5 v5.0.0-beta.4 v5.0.0-beta.3 v5.0.0-beta.2 v5.0.0-beta.1 v5.0.0-alpha.4 v5.0.0-alpha.3 v5.0.0-alpha.2 v5.0.0-alpha.1 v4.2.5 v4.2.4 v4.2.3 v4.2.2 v4.2.1 v4.2.0 v4.2.0-rc.3 v4.2.0-rc.2 v4.2.0-rc.1 v4.2.0-beta.1 v4.2.0-alpha.1
No related merge requests found
Showing with 8 additions and 5 deletions
+8 -5
......@@ -89,7 +89,8 @@ const defaultProps: Partial<ItemListLayoutProps> = {
filterItems: [],
hasDetailsView: true,
onDetails: noop,
virtual: true
virtual: true,
customizeTableRowProps: () => ({} as TableRowProps),
};
interface ItemListLayoutUserSettings {
......@@ -241,7 +242,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
sortItem={item}
selected={detailsItem && detailsItem.getId() === itemId}
onClick={hasDetailsView ? prevDefault(() => onDetails(item)) : undefined}
{...(customizeTableRowProps ? customizeTableRowProps(item) : {})}
{...customizeTableRowProps(item)}
>
{isSelectable && (
<TableCell
......@@ -392,19 +393,21 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
}
renderTableHeader() {
const { renderTableHeader, isSelectable, isConfigurable, store } = this.props;
const { customizeTableRowProps, renderTableHeader, isSelectable, isConfigurable, store } = this.props;
if (!renderTableHeader) {
return;
}
const enabledItems = this.items.filter(item => !customizeTableRowProps(item).disabled);
return (
<TableHead showTopLine nowrap>
{isSelectable && (
<TableCell
checkbox
isChecked={store.isSelectedAll(this.items)}
onClick={prevDefault(() => store.toggleSelectionAll(this.items))}
isChecked={store.isSelectedAll(enabledItems)}
onClick={prevDefault(() => store.toggleSelectionAll(enabledItems))}
/>
)}
{renderTableHeader.map((cellProps, index) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment