Skip to content

Commit

Permalink
Merge branch 'feature/3854_separate_on_hold' into release/2024-10-30_…
Browse files Browse the repository at this point in the history
…1600_issues_3854_3925
  • Loading branch information
RK206 committed Oct 30, 2024
2 parents 971f61d + d57f619 commit bc70bf2
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 75 deletions.
12 changes: 6 additions & 6 deletions doajtest/matrices/bll_todo_maned/top_todo_maned.matrix.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_id,account,raises,todo_maned_stalled,todo_maned_follow_up_old,todo_maned_ready,todo_maned_completed,todo_maned_assign_pending,todo_maned_new_update_request,todo_maned_new_update_request_order,todo_maned_ready_order,todo_maned_follow_up_old_order,todo_maned_stalled_order,todo_maned_assign_pending_order,todo_maned_completed_order
1,none,ArgumentException,0,0,0,0,0,0,,,,,,
2,no_role,,0,0,0,0,0,0,,,,,,
3,admin,,1,1,1,1,1,1,1,2,3,4,5,6
4,editor,,0,0,0,0,0,0,,,,,,
5,assed,,0,0,0,0,0,0,,,,,,
test_id,account,raises,todo_maned_stalled,todo_maned_follow_up_old,todo_maned_ready,todo_maned_completed,todo_maned_assign_pending,todo_maned_new_update_request,todo_maned_on_hold,todo_maned_new_update_request_order,todo_maned_ready_order,todo_maned_follow_up_old_order,todo_maned_stalled_order,todo_maned_assign_pending_order,todo_maned_completed_order,todo_maned_on_hold_order
1,none,ArgumentException,0,0,0,0,0,0,0,,,,,,,
2,no_role,,0,0,0,0,0,0,0,,,,,,,
3,admin,,1,1,1,1,1,1,1,1,2,3,4,5,6,7
4,editor,,0,0,0,0,0,0,0,,,,,,,
5,assed,,0,0,0,0,0,0,0,,,,,,,
76 changes: 40 additions & 36 deletions doajtest/matrices/bll_todo_maned/top_todo_maned.settings.csv
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
field,test_id,account,raises,todo_maned_stalled,todo_maned_follow_up_old,todo_maned_ready,todo_maned_completed,todo_maned_assign_pending,todo_maned_new_update_request,todo_maned_new_update_request_order,todo_maned_ready_order,todo_maned_follow_up_old_order,todo_maned_stalled_order,todo_maned_assign_pending_order,todo_maned_completed_order
type,index,generated,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional
default,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,
values,,none,ArgumentException,,,,,,,,,,,,
values,,no_role,,,,,,,,,,,,,
values,,admin,,,,,,,,,,,,,
values,,editor,,,,,,,,,,,,,
values,,assed,,,,,,,,,,,,,
,,,,,,,,,,,,,,,
conditional raises,,none,ArgumentException,,,,,,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_stalled,,admin,,1,,,,,,,,,,,
conditional todo_maned_stalled,,!admin,,0,,,,,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_follow_up_old,,admin,,,1,,,,,,,,,,
conditional todo_maned_follow_up_old,,!admin,,,0,,,,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_ready,,admin,,,,1,,,,,,,,,
conditional todo_maned_ready,,!admin,,,,0,,,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_completed,,admin,,,,,1,,,,,,,,
conditional todo_maned_completed,,!admin,,,,,0,,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_assign_pending,,admin,,,,,,1,,,,,,,
conditional todo_maned_assign_pending,,!admin,,,,,,0,,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_new_update_request,,admin,,,,,,,1,,,,,,
conditional todo_maned_new_update_request,,!admin,,,,,,,0,,,,,,
,,,,,,,,,,,,,,,
conditional todo_maned_new_update_request_order,,admin,,,,,,,,1,,,,,
conditional todo_maned_ready_order,,admin,,,,,,,,,2,,,,
conditional todo_maned_follow_up_old_order,,admin,,,,,,,,,,3,,,
conditional todo_maned_stalled_order,,admin,,,,,,,,,,,4,,
conditional todo_maned_assign_pending_order,,admin,,,,,,,,,,,,5,
conditional todo_maned_completed_order,,admin,,,,,,,,,,,,,6
field,test_id,account,raises,todo_maned_stalled,todo_maned_follow_up_old,todo_maned_ready,todo_maned_completed,todo_maned_assign_pending,todo_maned_new_update_request,todo_maned_on_hold,todo_maned_new_update_request_order,todo_maned_ready_order,todo_maned_follow_up_old_order,todo_maned_stalled_order,todo_maned_assign_pending_order,todo_maned_completed_order,todo_maned_on_hold_order
type,index,generated,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional,conditional
default,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
values,,none,ArgumentException,,,,,,,,,,,,,,
values,,no_role,,,,,,,,,,,,,,,
values,,admin,,,,,,,,,,,,,,,
values,,editor,,,,,,,,,,,,,,,
values,,assed,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional raises,,none,ArgumentException,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_stalled,,admin,,1,,,,,,,,,,,,,
conditional todo_maned_stalled,,!admin,,0,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_follow_up_old,,admin,,,1,,,,,,,,,,,,
conditional todo_maned_follow_up_old,,!admin,,,0,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_ready,,admin,,,,1,,,,,,,,,,,
conditional todo_maned_ready,,!admin,,,,0,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_completed,,admin,,,,,1,,,,,,,,,,
conditional todo_maned_completed,,!admin,,,,,0,,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_assign_pending,,admin,,,,,,1,,,,,,,,,
conditional todo_maned_assign_pending,,!admin,,,,,,0,,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_new_update_request,,admin,,,,,,,1,,,,,,,,
conditional todo_maned_new_update_request,,!admin,,,,,,,0,,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_on_hold,,admin,,,,,,,,1,,,,,,,
conditional todo_maned_on_hold,,!admin,,,,,,,,0,,,,,,,
,,,,,,,,,,,,,,,,,
conditional todo_maned_new_update_request_order,,admin,,,,,,,,,1,,,,,,
conditional todo_maned_ready_order,,admin,,,,,,,,,,2,,,,,
conditional todo_maned_follow_up_old_order,,admin,,,,,,,,,,,3,,,,
conditional todo_maned_stalled_order,,admin,,,,,,,,,,,,4,,,
conditional todo_maned_assign_pending_order,,admin,,,,,,,,,,,,,5,,
conditional todo_maned_completed_order,,admin,,,,,,,,,,,,,,6,
conditional todo_maned_on_hold_order,,admin,,,,,,,,,,,,,,,7
47 changes: 47 additions & 0 deletions doajtest/matrices/bll_todo_maned/top_todo_maned.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,35 @@
}
}
},
{
"name": "todo_maned_on_hold",
"type": "conditional",
"default": "",
"values": {
"1": {
"conditions": [
{
"account": {
"or": [
"admin"
]
}
}
]
},
"0": {
"conditions": [
{
"account": {
"nor": [
"admin"
]
}
}
]
}
}
},
{
"name": "todo_maned_new_update_request_order",
"type": "conditional",
Expand Down Expand Up @@ -314,6 +343,24 @@
]
}
}
},
{
"name": "todo_maned_on_hold_order",
"type": "conditional",
"default": "",
"values": {
"7": {
"conditions": [
{
"account": {
"or": [
"admin"
]
}
}
]
}
}
}
]
}
27 changes: 17 additions & 10 deletions doajtest/testbook/dashboards/maned_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tests:
- step: Go to the maned dashboard page
path: /dashboard
results:
- You can see 16 applications in your priority list
- You can see 18 applications in your priority list
- Your priority list contains a mixture of managing editor items (actions related to teams you are the managing editor for),
editor items (actions related to teams you are the editor for) and associate items (actions related to applications which
are assigned specifically to you for review).
Expand All @@ -37,30 +37,31 @@ tests:
- At least one of your priority items is for an application in the state ready (it should indicate that it is for your maned group)
- At least one of your priority items is for an application in the completed state which has not been updated for more than 2 weeks (it should indicate that it is for your maned group)
- At least one of your priority items is for an application in the pending state which has not been updated for more than 2 weeks (it should indicate that it is for your maned group)
- At least one of your priority items is for an application in the "on hold" state
- Your lowest priority item (last in the list) is for an update request which was submitted this month
- step: click on the managing editor's ready application
- step: Change the application status to "Accepted" and save
- step: close the tab, return to the dashboard and reload the page
results:
- You can see 15 applications in your priority list
- You can see 17 applications in your priority list
- The application you have just edited has disappeared from your priority list
- step: click on the [in progress] stalled managing editor's application
- step: make any minor adjustment to the metadata and save
- step: close the tab, return to the dashboard and reload the page
results:
- You can see 14 applications in your priority list
- You can see 16 applications in your priority list
- The application you just edited has disappeared from your priority list
- step: click on the "completed" maned application
- step: Change the application to "ready" status
- step: close the tab, return to the dashboard and reload the page
results:
- You can still see 14 applications in your priority list
- You can still see 15 applications in your priority list
- The completed application you just moved to ready is now in your priority list as a ready application
- step: click on the pending managing editor's application
- step: Assign the item to an editor in the selected group (there should be a test editor available to you to select)
- step: close the tab, return to the dashboard and reload the page
results:
- You have 13 applications left in your todo list
- You have 14 applications left in your todo list
- The pending application you just edited is no longer visible

- title: Filtering the todo list
Expand All @@ -74,22 +75,28 @@ tests:
- step: Go to the maned dashboard page
path: /dashboard
results:
- You can see 16 applications in your priority list
- You can see 18 applications in your priority list
- Your highest priority item (first in the list) is for an update request which was submitted last month
- Your lowest priority item (last in the list) is for an update request which was submitted this month
- On the top right of the todo list are a set of filter buttons "Show all", "New Applications" and "Update Requests"
- On the top right of the todo list are a set of filter buttons "Show all", "New Applications", "Update Requests" and "On Hold"
- The "Show all" button is highlighted
- step: click on the "New Applications" filter button
results:
- You can see 14 applications in your priority list
- The update requests which were on the previous screen are no longer visible
- You can see 16 applications in your priority list
- The update requests and "on hold" items which were on the previous screen are no longer visible
- The "New Applications" filter button is now highlighted
- step: click on the "Update Request" filter button
results:
- You can see 12application in your priority list
- You can see 2 applications in your priority list
- Your highest priority item (first in the list) is for an update request which was submitted last month
- Your lowest priority item (last in the list) is for an update request which was submitted this month
- The "Update Request" filter button is now highlighted
- step: click on the "On Hold" filter button
results:
- You can see 2 application in your priority list
- The "On Hold" filter button is now highlighted
- One of the "On Hold" items is for an application which is not assigned to you, but belongs to a group you are the managing editor for
- The other "On Hold" item is for an application which is assigned to you, in a group for which you are not the managing editor
- step: click the "Show all" filter button
results:
- You are back to the original display, containing both applications and update requests
25 changes: 21 additions & 4 deletions doajtest/testdrive/todo_maned_editor_associate.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setup(self) -> dict:

aapps = build_associate_applications(un)
eapps = build_editor_applications(un, eg2)
mapps = build_maned_applications(un, eg1, owner.id, eg3)
mapps = build_maned_applications(un, eg1, owner.id, eg3, eg2)


return {
Expand Down Expand Up @@ -96,7 +96,7 @@ def teardown(self, params) -> dict:
return {"status": "success"}


def build_maned_applications(un, eg, owner, eponymous_group):
def build_maned_applications(un, eg, owner, eponymous_group, other_group):
w = 7 * 24 * 60 * 60

apps = {}
Expand Down Expand Up @@ -142,6 +142,22 @@ def build_maned_applications(un, eg, owner, eponymous_group):
"title": un + " Maned Pending Application"
}]

app = build_application(un + " Maned (Group) On Hold Application", 2 * w, 2 * w, constants.APPLICATION_STATUS_ON_HOLD,
editor_group=eg.name, owner=owner)
app.save()
apps["on_hold"] = [{
"id": app.id,
"title": un + " Maned (Group) On Hold Application"
}]

app = build_application(un + " Maned (Editor) On Hold Application", 2 * w, 2 * w, constants.APPLICATION_STATUS_ON_HOLD,
editor_group=other_group.name, editor=un, owner=owner)
app.save()
apps["on_hold"].append({
"id": app.id,
"title": un + " Maned (Editor) On Hold Application"
})

app = build_application(un + " Maned Low Priority Pending Application", 1 * w, 1 * w,
constants.APPLICATION_STATUS_PENDING,
editor_group=eponymous_group.name, owner=owner)
Expand All @@ -154,11 +170,11 @@ def build_maned_applications(un, eg, owner, eponymous_group):

lmur = build_application(un + " Last Month Maned Update Request", 5 * w, 5 * w, constants.APPLICATION_STATUS_UPDATE_REQUEST,
editor_group=eponymous_group.name, owner=owner, update_request=True)
lmur.save()
# lmur.save()

tmur = build_application(un + " This Month Maned Update Request", 0, 0, constants.APPLICATION_STATUS_UPDATE_REQUEST,
editor_group=eponymous_group.name, owner=owner, update_request=True)
tmur.save()
# tmur.save()

apps["update_request"] = [
{
Expand All @@ -183,6 +199,7 @@ def build_application(title, lmu_diff, cd_diff, status, editor=None, editor_grou

if update_request:
ap.application_type = constants.APPLICATION_TYPE_UPDATE_REQUEST
ap.set_current_journal(ap.makeid())
else:
ap.remove_current_journal()
ap.remove_related_journal()
Expand Down
6 changes: 5 additions & 1 deletion doajtest/unit/test_bll_todo_top_todo_maned.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def test_top_todo(self, name, kwargs):
"todo_maned_ready",
"todo_maned_completed",
"todo_maned_assign_pending",
"todo_maned_new_update_request"
"todo_maned_new_update_request",
"todo_maned_on_hold"
]

category_args = {
Expand Down Expand Up @@ -100,6 +101,9 @@ def assign_pending(ap):
self.build_application("maned_update_request", 5 * w, 5 * w, constants.APPLICATION_STATUS_UPDATE_REQUEST, apps,
update_request=True)

# an application that was modifed recently into the ready status (todo_maned_completed)
self.build_application("maned_on_hold", 2 * w, 2 * w, constants.APPLICATION_STATUS_ON_HOLD, apps)

# Applications that should never be reported
############################################

Expand Down
Loading

0 comments on commit bc70bf2

Please sign in to comment.