-
Notifications
You must be signed in to change notification settings - Fork 188
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
feat(compass-global-writes): sharding error state COMPASS-8349 #6374
Conversation
onClick={onSubmit} | ||
disabled={!secondShardKey || isSubmittingForSharding} | ||
variant="primary" | ||
isLoading={isSubmittingForSharding} |
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.
Small change here. It used to be:
disabled={!secondShardKey || isSubmittingForSharding}
variant="primary"
leftGlyph={
isSubmittingForSharding ? (
<SpinLoader title="Creating shard key" />
) : undefined
}
{ | ||
onCreateShardKey: createShardKey, | ||
} | ||
)(CreateShardKeyForm); |
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.
Another small change - this is now connected directly, and it works with error/no error statuses.
c203243
to
aa0be2d
Compare
aa0be2d
to
0b19805
Compare
import { css, spacing } from '@mongodb-js/compass-components'; | ||
|
||
export const bannerStyles = css({ | ||
textAlign: 'justify', |
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.
this adds extra space in the banner and the message looks a bit weird (in the screenshot attached in the PR description). also, would be nice if we can split the error message by new line (server error has it).
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.
changed this setting for the error specifically. otherwise most messages I tried looked better with justify. also added pre-wrap on the error.
d6cf33e
to
9d194dd
Compare
9d194dd
to
950e100
Compare
Description
Notes:
CreateShardKeyForm
is simply moved out of unsharded state, as it is now reused for bothUnsharded
andShardingError
states - changes pointed out in a commentShardingError
also displays the error and a button to cancel sharding. this means that from this state the user can either go back (via the cancel button), or forward (by submitting the form)I have thought about whether this state needs to be separate, or if it would better be the unsharded state with optional error. In the end I continued the approach with separate states and the store behaving as a state machine. It still makes sense to me and I find it better than having a ton of conditional bits in the components. But, I've been working on this for a while, so I'm definitely biased and I wouldn't be surprised if the solution isn't that clear to someone else - let me know if that's the case and we can talk about how to make it clearer!
Preview:
if you happen to read the error message - this one actually should be handled in a different way (key mismatch screen), but this was the easiest for me to reproduce
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes