1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00
unleash.unleash/frontend
Thomas Heartman 5d1a8ca735
chore: add Change Requests to sidebar and fix command menu icon (#10932)
Adds the new change request overview to the sidebar and fixes the entry
in the command bar to use the right title and icon.

<img width="441" height="159" alt="image"
src="https://github.com/user-attachments/assets/a3eb4fdd-f440-470b-b42f-539ec53f0aa0"
/>
<img width="269" height="163" alt="image"
src="https://github.com/user-attachments/assets/a2fdf92d-73c5-4daf-af64-f9f5cfe56834"
/>


Additionally, standardize the change requests icon. Instead of using a
custom one from a svg, let's use the material icon (which is the same,
just -90deg rotated and flipped around an axis)

This standardization, makes the icon a tiny bit smaller in the new
project modal, but it's the same size (20x20) as the other icons, so I
don't think anyone's gonna notice or care, and I think it's better to
use the basic material icon.

Of course, we could scale it up (and add a `scale` prop to the change
request icon), but I'd rather leave it out for consistency and
simplicity for now.

old:
<img width="835" height="52" alt="image"
src="https://github.com/user-attachments/assets/00dc35f3-a536-4e10-8115-2a0dbde92bb1"
/>

new: 
<img width="823" height="63" alt="image"
src="https://github.com/user-attachments/assets/5870fde1-05c1-43ce-a1c1-7ddc2242fb6b"
/>



As for the scale, I've set it to 1.1, because that makes it damn near
identical on the change request page (where I've also updated the raw
svg to the new icon) (old one on left, new one on right):
<img width="500" height="796" alt="image"
src="https://github.com/user-attachments/assets/fbbbf44f-8f8d-4cb9-b466-4cf3e70bfb1a"
/>
2025-11-06 12:12:58 +00:00
..
.yarn/releases chore(build): Bump Yarn to 4.10.3 (#10865) 2025-10-27 12:58:24 +01:00
cypress
public
scripts
src chore: add Change Requests to sidebar and fix command menu icon (#10932) 2025-11-06 12:12:58 +00:00
.editorconfig
.gitignore
.npmignore
.nvmrc
.yarnrc.yml chore(build): Bump Yarn to 4.10.3 (#10865) 2025-10-27 12:58:24 +01:00
check-imports.rc
cypress.config.ts
cypress.d.ts
index.html
index.js
mise.toml
orval.config.ts
package.json chore(build): Bump Yarn to 4.10.3 (#10865) 2025-10-27 12:58:24 +01:00
README.md
tsconfig.json
tsconfig.node.json
vercel.json
vite.config.mts
yarn.lock chore(deps): bump validator from 13.12.0 to 13.15.20 in /frontend (#10877) 2025-10-28 09:37:52 +01:00

frontend

This directory contains the Unleash Admin UI frontend app.

Run with a local instance of the unleash-api

Refer to the Contributing to Unleash guide for instructions. The frontend dev server runs (in port 3000) simultaneously with the backend dev server (in port 4242):

yarn install
yarn dev

Run with a sandbox instance of the Unleash API

Alternatively, instead of running unleash-api on localhost, you can use a remote instance:

cd ./frontend
yarn install
yarn run start:sandbox

Running end-to-end tests

We have a set of Cypress tests that run on the build before a PR can be merged so it's important that you check these yourself before submitting a PR. On the server the tests will run against the deployed Heroku app so this is what you probably want to test against:

yarn run start:sandbox

In a different shell, you can run the tests themselves:

yarn run e2e:heroku

If you need to test against patches against a local server instance, you'll need to run that, and then run the end to end tests using:

yarn run e2e

You may also need to test that a feature works against the enterprise version of unleash. Assuming the Heroku instance is still running, this can be done by:

yarn run start:enterprise
yarn run e2e

Generating the OpenAPI client

The frontend uses an OpenAPI client generated from the backend's OpenAPI spec. Whenever there are changes to the backend API, the client should be regenerated:

For now we only use generated types (src/openapi/models). We will use methods (src/openapi/apis) for new features soon.

yarn gen:api
rm -rf src/openapi/apis

clean up src/openapi/index.ts imports, only keep first line export * from './models';

This script assumes that you have a running instance of the enterprise backend at http://localhost:4242. The new OpenAPI client will be generated from the runtime schema of this instance. The target URL can be changed by setting the UNLEASH_OPENAPI_URL env var.

Analyzing bundle size

npx vite-bundle-visualizer in the root of the frontend directory