web-console: Added Statement Timeout Configuration and retry button for timeout #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added an extra param
isFromError
fortoggleRunning
to inform the query run inMonaco
to run the query that is set from the `ErrorNotificationAdded an extra param to
queryRaw
to set headers for the query.Added a RetryButton for ErrorNotifcation that are timeouts.
Clicking on the RetryButton will run the query, and also based on the
running.value
set the button to disabled.As a general heuristic the query running this way will be doubling the timeout value.
Initial Request with timeout at 6000
![timeout-6000](https://private-user-images.githubusercontent.com/4145525/238698747-9a1a0d63-1fe5-4909-a58f-13d39b7c51d7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDU2NjcsIm5iZiI6MTczOTYwNTM2NywicGF0aCI6Ii80MTQ1NTI1LzIzODY5ODc0Ny05YTFhMGQ2My0xZmU1LTQ5MDktYTU4Zi0xM2QzOWI3YzUxZDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDc0MjQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGY0ZDU1NmE0MmM5MDdjMjY4Yzk4N2E5NWJkNmJiNDAzODhlMGI3NGQ5MWVjMjk1YmNmODU3ZWVlMWM0YTdhYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.G41Y11TgBvEk-JltlZsBkBfg4xAqlqnqDBYh7DHRauE)
Button disabled while a query is running
![Screenshot 2023-05-16 at 9 03 07 PM](https://private-user-images.githubusercontent.com/4145525/238699283-ad16b0f4-a08a-4bb1-92d7-6fef6d3a4da2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDU2NjcsIm5iZiI6MTczOTYwNTM2NywicGF0aCI6Ii80MTQ1NTI1LzIzODY5OTI4My1hZDE2YjBmNC1hMDhhLTRiYjEtOTJkNy02ZmVmNmQzYTRkYTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDc0MjQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjZkNmYzMDA2OTdlYzZlMjI1MWY0MjQ5OWFmNWMyMzU5YjhjMjYxYThiMTRlZWIxNDRlM2QwMGFlNWZkODJmOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.jEqVCKMrMX-X3iDIiQyK7vetGKaf6fvvjhFyoA3XdIQ)
Query made with retry button with timeout at 12000
![Screenshot 2023-05-16 at 9 03 29 PM](https://private-user-images.githubusercontent.com/4145525/238699424-3ad4d271-79ad-45b2-98dd-019153b66d94.png?jwt=eyJhbGciOiJ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UNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDc0MjQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjUyM2VjYzNlZTAxMTBlYmYxYTY5YWE0ZTJlZTc4NzdlZGIwYWVlNmY3NzlkMzBlYWRmNTNmODkwMThmNTk4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.QfGQCDUd5MSb8AipGYKpWKVmfoJf3aJjXVIpM7jpxiY)
UX improvements:
Made the retry button green with greyed out background to increase prominence
When running, the button turns to a stop button that can be used to stop the query if the user wishes.
![Screenshot 2023-05-19 at 7 43 34 PM](https://private-user-images.githubusercontent.com/4145525/239523341-a127d39f-19c1-4aef-b698-de9c7d25863a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDU2NjcsIm5iZiI6MTczOTYwNTM2NywicGF0aCI6Ii80MTQ1NTI1LzIzOTUyMzM0MS1hMTI3ZDM5Zi0xOWMxLTRhZWYtYjY5OC1kZTljN2QyNTg2M2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDc0MjQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjRmYTljZTgzYTYwNmE1ZjVlNjgwYTY2MmY4YmU5NzY0NTdlODUzYzIxOTliM2JiZTEyNmE1NjczMDk3Mzc0MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.634rTBc_RwR0XjNQkLAV9FGVxthNq_TbblhZRGBQZh4)
Some further UX improvements that can be made/considered:
Some of the best practices for react that I am familiar with are:
useEffect
. (applied in PR)useEffect
to break up the side effects based on their dependencies rather than putting them all in one (applied in PR)useState(heavyComputation())
is initialized once,heavyComputation()
will still be invoked everytime the component renders, useuseMemo
to improve performance.