-
Notifications
You must be signed in to change notification settings - Fork 64
Adding type to layer dialog hooks #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
df05094
7101462
0f37850
da56e22
d4d9064
0d69ede
bd83973
dd2fd55
c4d3a23
707720a
5824fc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ import { | |||||||||
| } from '@/src/dialogs/symbology/symbologyDialog'; | ||||||||||
| import { Utils, VectorUtils } from '@/src/dialogs/symbology/symbologyUtils'; | ||||||||||
| import ValueSelect from '@/src/dialogs/symbology/vector_layer/components/ValueSelect'; | ||||||||||
| import { ClassificationMode } from '@/src/types'; | ||||||||||
|
|
||||||||||
| const Graduated: React.FC<ISymbologyTabbedDialogWithAttributesProps> = ({ | ||||||||||
| model, | ||||||||||
|
|
@@ -29,7 +30,7 @@ const Graduated: React.FC<ISymbologyTabbedDialogWithAttributesProps> = ({ | |||||||||
| 'jenks', | ||||||||||
| 'pretty', | ||||||||||
| 'logarithmic', | ||||||||||
| ]; | ||||||||||
| ] as ClassificationMode[]; | ||||||||||
nakul-py marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| const selectableAttributeRef = useRef<string>(); | ||||||||||
| const symbologyTabRef = useRef<string>(); | ||||||||||
|
|
@@ -215,8 +216,8 @@ const Graduated: React.FC<ISymbologyTabbedDialogWithAttributesProps> = ({ | |||||||||
| }; | ||||||||||
|
|
||||||||||
| const buildColorInfoFromClassification = ( | ||||||||||
| selectedMode: string, | ||||||||||
| numberOfShades: string, | ||||||||||
| selectedMode: ClassificationMode | undefined, | ||||||||||
| numberOfShades: number | undefined, | ||||||||||
|
||||||||||
| selectedMode: ClassificationMode | undefined, | |
| numberOfShades: number | undefined, | |
| selectedMode: ClassificationMode, | |
| numberOfShades: number, |
Let's make these required and check that these are defined before allowing the user to trigger this function to be called (e.g. don't allow the "Classify" button to be clicked unless these are defined). Then we can remove the casts below!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safely done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still check if
selectedModeandnumberofShadesare undefined here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can check if
selectedModeandnumberofShadesare undefined here as it is More defensive ensures all three are unset before populating.