1
0
mirror of https://github.com/Unleash/unleash.git synced 2026-02-04 20:10:52 +01:00
unleash.unleash/frontend
Kamala be130979ee
feat: Suggest release templates for production environments (#11279)
Adds a "Choose a release template" suggestion for production
environments without strategies (enterprise only).
When clicked, opens the "Add Strategy" dialog with the release templates
filter preselected.
Non-production environments continue to show the default strategy
suggestion.

## Notes 

This unfortunately turned out to be a big PR 🥲 as it includes some
refactoring to be able to reuse components.
- The "Add strategy" button has been broken out of
`FeatureStrategyMenu`, so the latter can be reused (since we want to
show the same dialog when clicking the button "Choose a release
template");
- The new `EnvironmentTemplateSuggestion` shares styles with
`EnvironmentStrategySuggestion` (which can be found in
`EnvironmentHeader.styles.tsx`);
- `FeatureStrategyMenu` now has a `defaultFilter` prop, so the dialog
can be opened with a preselected filter.

<img width="900" height="349" alt="Screenshot 2026-02-03 at 17 19 32
(2)"
src="https://github.com/user-attachments/assets/27f11e24-163f-4f4d-8134-a5d08ff540ac"
/>
<img width="1379001" height="557" alt="Screenshot 2026-02-03 at 17 20
14"
src="https://github.com/user-attachments/assets/0efe77f5-af3e-498a-b305-fd5c1ed98906"
/>
2026-02-04 11:34:42 +01:00
..
.yarn/releases task: security upgrades server (#11125) 2025-12-11 17:23:18 +01:00
cypress task: security upgrades server (#11125) 2025-12-11 17:23:18 +01:00
public
scripts
src feat: Suggest release templates for production environments (#11279) 2026-02-04 11:34:42 +01:00
.editorconfig
.gitignore
.npmignore
.nvmrc
.yarnrc.yml task: security upgrades server (#11125) 2025-12-11 17:23:18 +01:00
check-imports.rc
cypress.config.ts task: security upgrades server (#11125) 2025-12-11 17:23:18 +01:00
cypress.d.ts
index.html Chore: Tweaks to typography (#11103) 2025-12-18 14:55:45 +00:00
index.js
mise.toml
orval.config.ts
package.json task: security upgrades server (#11125) 2025-12-11 17:23:18 +01:00
README.md
tsconfig.json
tsconfig.node.json
vercel.json
vite.config.mts style: lint sourcemap line in vite config (#11200) 2026-01-07 16:11:01 +00:00
yarn.lock chore(deps): bump lodash from 4.17.21 to 4.17.23 in /frontend (#11271) 2026-01-29 13:07:33 +00: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