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

#2581 - Improve login-error prompt style #2586

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

SebinSong
Copy link
Collaborator

closes #2581

[ screenshot ]

@SebinSong SebinSong self-assigned this Feb 3, 2025
}

const result = await sbp('gi.ui/prompt', promptOptions)
if (!result) {
if (result) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now that 'Yes' is the primary button, this check must be negated.

Comment on lines +62 to +73
// Sometimes, the query string for modal has both 'modal' and 'subcontent' eg.) '/app/?modal=SignupModal&subcontent=Prompt'
if (to.query.subcontent) {
const subContentTo = to.query.subcontent.split('+').pop()
if (subContentTo !== this.activeSubContent) {
// Try to find the target subcontent in the list of subcontent
const i = this.subcontent.indexOf(subContentTo)
if (i !== -1) {
this.subcontent = this.subcontent.slice(0, i)
} else {
this.subcontent = [subContentTo]
}
}
Copy link
Collaborator Author

@SebinSong SebinSong Feb 3, 2025

Choose a reason for hiding this comment

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

This is irrelevant to the issue itself but a fix for a bug I encountered while working on the issue.
The bug was that, when the app is reloaded and it has 'sign-up' modal and also 'login-error' prompt on top of it, this.subcontent becomes a weird string value (it was alphabet t in my case) while theModal.vue is assuming that this.subcontent is an array of strings at all times.
As a result, I was unable to close SignupModal.vue. So had to update this part with fixes like L:71 above.

Copy link

cypress bot commented Feb 3, 2025

group-income    Run #3875

Run Properties:  status check passed Passed #3875  •  git commit b9d528377c ℹ️: Merge ce289385b6d4d481f94ebf93329470016a54409f into a7d7b698d248e1d194e5c1a5f500...
Project group-income
Branch Review sebin/task/#2581-improve-login-error-prompt
Run status status check passed Passed #3875
Run duration 11m 09s
Commit git commit b9d528377c ℹ️: Merge ce289385b6d4d481f94ebf93329470016a54409f into a7d7b698d248e1d194e5c1a5f500...
Committer Sebin Song
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 112
View all changes introduced in this branch ↗︎

@SebinSong SebinSong changed the title Improve login-error prompt style #2581 - Improve login-error prompt style Feb 3, 2025
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Great work @SebinSong!

I could merge as-is, since everything works, or we could add the 'filled' styled as part of this PR, or leave that as a separate issue. Let me know which you prefer!

secondaryButton: L('Yes')
primaryButton: L('Yes'),
secondaryButton: L('No'),
primaryButtonStyle: 'primary', // make primary button 'filled' style
Copy link
Member

Choose a reason for hiding this comment

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

Why is it that the default style is called 'outlined', and to make it filled, we call it 'primary' instead of 'filled'?

Wouldn't it make more sense to call it 'filled'?

Note: if you change this, you'd need to look through the rest of the codebase for 'primary' and make sure everything is updated accordingly. Or you could add the style as an alias to primary, without changing the existing definition of primary, which would be safer.

Copy link
Collaborator Author

@SebinSong SebinSong Feb 7, 2025

Choose a reason for hiding this comment

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

Why is it that the default style is called 'outlined', and to make it filled, we call it 'primary' instead of 'filled'?

Well, the Prompt.vue had both buttons as 'outlined' style before this PR and I'm only changing the style of one button for a particular prompt(Login Error) in this PR..

Wouldn't it make more sense to call it 'filled'?

Nowhere in this project's CSS is below button style called 'filled' but instead it is called 'primary'.

(The term 'filled' is something people at my other company use for that kind of button style. I think I got it from there)

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Nicely done!

@taoeffect taoeffect merged commit a64f8e0 into master Feb 7, 2025
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#2581-improve-login-error-prompt branch February 7, 2025 21:55
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.

Improve prompt that appears on login to forked chain
2 participants