invenio-app-rdm 13.0.0b2.dev9__py2.py3-none-any.whl → 13.0.0b2.dev10__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.
@@ -17,6 +17,6 @@
17
17
  #
18
18
  # See PEP 0440 for details - https://www.python.org/dev/peps/pep-0440
19
19
 
20
- __version__ = "13.0.0b2.dev9"
20
+ __version__ = "13.0.0b2.dev10"
21
21
 
22
22
  __all__ = ("__version__",)
@@ -1,7 +1,7 @@
1
1
  {# -*- coding: utf-8 -*-
2
2
 
3
3
  This file is part of Invenio.
4
- Copyright (C) 2016-2024 CERN.
4
+ Copyright (C) 2016-2025 CERN.
5
5
 
6
6
  Invenio is free software; you can redistribute it and/or modify it
7
7
  under the terms of the MIT License; see LICENSE file for more details.
@@ -64,6 +64,19 @@
64
64
  {{ _("Record") }}
65
65
  </a>
66
66
  {% endif %}
67
+
68
+ {% if checks %}
69
+ <a
70
+ role="tab"
71
+ class="item"
72
+ data-tab="checks"
73
+ aria-selected="false"
74
+ aria-controls="checks-tab-panel"
75
+ id="checks-tab"
76
+ >
77
+ {% include "invenio_checks/requests/title.html" %}
78
+ </a>
79
+ {% endif %}
67
80
  </div>
68
81
 
69
82
  <div
@@ -76,6 +89,20 @@
76
89
  {{ super() }}
77
90
  </div>
78
91
 
92
+ {% if checks %}
93
+ <div
94
+ class="ui bottom attached tab segment borderless"
95
+ data-tab="checks"
96
+ role="tabpanel"
97
+ aria-labelledby="checks-tab"
98
+ id="checks-tab-panel"
99
+ hidden="hidden"
100
+ >
101
+ {% include "invenio_checks/requests/details.html" %}
102
+ </div>
103
+ {% endif %}
104
+
105
+ {# The record tab content needs to be last since the HTML structure is complex and breaks following tab contents #}
79
106
  {% if record %}
80
107
  <div
81
108
  class="ui bottom attached tab segment borderless"
@@ -90,5 +117,6 @@
90
117
  {% include "invenio_app_rdm/records/detail.html" %}
91
118
  </div>
92
119
  {% endif %}
120
+
93
121
  </div>
94
122
  {% endblock request_timeline %}
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2019-2024 CERN.
3
+ # Copyright (C) 2019-2025 CERN.
4
4
  # Copyright (C) 2019-2022 Northwestern University.
5
5
  # Copyright (C) 2022 TU Wien.
6
6
  #
@@ -9,11 +9,11 @@
9
9
 
10
10
  """Request views module."""
11
11
 
12
- from flask import g, render_template
12
+ from flask import current_app, g, render_template
13
13
  from flask_login import current_user, login_required
14
14
  from invenio_communities.config import COMMUNITIES_ROLES
15
15
  from invenio_communities.members.services.request import CommunityInvitation
16
- from invenio_communities.proxies import current_identities_cache
16
+ from invenio_communities.proxies import current_communities, current_identities_cache
17
17
  from invenio_communities.subcommunities.services.request import (
18
18
  SubCommunityInvitationRequest,
19
19
  SubCommunityRequest,
@@ -31,6 +31,7 @@ from invenio_requests.customizations import AcceptAction
31
31
  from invenio_requests.resolvers.registry import ResolverRegistry
32
32
  from invenio_requests.views.decorators import pass_request
33
33
  from invenio_users_resources.proxies import current_user_resources
34
+ from sqlalchemy import case
34
35
  from sqlalchemy.orm.exc import NoResultFound
35
36
 
36
37
  from ...records_ui.utils import get_external_resources
@@ -162,6 +163,78 @@ def _resolve_record_or_draft_media_files(record, request):
162
163
  return None
163
164
 
164
165
 
166
+ def _resolve_checks(record, request, community=None):
167
+ """Resolve the checks for this draft/record related to the community and the request."""
168
+ # FIXME: Move this logic to invenio-checks
169
+
170
+ # Early exit if checks are not enabled.
171
+ enabled = current_app.config.get("CHECKS_ENABLED", False)
172
+
173
+ if not enabled:
174
+ return None
175
+
176
+ # Early exit if not draft submission nor record inclusion
177
+ request_type = request["type"]
178
+ is_draft_submission = request_type == CommunitySubmission.type_id
179
+ is_record_inclusion = request_type == CommunityInclusion.type_id
180
+
181
+ if not is_draft_submission and not is_record_inclusion:
182
+ return None
183
+
184
+ # Resolve the target community from the request if the community was not passed as an argument
185
+ if not community:
186
+ community_uuid = request["receiver"]["community"]
187
+ community = current_communities.service.read(
188
+ id_=community_uuid, identity=g.identity
189
+ )
190
+
191
+ # Collect the community UUID and the potential parent community UUID
192
+ communities = []
193
+ community_parent_id = community.to_dict().get("parent", {}).get("id")
194
+ if community_parent_id:
195
+ # Add the parent community first for later ordering of check configs
196
+ communities.append(community_parent_id)
197
+ communities.append(community.id)
198
+
199
+ # Resolve the record UUID
200
+ if is_record_inclusion:
201
+ record_uuid = current_rdm_records_service.record_cls.pid.resolve(
202
+ record["id"]
203
+ ).id
204
+ else:
205
+ record_uuid = current_rdm_records_service.draft_cls.pid.resolve(
206
+ record["id"], registered_only=False
207
+ ).id
208
+
209
+ # Early exit if no check config found for the communities
210
+ from invenio_checks.models import CheckConfig, CheckRun
211
+
212
+ check_configs = (
213
+ CheckConfig.query.filter(CheckConfig.community_id.in_(communities))
214
+ .order_by(
215
+ # Order by the communities (parent first if any) and then by check IDs for deterministic ordering
216
+ case((CheckConfig.community_id == communities[0], 0), else_=1),
217
+ CheckConfig.check_id,
218
+ )
219
+ .all()
220
+ )
221
+
222
+ if not check_configs:
223
+ return None
224
+
225
+ # Find check runs for the given check configs
226
+ check_config_ids = [check_config.id for check_config in check_configs]
227
+ checks = CheckRun.query.filter(
228
+ CheckRun.config_id.in_(check_config_ids),
229
+ CheckRun.record_id == record_uuid,
230
+ ).all()
231
+ # For a given record, there is one check run corresponding to one check config
232
+ # Order the check runs by the same order as the check configs for deterministic ordering
233
+ checks = sorted(checks, key=lambda check: check_config_ids.index(check.config_id))
234
+
235
+ return checks
236
+
237
+
165
238
  @login_required
166
239
  @pass_request(expand=True)
167
240
  def user_dashboard_request_view(request, **kwargs):
@@ -179,9 +252,10 @@ def user_dashboard_request_view(request, **kwargs):
179
252
 
180
253
  if has_record_topic:
181
254
  topic = _resolve_topic_record(request)
182
- record_ui = topic["record_ui"] # None when draft
183
- record = topic["record"] # None when draft
255
+ record_ui = topic["record_ui"]
256
+ record = topic["record"]
184
257
  is_draft = record_ui["is_draft"] if record_ui else False
258
+ checks = _resolve_checks(record, request)
185
259
 
186
260
  files = _resolve_record_or_draft_files(record_ui, request)
187
261
  media_files = _resolve_record_or_draft_media_files(record_ui, request)
@@ -191,6 +265,7 @@ def user_dashboard_request_view(request, **kwargs):
191
265
  user_avatar=avatar,
192
266
  invenio_request=request.to_dict(),
193
267
  record=record_ui,
268
+ checks=checks,
194
269
  permissions=topic["permissions"],
195
270
  is_preview=is_draft, # preview only when draft
196
271
  is_draft=is_draft,
@@ -256,9 +331,10 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs)
256
331
 
257
332
  if is_draft_submission or is_record_inclusion:
258
333
  topic = _resolve_topic_record(request)
259
- record_ui = topic["record_ui"] # None when draft
260
- record = topic["record"] # None when draft
334
+ record_ui = topic["record_ui"]
335
+ record = topic["record"]
261
336
  is_draft = record_ui["is_draft"] if record_ui else False
337
+ checks = _resolve_checks(record, request, community)
262
338
 
263
339
  permissions.update(topic["permissions"])
264
340
  files = _resolve_record_or_draft_files(record_ui, request)
@@ -270,6 +346,7 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs)
270
346
  invenio_request=request.to_dict(),
271
347
  record=record_ui,
272
348
  community=community_ui,
349
+ checks=checks,
273
350
  permissions=permissions,
274
351
  is_preview=is_draft, # preview only when draft
275
352
  is_draft=is_draft,
@@ -79,7 +79,7 @@
79
79
  --------------------*/
80
80
  @mobileBreakpoint : 320px;
81
81
  @tabletBreakpoint : 768px;
82
- @computerBreakpoint : 1300px;
82
+ @computerBreakpoint : 1280px;
83
83
  @largeMonitorBreakpoint : 1680px;
84
84
  @widescreenMonitorBreakpoint : 1920px;
85
85
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invenio-app-rdm
3
- Version: 13.0.0b2.dev9
3
+ Version: 13.0.0b2.dev10
4
4
  Summary: Invenio Research Data Management.
5
5
  Home-page: https://github.com/inveniosoftware/invenio-app-rdm
6
6
  Author: CERN
@@ -97,6 +97,11 @@ https://inveniordm.docs.cern.ch
97
97
  Changes
98
98
  =======
99
99
 
100
+ Version v13.0.0b2.dev10 (released 2025-03-26)
101
+
102
+ - checks: add checks tab to requests
103
+ - theme: fix responsive breakpoints for low resolution screens
104
+
100
105
  Version v13.0.0b2.dev9 (released 2025-03-21)
101
106
 
102
107
  - (Empty release to trigger fixed PyPI publish GitHub action)
@@ -1,4 +1,4 @@
1
- invenio_app_rdm/__init__.py,sha256=FIkB_rbitAH8BdzILQrpWRCfAei5BWbKyr-R83rApxM,699
1
+ invenio_app_rdm/__init__.py,sha256=3pnwudT7aV7d7sjgZCafdQsNDf6FE0SGZriGkEUGEU4,700
2
2
  invenio_app_rdm/cli.py,sha256=G6QqNU2W6n6ICtTMnpeKFXIsdorncDmVXwwwsGH5F2k,2746
3
3
  invenio_app_rdm/config.py,sha256=aQHeG7QxiKx01eDi1Xo7hsOfyAfe_yb8SNrq-CDOYag,50448
4
4
  invenio_app_rdm/ext.py,sha256=PkZhATGJDgYqBJQh41NdvBZWR83mgI3Eej6rj10UVJE,5278
@@ -91,14 +91,14 @@ invenio_app_rdm/requests_ui/__init__.py,sha256=wc2y0djrYmH9_vUq39P0IWW6R63FVXfKH
91
91
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-inclusion/index.html,sha256=wcJC7ZG4hznfVEEe_ydmsb1UNNTIWvUbLFhY35k-VQs,389
92
92
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-invitation/community_dashboard.html,sha256=3soWIke5l4eRAmZw2UeW6wu-AcT6ms4K_9U6DIYxMmw,1153
93
93
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-invitation/user_dashboard.html,sha256=ppUbbIROa_zED4WFTB6qqRbbJxewzjc6wKDzKhVglak,778
94
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-submission/index.html,sha256=pemNfdAayHfm4lGH3qWcrhI_ijuCstjKtReAWIG3eMk,2630
94
+ invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/community-submission/index.html,sha256=VuCP7BF71g0KDYkAqlFR0UTaYUYXhuWd1LxmBzW7xhw,3389
95
95
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/guest-access-request/index.html,sha256=Ywy6XPMdtWBxMN8guLfO59v8UzjdT2VolNYHAVM50l8,1958
96
96
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/macros/request_header.html,sha256=Iado6BmcFFswmvQ9IrdtgSyAzJr5AIT2BP2IDg-B-8U,2695
97
97
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity/index.html,sha256=eEYjTnVL-L30Dm_1LvSNKSx3QEHRoxMGHLupvu_1nMM,1453
98
98
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/subcommunity-invitation/index.html,sha256=347Saf8Fv78uevCbK2nFiOtNFUT0QyZSZS7lgoNzHdQ,1448
99
99
  invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/user-access-request/index.html,sha256=ltSP9sYPnpmCKMDYpZYU25Wxr3Dfqe2RNDxm6bVjX_I,1779
100
100
  invenio_app_rdm/requests_ui/views/__init__.py,sha256=7QiAyRq8Eu84IXwjzxK63vNeTZnowZ5P85xtw7XgRjs,397
101
- invenio_app_rdm/requests_ui/views/requests.py,sha256=gREAyePWlE-E3LIebTuSkzZ6VGlunS0nV4JE6QnQo8E,12812
101
+ invenio_app_rdm/requests_ui/views/requests.py,sha256=aL2I5imforii7OHQESMQcrYGxEFebCNKHQnrz4J9yH0,15683
102
102
  invenio_app_rdm/requests_ui/views/ui.py,sha256=DBysYQa__gOCg-pikO6HmoVLmRmMAVWeTBiYhPa7PmA,2359
103
103
  invenio_app_rdm/theme/__init__.py,sha256=QbkxNjjOmGKRlie96HfTXgnFeVQjOX0GdiZnHP7pIhs,277
104
104
  invenio_app_rdm/theme/views.py,sha256=UJs2_C28BWsXY1JqbRK4_ML1JRtGo1yM2S0_W37JJo4,4545
@@ -253,7 +253,7 @@ invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/elements/seg
253
253
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/reset.overrides,sha256=ms-coZLC-kFoWoZ4UNyJq0FRQ0bSLRziXzbyP7tnmNA,139
254
254
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/reset.variables,sha256=Luyh-V1w5wDFv2j77bYmTxfn22Cp7h1vLjRsqhf207Y,139
255
255
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.overrides,sha256=Okd5gBx3clt63UUmvSOb1PlHwDEB7-Th9DUJ4LNAXmw,9010
256
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.variables,sha256=j59x9AQ5p4omynVitye2tIM3h0GCXSqcajNYJElKxjI,3043
256
+ invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.variables,sha256=IQZqcNQ1AwmrpiPwkWZ6Zk67kyCMf8DJBqNgC1porDY,3043
257
257
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.overrides,sha256=l579RQL56DrLyWEG2Tahm-355u6ESWqOf-hZpJrcS8E,3339
258
258
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.variables,sha256=JFUnfiL_Xve48EwxRjYq0T-QJA8jboC606L08IjrBXg,322
259
259
  invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/checkbox.overrides,sha256=VV-V1ez1AT-2ULq8kh9akUZncGOx6ESGnEUqDlvRihY,137
@@ -524,7 +524,7 @@ invenio_app_rdm/users_ui/views/__init__.py,sha256=SMdY2NJj9GICfr3Xuok7qdNYVtA2bJ
524
524
  invenio_app_rdm/users_ui/views/dashboard.py,sha256=iUn2PrODAwb8ugmMosJKAjPhUzjCiWiAWoXQr9RUFuc,1793
525
525
  invenio_app_rdm/users_ui/views/ui.py,sha256=W_eXM8dLVIrNHQB2UEh37C9BYoHauft6RyvcDNFHovA,1742
526
526
  invenio_app_rdm/utils/files.py,sha256=CruDyO2gDVadSlWEJD-WHpWHeOQ0juh-Ei9jz3D9yjc,3923
527
- invenio_app_rdm-13.0.0b2.dev9.dist-info/licenses/LICENSE,sha256=AZXFHRrZa5s4m9DV7zZr4bPGTMUvcEPCodeV_AmFI8k,1204
527
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/licenses/LICENSE,sha256=AZXFHRrZa5s4m9DV7zZr4bPGTMUvcEPCodeV_AmFI8k,1204
528
528
  tests/__init__.py,sha256=yKVf0yYRuxmXvyAtLjmfpHGVCsEkZOhs_FojAAM_w-8,244
529
529
  tests/conftest.py,sha256=6iR-l-DIpQDxN2LLMu6kbHnLsmAW1m8Lq-j8rNNucf8,8956
530
530
  tests/test_tasks.py,sha256=6l25lcMjL3ZuQr4hsxbAEjSTu_J1aKkOB3ZXqOZZIy0,3712
@@ -557,8 +557,8 @@ tests/ui/test_filters.py,sha256=Q90wsJffjMVir7wNX8taGf2KZleLtPbXZXHLTkBpzLA,284
557
557
  tests/ui/test_signposting_ui.py,sha256=KCSjQlMD2VKlwQCyZYDwYjtVNL35x3u-ZC4ceD5y21w,3847
558
558
  tests/ui/test_static.py,sha256=vO3OQAOhrQESJifnQfM1pw7JYz3J874O8BAb7Cc_PPA,868
559
559
  tests/ui/test_stats_ui.py,sha256=LHa_0hjvpYvliSk_jknWy-90CO82jVElUfK5Ua_ZmfA,3554
560
- invenio_app_rdm-13.0.0b2.dev9.dist-info/METADATA,sha256=GZDaUUa4_5vy4byolI4EngICtQmVlItjLx6KUrgZzxY,11589
561
- invenio_app_rdm-13.0.0b2.dev9.dist-info/WHEEL,sha256=aoLN90hLOL0c0qxXMxWYUM3HA3WmFGZQqEJHX1V_OJE,109
562
- invenio_app_rdm-13.0.0b2.dev9.dist-info/entry_points.txt,sha256=r1vTqYNABeWqRMWitzyR9FnBsAy-KYZKZCp95IziyLY,2070
563
- invenio_app_rdm-13.0.0b2.dev9.dist-info/top_level.txt,sha256=NqTqrntInEAci7EXcNBvouXFMqwyjVQhEI0b7izYRBY,22
564
- invenio_app_rdm-13.0.0b2.dev9.dist-info/RECORD,,
560
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/METADATA,sha256=LaC3nBTqxcVDa0G8jg2ZsX9zt2lpVBlU82rv4zyQ2e8,11738
561
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
562
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/entry_points.txt,sha256=r1vTqYNABeWqRMWitzyR9FnBsAy-KYZKZCp95IziyLY,2070
563
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/top_level.txt,sha256=NqTqrntInEAci7EXcNBvouXFMqwyjVQhEI0b7izYRBY,22
564
+ invenio_app_rdm-13.0.0b2.dev10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.3)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any