From 08e8bf4bcf9eb162f49d4af55b37b08b3abfbe80 Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Thu, 7 Jan 2021 13:38:13 -0800 Subject: [PATCH 1/2] Fix two settings tab issues (#374) --- src/Explorer/Controls/Settings/SettingsComponent.tsx | 4 ++-- .../ThroughputInputAutoPilotV3Component.tsx | 4 ++-- src/Explorer/Controls/Settings/SettingsUtils.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 704bebb24..792d9d8e3 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -138,8 +138,8 @@ export class SettingsComponent extends React.Component, newValue?: string ): void => { - const newThroughput = getSanitizedInputValue(newValue, this.autoPilotInputMaxValue); + const newThroughput = getSanitizedInputValue(newValue); this.props.onMaxAutoPilotThroughputChange(newThroughput); }; @@ -435,7 +435,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component< event: React.FormEvent, newValue?: string ): void => { - const newThroughput = getSanitizedInputValue(newValue, this.throughputInputMaxValue); + const newThroughput = getSanitizedInputValue(newValue); if (this.overrideWithAutoPilotSettings()) { this.props.onMaxAutoPilotThroughputChange(newThroughput); } else { diff --git a/src/Explorer/Controls/Settings/SettingsUtils.tsx b/src/Explorer/Controls/Settings/SettingsUtils.tsx index 06b29b4b3..daa9f5e85 100644 --- a/src/Explorer/Controls/Settings/SettingsUtils.tsx +++ b/src/Explorer/Controls/Settings/SettingsUtils.tsx @@ -101,13 +101,13 @@ export const parseConflictResolutionProcedure = (procedureFromBackEnd: string): return procedureFromBackEnd; }; -export const getSanitizedInputValue = (newValueString: string, max: number): number => { +export const getSanitizedInputValue = (newValueString: string, max?: number): number => { const newValue = parseInt(newValueString); if (isNaN(newValue)) { return zeroValue; } // make sure new value does not exceed the maximum throughput - return Math.min(newValue, max); + return max ? Math.min(newValue, max) : newValue; }; export const isDirty = (current: isDirtyTypes, baseline: isDirtyTypes): boolean => { From 6e619175c6f8d6d9104261085e5410e945ea71c8 Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Fri, 8 Jan 2021 15:00:26 +0100 Subject: [PATCH 2/2] Fix missing scrollbar in left pane when too many collections/notebooks (#375) Constrain left pane container to height: 100% so that scrollbar show up when content wants to overflow. The `main` classname seems too generic, but I left it alone (so I don't break anything), since this part will eventually be ported to React. --- less/tree.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/less/tree.less b/less/tree.less index e59a00a87..56a5ee38e 100644 --- a/less/tree.less +++ b/less/tree.less @@ -4,6 +4,9 @@ .resourceTree { height: 100%; flex: 0 0 auto; + .main { + height: 100%; + } } .resourceTreeScroll {