invenio-app-rdm 13.0.0b3.dev15__py2.py3-none-any.whl → 13.0.0b3.dev17__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invenio_app_rdm/__init__.py +1 -1
- invenio_app_rdm/administration/audit_logs/audit_logs.py +22 -18
- invenio_app_rdm/communities_ui/sitemap.py +63 -0
- invenio_app_rdm/communities_ui/views/communities.py +9 -8
- invenio_app_rdm/communities_ui/views/ui.py +1 -1
- invenio_app_rdm/config.py +14 -0
- invenio_app_rdm/records_ui/sitemap.py +44 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/AuditLogActions.js +136 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewJson.js +35 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewRecentChanges.js +119 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/index.js +2 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/search/SearchResultItemLayout.js +34 -18
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/RevisionsDiffViewer.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/api.js +5 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/routes.js +7 -1
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package.json +2 -1
- invenio_app_rdm/theme/{static → templates/semantic-ui/invenio_app_rdm}/robots.txt +4 -0
- invenio_app_rdm/theme/views.py +6 -2
- invenio_app_rdm/theme/webpack.py +1 -0
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/METADATA +13 -2
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/RECORD +29 -24
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/WHEEL +1 -1
- tests/conftest.py +126 -8
- tests/ui/conftest.py +6 -8
- tests/ui/test_robotstxt.py +35 -0
- tests/ui/test_sitemaps.py +85 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewAction.js +0 -0
- tests/ui/test_static.py +0 -25
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/entry_points.txt +0 -0
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/licenses/LICENSE +0 -0
- {invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2025 Northwestern University.
|
|
4
|
+
#
|
|
5
|
+
# Invenio-App-RDM is free software; you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
+
|
|
8
|
+
"""Test sitemaps."""
|
|
9
|
+
|
|
10
|
+
import datetime
|
|
11
|
+
|
|
12
|
+
import time_machine
|
|
13
|
+
from invenio_communities.proxies import current_communities
|
|
14
|
+
|
|
15
|
+
from invenio_app_rdm.communities_ui.sitemap import SitemapSectionOfCommunities
|
|
16
|
+
from invenio_app_rdm.records_ui.sitemap import SitemapSectionOfRDMRecords
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_sitemap_section_of_communities(running_app, community_input, create_community):
|
|
20
|
+
# by default converted to UTC w/ time 00:00:00
|
|
21
|
+
with time_machine.travel(datetime.date(2025, 3, 27)):
|
|
22
|
+
community_input["slug"] = "my-test-community-1"
|
|
23
|
+
c1 = create_community(data=community_input)
|
|
24
|
+
community_input["slug"] = "my-test-community-2"
|
|
25
|
+
community_input["access"]["visibility"] = "restricted"
|
|
26
|
+
c2 = create_community(data=community_input)
|
|
27
|
+
with time_machine.travel(datetime.date(2025, 3, 28)):
|
|
28
|
+
community_input["slug"] = "my-test-community-3"
|
|
29
|
+
community_input["access"]["visibility"] = "public"
|
|
30
|
+
community_input["metadata"]["page"] = "A page to be indexed."
|
|
31
|
+
c3 = create_community(data=community_input)
|
|
32
|
+
|
|
33
|
+
current_communities.service.indexer.refresh() # index in search engine
|
|
34
|
+
section = SitemapSectionOfCommunities()
|
|
35
|
+
|
|
36
|
+
entries = [section.to_dict(entity) for entity in section.iter_entities()]
|
|
37
|
+
|
|
38
|
+
expected_entries = [
|
|
39
|
+
{
|
|
40
|
+
"loc": "https://127.0.0.1:5000/communities/my-test-community-3/records",
|
|
41
|
+
"lastmod": "2025-03-28T00:00:00Z",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"loc": "https://127.0.0.1:5000/communities/my-test-community-3/about",
|
|
45
|
+
"lastmod": "2025-03-28T00:00:00Z",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"loc": "https://127.0.0.1:5000/communities/my-test-community-1/records",
|
|
49
|
+
"lastmod": "2025-03-27T00:00:00Z",
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
assert expected_entries == entries
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def test_sitemap_section_of_records(
|
|
56
|
+
running_app, minimal_record, create_record, records_service
|
|
57
|
+
):
|
|
58
|
+
# by default converted to UTC w/ time 00:00:00
|
|
59
|
+
with time_machine.travel(datetime.date(2025, 3, 27)):
|
|
60
|
+
minimal_record["title"] = "my-test-record-1"
|
|
61
|
+
r1 = create_record(data=minimal_record)
|
|
62
|
+
minimal_record["title"] = "my-test-record-2"
|
|
63
|
+
minimal_record["access"]["record"] = "restricted"
|
|
64
|
+
r2 = create_record(data=minimal_record)
|
|
65
|
+
with time_machine.travel(datetime.date(2025, 3, 28)):
|
|
66
|
+
minimal_record["title"] = "my-test-record-3"
|
|
67
|
+
minimal_record["access"]["record"] = "public"
|
|
68
|
+
r3 = create_record(data=minimal_record)
|
|
69
|
+
|
|
70
|
+
records_service.indexer.refresh()
|
|
71
|
+
section = SitemapSectionOfRDMRecords()
|
|
72
|
+
|
|
73
|
+
entries = [section.to_dict(entity) for entity in section.iter_entities()]
|
|
74
|
+
|
|
75
|
+
expected_entries = [
|
|
76
|
+
{
|
|
77
|
+
"loc": f"https://127.0.0.1:5000/records/{r3.id}",
|
|
78
|
+
"lastmod": "2025-03-28T00:00:00Z",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"loc": f"https://127.0.0.1:5000/records/{r1.id}",
|
|
82
|
+
"lastmod": "2025-03-27T00:00:00Z",
|
|
83
|
+
},
|
|
84
|
+
]
|
|
85
|
+
assert expected_entries == entries
|
invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewAction.js
DELETED
|
File without changes
|
tests/ui/test_static.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio-RDM is free software; you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def test_static(app, client, es_clear):
|
|
10
|
-
"""Check if robots.txt returns a string response."""
|
|
11
|
-
|
|
12
|
-
# Save the current static folder to revert after finishing the test.
|
|
13
|
-
app_static_folder = app.static_folder
|
|
14
|
-
# Use as static folder the one of the blueprint we are testing.
|
|
15
|
-
app.static_folder = app.blueprints["invenio_app_rdm"].static_folder
|
|
16
|
-
|
|
17
|
-
response = client.get("/robots.txt")
|
|
18
|
-
|
|
19
|
-
assert response.status_code == 200
|
|
20
|
-
assert type(response.text) == str
|
|
21
|
-
assert "Disallow: /search" in response.text
|
|
22
|
-
assert "Disallow: /api" in response.text
|
|
23
|
-
assert "Disallow: /administration" in response.text
|
|
24
|
-
|
|
25
|
-
app.static_folder = app_static_folder
|
|
File without changes
|
|
File without changes
|
{invenio_app_rdm-13.0.0b3.dev15.dist-info → invenio_app_rdm-13.0.0b3.dev17.dist-info}/top_level.txt
RENAMED
|
File without changes
|