Skip to content

Commit 1766476

Browse files
authored
Merge pull request #155 from Xpirix/feed_review_improvment
Enhance review workflow for feed entries
2 parents d78ff71 + 7d55ea8 commit 1766476

14 files changed

+2462
-442
lines changed

README.md

Lines changed: 149 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,42 +188,174 @@ A home page that displays feeds as they are rendered in QGIS is now available at
188188
</details>
189189

190190
<details>
191-
<summary><strong>Control panel and permissions</strong></summary>
191+
<summary><strong>User Roles and Permissions</strong></summary>
192192
</br>
193193

194-
Users with `staff` flag can enter the control panel at `/admin` and add feed entries, by default entries are not published.
194+
The system has three main user roles with different capabilities:
195195

196-
Users with `superadmin` flag will be notified by email when an entry is added to the feed and will be able to publish the entry.
196+
### 📝 Authors (Staff Users)
197+
Users with the `staff` flag can:
198+
- Create new feed entries
199+
- Edit their own entries (including during review)
200+
- Submit entries for review
201+
- Add comments to their entries and respond to reviewer feedback
202+
- View all entries and their statuses
197203

198-
Appart from `superadmin`, only users with the permission `qgisfeed | Can publish QGIS feed` can publish the entry. Like the group `qgisfeedentry_authors`, the group `qgisfeedentry_approver` with the permission `qgisfeed | Can publish QGIS feed` are created when a `Save` signal from the `User` model is detected.
204+
### ✅ Reviewers (Approvers)
205+
Users with the `qgisfeed.publish_qgisfeedentry` permission can:
206+
- Review any entry (including their own if they're also the author)
207+
- Approve entries (moves status to "Approved")
208+
- Request changes from authors
209+
- Add comments to any entry
210+
- Publish approved entries
211+
212+
### 👑 Superusers
213+
Superusers have all permissions and can:
214+
- Do everything authors and reviewers can do
215+
- Self-approve and publish their own entries
216+
- Manage all system settings
217+
218+
**Note:** The groups `qgisfeedentry_authors` and `qgisfeedentry_approvers` are automatically created when needed.
199219

200-
For content field, a hard limit on the number of characters allowed is configurable in administration page (Character limit configurations). If not set, max characters value for this field is 500. If you want to add a custom max characters for this field, the field name value should be `content`.
201220
</details>
202221

203222
<details>
204-
<summary><strong>Manage feeds page</strong></summary>
223+
<summary><strong>Review Workflow</strong></summary>
205224
</br>
206225

207-
***Note: The permissions for this page are the same as described in the Control Panel and permissions.***
226+
The review system works similarly to GitHub Pull Requests, enabling collaborative review and discussion:
227+
228+
### 📋 Workflow Steps
229+
230+
1. **Create Entry (Draft)**
231+
- Author creates a new feed entry
232+
- Entry starts in "Draft" status
233+
- Author can assign multiple reviewers
234+
235+
2. **Submit for Review**
236+
- Author clicks "Submit for Review"
237+
- Entry moves to "Pending Review" status
238+
- Assigned reviewers are notified by email
239+
- **Author can still edit the entry while under review**
240+
241+
3. **Review Process**
242+
- Reviewers can:
243+
-**Approve** - Entry moves to "Approved" status (ready to publish)
244+
- ⚠️ **Request Changes** - Entry moves to "Changes Requested" status
245+
- 💬 **Add Comment** - Provide feedback without changing status
246+
- **Multiple reviewers can be assigned**
247+
- Each reviewer's status is tracked independently
248+
- Authors can respond with comments at any time
249+
250+
4. **Addressing Feedback**
251+
- Author makes requested changes
252+
- Entry stays in review state (doesn't reset)
253+
- Reviewers are notified of updates
254+
- Review conversation continues
255+
256+
5. **Approval**
257+
- **Any one reviewer approval** moves entry to "Approved" status
258+
- No need to wait for all reviewers
259+
- Multiple approvals are visible but not required
260+
261+
6. **Publishing**
262+
- Only users with publish permission can publish
263+
- Authors **without** publish permission cannot publish (even their own entries)
264+
- Authors **with** publish permission can self-approve and publish
265+
- Entry moves to "Published" status and goes live
266+
267+
### 🔄 Status Flow
268+
269+
```
270+
Draft → Pending Review → Approved → Published
271+
272+
Changes Requested → (back to Pending Review)
273+
```
274+
275+
### 💬 Communication During Review
276+
277+
- **Review History**: All actions are visible in chronological order (oldest first)
278+
- **Comments**: Both authors and reviewers can add comments at any time
279+
- **Status Badges**: Visual indicators show each reviewer's current state:
280+
- ✅ Green: Approved
281+
- ⚠️ Yellow: Changes Requested
282+
- 💬 Blue: Comment Only
283+
- ⏰ Gray: Pending (not reviewed yet)
208284

209-
After logging in with the login screen at `/accounts/login/` (can be also accessed from the **Login** button on the **Homepage**), users are provided with tools to manage feed items:
210-
- A list of feed items, sortable and filterable by title, date published, author, language, need review
211-
- A button to create a new feed item - clicking will take you to a blank feed item form (See **Feed item form** below)
212-
- Clicking on an item on the list will take you to a feed item form (See **Feed item form** below)
285+
### 👥 Multi-Reviewer Support
286+
287+
- Multiple reviewers can be assigned to one entry
288+
- Reviewers are visible throughout the entire workflow
289+
- Each reviewer's status is tracked and displayed separately
290+
- Authors can see who has approved and who is still pending
213291

214292
</details>
215293

294+
<details>
295+
<summary><strong>Manage feeds page</strong></summary>
296+
</br>
297+
298+
After logging in at `/accounts/login/` (accessible from the **Login** button on the **Homepage**), users can manage feed items:
299+
300+
- View a list of all feed items
301+
- Sort and filter by: title, date published, author, language, review status
302+
- Create new feed items (click "New entry" button)
303+
- Edit existing entries (click on any item in the list)
304+
- See entry status badges (Draft, Pending Review, Changes Requested, Approved, Published)
305+
306+
</details>
216307

217308
<details>
218309
<summary><strong>Feed item form</strong></summary>
219310
</br>
220311

221-
The feed item form page is displayed when clicking the **New entry** item button or an item on the list:
222-
- The feed item form is displayed on the left with all the widgets needed to edit the entry. On the right, a preview of the entry as it will be rendered in QGIS. Any edits made in the form shall immediately update the preview.
223-
- In the content widget only the following html tags are allowed: p, strong, italics. A hard limit on the number of characters allowed is configurable in administration page in the model `Character limit configurations` (default is 500).
224-
- Once a feed item is created or modified, there will be a review step where the user is asked to confirm that they have checked everything carefully.
225-
- The form is placed in the column **Need review** in the list before final submission.
226-
- The form must be approved by someone the permission `qgisfeed | Can publish QGIS feed` before it is published.
312+
### Form Layout
313+
- **Left side**: Edit form with all entry fields
314+
- **Right side**: Live preview showing how it will appear in QGIS
315+
- Changes update the preview in real-time
316+
317+
### Key Features
318+
319+
#### Reviewers Selection
320+
- Available on both create and edit forms
321+
- Select multiple reviewers using the dropdown
322+
- Reviewers are notified by email when assigned
323+
324+
#### Reviewer Status Panel
325+
Shows the current state of each assigned reviewer:
326+
- Name and review status (Pending, Approved, Changes Requested)
327+
- Timestamp of their last action
328+
- Color-coded visual indicators
329+
330+
#### Content Editor
331+
- Rich text editor with limited HTML tags: `<p>`, `<strong>`, `<em>`
332+
- Character limit is configurable (default: 500 characters)
333+
- Live character counter
334+
335+
#### Actions Available
336+
337+
**For Authors:**
338+
- Save as draft
339+
- Submit for review
340+
- Edit during review (stays in review state)
341+
- Add comments for reviewers
342+
343+
**For Reviewers:**
344+
- Approve entry
345+
- Request changes
346+
- Add comments
347+
- Publish (if approved)
348+
349+
**For Authors with Publish Permission:**
350+
- All author actions
351+
- All reviewer actions (can self-approve and publish)
352+
353+
### Review & Comment Section
354+
- Visible when entry is under review, has changes requested, or is approved
355+
- Shows all review history in chronological order
356+
- Authors can add comments at any time
357+
- Reviewers can approve, request changes, or comment
358+
- Comment field is always available for both parties
227359

228360
</details>
229361

qgisfeedproject/qgisfeed/admin.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from .models import (
3030
CharacterLimitConfiguration,
3131
DailyQgisUserVisit,
32+
FeedEntryReview,
33+
FeedEntryRevision,
3234
QgisFeedEntry,
3335
QgisUserVisit,
3436
)
@@ -164,8 +166,30 @@ def platform(sel, obj):
164166
qgis_version.short_description = "QGIS Version"
165167

166168

169+
class FeedEntryReviewAdmin(admin.ModelAdmin):
170+
list_display = ("entry", "reviewer", "action", "created_at")
171+
list_filter = ("action", "created_at")
172+
search_fields = ("entry__title", "reviewer__username", "comment")
173+
readonly_fields = ("entry", "reviewer", "created_at")
174+
175+
def has_add_permission(self, request):
176+
return False
177+
178+
179+
class FeedEntryRevisionAdmin(admin.ModelAdmin):
180+
list_display = ("entry", "user", "changed_at", "change_summary")
181+
list_filter = ("changed_at",)
182+
search_fields = ("entry__title", "user__username", "change_summary")
183+
readonly_fields = ("entry", "user", "title", "content", "url", "changed_at")
184+
185+
def has_add_permission(self, request):
186+
return False
187+
188+
167189
admin.site.register(QgisFeedEntry, QgisFeedEntryAdmin)
168190
admin.site.register(CharacterLimitConfiguration, CharacterLimitConfigurationAdmin)
191+
admin.site.register(FeedEntryReview, FeedEntryReviewAdmin)
192+
admin.site.register(FeedEntryRevision, FeedEntryRevisionAdmin)
169193
admin.site.unregister(UserVisit)
170194
admin.site.register(UserVisit, UpdatedUserVisitAdmin)
171195
admin.site.register(DailyQgisUserVisit, DailyQgisUserVisitAdmin)

0 commit comments

Comments
 (0)