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
FEATURE: Featured topic for user profile & card #8461
Conversation
You've signed the CLA, markvanlan. Thank you! This pull request is ready for review. |
@awesomerobot Can see what you think of the changes to this html and this css? The user card right now has all its rows numbered (from first-sixth), but all the rows following the first and second are styled no differently. I needed to add another row, and this structure made it so annoying to arbitrarily increase the class names from "third" to "fourth" and so on. This change does not alter the user card appearance, until the user "features a topic" on their profile |
Yeah moving away from the numbered rows makes sense... I suspect that some sites use those numbered classes to hide specific sections of the user card, but it looks like the children of those divs can be used to the safe effect? Instead of hiding |
@awesomerobot Yeah, all those rows have classes like |
If you created the topic you are viewing, this Now the As well as the user's profile (this is the view logged in as someone else. This view looks different if you are viewing yourself, and does not show the link.) And finally, users can see their featured topic under |
Is there a bit more context where this feature is discussed? |
https://meta.discourse.org/t/add-a-curated-personal-learning-page-for-users/132897/17?u=eviltrout
|
Got it, maybe lets discuss the UX a bit more on meta, I feel like the full title + the text "featured topic:" is mega noisy in then featuring scenario. In some ways when you feature stuff like this you probably want to select a font awesome icon (with a default) and then a few short words... 🔧 buy/sell Then we can display this link next to website on that line. |
end | ||
|
||
message << "\nPlease verify if those key(s) are required as part of the web hook's payload." | ||
message = (difference < 0 ? |
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.
When this error has failed in the past, the error is because the test itself broke; it did not say the error message it was supposed to. It was the cannot modify frozen string error.
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.
I believe this is unrelated and can be safely ignored.
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.
I added to the user serializer, so this test failed.
This is the error message I got:
Failures:
1) WebHookUserSerializer should only include the required keys
Failure/Error: message << "#{difference} key(s) have been added to this serializer."
FrozenError:
can't modify frozen String
# ./spec/serializers/web_hook_user_serializer_spec.rb:34:in `block (3 levels) in <main>'
# ./spec/serializers/web_hook_user_serializer_spec.rb:28:in `block (2 levels) in <main>'
With this change, the new error message would be (if I didn't fix the error)
Failures:
1) WebHookUserSerializer should only include the required keys
Failure/Error:
expect(difference).to eq(0), lambda {
message = (difference < 0 ?
"#{difference * -1} key(s) have been removed from this serializer." :
"#{difference} key(s) have been added to this serializer.") +
"\nPlease verify if those key(s) are required as part of the web hook's payload."
}
1 key(s) have been added to this serializer.
Please verify if those key(s) are required as part of the web hook's payload.
# ./spec/serializers/web_hook_user_serializer_spec.rb:28:in `block (2 levels) in <top (required)>'
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.
Oh right if you add to to the user serializer this is legit. I personally hate this test that fails every time we do that. You have to account for the new column in this test.
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.
A nice start! Let's keep iterating on it!
app/assets/javascripts/discourse/components/topic-footer-buttons.js.es6
Outdated
Show resolved
Hide resolved
db/migrate/20191202202212_add_featured_topic_id_to_user_profiles.rb
Outdated
Show resolved
Hide resolved
app/assets/javascripts/discourse/components/topic-footer-buttons.js.es6
Outdated
Show resolved
Hide resolved
app/assets/javascripts/discourse/components/user-card-contents.js.es6
Outdated
Show resolved
Hide resolved
|
||
if ( | ||
this.currentUser.featured_topic && | ||
this.currentUser.featured_topic.id !== this.model.id |
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.
Could be simplify by:
this.get("currentUser.featured_topic.id") !== this.model.id
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.
These statements are not equivalent, and does not work for what I need.
I do not want to entire this branch of the if, when the featured_topic is null. this.get("currentUser.featured_topic.id") !== this.model.id
evaluates to true
when the featured_topic
is null.
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.
Looks good to me now! Thanks.
No description provided.