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

When auto capitalization of key enabled for the project then directly pasting the key doesn't capitalize the key #2693

Open
shaharyar-shamshi opened this issue Nov 6, 2024 · 0 comments · May be fixed by #2694

Comments

@shaharyar-shamshi
Copy link

shaharyar-shamshi commented Nov 6, 2024

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to /project/:id/settings
  2. enable the auto capitalization of keys
  3. Now add the secret
  4. In key field directly paste anything in lower case
  5. save it by adding fields

Expected behavior

The key should be capitalized

Screenshots

Screenshot 2024-11-06 at 12 32 18 PM

Additional context

This can be fixed by changing the This function

to


  const handlePaste = (e: ClipboardEvent<HTMLInputElement>) => {
    e.preventDefault();
    const delimitters = [":", "="];
    const pastedContent = e.clipboardData.getData("text");
    let { key, value } = getKeyValue(pastedContent, delimitters);

    if (currentWorkspace?.autoCapitalization) {
      key = key.toUpperCase();
    }

    setValue("key", key);
    setValue("value", value);
  };

Backend

This is needs to be handled in backend as well in secret service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant