Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
81ae356
Add general tab fields, begin state management of form
Anemy Nov 19, 2021
3aaf56b
update connection general tab state, keep state between swaps
Anemy Nov 22, 2021
e0e468b
Update state, make collapse sizes nicer
Anemy Nov 23, 2021
7b52e32
add form state
Anemy Nov 24, 2021
ee412ff
Add host validity check
Anemy Nov 24, 2021
5887c2b
disable form with invalid connection uri
Anemy Nov 24, 2021
b41347a
Add direct connection tests
Anemy Nov 29, 2021
a591991
Add schema input tests
Anemy Nov 29, 2021
3c6a4b0
Add host tests
Anemy Nov 29, 2021
a999f18
Add general tab tests
Anemy Nov 29, 2021
6454127
use constant variable for default connection, remove log
Anemy Nov 29, 2021
c804fd7
merge main
Anemy Nov 29, 2021
bbba6ed
update field change action usage and typing
Anemy Nov 30, 2021
26dc8aa
improve schema styles
Anemy Nov 30, 2021
ab740c4
Update connection string comments
Anemy Nov 30, 2021
b06482c
update depcheck for shared testing-library/dom change from other pr
Anemy Nov 30, 2021
d7cfaaf
Make directConnection checkbox always shown when it's set, hide when …
Anemy Nov 30, 2021
60c489e
merge main, add connection string test
Anemy Nov 30, 2021
ffdf8d7
Add host input function tests
Anemy Nov 30, 2021
74148fa
fix package-lock
Anemy Nov 30, 2021
04e17fd
Dont default directConnection to true on schema change
Anemy Nov 30, 2021
9917c56
merge main
Anemy Dec 3, 2021
21f01bb
Merge branch 'main' into COMPASS-5231-add-general-tab-contents-to-con…
Anemy Dec 13, 2021
83445b4
update form state handling
Anemy Dec 14, 2021
9054624
Update state management, tests not updated yet, need to do some clean…
Anemy Dec 14, 2021
714ff6c
update error hiding
Anemy Dec 14, 2021
29fa72c
pull errors from form fields
Anemy Dec 14, 2021
5ec4dd2
reformat
Anemy Dec 14, 2021
d0915aa
Update tests for connection form field states
Anemy Dec 15, 2021
9c5e45d
Add tests for updating host
Anemy Dec 15, 2021
e177bdf
Added tests for schema change action
Anemy Dec 15, 2021
6596fd9
Improve host error messaging, add host index for error index
Anemy Dec 15, 2021
06353bc
merge main
Anemy Dec 15, 2021
fbf7806
update useEffect usage
Anemy Dec 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 101 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/compass-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@leafygreen-ui/modal": "^7.0.0",
"@leafygreen-ui/palette": "^3.2.2",
"@leafygreen-ui/portal": "^3.1.3",
"@leafygreen-ui/radio-box-group": "^6.1.4",
"@leafygreen-ui/select": "^3.0.4",
"@leafygreen-ui/tabs": "^5.1.3",
"@leafygreen-ui/text-area": "^4.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/compass-components/src/compass-ui-colors.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const gray8 = '#f5f6f7';
export const transparentGray = 'rgba(180, 180, 180, 0.5)';
export const transparentWhite = 'rgba(255, 255, 255, 0.5)';
11 changes: 7 additions & 4 deletions packages/compass-components/src/components/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const containerStyles = css({
marginTop: spacing[3],
display: 'flex',
alignItems: 'center',
'&:hover': {
cursor: 'pointer',
},
});
const buttonIconStyles = css({
marginRight: spacing[1],
});
interface AccordionProps {
dataTestId?: string;
Expand All @@ -54,7 +54,10 @@ function Accordion(
setOpen((currentOpen) => !currentOpen);
}}
>
<Icon glyph={open ? 'ChevronDown' : 'ChevronRight'} />
<Icon
className={buttonIconStyles}
glyph={open ? 'ChevronDown' : 'ChevronRight'}
/>
{props.text}
</button>
</p>
Expand Down
1 change: 1 addition & 0 deletions packages/compass-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export { default as Modal } from '@leafygreen-ui/modal';
export { uiColors } from '@leafygreen-ui/palette';
export * as compassUIColors from './compass-ui-colors';
export { default as Portal } from '@leafygreen-ui/portal';
export { RadioBox, RadioBoxGroup } from '@leafygreen-ui/radio-box-group';
export { Select, Option, Size as SelectSize } from '@leafygreen-ui/select';
export { Tabs, Tab } from '@leafygreen-ui/tabs';
export { default as TextArea } from '@leafygreen-ui/text-area';
Expand Down
1 change: 1 addition & 0 deletions packages/connect-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@mongodb-js/prettier-config-compass": "^0.3.0",
"@mongodb-js/tsconfig-compass": "^0.3.0",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/chai": "^4.2.21",
"@types/chai-dom": "^0.0.10",
"@types/mocha": "^9.0.0",
Expand Down
13 changes: 0 additions & 13 deletions packages/connect-form/src/advanced-connection-options.tsx

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { css } from '@emotion/css';
import React from 'react';
import {
Accordion,
compassUIColors,
spacing,
} from '@mongodb-js/compass-components';
import ConnectionStringUrl from 'mongodb-connection-string-url';

import AdvancedOptionsTabs from './advanced-options-tabs/advanced-options-tabs';
import { UpdateConnectionFormField } from '../hooks/use-connect-form';
import { ConnectionFormError } from '../utils/connect-form-errors';

const disabledOverlayStyles = css({
position: 'absolute',
top: 0,
// Space around it to ensure added focus borders are covered.
bottom: -spacing[1],
left: -spacing[1],
right: -spacing[1],
backgroundColor: compassUIColors.transparentWhite,
zIndex: 1,
cursor: 'not-allowed',
});

const connectionTabsContainer = css({
position: 'relative',
});

function AdvancedConnectionOptions({
disabled,
errors,
connectionStringUrl,
hideError,
updateConnectionFormField,
}: {
errors: ConnectionFormError[];
disabled: boolean;
connectionStringUrl: ConnectionStringUrl;
hideError: (errorIndex: number) => void;
updateConnectionFormField: UpdateConnectionFormField;
}): React.ReactElement {
return (
<Accordion text="Advanced Connection Options">
<div className={connectionTabsContainer}>
{disabled && (
<div
className={disabledOverlayStyles}
title="The connection form is disabled when the connection string cannot be parsed."
/>
)}
<AdvancedOptionsTabs
errors={errors}
hideError={hideError}
connectionStringUrl={connectionStringUrl}
updateConnectionFormField={updateConnectionFormField}
/>
</div>
</Accordion>
);
}

export default AdvancedConnectionOptions;
Loading