* feat: Improve navbar to be more compact
The navbar was unnecessarily large before, which made
the UI feel a bit bloaty from my perspective.
* Attempt to remove overrides
* Update theme
* Add text field
* Update theme to dark!
* Fix import ordering
* Fix page location
* Fix requested changes
* Add storybook for workspaces page view
* Add empty view
* Add tests for empty view
* Remove templates page
* Fix local port
* Remove templates from nav
* Fix e2e test
* Remove time.ts
* Remove dep
* Add background color to margins
* Merge status checking from workspace page
* Fix requested changes
* Fix workspace status tests
* refactor: allow helperText in getFormHelpers
By passing in helperText, we will not accidentally overwrite it.
* fix: CreateWorkspaceForm name validation
Resolves: #1421
* Move component and prep
* Make WorkspaceSection more reusable
* Lay out elements
* Layout tweaks
* Add outdated to Workspace type
* Fill out status bar component
* Format
* Add transition to types
* Add api handlers for build toggle
* Format
* Parallelize machine
* Lay out basics of build submachine
* Pipe start and stop events through - needs status
* Attempt at a machine
It's so big, but collapsing start and stop made it hard to distinguish retry from toggle
* Update mock
* Render status and buttons
* Fix type error on template page
* Move Settings
* Format
* Keep refreshed workspace
* Make it switch workspaces
* Lint
* Fix relative api path
* Test
* Fix polling
* Add loading workspace state
* Format
* Add stub settings page
* Format
* Lint
* Get rid of let
* Add update
* Make start use version id
Important for update
* Fix imports
* Add polling for outdated
* Rely on context instead of finite state for status
* Handle canceling
* Fix tests
* Format
* Display errors so users know when button presses didn't work
* Fix api typo, remove logging
* Lint
* Simplify type
Co-authored-by: G r e y <grey@coder.com>
* Add type, extract helper
Co-authored-by: G r e y <grey@coder.com>
It appears unclear as of now when/if these will be implemented so I
opted to remove them (as opposed to commenting them out) to avoid having
them rot (they are easily added back anyway).
Closes#1232.
* Make column renderer use the same type as its key
That way the renderer only takes `string` for example when rendering the
name field instead of `string | number` when the interface has some
fields that are strings and some fields are numbers.
This will be necessary when switching to generated types since some of
the fields are numbers (like the owner count on a template).
* Switch fully to generated types
In some places the organization ID is part of the URL but not part of
the request so I separated out the ID into a separate argument in the
relevant API functions.
Otherwise this was a straightforward replacement where I mostly only
needed to change some of the interface names (User instead of
UserResponse for example) and add a few missing but required properties.
I kind of winged the template form; I am not sure what the difference
between a template and template version is or why the latter comes
before the former so the form just returns all the data required to
create both.
* Delete handwritten types
Except for UserAgent which seems to be purely frontend and
ReconnectingPTYRequest which is not in codersdk so I am just leaving it
for now.
* Remove implemented omitempty as a future idea
This was implemented in 2d3dc436a8.
* Add missing optionalities to generated request interfaces
This PR adds a package lifecycle and an Executor implementation that attempts to schedule a build of workspaces with autostart configured.
- lifecycle.Executor takes a chan time.Time in its constructor (e.g. time.Tick(time.Minute))
- Whenever a value is received from this channel, it executes one iteration of looping through the workspaces and triggering lifecycle operations.
- When the context passed to the executor is Done, it exits.
- Only workspaces that meet the following criteria will have a lifecycle operation applied to them:
- Workspace has a valid and non-empty autostart or autostop schedule (either)
- Workspace's last build was successful
- The following transitions will be applied depending on the current workspace state:
- If the workspace is currently running, it will be stopped.
- If the workspace is currently stopped, it will be started.
- Otherwise, nothing will be done.
- Workspace builds will be created with the same parameters and template version as the last successful build (for example, template version)
* feat: Implement pagination for template versions
* feat: Use unified pagination between users and template versions
* Sync codepaths between users and template versions
* Create requestOption type in codersdk and add test
* Fix created_at edge case for pagination cursor in queries
* feat: Add support for json omitempty and embedded structs in apitypings (#1318)
* Add scripts/apitypings/main.go to Makefile
* Change name of existing workspace call
* Add new api call (has handler already)
* WorkspacesPage -> WorkspacePage
* starting to replace swr
* Add other api calls
* Fix api call
* Replace swr with xstate
* Format
* Test - wip
* Fix route in template page
* Fix endpoint in create workspace
* Fix tests
* Lint
This splits our pages to use separate JavaScript bundles. It
initially splits the terminal, which reduces our primary
bundle size by ~400KB.
We should do this for all pages, but that can come in a future
change. This leaves the loading page empty for now, which I
think is fine. None of our pages are large enough that the blank
screen temporarily would be concerning.