This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Setup UI: Add remote repositories setup step UI #47572
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
11594e4
Add first WIP draft of setup wizard remote repositories step
vovakulikov 2e3fe05
Move picker to the separate page
vovakulikov 1ecfcf1
Fix repo pattern list styles
vovakulikov d23c7c5
Add WIP workaround link for the setup wizard route
vovakulikov c8e34df
Add WIP navigation for different code hosts
vovakulikov bfdebcb
Add debounce time for the tooltip UI
vovakulikov d05c110
Fix combobox className prop
vovakulikov b9cb39e
Fix react node import
vovakulikov ca227ba
Fix editor UI
vovakulikov 18fb722
Add controlled field hook
vovakulikov 3f26cef
Ad common components for code host connection UI
vovakulikov 351fb37
Add code host connection UI github code host
vovakulikov 80f0dcd
Fix small visuals in core setup UI
vovakulikov e9699b6
Support json-like connection form for all standard external services
vovakulikov d6d9a5a
Support code host edit UI
vovakulikov f4d0e27
Fix initial values storing
vovakulikov bf5ae01
Fix imports
vovakulikov da35ebc
Fix CI problems
vovakulikov 1c38c1f
Fix styles
vovakulikov 7e7853e
Make setup wizard lazy loaded
vovakulikov dd38dce
Update client/web/src/setup-wizard/components/remote-repositories-ste…
vovakulikov a550dcc
Add add more code host link
vovakulikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
client/branded/src/search-ui/input/__snapshots__/SearchContextMenu.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| .actions { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| } | ||
|
|
||
| .action { | ||
| margin: 0.5rem 0.5rem 0 0; | ||
| flex: 0 auto; | ||
| gap: 0.25rem; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...b/src/setup-wizard/components/remote-repositories-step/RemoteRepositoriesStep.module.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| .root { | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .content { | ||
| display: flex; | ||
| gap: 0.25rem; | ||
| min-height: 30rem; | ||
|
|
||
| &-navigation { | ||
| flex-basis: 35%; | ||
| flex-grow: 0; | ||
| flex-shrink: 0; | ||
| padding: 1rem; | ||
| } | ||
|
|
||
| &-main { | ||
| flex-grow: 1; | ||
| padding: 1rem; | ||
| } | ||
| } | ||
|
|
||
| .navigation { | ||
| // Top margin to compensate main and left content first line texts | ||
| margin-top: 0.2rem; | ||
| } | ||
|
|
||
| .code-host-picker { | ||
| &-header { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding-bottom: 0.75rem; | ||
| border-bottom: 1px solid var(--border-color); | ||
| } | ||
|
|
||
| &-list { | ||
| width: 100%; | ||
| list-style: none; | ||
| padding: 0; | ||
| margin: 1rem 0 0 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.25rem; | ||
| justify-content: stretch; | ||
| } | ||
|
|
||
| &-item { | ||
| display: flex; | ||
| width: 100%; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
|
|
||
| &:hover { | ||
| background-color: var(--btn-light-color-variant) !important; | ||
| } | ||
| } | ||
| } |
52 changes: 52 additions & 0 deletions
52
client/web/src/setup-wizard/components/remote-repositories-step/RemoteRepositoriesStep.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { FC, HTMLAttributes } from 'react' | ||
|
|
||
| import classNames from 'classnames' | ||
| import { Routes, Route, matchPath, useLocation } from 'react-router-dom-v5-compat' | ||
|
|
||
| import { Container, Text } from '@sourcegraph/wildcard' | ||
|
|
||
| import { CustomNextButton } from '../setup-steps' | ||
|
|
||
| import { CodeHostsPicker } from './components/code-host-picker' | ||
| import { CodeHostCreation, CodeHostEdit } from './components/code-hosts' | ||
| import { CodeHostsNavigation } from './components/navigation' | ||
|
|
||
| import styles from './RemoteRepositoriesStep.module.scss' | ||
|
|
||
| interface RemoteRepositoriesStepProps extends HTMLAttributes<HTMLDivElement> {} | ||
|
|
||
| export const RemoteRepositoriesStep: FC<RemoteRepositoriesStepProps> = props => { | ||
| const { className, ...attributes } = props | ||
|
|
||
| const location = useLocation() | ||
| const editConnectionRouteMatch = matchPath('/setup/remote-repositories/:codehostId/edit', location.pathname) | ||
| const newConnectionRouteMatch = matchPath('/setup/remote-repositories/:codeHostType/create', location.pathname) | ||
|
|
||
| return ( | ||
| <div {...attributes} className={classNames(className, styles.root)}> | ||
| <Text size="small" className="mb-2"> | ||
| Connect remote code hosts where your source code lives. | ||
| </Text> | ||
|
|
||
| <section className={styles.content}> | ||
| <Container className={styles.contentNavigation}> | ||
| <CodeHostsNavigation | ||
| activeConnectionId={editConnectionRouteMatch?.params?.codehostId} | ||
| createConnectionType={newConnectionRouteMatch?.params?.codeHostType} | ||
| className={styles.navigation} | ||
| /> | ||
| </Container> | ||
|
|
||
| <Container className={styles.contentMain}> | ||
| <Routes> | ||
| <Route index={true} element={<CodeHostsPicker />} /> | ||
| <Route path=":codeHostType/create" element={<CodeHostCreation />} /> | ||
| <Route path=":codehostId/edit" element={<CodeHostEdit />} /> | ||
| </Routes> | ||
| </Container> | ||
| </section> | ||
|
|
||
| <CustomNextButton label="Custom next step label" disabled={true} /> | ||
| </div> | ||
| ) | ||
| } | ||
29 changes: 29 additions & 0 deletions
29
...mponents/remote-repositories-step/components/code-host-picker/CodeHostsPicker.module.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| .header { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding-bottom: 0.75rem; | ||
| border-bottom: 1px solid var(--border-color); | ||
| } | ||
|
|
||
| .list { | ||
| width: 100%; | ||
| list-style: none; | ||
| padding: 0; | ||
| margin: 1rem 0 0 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.25rem; | ||
| justify-content: stretch; | ||
| } | ||
|
|
||
| .item { | ||
| display: flex; | ||
| width: 100%; | ||
| justify-content: flex-start; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
|
|
||
| &:hover { | ||
| background-color: var(--btn-light-color-variant) !important; | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.