-
Notifications
You must be signed in to change notification settings - Fork 1k
refactor(site): replace UserContext with userXService #465
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
e620598
Install and configure XState
presleyp c3a143b
userXService - typegen not working yet
presleyp 561cd6b
Lint, fix error transitions
presleyp 1548fb8
Lint
presleyp 80e10c8
Change initial state to handle loss of state
presleyp 3daf0a9
Fix gitignore
presleyp 9f65327
Fix types by hook or by crook
presleyp d6bd5f6
Use xservice in all pages
presleyp 242cb61
Merge branch 'main' into 435/presleyp/user-state
presleyp 1e07da7
Glue/visual component separation
presleyp 16692da
Fix dependency merge
presleyp d1017f0
Lint
presleyp 85779b9
Remove UserContext
presleyp f82b099
Remove inspector
presleyp d4d79ea
Add typegen command to site/out
bryphe-coder ca2fc53
Merge branch '435/presleyp/user-state' of github.com:coder/coder into…
bryphe-coder 17db4a9
Fix index page redirects
presleyp aa5441d
Merge branch '435/presleyp/user-state' of github.com:coder/coder into…
presleyp 8d3f051
DRY up nav and redirects
presleyp d98c8c7
Merge branch 'main' into 435/presleyp/user-state
presleyp e5fd635
Moves based on merge
presleyp 9ef9dca
Moving Page helpers into Page dir
presleyp 97d94de
Move xservice into src, update script
presleyp 9c21d4f
Move and storybook navbarview
presleyp d1b1bab
Update docs
presleyp e6a7895
Install MSW
presleyp 6ac0530
Reorganization, with apologies
presleyp 1c54f80
Missed spots
presleyp ee8ff32
Add mock handlers
presleyp a88e260
Configure jest for msw
presleyp e0e36a0
Fix typos
presleyp cf7f934
Shift unit test to NavbarView
presleyp ca3e7fc
Fix test types
presleyp 6700453
Rename NavbarView test
presleyp 48ac5b7
Attempt at test, wip
presleyp 5c142db
Fix config
presleyp 595859a
Be logged out, only warn
presleyp 1824877
Conditionally show text to help test
presleyp f3902a1
Use a Context for MSW's sake
presleyp 219bc44
mocks -> test_helpers
presleyp 9d638ee
Enable dev tools
presleyp b4bb44e
Format
presleyp 9c40fc5
Fix import
presleyp 46e3888
Merge branch 'main' into 435/presleyp/user-state
presleyp e0f4d7a
Fixes
presleyp 5a0f9ac
Merge branch 'main' into 435/presleyp/user-state
presleyp 42f0554
Lint
presleyp 2be726b
run typegen postinstall
presleyp 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
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ coverage | |
.next | ||
storybook-static | ||
test-results | ||
**/*.typegen.ts |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export interface LoginResponse { | ||
session_token: string | ||
} | ||
|
||
export interface UserResponse { | ||
readonly id: string | ||
readonly username: string | ||
readonly email: string | ||
readonly created_at: string | ||
} | ||
|
||
/** | ||
* `Organization` must be kept in sync with the go struct in organizations.go | ||
*/ | ||
export interface Organization { | ||
id: string | ||
name: string | ||
created_at: string | ||
updated_at: string | ||
} | ||
|
||
export interface Provisioner { | ||
id: string | ||
name: string | ||
} | ||
|
||
// This must be kept in sync with the `Project` struct in the back-end | ||
export interface Project { | ||
id: string | ||
created_at: string | ||
updated_at: string | ||
organization_id: string | ||
name: string | ||
provisioner: string | ||
active_version_id: string | ||
} | ||
|
||
export interface CreateProjectRequest { | ||
name: string | ||
organizationId: string | ||
provisioner: string | ||
} | ||
|
||
export interface CreateWorkspaceRequest { | ||
name: string | ||
project_id: string | ||
} | ||
|
||
// Must be kept in sync with backend Workspace struct | ||
export interface Workspace { | ||
id: string | ||
created_at: string | ||
updated_at: string | ||
owner_id: string | ||
project_id: string | ||
name: string | ||
} | ||
|
||
export interface APIKeyResponse { | ||
key: string | ||
} |
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
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.