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

apps/item detail templates: use label/badges from model property and … #4585

Merged
merged 4 commits into from
Oct 21, 2022

Conversation

fuzzylogic2000
Copy link
Contributor

…move badge properties to mixin to use in topics

I used the badge properties also in the detail views. But we need to check what to do with the budget badges on the tile.

So, questions for you @CarolingerSeilchenspringer :
We did use different solutions for all the different badges and all different idea derivates. With redoing the badges on the list, I put them into the same order and added the same behaviour everywhere:

  • order (detail view and list): moderator feedback, budget, point_label, category, labels
  • behaviour on the list: after three badges, the others are counted and put behind the badges as link "... more"
    That is fine, right?

But for the detail view, we only added the "budget not specified" to budgeting proposals, not kiezkasse. I also changed that and kiezkasse proposals are the same now. Also fine (just improving), right?

But finally the question we need a decision on: so far the budget is not displayed in the list when it is 0. https://meinberlin-dev.liqd.net/projekte/module/kiezkasse-4/?mode=list It would be easier if we could change that and also display the 0-label on the list:
Screenshot from 2022-10-19 17-05-36
But we can also remove it from the list. And keep it like it is now. Please tell us @CarolingerSeilchenspringer

@fuzzylogic2000
Copy link
Contributor Author

@CarolingerSeilchenspringer That was a long text and a lot of questions yesterday, but the only question actually is: Can we keep the "Kosten: keine Angabe" when the budget is 0 on the lists for Bürgerhaushalt and Kiezkasse or shouldn't there be any badge in that case?

@CarolingerSeilchenspringer
Copy link
Contributor

@fuzzylogic2000 checked and find all three solutions you mention good. Have it the same everywhere sounds the best option.

package.json Outdated Show resolved Hide resolved
@fuzzylogic2000 fuzzylogic2000 force-pushed the kl-2022-10-more-item-label-template-stuff branch from 5abd4c5 to be739f4 Compare October 20, 2022 14:05
@fuzzylogic2000 fuzzylogic2000 force-pushed the kl-2022-10-more-item-label-template-stuff branch from be739f4 to 08c6779 Compare October 20, 2022 14:23
@fuzzylogic2000
Copy link
Contributor Author

@Rineee Added some more things. :)

@@ -48,20 +20,18 @@ class ProposalSerializer(serializers.ModelSerializer):
class Meta:
model = Proposal
fields = (
'budget', 'category', 'comment_count', 'created',
'creator', 'is_archived', 'labels', 'moderator_feedback',
'additional_item_badges_for_list_count', 'comment_count',
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I never realized that you can serialize properties just like that!

@Rineee Rineee self-requested a review October 20, 2022 15:33
Copy link
Contributor

@Rineee Rineee left a comment

Choose a reason for hiding this comment

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

Totally love it! 🎉

Maybe someone else wants to check? But good to merge from my side once tests are fixed.

@fuzzylogic2000 fuzzylogic2000 force-pushed the kl-2022-10-more-item-label-template-stuff branch from 08c6779 to d8ee032 Compare October 20, 2022 16:52
@fuzzylogic2000 fuzzylogic2000 requested a review from Rineee October 20, 2022 16:52
Comment on lines -41 to -48
test('displaying category badge', () => {
render(
<ListItemBadges
badges={categoryBadge}
/>
)
expect(screen.getByText('category1')).toBeTruthy()
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was a bit sad to delete tests, but as the component got a lot dumber with the serializer having all the info, they didn't make sense anymore. When I got it right, it only tests if the badges are there, right? We could still test if the moderator_statement is yellow and if the point_label has the icon or do the tests magically do that? @khamui Maybe you could have a look? (I will merge if the tests are actually all fine this time, though. 😅 )

@fuzzylogic2000 fuzzylogic2000 merged commit 65b0610 into main Oct 21, 2022
@fuzzylogic2000 fuzzylogic2000 deleted the kl-2022-10-more-item-label-template-stuff branch October 21, 2022 12:23
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.

3 participants