-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #666 from Path-of-Modifiers/663-fix-cannot-cast-nu…
…ll-text-value-in-jsonb-to-boolean-error #663 Removed unused plot inputs and fixed autofocus min max
- Loading branch information
Showing
17 changed files
with
74 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 45 additions & 44 deletions
89
src/frontend/src/components/Input/ItemInputComp/MinMaxItemLvlInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,55 @@ | ||
import { useGraphInputStore } from "../../../store/GraphInputStore"; | ||
import { | ||
MinMaxNumberInput, | ||
HandleNumberChangeEventFunction, | ||
DefaultMinMaxValues, | ||
MinMaxNumberInput, | ||
HandleNumberChangeEventFunction, | ||
DefaultMinMaxValues, | ||
} from "../StandardLayoutInput/MinMaxNumberInput"; | ||
|
||
interface MinMaxInputProps { | ||
text: string; | ||
text: string; | ||
} | ||
|
||
// Min Max Item Lvl Input Component - This component is used to input the min and max ilvl of an item. | ||
export const MinMaxIlvlInput = (props: MinMaxInputProps) => { | ||
const { itemSpec, setItemSpecMinIlvl, setItemSpecMaxIlvl } = | ||
useGraphInputStore(); | ||
|
||
const handleMinChange = (eventValue: string) => { | ||
const eventValueInt = parseInt(eventValue); | ||
|
||
setItemSpecMinIlvl(eventValueInt); | ||
}; | ||
|
||
const handleMaxChange = (eventValue: string) => { | ||
const eventValueInt = parseInt(eventValue); | ||
|
||
setItemSpecMaxIlvl(eventValueInt); | ||
}; | ||
|
||
const handleNumberChange: HandleNumberChangeEventFunction = ( | ||
value, | ||
numericalType | ||
) => { | ||
if (numericalType === "min") { | ||
handleMinChange(value); | ||
} else if (numericalType === "max") { | ||
handleMaxChange(value); | ||
} else { | ||
throw "'numericalType' must be 'min' or 'max'"; | ||
} | ||
}; | ||
|
||
const presetValue: DefaultMinMaxValues = { | ||
min: itemSpec?.minIlvl != null ? itemSpec.minIlvl : undefined, | ||
max: itemSpec?.maxIlvl != null ? itemSpec.maxIlvl : undefined, | ||
}; | ||
|
||
return ( | ||
<MinMaxNumberInput | ||
descriptionText={props.text} | ||
handleNumberChange={handleNumberChange} | ||
defaultValues={presetValue} | ||
/> | ||
); | ||
const { itemSpec, setItemSpecMinIlvl, setItemSpecMaxIlvl } = | ||
useGraphInputStore(); | ||
|
||
const handleMinChange = (eventValue: string) => { | ||
const eventValueInt = parseInt(eventValue); | ||
|
||
setItemSpecMinIlvl(eventValueInt); | ||
}; | ||
|
||
const handleMaxChange = (eventValue: string) => { | ||
const eventValueInt = parseInt(eventValue); | ||
|
||
setItemSpecMaxIlvl(eventValueInt); | ||
}; | ||
|
||
const handleNumberChange: HandleNumberChangeEventFunction = ( | ||
value, | ||
numericalType, | ||
) => { | ||
if (numericalType === "min") { | ||
handleMinChange(value); | ||
} else if (numericalType === "max") { | ||
handleMaxChange(value); | ||
} else { | ||
throw "'numericalType' must be 'min' or 'max'"; | ||
} | ||
}; | ||
|
||
const presetValue: DefaultMinMaxValues = { | ||
min: itemSpec?.minIlvl != null ? itemSpec.minIlvl : undefined, | ||
max: itemSpec?.maxIlvl != null ? itemSpec.maxIlvl : undefined, | ||
}; | ||
|
||
return ( | ||
<MinMaxNumberInput | ||
descriptionText={props.text} | ||
handleNumberChange={handleNumberChange} | ||
defaultValues={presetValue} | ||
autoFocus={false} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.