Commit Graph

35 Commits

Author SHA1 Message Date
90a875d916 chore: implement tests for dynamic parameter component (#18745) 2025-07-03 13:09:59 -04:00
8de3cd6400 chore: tweak biome config (#15864) 2024-12-17 12:49:34 -07:00
1d925ab043 fix: ensure user admins can always see users table (#15226)
Closes #15212

## Changes made
- Updated logic so that proxy config is only requested when appropriate,
instead of for all users on all deployment pages
- Split up the main context provider for the `/deployment` and
`/organizations` routes, and updated layout logic for
`ManagementSettingsLayout` layout component. This ensures the sidebar is
always visible, even if request errors happen
- Added additional routing safeguards to make sure that even if a user
can view one page in the deployment section, they won't be able to
navigate directly to any arbitrary deployment page
- Updated logic for sidebar navigation to ensure that nav items only
appear when the user truly has permission
- Centralized a lot of the orgs logic into the `useAuthenticated` hook
- Added additional check cases to the `permissions.tsx` file, to give
more granularity, and added missing type-checking
- Extended the API for the `RequirePermissions` component to let it
redirect users anywhere
- Updated some of our testing setup files to ensure that types were
defined correctly

---------

Co-authored-by: McKayla Washburn <mckayla@hey.com>
2024-10-29 01:06:33 -04:00
52f03dbdf2 fix(site): fix build logs scrolling on safari (#14884)
Fix https://github.com/coder/coder/issues/9687
2024-10-03 13:27:35 -03:00
0793a4b35b feat: add cross-origin reporting for telemetry in the dashboard (#13612)
* feat: add cross-origin reporting for telemetry in the dashboard

* Respect the telemetry flag

* Fix embedded metadata

* Fix compilation error

* Fix linting
2024-06-20 15:19:45 -04:00
2f437005b7 chore(site): clean up mocks after each test (#12805) 2024-04-01 13:14:36 -03:00
9028717c9b fix: disable auto-create if external auth requirements aren't met (#12538) 2024-03-19 16:42:40 -06:00
23e3e4ce58 chore(site): upgrade msw to 2.0 (#12597)
Closes https://github.com/coder/coder/issues/11426
2024-03-19 09:30:20 -03:00
0fe109d517 chore: sort imports in our typescript code (#12417) 2024-03-05 16:31:22 -07:00
2ca8248315 chore(site): apply code conventions (#12316) 2024-02-27 12:24:07 +00:00
79480ca587 feat(site): display build logs on template creation (#12271) 2024-02-23 12:23:52 -07:00
584a2e87c9 chore(site): remove create template xservice (#10112) 2023-10-09 14:10:48 -03:00
2b5428e95f refactor: start using emotion for styling (#9909) 2023-09-29 13:08:17 -06:00
988c9af015 chore: format code with semicolons when using prettier (#9555) 2023-09-06 12:59:26 -06:00
24ec05b5c5 chore: bump prettier from 2.8.1 to 3.0.0 in /site (#8477)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cian Johnston <cian@coder.com>
Co-authored-by: Muhammad Atif Ali <atif@coder.com>
2023-07-13 14:44:12 +03:00
f0bd258ff1 feat: move proxy settings page to deployment options (#8246)
* feat: Move workspace proxy page to deployment options

Workspace proxy settings page is now an admin feature

* WorkspaceProxy response extends region
2023-06-30 11:32:35 -04:00
b32ed2d97e chore: add function to refetch latencies to ProxyContext (#7769)
* Allow refetching of proxy latencies
* Pass refetch funtion up the context stack
* Add to menu bar
2023-06-01 13:37:20 +00:00
b8c07ff014 feat: Auto select workspace proxy based on lowest latency (#7515)
* feat: Proxy auto select and user selection state
* chore: Auto select based on latency
* Add extra test for unknown latencies
* Mock latencies for unit tests
2023-05-22 16:56:41 +02:00
8f768f8276 feat: Workspace Proxy picker show latency to each proxy (#7486)
* chore: Add cors to workspace proxies to allow for latency checks
* Add latency check to wsproxy

Use performance API timings.
- Fix cors and timing headers
- Accept custom headers
2023-05-11 15:42:30 -05:00
813b54942f chore(site): Make FE tests faster (#6543) 2023-03-13 13:35:09 -03:00
136f23fb4c refactor(site): Suport template version variables on template creation (#6434) 2023-03-06 18:36:19 +00:00
909fbb6d2c fix(site): Upload template files on template version editor (#6222) 2023-02-16 13:59:48 -03:00
2117eb4f31 chore: Improve bundle size (#5761) 2023-01-18 17:31:31 +00:00
6252f782d8 fix: Setup redirect state (#5759) 2023-01-18 15:28:46 +00:00
85c679597c site: reduce printWidth to 80 (#4437)
Resolves #4435
2022-10-10 10:33:35 -07:00
ce953441fb refactor: clean up types in jest.setup.ts (#4285) 2022-10-04 09:04:23 -07:00
9775228b00 fix: call testing lib cleanup afterEach test (#4232) 2022-09-27 16:27:42 -07:00
82938944e7 refactor: update Prettier printWidth to 100 (#2684) 2022-06-27 10:53:44 -04:00
cfa316be89 fix: incomplete message when intercepting console logger (#1875)
I was getting a message like "Warning: Failed type %s: %s%s".
2022-05-27 17:16:19 -05:00
cf5aca799d Add reset user password action (#1320) 2022-05-06 13:23:03 -05:00
f911c8a781 feat: Add suspend user action (#1275) 2022-05-04 16:10:38 +00:00
b9933d493a refactor: camel case files (#1081) 2022-04-19 11:18:12 -05:00
88e30bec55 feat: add the preferences/account page (#999) 2022-04-15 13:17:50 -04:00
22f820c69b 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>
2022-03-18 14:07:08 -04:00
edd8345658 fix: UX - Error logs in development from Empty state component (#466)
Fixes #452 

When the empty state is rendered with a non-textual element (which it turns out all our current empty states are, because they have a `<button />` component as a call to action), this noisy error log was showing up in the `console`:

```
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.
    at div
    at div
    at p
    at Typography (webpack-internal:///./node_modules/@material-ui/core/esm/Typography/Typography.js:166:28)
    at WithStyles (webpack-internal:///./node_modules/@material-ui/styles/esm/withStyles/withStyles.js:64:31)
    at div
    at StyledComponent (webpack-internal:///./node_modules/@material-ui/styles/esm/styled/styled.js:95:28)
    at EmptyState (webpack-internal:///./src/components/EmptyState/index.tsx:47:25)
...
    at ProjectsPage (webpack-internal:///./src/pages/projects/index.tsx:37:18)
    at Routes (webpack-internal:///./node_modules/react-router/index.js:275:5)
    at ThemeProvider (webpack-internal:///./node_modules/@material-ui/styles/esm/ThemeProvider/ThemeProvider.js:44:24)
    at UserProvider (webpack-internal:///./src/contexts/UserContext.tsx💯55)
    at SWRConfig$1 (webpack-internal:///./node_modules/swr/dist/index.esm.js:501:23)
    at Router (webpack-internal:///./node_modules/react-router/index.js:209:15)
    at BrowserRouter (webpack-internal:///./node_modules/react-router-dom/index.js:118:5)
    at App
 ```

The issue was that the `description` prop could either be a `string` or an actual `React` component, but was always rendered as a child of a `<Typography />` component. The `<Typography>` component internally renders as a `<p>`, which is not valid to nest `<div>`s inside.

The fix is to not nest inside a `<Typography />` block, but an actual `<div />`.
2022-03-16 20:17:41 -07:00