Skip to content

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Oct 9, 2024

@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Oct 9, 2024
@github-actions github-actions bot added the feat label Oct 9, 2024
data-testid="save-button"
variant={ButtonVariant.PrimaryOutline}
variant={
onSaveAndConnect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically: If there is no save&connect button (the Connect button), make the Save button the "default" (ie. solid green) one. type for both are still implicitly "button", though. there is no default. Would be ambiguous anyway because we have a custom onSubmit handler that would have to be kept in sync.

);
const onSubmitForm = useCallback(() => {
const updatedConnectionOptions = cloneDeep(connectionOptions);
// TODO: this method throws on malformed connection strings instead of
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old TODO comment. I just swapped two callbacks around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paula-stacho Did we ever add a ticket for this TODO? Are we going to address it?

what happens when you click a submit button) you have to use submit() which only
works with role="form", but eslint doesn't like that because role="form"
should be redundant.
https://stackoverflow.com/questions/59362804/pressing-enter-to-submit-form-in-react-testing-library-does-not-work
Copy link
Contributor Author

@lerouxb lerouxb Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a better way to simulate submitting a form by pressing enter rather than pressing a button so that the callback gets called in tests, please let me know. I added tests because pressing enter wasn't doing what pressing Save did so I modified the onSubmit callback, then realised we never actually seem to test this distinction.

<H3 className={headingWithHiddenButtonStyles}>
{initialConnectionInfo.favorite?.name ?? 'New Connection'}
{(initialConnectionInfo.favorite?.name ?? 'New Connection') ||
'Edit Connection'}
Copy link
Contributor Author

@lerouxb lerouxb Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by to fix the case where you edit a connection that has no favorite name.
Screenshot 2024-10-08 at 13 11 16

const sectionDarkModeStyles = css({
'--theme-background-color': palette.blue.dark3,
'--theme-border-color': palette.blue.dark2,
'--theme-background-color': palette.gray.dark3,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that according to the design, the blue help text boxes on the right are now grey.

darkMode?: boolean;
initialConnectionInfo: ConnectionInfo;
connectionErrorMessage?: string | null;
disableEditingConnectedConnection?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional new prop with undefined acting like false, so vscode should be unaffected.

>
<div className={disabledConnectedConnectionContentStyles}>
<div>
While connected, you may only personalize your
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really what "personalize" means, unless we consider connections to be people

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fits the dictionary definition.

@lerouxb lerouxb merged commit 529a71d into main Oct 9, 2024
27 of 29 checks passed
@lerouxb lerouxb deleted the edit-connected-connections branch October 9, 2024 13:10
@lerouxb lerouxb added release notes and removed feature flagged PRs labeled with this label will not be included in the release notes of the next release labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants