refactor: create feature migration#6925
refactor: create feature migration#6925kyle-ssg wants to merge 132 commits intochore/permission-typesfrom
Conversation
# Conflicts: # frontend/web/components/modals/create-feature/index.js # frontend/web/components/pages/FeaturesPage.js
# Conflicts: # frontend/package-lock.json # frontend/package.json # frontend/web/components/modals/create-feature/index.js
# Conflicts: # .github/workflows/.reusable-docker-e2e-tests.yml # frontend/.claude/context/e2e.md # frontend/Makefile # frontend/api/index.js # frontend/e2e/global-setup.playwright.ts # frontend/e2e/helpers/e2e-helpers.playwright.ts # frontend/e2e/tests/change-request-test.pw.ts # frontend/e2e/tests/flag-tests.pw.ts # frontend/e2e/tests/invite-test.pw.ts # frontend/e2e/tests/organisation-test.pw.ts # frontend/e2e/tests/project-permission-test.pw.ts # frontend/e2e/tests/project-test.pw.ts # frontend/e2e/tests/segment-test.pw.ts # frontend/e2e/tests/versioning-tests.pw.ts # frontend/package-lock.json
… package for npm
…tion-continued # Conflicts: # frontend/web/components/modals/create-feature/index.js # frontend/web/components/modals/create-feature/tabs/CreateFeatureTab.tsx # frontend/web/components/modals/create-feature/tabs/FeatureSettingsTab.tsx # frontend/web/components/modals/create-feature/tabs/FeatureValue.tsx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
| const envId = project?.environments?.find( | ||
| (env) => env.api_key === environmentId, | ||
| )?.id | ||
| if (!envId) { | ||
| setUserOverridesNoPermissionState() | ||
| return | ||
| } |
There was a problem hiding this comment.
I think I might have found a bug
This is comparing api_key (a string like "RAvjEqbj96SXiJP4hQHd5E") with environmentId which is now a numeric ID (e.g. "123") after #6322. They'll never match, so it always falls into the no-permission state.
environmentId is already the numeric ID, so this lookup can be removed and environmentId passed directly to getPermission.
I am getting this:
| getPermission( | ||
| getStore(), | ||
| { | ||
| id: envId, | ||
| level: 'environment', | ||
| }, | ||
| { forceRefetch }, | ||
| ) |
There was a problem hiding this comment.
| getPermission( | |
| getStore(), | |
| { | |
| id: envId, | |
| level: 'environment', | |
| }, | |
| { forceRefetch }, | |
| ) | |
| getPermission( | |
| getStore(), | |
| { | |
| id: environmentId, | |
| level: 'environment', | |
| }, | |
| { forceRefetch }, | |
| ) |
it seems to do the trick
| const environment = project?.environments?.find( | ||
| (env) => env.api_key === environmentId, | ||
| ) |
There was a problem hiding this comment.
Same api_key vs numeric ID issue as above — environment is always undefined, so isVersioned and is4Eyes are always false. This silently bypasses 4-eyes/change requests for segment overrides.
There was a problem hiding this comment.
| const environment = project?.environments?.find( | |
| (env) => env.api_key === environmentId, | |
| ) | |
| const environment = getEnvironment(environmentId) |
| userOverridesPage(1) | ||
| }) | ||
| .catch(() => { | ||
| setIsLoading(false) |
There was a problem hiding this comment.
What do you think about adding setUserOverridesErrorState in here as well to avoid silent errors ?
| setIsLoading(false) | |
| setIsLoading(false) | |
| setUserOverridesErrorState() |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Migrates all tabs including the create feature modal itself to TypeScript, no type errors to do with creating / editing a feature and also reduces the feature modal by ~1200 LoC.
Migrates a few components to ES export
How did you test this code?