Page MenuHomeSoftware Heritage

Add-forge-now request dashboard
ClosedPublic

Authored by jayeshv on Mar 17 2022, 7:07 PM.

Details

Summary

Add-forge-now request dashboard

To be used by moderators to update the status of an add forge request
Shows the current status and history of the request
Possibility to add a comment without changing the status
Shows details about a request and its history
Cypress tests

Related to T3992
Related to T4003
Related to T4001

Diff Detail

Repository
rDWAPPS Web applications
Branch
sprint-add-forge-now
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27540
Build 43100: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 43099: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7374 (id=26657)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  55 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 124 ++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  86 ++++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  44 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 137 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 44 files changed, 3236 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit 443afffdcfacb077ee0e458851a2fd933e2e20f4
Merge: 7bfbda85 14ba8792
Author: Jenkins user <jenkins@localhost>
Date:   Thu Mar 17 18:08:01 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 14ba8792d4b3ce7b399a5ec50071cad4687d73c0
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 19:04:09 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1491/ for more details.

ardumont added inline comments.
assets/src/bundles/add_forge/request-dashboard.js
58–66

suggestion!

100

by the way, for those 'terminal' statuses, we may want to hide the 'select' status
change or something (since they will end up empty at that point).

This is not necessary for this diff, that's ui minor detail. Let's focus on landing this
first, then we'll be able to properly think over the paper cuts and improve those over
time.

101

we'll need to fetch that from the server somehow to avoid the duplication btw (at some point, not necessarily for this diff).

swh/web/admin/add_forge_now.py
43

add a heading entry in the returned dict so it's populated in the template (proposed something, feel free to improve that 'title').

swh/web/templates/add_forge_now/request-dashboard.html
17

that and my previous comment, to lift the heading use as other template do?

Fixes for history; admin email

Updating D7374: WIP - Not for review

Add-forge-now request dashboard

assets/src/bundles/add_forge/request-dashboard.js
100

@ardumont This is fixed in a slightly different way. In terminal status only the comment option is available now.

Build is green

Patch application report for D7374 (id=26660)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  55 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 163 +++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  86 ++++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  44 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 44 files changed, 3273 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit fdae0e8559193eeb7ce2a3a0ace7cb98c6b27da3
Merge: 7bfbda85 061ab15a
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 08:13:22 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 061ab15aa658122e952bd993bcdb86d5dbb527f3
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 09:09:36 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1492/ for more details.

jayeshv marked 2 inline comments as done.

Review comments; setting heading from server

Updating D7374: WIP - Not for review

Add-forge-now request dashboard

Build is green

Patch application report for D7374 (id=26661)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  55 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 163 +++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  86 ++++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 44 files changed, 3275 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit 9faf73bfca327f3063bf696038dacdab18000240
Merge: 7bfbda85 e81ea056
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 08:32:53 2022 +0000

    Merge branch 'diff-target' into HEAD

commit e81ea056cdfc12d7a73987e628c83c19ff4b0e4c
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 09:31:04 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1493/ for more details.

Added link to request dashboard in moderation view

Updating D7374: WIP - Not for review

Add-forge-now request dashboard

Build is green

Patch application report for D7374 (id=26662)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  58 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 163 +++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  86 ++++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 44 files changed, 3278 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit 1ae536ebbca19c7e3bacb07a5e3a252dae1b7ebb
Merge: 7bfbda85 6c81091e
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 08:57:25 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 6c81091ec7d36a885d61804a16b2b3e486560fdf
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 09:55:27 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1494/ for more details.

Minor changes, var name changes

Updating D7374: WIP - Not for review

Add-forge-now request dashboard

jayeshv retitled this revision from WIP - Not for review Add-forge-now request dashboard to Add-forge-now request dashboard.Mar 18 2022, 11:11 AM
jayeshv edited the summary of this revision. (Show Details)

Build is green

Patch application report for D7374 (id=26668)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  58 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 162 +++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  68 +++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 44 files changed, 3259 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit 3eee1ebdb9b81bc1e0495dd6ce117699cdfef2d8
Merge: 7bfbda85 a9f20e75
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 10:10:30 2022 +0000

    Merge branch 'diff-target' into HEAD

commit a9f20e755f2bac0be21ad856b164f4e5ffa82db9
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 11:06:50 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of an add forge request
    Shows the current status and history of the request
    Possibility to add a comment without changing the status
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1495/ for more details.

anlambert added a subscriber: anlambert.
anlambert added inline comments.
assets/src/bundles/add_forge/request-dashboard.js
10–23

Please use an ejs template instead, you can find example of use here

82–96

Use an ejs template for this too.

swh/web/admin/add_forge_now.py
33

Please update the regexp to only accept numbers.

This revision now requires changes to proceed.Mar 18 2022, 11:40 AM
vlorentz added inline comments.
assets/src/bundles/add_forge/request-dashboard.js
18

I know this is going to be bikeshedded away, but FYI the correct expression is "Would you be so kind as to reply"; and is usually considered overly formal / sarcastic.

assets/src/bundles/add_forge/request-dashboard.js
18

@vlorentz I agree and think our help text also needs some improvement.
I took this from https://hedgedoc.softwareheritage.org/9z-HMpwsQnKx3jK41nnHKw?both#Help-text-on-tab

assets/src/bundles/add_forge/request-dashboard.js
10–23

@anlambert It is a static text as of now, Should we use a template for that?
i'm changing the one below (request History) to template.

assets/src/bundles/add_forge/request-dashboard.js
10–23

Yes we should as the forge URL needs to be inserted and later on we will have to add the submitter username if he allowed us too.

It also enables to not have that gigantic string in js file and to properly wrap the text in a dedicated template file.

jayeshv edited the summary of this revision. (Show Details)

Addressing review comments

Build is green

Patch application report for D7374 (id=26680)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 .../bundles/add_forge/add-request-history-item.ejs |  30 ++
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/forge-admin-email.ejs |  20 +
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  58 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 135 ++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  68 +++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 46 files changed, 3282 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/add-request-history-item.ejs
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/forge-admin-email.ejs
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit a2f5c3b5b74e9a09a1fa273e24f5cdf1b85b677b
Merge: 7bfbda85 429a9d3c
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 11:47:21 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 429a9d3c9b1e20baa256fa2a87758f9001b27be3
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 12:45:38 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of an add forge request
    Shows the current status and history of the request
    Possibility to add a comment without changing the status
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1497/ for more details.

assets/src/bundles/add_forge/forge-admin-email.ejs
11 ↗(On Diff #26680)

Please replace [URL] by <%= forgeUrl %> and pass the forgeUrl value as parameter of the template rendering function.

Also you should wrap the text to shorter lines (up to 80 columns).

anlambert added inline comments.
assets/src/bundles/add_forge/request-dashboard.js
20–34

This code is not covered by tests.

127–134

This should also be covered by cypress tests.

You could use that cypress trick and check the new URL starts with mailto: <email>

swh/web/admin/add_forge_now.py
26

We should add simple tests checking HTTP status code for this view (200 for moderator user, 403 for other ones).

41

same here

This revision now requires changes to proceed.Mar 18 2022, 2:01 PM

Review comments, changed email template

Build is green

Patch application report for D7374 (id=26692)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 .../bundles/add_forge/add-request-history-item.ejs |  30 ++
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/forge-admin-email.ejs |  28 ++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  58 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 135 ++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  68 +++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   3 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   6 +-
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  18 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   1 +
 46 files changed, 3290 insertions(+), 18 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/add-request-history-item.ejs
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/forge-admin-email.ejs
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
Changes applied before test
commit 674b872477b4864ddf2af8e5e8e9002cfd8a4433
Merge: 7bfbda85 8b81764e
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 13:22:03 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 8b81764e07a7ccaf6df26c5663634e5456ef1ebe
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 14:20:44 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1498/ for more details.

This revision is now accepted and ready to land.Mar 18 2022, 2:37 PM

Rebase on top of latest commit

This revision was landed with ongoing or failed builds.Mar 18 2022, 3:21 PM
This revision was automatically updated to reflect the committed changes.

Build is green

Patch application report for D7374 (id=26696)

Could not rebase; Attempt merge onto 7bfbda85ff...

Merge made by the 'recursive' strategy.
 .../bundles/add_forge/add-request-history-item.ejs |  30 ++
 assets/src/bundles/add_forge/create-request.js     |  92 ++++
 assets/src/bundles/add_forge/forge-admin-email.ejs |  28 ++
 assets/src/bundles/add_forge/index.js              |  12 +
 .../src/bundles/add_forge/moderation-dashboard.js  |  58 +++
 assets/src/bundles/add_forge/request-dashboard.js  | 135 ++++++
 cypress/fixtures/add-forge-now-request.json        |  23 +
 cypress/fixtures/add-forge-now-requests.json       |  79 ++++
 .../add-forge-now-request-create.spec.js           | 139 ++++++
 .../add-forge-now-request-dashboard.spec.js        |  68 +++
 .../add-forge-now-requests-moderation.spec.js      | 122 ++++++
 cypress/integration/deposit-admin.spec.js          |  52 ++-
 cypress/support/index.js                           |   8 +
 swh/web/add_forge_now/__init__.py                  |   0
 swh/web/add_forge_now/apps.py                      |  10 +
 swh/web/add_forge_now/migrations/0001_initial.py   | 109 +++++
 swh/web/add_forge_now/migrations/__init__.py       |   0
 swh/web/add_forge_now/models.py                    |  99 +++++
 swh/web/add_forge_now/tests/test_migration.py      |  62 +++
 swh/web/add_forge_now/views.py                     | 107 +++++
 swh/web/admin/add_forge_now.py                     |  46 ++
 swh/web/admin/urls.py                              |   6 +-
 swh/web/api/urls.py                                |   1 +
 swh/web/api/views/add_forge_now.py                 | 355 +++++++++++++++
 swh/web/auth/utils.py                              |   1 +
 swh/web/common/utils.py                            |   7 +-
 swh/web/config.py                                  |   9 +
 swh/web/inbound_email/__init__.py                  |   0
 swh/web/inbound_email/apps.py                      |  11 +
 .../management/commands/process_inbound_email.py   |  73 ++++
 swh/web/inbound_email/signals.py                   |  36 ++
 swh/web/inbound_email/utils.py                     |  63 +++
 swh/web/settings/common.py                         |   2 +
 swh/web/settings/tests.py                          |   1 +
 .../templates/add_forge_now/create-request.html    | 234 ++++++++++
 .../templates/add_forge_now/request-dashboard.html | 135 ++++++
 .../add_forge_now/requests-moderation.html         |  45 ++
 swh/web/templates/layout.html                      |  22 +-
 swh/web/tests/add_forge_now/test_models.py         |  26 ++
 swh/web/tests/add_forge_now/test_views.py          | 203 +++++++++
 swh/web/tests/api/views/test_add_forge_now.py      | 483 +++++++++++++++++++++
 swh/web/tests/conftest.py                          |  12 +-
 swh/web/tests/create_test_admin.py                 |  10 +-
 swh/web/tests/create_test_users.py                 |  23 +-
 .../tests/inbound_email/test_management_command.py | 161 +++++++
 swh/web/tests/inbound_email/test_utils.py          | 113 +++++
 swh/web/tests/test_config.py                       |  23 +
 swh/web/tests/utils.py                             |  14 +-
 swh/web/urls.py                                    |   7 +-
 49 files changed, 3335 insertions(+), 20 deletions(-)
 create mode 100644 assets/src/bundles/add_forge/add-request-history-item.ejs
 create mode 100644 assets/src/bundles/add_forge/create-request.js
 create mode 100644 assets/src/bundles/add_forge/forge-admin-email.ejs
 create mode 100644 assets/src/bundles/add_forge/index.js
 create mode 100644 assets/src/bundles/add_forge/moderation-dashboard.js
 create mode 100644 assets/src/bundles/add_forge/request-dashboard.js
 create mode 100644 cypress/fixtures/add-forge-now-request.json
 create mode 100644 cypress/fixtures/add-forge-now-requests.json
 create mode 100644 cypress/integration/add-forge-now-request-create.spec.js
 create mode 100644 cypress/integration/add-forge-now-request-dashboard.spec.js
 create mode 100644 cypress/integration/add-forge-now-requests-moderation.spec.js
 create mode 100644 swh/web/add_forge_now/__init__.py
 create mode 100644 swh/web/add_forge_now/apps.py
 create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py
 create mode 100644 swh/web/add_forge_now/migrations/__init__.py
 create mode 100644 swh/web/add_forge_now/models.py
 create mode 100644 swh/web/add_forge_now/tests/test_migration.py
 create mode 100644 swh/web/add_forge_now/views.py
 create mode 100644 swh/web/admin/add_forge_now.py
 create mode 100644 swh/web/api/views/add_forge_now.py
 create mode 100644 swh/web/inbound_email/__init__.py
 create mode 100644 swh/web/inbound_email/apps.py
 create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py
 create mode 100644 swh/web/inbound_email/signals.py
 create mode 100644 swh/web/inbound_email/utils.py
 create mode 100644 swh/web/templates/add_forge_now/create-request.html
 create mode 100644 swh/web/templates/add_forge_now/request-dashboard.html
 create mode 100644 swh/web/templates/add_forge_now/requests-moderation.html
 create mode 100644 swh/web/tests/add_forge_now/test_models.py
 create mode 100644 swh/web/tests/add_forge_now/test_views.py
 create mode 100644 swh/web/tests/api/views/test_add_forge_now.py
 create mode 100644 swh/web/tests/inbound_email/test_management_command.py
 create mode 100644 swh/web/tests/inbound_email/test_utils.py
 create mode 100644 swh/web/tests/test_config.py
Changes applied before test
commit a5e05715943ffa066b4f479fb3119b416304b7cd
Merge: 7bfbda85 0a796988
Author: Jenkins user <jenkins@localhost>
Date:   Fri Mar 18 14:21:26 2022 +0000

    Merge branch 'diff-target' into HEAD

commit 0a796988974ed60d674262adb30ed322bbc27a8c
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Mar 18 14:20:44 2022 +0100

    Add-forge-now request dashboard
    
    To be used by moderators to update the status of a request
    Shows details about a request and its history
    Cypress tests
    
    Related to T3992
    Related to T4003
    Related to T4001

commit b30a120340bce5fe9f8ef9f1fabdf73f2d4e9917
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 17:41:44 2022 +0100

    Add feature flag to toggle on/off add-forge-now feature
    
    This also prevents the server code from being served when the feature flag is off.
    
    Related to T4040

commit 7e61894e90438f53c625961350d92cd01dc62138
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:14:51 2022 +0100

    Add moderation view to list add-forge-now requests
    
    In a future commit, it will be possible to browse from that view to the detailed request
    dashboard.
    
    This also reworks the left menu to allow access to staff or people with the add forge
    now moderator permission.
    
    Related to T3991

commit 4e23aa2eb8fca1f5c62a745f44f2f4b3b46003a9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 17 10:13:22 2022 +0100

    Fix access for people with permission access to deposit moderation
    
    This will allow easier adaptations when adding new views with different permissions.

commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Thu Mar 17 11:33:57 2022 +0100

    Create "Add forge now" request
    
    Added a form to submit an "add forge now" request.
    Left menus changed to include "add forge now" page.
    Possbility to browse existing requests is added
    in a seperate tab in the same view.
    Cypress tests
    
    Related to T3998
    Related to T3989
    Related to T4012
    Related to T3988

commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27
Merge: c24e6822 9f2e1cb9
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 16:21:35 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit c24e6822a1569817b6d970fbc550cdf66f2188f0
Merge: ca39b06c 627ba79a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 16 14:20:52 2022 +0100

    Merge branch 'master' into sprint-add-forge-now

commit ca39b06c46ba42f73f898377d3093299ea21a85a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 16:37:54 2022 +0100

    inbound_email: add utilities to extract and filter email recipients

commit bf099ce9654d0b765f0820189857ab7c7beb6c6b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 9 14:29:37 2022 +0100

    Bootstrap a common app for management of inbound emails

commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 15 15:06:10 2022 +0100

    add_forge_now: Move datatables listing in dedicated endpoint
    
    Merging datatables special processing in /api/1/add-forge/request/list
    endpoint implementation was quite disturbing.
    
    So better using a dedicated endpoint for that in a similar manner as
    with save code now requests listing.
    
    The endpoint to use with datatables is now the following one:
    /add-forge/request/list/datatables.
    
    Related to T3989
    Related to T3991

commit f6343395310bc226a50a283c88304006e8ece337
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Mar 14 15:35:17 2022 +0100

    api/add_forge_now: Allow to use requests list endpoint with datatables
    
    datatables is the javascript library we use on the frontend side to
    display interactive tables.
    
    As we use server-side processing, table data must be provided in a
    paginated way by an HTTP endpoint.
    
    Response format expected by datatables is different from the one
    returned by the Web API endpoint listing add-forge requests.
    
    So adapt the response format of that endpoint when we know the
    input request has been sent by datatables.
    
    Related to T3989
    Related to T3991

commit 26748e56ecce5877fce3a215eba06a19ebb8342f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 10 14:09:36 2022 +0100

    api: Add endpoint to get details about an add-forge request
    
    Related to T4030

commit 294a95c711bc40622c6d718afa2535f377b90dfc
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:30:06 2022 +0100

    api: Add endpoint to list add-forge requests
    
    Related to T4027

commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Mar 9 16:28:03 2022 +0100

    api: Add endpoint to update an add-forge request
    
    Related to T4026

commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Mar 8 15:23:50 2022 +0100

    api: Add endpoint to create an add-forge request
    
    Related to T3990

commit 03101208803501e5178f35d18d171e740ee4ca76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 8 11:34:44 2022 +0100

    add_forge_now: Bootstrap app and model

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1501/ for more details.