Repository: liqd/a4-meinberlin

Issue:
(react list) proposal-list-item should show created/modified date
**URL:** proposal-list
**user:** any
**expected behaviour:** list items (tiles) in react list should show `created on/modified on` in front of date (see django list)
**behaviour:** list items do not indicate created on or modified on, but shows only the date
**important screensize:** any
**device & browser:** any
**Comment/Question:** 

Screenshot?

Note: This will only affect where this particular react list is used (currently only used for budgeting/proposal-list)


Discussion:

Resolving patch:
diff --git a/meinberlin/apps/budgeting/serializers.py b/meinberlin/apps/budgeting/serializers.py
--- a/meinberlin/apps/budgeting/serializers.py
+++ b/meinberlin/apps/budgeting/serializers.py
@@ -30,12 +30,12 @@ class ProposalSerializer(serializers.ModelSerializer):
 
     class Meta:
         model = Proposal
-        fields = ('budget', 'category', 'comment_count', 'created', 'creator',
-                  'is_archived', 'name', 'negative_rating_count',
+        fields = ('budget', 'category', 'comment_count', 'created', 'modified',
+                  'creator', 'is_archived', 'name', 'negative_rating_count',
                   'positive_rating_count', 'url', 'pk', 'moderator_feedback',
                   'moderator_feedback_choices', 'locale')
         read_only_fields = ('budget', 'category', 'comment_count', 'created',
-                            'creator', 'is_archived', 'name',
+                            'modified', 'creator', 'is_archived', 'name',
                             'negative_rating_count', 'positive_rating_count',
                             'url', 'pk', 'moderator_feedback',
                             'moderator_feedback_choices', 'locale')


Test patch:
diff --git a/meinberlin/apps/budgeting/assets/__tests__/BudgetingProposalListItem.jest.jsx b/meinberlin/apps/budgeting/assets/__tests__/BudgetingProposalListItem.jest.jsx
--- a/meinberlin/apps/budgeting/assets/__tests__/BudgetingProposalListItem.jest.jsx
+++ b/meinberlin/apps/budgeting/assets/__tests__/BudgetingProposalListItem.jest.jsx
@@ -1,6 +1,7 @@
 import React from 'react'
 import { render, screen } from '@testing-library/react'
 import { BudgetingProposalListItem } from '../BudgetingProposalListItem'
+import django from '../../../../../__mocks__/djangoMock'
 
 test('render list item with vote button', () => {
   const proposal = {
@@ -12,8 +13,9 @@ test('render list item with vote button', () => {
   render(<BudgetingProposalListItem proposal={proposal} isVotingPhase />)
   expect(screen.getByText('myProposal')).toBeTruthy()
   expect(screen.getByText('creator')).toBeTruthy()
-  const resolvedDate = screen
-    .queryByText('11. November 2021') || screen.queryByText('11 November 2021')
+  const resolvedDate =
+    screen.queryByText(`${django.gettext()} 11. November 2021`) ||
+    screen.queryByText(`${django.gettext()} 11 November 2021`)
   expect(resolvedDate).toBeTruthy()
 })
 
@@ -27,7 +29,8 @@ test('render list item with stats', () => {
   render(<BudgetingProposalListItem proposal={proposal} isVotingPhase={false} />)
   expect(screen.getByText('myProposal')).toBeTruthy()
   expect(screen.getByText('creator')).toBeTruthy()
-  const resolvedDate = screen
-    .queryByText('11. November 2021') || screen.queryByText('11 November 2021')
+  const resolvedDate =
+    screen.queryByText(`${django.gettext()} 11. November 2021`) ||
+    screen.queryByText(`${django.gettext()} 11 November 2021`)
   expect(resolvedDate).toBeTruthy()
 })