Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Environment Picker): Simplify the environment picker UX #8005

Merged

Conversation

gatzjames
Copy link
Contributor

@gatzjames gatzjames commented Sep 25, 2024

Highlights:

  • Updates the environment picker to have a simpler UX and make it easier to understand the order environments are applied
Before After
image image

Closes INS-4488

Comment on lines 37 to 42
const collectionEnvironmentList = [...subEnvironments].map(({ type, ...environment }) => ({ ...environment, id: environment._id, isBase: environment._id === baseEnvironment._id }));

const selectedGlobalBaseEnvironmentId = activeGlobalEnvironment?.parentId.startsWith('wrk') ? activeGlobalEnvironment._id : activeGlobalEnvironment?.parentId;
const selectedGlobalBaseEnvironment = globalBaseEnvironments.find(e => e._id === selectedGlobalBaseEnvironmentId);

const globalEnvironmentList = selectedGlobalBaseEnvironment ? [selectedGlobalBaseEnvironment, ...globalSubEnvironments.filter(e => e.parentId === selectedGlobalBaseEnvironment._id)].map(({ type, ...subenvironment }) => ({ ...subenvironment, id: subenvironment._id, isBase: subenvironment._id === selectedGlobalBaseEnvironment._id })) : [];
const globalEnvironmentList = selectedGlobalBaseEnvironment ? [...globalSubEnvironments.filter(e => e.parentId === selectedGlobalBaseEnvironment._id)].map(({ type, ...subenvironment }) => ({ ...subenvironment, id: subenvironment._id, isBase: subenvironment._id === selectedGlobalBaseEnvironment._id })) : [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

@gatzjames gatzjames force-pushed the feat/environment-picker-ux-improvements branch from c7d7491 to bd9195d Compare September 25, 2024 16:12
@gatzjames gatzjames self-assigned this Sep 25, 2024
@gatzjames gatzjames force-pushed the feat/environment-picker-ux-improvements branch from bf8da48 to 865c37a Compare September 26, 2024 13:45
Co-authored-by: Jack Kavanagh <[email protected]>
filfreire
filfreire previously approved these changes Sep 27, 2024
@gatzjames gatzjames enabled auto-merge (squash) September 27, 2024 12:35
@gatzjames gatzjames merged commit e1cb05d into Kong:develop Sep 27, 2024
8 checks passed
@gatzjames gatzjames deleted the feat/environment-picker-ux-improvements branch September 27, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants