diff --git a/sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0_src.json b/sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0_src.json index 0ce80e23..9c97382d 100644 --- a/sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0_src.json +++ b/sonar/modules/deposits/jsonschemas/deposits/deposit-v1.0.0_src.json @@ -1113,11 +1113,12 @@ "type": "string", "default": "cre", "enum": [ - "dgs", - "prt", "cre", + "ctb", "edt", - "ctb" + "dgc", + "dgs", + "prt" ], "form": { "templateOptions": { @@ -1138,6 +1139,10 @@ "label": "contribution_role_edt", "value": "edt" }, + { + "label": "contribution_role_dgc", + "value": "dgc" + }, { "label": "contribution_role_dgs", "value": "dgs" diff --git a/sonar/modules/documents/jsonschemas/documents/document-v1.0.0_src.json b/sonar/modules/documents/jsonschemas/documents/document-v1.0.0_src.json index fde12631..c1d23cbd 100644 --- a/sonar/modules/documents/jsonschemas/documents/document-v1.0.0_src.json +++ b/sonar/modules/documents/jsonschemas/documents/document-v1.0.0_src.json @@ -1354,6 +1354,7 @@ "allowAdd": true } } + } }, "propertiesOrder": [ @@ -1978,34 +1979,39 @@ "title": "Role", "type": "string", "enum": [ - "dgs", - "prt", "cre", + "ctb", "edt", - "ctb" + "dgc", + "dgs", + "prt" ], "default": "cre", "form": { "options": [ - { - "label": "contribution_role_dgs", - "value": "dgs" - }, - { - "label": "contribution_role_prt", - "value": "prt" - }, { "label": "contribution_role_cre", "value": "cre" }, + { + "label": "contribution_role_ctb", + "value": "ctb" + }, { "label": "contribution_role_edt", "value": "edt" }, { - "label": "contribution_role_ctb", - "value": "ctb" + "label": "contribution_role_dgc", + "value": "dgc" + }, + { + "label": "contribution_role_dgs", + "value": "dgs" + }, + { + "label": "contribution_role_prt", + "value": "prt" } ] } diff --git a/sonar/modules/documents/views.py b/sonar/modules/documents/views.py index a6b6e5bb..66cd5690 100644 --- a/sonar/modules/documents/views.py +++ b/sonar/modules/documents/views.py @@ -194,7 +194,7 @@ def contributors(record): if not record.get('contribution'): return [] - priorities = ['cre', 'ctb', 'dgs', 'edt', 'prt'] + priorities = ['cre', 'ctb', 'dgs', 'dgc', 'edt', 'prt'] return sorted(record['contribution'], key=lambda i: priorities.index(i['role'][0])) diff --git a/tests/ui/documents/test_documents_views.py b/tests/ui/documents/test_documents_views.py index 40f1c47e..be5d194b 100644 --- a/tests/ui/documents/test_documents_views.py +++ b/tests/ui/documents/test_documents_views.py @@ -236,6 +236,8 @@ def test_contributors(): """Test ordering contributors.""" contributors = [{ 'role': ['dgs'] + }, { + 'role': ['dgc'] }, { 'role': ['ctb'] }, { @@ -246,7 +248,7 @@ def test_contributors(): 'role': ['cre'] }] - priorities = ['cre', 'ctb', 'dgs', 'edt', 'prt'] + priorities = ['cre', 'ctb', 'dgs', 'dgc', 'edt', 'prt'] for index, contributor in enumerate( views.contributors({'contribution': contributors})):