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(ui): create environment UI #3280

Merged
merged 4 commits into from
Jan 10, 2025

Conversation

bodinsamuel
Copy link
Collaborator

Changes

Fixes https://linear.app/nango/issue/NAN-2224/create-environments-in-nango-ui

  • Add UI to create environment
    As stated by the spec, it's only available for paying customers and up to 10 env.

  • Fix Dropdown checkbox

  • Fix some error check

🧪 Tests

  • Go to dash
  • Create an env
    Screenshot 2025-01-09 at 18 51 37

@bodinsamuel bodinsamuel self-assigned this Jan 9, 2025
Copy link

linear bot commented Jan 9, 2025

@@ -22,7 +22,7 @@ export const connectionIdSchema = z
.max(255);
export const envSchema = z
.string()
.regex(/^[a-zA-Z0-9_-]+$/)
.regex(/^[a-z0-9_-]+$/)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was an oversight, prod has no env with an uppercase

Copy link
Contributor

@nalanj nalanj left a comment

Choose a reason for hiding this comment

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

Works great! Lots of small comments below that should in no-way block this:

  • One silly issue we may want to handle is overflows on the environment name. This would apply in the scrolling list as well. See:
image
  • It may also make sense to put an overflow scroll on the list in the dropdown so that the button always shows:
image
  • Maybe just a future issue, but should we let you rename an environment from the Environment Settings UI?

  • Also should we handle deleting environments? No clue how awful that would be but someone's going to ask for it once they can easily create them.


const environments = await environmentService.getEnvironmentsByAccountId(accountId);
if (environments.length >= 10) {
res.status(400).send({ error: { code: 'resource_capped', message: "Can't create more environment" } });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
res.status(400).send({ error: { code: 'resource_capped', message: "Can't create more environment" } });
res.status(400).send({ error: { code: 'resource_capped', message: "Can't create more environments" } });

@bodinsamuel
Copy link
Collaborator Author

Thanks, fixed that scroll issue and fixed width

Maybe just a future issue, but should we let you rename an environment from the Environment Settings UI?

Not planned yet

Also should we handle deleting environments?

Not planned yet

Since it's for paying customer they will still have a direct line of contact with us, butI'm sure those 2 features will come later 👌🏻

Copy link

gitguardian bot commented Jan 10, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
8205899 Triggered Generic Password 0b2906f packages/cli/docker/docker-compose.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@bodinsamuel bodinsamuel merged commit f4fddbc into master Jan 10, 2025
21 checks passed
@bodinsamuel bodinsamuel deleted the sam/25_01_09/feat/create-environment-ui branch January 10, 2025 16:22
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.

2 participants