-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
} | ||
|
||
const result = await sbp('gi.ui/prompt', promptOptions) | ||
if (!result) { | ||
if (result) { |
There was a problem hiding this comment.
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.
// 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] | ||
} | ||
} |
There was a problem hiding this comment.
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.
group-income
|
Project |
group-income
|
Branch Review |
sebin/task/#2581-improve-login-error-prompt
|
Run status |
|
Run duration | 11m 09s |
Commit |
|
Committer | Sebin Song |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
10
|
|
0
|
|
112
|
View all changes introduced in this branch ↗︎ |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'.
![](https://private-user-images.githubusercontent.com/17641213/411091408-55ba18bc-2387-4936-8755-40754c72293a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDQ5NjcsIm5iZiI6MTczOTM0NDY2NywicGF0aCI6Ii8xNzY0MTIxMy80MTEwOTE0MDgtNTViYTE4YmMtMjM4Ny00OTM2LTg3NTUtNDA3NTRjNzIyOTNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA3MTc0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1ZWZhNGFmNzdmMjhlYTIzZGVhZDEwODdlNGIyZjZiMjM4NjM1ZjhlMmYzZjUwNzg3MTljYmViZTJjNzA2NDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6M04-ZKkwz4EX2660wVTqfUFH4sCBfRLg1wCNcf-PG0)
![](https://private-user-images.githubusercontent.com/17641213/411092153-f7d0d791-d67b-4d11-8e1a-0c69e401fe70.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDQ5NjcsIm5iZiI6MTczOTM0NDY2NywicGF0aCI6Ii8xNzY0MTIxMy80MTEwOTIxNTMtZjdkMGQ3OTEtZDY3Yi00ZDExLThlMWEtMGM2OWU0MDFmZTcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDA3MTc0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhY2MyYzVmOTZkNjY1MzI2ZGM0MzA2ZWRhNDM5ODMxYTQ4YjQzZmYxYzcyOTgyY2IzNDdhYTRiN2JjNGI2ODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2E2JOW4bVedP7K3tplkgfT_pLwpTtmuA_h1L2q-ml2w)
(The term 'filled' is something people at my other company use for that kind of button style. I think I got it from there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
closes #2581
[ screenshot ]