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: automatically generate the credentialName in the Login Component #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karanngi
Copy link

@karanngi karanngi commented Aug 2, 2024

Hello Team,
This PR address the issue to automatically generate the credentialName in the Login Component.

Closes this #37

…t , suggestionFunc, PlaceholderFunc

Signed-off-by: karanngi <[email protected]>
Comment on lines +40 to +42
if loginView.Name == "" && loginView.Server != "" && loginView.Username != "" {
loginView.Name = fmt.Sprintf("%s@%s", loginView.Username, utils.SanitizeServerAddress(loginView.Server))

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is redundant, please remove.

Suggested change
if loginView.Name == "" && loginView.Server != "" && loginView.Username != "" {
loginView.Name = fmt.Sprintf("%s@%s", loginView.Username, utils.SanitizeServerAddress(loginView.Server))

Comment on lines 65 to 66
Validate(func(str string) error {
if str == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update Name of Credential validate block with this code

Suggested change
Validate(func(str string) error {
if str == "" {
Validate(func(str string) error {
if str == "" {
loginView.Name = fmt.Sprintf("%s@%s", loginView.Username, utils.SanitizeServerAddress(loginView.Server))
return nil
}
return nil
}),

This ensures that when Credential name is empty it is autofilled with the default value.

@Althaf66 Althaf66 added the invalid This doesn't seem right label Sep 19, 2024
@Vad1mo
Copy link
Member

Vad1mo commented Nov 10, 2024

related #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants