-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(site): replace UserContext with userXService (#465)
* Install and configure XState * userXService - typegen not working yet * Lint, fix error transitions * Lint * Change initial state to handle loss of state * Fix gitignore * Fix types by hook or by crook * Use xservice in all pages * Glue/visual component separation * Fix dependency merge * Lint * Remove UserContext * Remove inspector * Add typegen command to site/out * Fix index page redirects * DRY up nav and redirects * Moves based on merge * Moving Page helpers into Page dir * Move xservice into src, update script * Move and storybook navbarview * Update docs * Install MSW * Reorganization, with apologies * Missed spots * Add mock handlers * Configure jest for msw * Fix typos * Shift unit test to NavbarView * Fix test types * Rename NavbarView test * Attempt at test, wip * Fix config * Be logged out, only warn * Conditionally show text to help test * Use a Context for MSW's sake * mocks -> test_helpers * Enable dev tools * Format * Fix import * Fixes * Lint * run typegen postinstall Co-authored-by: Bryan Phelps <bryan@coder.com>
- Loading branch information
1 parent
8fde3ed
commit 22f820c
Showing
43 changed files
with
1,028 additions
and
512 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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.