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: show decoded value for base64 values in Secrets, ConfigMaps (#663) #714

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Feb 12, 2024

fixes #663

Secrets and ConfigMaps to test this PR: secrets-configmaps.zip

@adietish
Copy link
Collaborator Author

Current impl works fine for 1-line secrets:
Screen-Recording-2024-02-15-at-1

I am current working on displaying hints and editing multiline secrets.

@adietish adietish changed the title feat: show decoded value for base64 values in Secrets, ConfigMaps (#663) feat: show decoded value for base64 values in Secrets(#663) Feb 16, 2024
@adietish adietish changed the title feat: show decoded value for base64 values in Secrets(#663) feat: show decoded value for base64 values in Secrets (#663) Feb 16, 2024
@adietish adietish changed the title feat: show decoded value for base64 values in Secrets (#663) feat: show decoded value for base64 values in Secrets, ConfigMaps (#663) Feb 16, 2024
@adietish adietish force-pushed the issue-663 branch 4 times, most recently from 8a8aefa to eb612c5 Compare February 16, 2024 19:37
@adietish
Copy link
Collaborator Author

adietish commented Feb 19, 2024

I now added display & edit for multiline values:
Hints display 1 line of data, shortened by an ellipsis. Clicking onto the hints opens an input balloon with a text area.
image

@adietish
Copy link
Collaborator Author

I decided to have binary data shown as hex-values, not allowing them to be edited.

image

I could have provided them to be edited in binary form via a JFormattedTextField (see https://docs.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html) but I'm unsure if this would be useful and match real-world use cases. I thus didn't go for it for now.
One could have a f

@adietish
Copy link
Collaborator Author

Here are some examples that can be used to test this PR: secrets-configmaps.zip

@adietish adietish force-pushed the issue-663 branch 2 times, most recently from c7a567c to 233cc11 Compare February 19, 2024 19:44
@adietish adietish force-pushed the issue-663 branch 2 times, most recently from ff60195 to ab18611 Compare February 21, 2024 22:02
@sbouchet
Copy link
Contributor

sbouchet commented Feb 22, 2024

still does not work as expected on fedora. on the below screencast, i'm trying to use shift/ctrl + enter to create new line.
even the button does not work :( ( san't see my mouse on it, but the selection shows my trials )
Capture vidéo du 2024-02-22 09-56-44.webm

@adietish adietish force-pushed the issue-663 branch 2 times, most recently from 2efc0cd to 145ea90 Compare February 22, 2024 13:27
@datho7561
Copy link
Contributor

Multiline editing now works properly for me.

One more thing I ran into was if you have a single line secret, and try to insert a newline, then it won't work. However, I don't think this is a big issue.

@adietish adietish force-pushed the issue-663 branch 2 times, most recently from 27deb39 to 2bdf650 Compare February 22, 2024 16:25
@adietish
Copy link
Collaborator Author

adietish commented Feb 22, 2024

@datho7561, @sbouchet: I fixed both issues. One can now edit quoted values and you can insert new lines by pressing Shift + Enter. An explanatory label to the left of the apply button would tell you about it. Hitting enter without shift applies the value.
I dont provide different widgets (text field / text area) any more. I always use a text area with at least 4 rows (more if needed). I noticed that using a text field or a text area doesnt make a lot of sense when you start turning a "short" value to a large value (ex "42" -> big certificate).
I also enabled word wrapping so that the input balloon always has the same width.

Screen.Recording.2024-02-22.at.17.43.51.mov

Please re-test. Thanks!

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks great to me!

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Still seems good to me!

@adietish adietish force-pushed the issue-663 branch 11 times, most recently from 9f8d003 to 8e97f6c Compare February 23, 2024 09:10
Copy link

sonarcloud bot commented Feb 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

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

LGTM. well done !

@adietish adietish merged commit eff7074 into redhat-developer:main Feb 26, 2024
14 checks passed
@adietish adietish deleted the issue-663 branch February 26, 2024 19: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.

As a user I would like to easily create/edit Secrets in the editor
3 participants