invenio-app-rdm 13.0.0b4.dev1__py2.py3-none-any.whl → 14.0.0b1.dev8__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.
Files changed (247) hide show
  1. invenio_app_rdm/__init__.py +1 -1
  2. invenio_app_rdm/administration/moderation/__init__.py +11 -0
  3. invenio_app_rdm/administration/moderation/requests.py +175 -0
  4. invenio_app_rdm/administration/records/records.py +9 -7
  5. invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests.html +14 -0
  6. invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests_details.html +91 -0
  7. invenio_app_rdm/administration/user_moderation/user_moderation.py +4 -4
  8. invenio_app_rdm/administration/users/users.py +0 -5
  9. invenio_app_rdm/communities_ui/views/communities.py +9 -5
  10. invenio_app_rdm/config.py +73 -4
  11. invenio_app_rdm/ext.py +2 -2
  12. invenio_app_rdm/fixtures/pages.py +5 -2
  13. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/deposit.html +11 -0
  14. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +2 -5
  15. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html +2 -2
  16. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/details.html +2 -2
  17. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/communities.html +8 -7
  18. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/external_resources.html +5 -6
  19. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/licenses.html +9 -13
  20. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/manage_menu.html +8 -5
  21. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/stats.html +2 -4
  22. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/detail.html +1 -1
  23. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/doi.html +7 -5
  24. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/files.html +21 -4
  25. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/tombstone.html +6 -1
  26. invenio_app_rdm/records_ui/utils.py +93 -1
  27. invenio_app_rdm/records_ui/views/decorators.py +24 -14
  28. invenio_app_rdm/records_ui/views/deposits.py +100 -27
  29. invenio_app_rdm/records_ui/views/filters.py +11 -4
  30. invenio_app_rdm/records_ui/views/records.py +23 -13
  31. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/file-modification/index.html +88 -0
  32. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/guest-access-request/index.html +5 -5
  33. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/record-deletion/index.html +95 -0
  34. invenio_app_rdm/requests_ui/views/requests.py +54 -87
  35. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewRecentChanges.js +8 -8
  36. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/ImpersonateUserForm.js +12 -17
  37. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/RevisionsDiffViewer.js +14 -16
  38. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/SetQuotaAction.js +1 -1
  39. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/routes.js +1 -2
  40. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchResultItem.js +81 -0
  41. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchbarLayout.js +48 -0
  42. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/index.js +22 -0
  43. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/communityRecordsSearch/CommunityRecordsSearchAppLayout.js +3 -4
  44. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/CopyButton.js +38 -19
  45. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js +45 -0
  46. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionModal.js +354 -0
  47. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionRadioGroup.js +44 -0
  48. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion.js +81 -0
  49. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +55 -5
  50. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js +4 -1
  51. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js +2 -2
  52. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ExportDropdown.js +7 -2
  53. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js +52 -19
  54. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCitationField.js +15 -14
  55. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitiesListModal/RecordCommunitiesListModal.js +4 -4
  56. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitySubmission/RecordCommunitySubmissionModal.js +1 -1
  57. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js +17 -3
  58. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js +16 -17
  59. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RemoveFromCommunity/RemoveFromCommunityAction.js +5 -5
  60. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/index.js +42 -40
  61. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/theme.js +9 -5
  62. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineEdit.js +5 -5
  63. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineRead.js +2 -2
  64. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/search/components.js +14 -19
  65. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/theme.js +9 -0
  66. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/file_uploader/uppy.less +37 -0
  67. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/landing_page/licenses.less +5 -3
  68. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.overrides +6 -1
  69. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.overrides +10 -1
  70. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.overrides +7 -0
  71. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.variables +0 -0
  72. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next.js +1 -1
  73. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/_generatedTranslations.js +66 -0
  74. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/messages.po +804 -137
  75. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/translations.json +277 -249
  76. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/messages.po +689 -70
  77. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/translations.json +102 -82
  78. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/messages.po +699 -80
  79. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/translations.json +112 -92
  80. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/messages.po +821 -138
  81. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/translations.json +290 -262
  82. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/messages.po +691 -66
  83. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/translations.json +91 -71
  84. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/messages.po +818 -138
  85. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/translations.json +260 -240
  86. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/messages.po +698 -78
  87. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/translations.json +108 -88
  88. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/messages.po +1000 -5
  89. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/translations.json +81 -28
  90. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/messages.po +810 -137
  91. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/translations.json +253 -233
  92. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/messages.po +746 -133
  93. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/translations.json +130 -110
  94. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/messages.po +688 -69
  95. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/translations.json +103 -79
  96. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/messages.po +809 -126
  97. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/translations.json +277 -257
  98. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/messages.po +695 -70
  99. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/translations.json +101 -79
  100. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/messages.po +801 -135
  101. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/translations.json +254 -234
  102. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/index.js +16 -65
  103. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/messages.po +712 -86
  104. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/translations.json +116 -96
  105. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/messages.po +683 -70
  106. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/translations.json +96 -78
  107. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/messages.po +689 -70
  108. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/translations.json +109 -85
  109. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/messages.po +889 -0
  110. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/translations.json +277 -0
  111. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/messages.po +702 -71
  112. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/translations.json +113 -85
  113. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/messages.po +689 -70
  114. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/translations.json +102 -82
  115. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/messages.po +704 -70
  116. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/translations.json +119 -91
  117. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/messages.po +694 -69
  118. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/translations.json +93 -73
  119. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/messages.po +717 -85
  120. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/translations.json +155 -133
  121. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/messages.po +806 -124
  122. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/translations.json +288 -260
  123. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/messages.po +713 -82
  124. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/translations.json +119 -91
  125. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/messages.po +807 -141
  126. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/translations.json +260 -240
  127. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/messages.po +799 -128
  128. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/translations.json +259 -239
  129. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/messages.po +756 -131
  130. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/translations.json +124 -96
  131. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/messages.po +736 -123
  132. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/translations.json +130 -108
  133. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/messages.po +683 -70
  134. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/translations.json +100 -78
  135. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package.json +3 -37
  136. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/translations.pot +243 -94
  137. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.de.html +2 -2
  138. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.en.html +4 -4
  139. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.sv.html +4 -4
  140. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/intro_section.html +7 -6
  141. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/macros/records_list.html +2 -1
  142. invenio_app_rdm/theme/templates/semantic-ui/invenio_communities/default_static_page.html +26 -0
  143. invenio_app_rdm/theme/webpack.py +3 -2
  144. invenio_app_rdm/translations/ar/LC_MESSAGES/messages.mo +0 -0
  145. invenio_app_rdm/translations/ar/LC_MESSAGES/messages.po +972 -376
  146. invenio_app_rdm/translations/bg/LC_MESSAGES/messages.mo +0 -0
  147. invenio_app_rdm/translations/bg/LC_MESSAGES/messages.po +907 -278
  148. invenio_app_rdm/translations/ca/LC_MESSAGES/messages.mo +0 -0
  149. invenio_app_rdm/translations/ca/LC_MESSAGES/messages.po +912 -283
  150. invenio_app_rdm/translations/cs/LC_MESSAGES/messages.mo +0 -0
  151. invenio_app_rdm/translations/cs/LC_MESSAGES/messages.po +1069 -405
  152. invenio_app_rdm/translations/da/LC_MESSAGES/messages.mo +0 -0
  153. invenio_app_rdm/translations/da/LC_MESSAGES/messages.po +908 -273
  154. invenio_app_rdm/translations/de/LC_MESSAGES/messages.mo +0 -0
  155. invenio_app_rdm/translations/de/LC_MESSAGES/messages.po +1017 -406
  156. invenio_app_rdm/translations/el/LC_MESSAGES/messages.mo +0 -0
  157. invenio_app_rdm/translations/el/LC_MESSAGES/messages.po +915 -286
  158. invenio_app_rdm/translations/es/LC_MESSAGES/messages.mo +0 -0
  159. invenio_app_rdm/translations/es/LC_MESSAGES/messages.po +963 -371
  160. invenio_app_rdm/translations/et/LC_MESSAGES/messages.mo +0 -0
  161. invenio_app_rdm/translations/et/LC_MESSAGES/messages.po +938 -362
  162. invenio_app_rdm/translations/fa/LC_MESSAGES/messages.mo +0 -0
  163. invenio_app_rdm/translations/fa/LC_MESSAGES/messages.po +906 -277
  164. invenio_app_rdm/translations/fr/LC_MESSAGES/messages.mo +0 -0
  165. invenio_app_rdm/translations/fr/LC_MESSAGES/messages.po +1032 -375
  166. invenio_app_rdm/translations/hr/LC_MESSAGES/messages.mo +0 -0
  167. invenio_app_rdm/translations/hr/LC_MESSAGES/messages.po +907 -278
  168. invenio_app_rdm/translations/hu/LC_MESSAGES/messages.mo +0 -0
  169. invenio_app_rdm/translations/hu/LC_MESSAGES/messages.po +985 -369
  170. invenio_app_rdm/translations/it/LC_MESSAGES/messages.mo +0 -0
  171. invenio_app_rdm/translations/it/LC_MESSAGES/messages.po +928 -298
  172. invenio_app_rdm/translations/ja/LC_MESSAGES/messages.mo +0 -0
  173. invenio_app_rdm/translations/ja/LC_MESSAGES/messages.po +907 -278
  174. invenio_app_rdm/translations/ka/LC_MESSAGES/messages.mo +0 -0
  175. invenio_app_rdm/translations/ka/LC_MESSAGES/messages.po +909 -280
  176. invenio_app_rdm/translations/ko/LC_MESSAGES/messages.mo +0 -0
  177. invenio_app_rdm/translations/ko/LC_MESSAGES/messages.po +1361 -0
  178. invenio_app_rdm/translations/lt/LC_MESSAGES/messages.mo +0 -0
  179. invenio_app_rdm/translations/lt/LC_MESSAGES/messages.po +910 -281
  180. invenio_app_rdm/translations/messages.pot +486 -303
  181. invenio_app_rdm/translations/no/LC_MESSAGES/messages.mo +0 -0
  182. invenio_app_rdm/translations/no/LC_MESSAGES/messages.po +907 -278
  183. invenio_app_rdm/translations/pl/LC_MESSAGES/messages.mo +0 -0
  184. invenio_app_rdm/translations/pl/LC_MESSAGES/messages.po +907 -278
  185. invenio_app_rdm/translations/pt/LC_MESSAGES/messages.mo +0 -0
  186. invenio_app_rdm/translations/pt/LC_MESSAGES/messages.po +906 -277
  187. invenio_app_rdm/translations/ro/LC_MESSAGES/messages.mo +0 -0
  188. invenio_app_rdm/translations/ro/LC_MESSAGES/messages.po +1042 -384
  189. invenio_app_rdm/translations/ru/LC_MESSAGES/messages.mo +0 -0
  190. invenio_app_rdm/translations/ru/LC_MESSAGES/messages.po +1022 -370
  191. invenio_app_rdm/translations/sk/LC_MESSAGES/messages.mo +0 -0
  192. invenio_app_rdm/translations/sk/LC_MESSAGES/messages.po +916 -287
  193. invenio_app_rdm/translations/sv/LC_MESSAGES/messages.mo +0 -0
  194. invenio_app_rdm/translations/sv/LC_MESSAGES/messages.po +989 -380
  195. invenio_app_rdm/translations/tr/LC_MESSAGES/messages.mo +0 -0
  196. invenio_app_rdm/translations/tr/LC_MESSAGES/messages.po +992 -341
  197. invenio_app_rdm/translations/uk/LC_MESSAGES/messages.mo +0 -0
  198. invenio_app_rdm/translations/uk/LC_MESSAGES/messages.po +935 -356
  199. invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.mo +0 -0
  200. invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.po +939 -347
  201. invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.mo +0 -0
  202. invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.po +907 -278
  203. invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py +190 -62
  204. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/METADATA +118 -7
  205. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/RECORD +209 -225
  206. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/entry_points.txt +2 -0
  207. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/top_level.txt +0 -1
  208. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next-scanner.config.js +0 -64
  209. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package-lock.json +0 -1512
  210. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/compileCatalog.js +0 -40
  211. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/initCatalog.js +0 -20
  212. tests/__init__.py +0 -8
  213. tests/api/__init__.py +0 -8
  214. tests/api/conftest.py +0 -24
  215. tests/api/test_protect_files_rest.py +0 -73
  216. tests/api/test_record_api.py +0 -175
  217. tests/api/test_stats_api.py +0 -26
  218. tests/conftest.py +0 -390
  219. tests/fixtures/__init__.py +0 -8
  220. tests/fixtures/app_data/oai_sets.yaml +0 -3
  221. tests/fixtures/app_data/pages/about.html +0 -1
  222. tests/fixtures/app_data/pages.yaml +0 -4
  223. tests/fixtures/conftest.py +0 -27
  224. tests/fixtures/test_cli.py +0 -25
  225. tests/fixtures/test_fixtures.py +0 -46
  226. tests/mock_module/__init__.py +0 -7
  227. tests/mock_module/templates/mock_mail.html +0 -27
  228. tests/mock_module/views.py +0 -32
  229. tests/redirector/__init__.py +0 -8
  230. tests/redirector/conftest.py +0 -54
  231. tests/redirector/test_redirector.py +0 -28
  232. tests/test_tasks.py +0 -209
  233. tests/test_utils.py +0 -67
  234. tests/test_version.py +0 -16
  235. tests/test_views.py +0 -43
  236. tests/ui/__init__.py +0 -8
  237. tests/ui/conftest.py +0 -115
  238. tests/ui/test_deposits.py +0 -115
  239. tests/ui/test_export_formats.py +0 -37
  240. tests/ui/test_file_download.py +0 -73
  241. tests/ui/test_filters.py +0 -10
  242. tests/ui/test_robotstxt.py +0 -35
  243. tests/ui/test_signposting_ui.py +0 -95
  244. tests/ui/test_sitemaps.py +0 -85
  245. tests/ui/test_stats_ui.py +0 -92
  246. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/WHEEL +0 -0
  247. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020-2024 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
  Copyright (C) 2020-2021 Northwestern University.
4
4
  Copyright (C) 2021-2023 TU Wien.
5
5
  Copyright (C) 2021 Graz University of Technology.
@@ -21,7 +21,7 @@
21
21
  {%- endblock css %}
22
22
  {% endif %}
23
23
 
24
- {%- from "invenio_app_rdm/records/macros/files.html" import file_list_box, preview_file_box, media_file_list_box %}
24
+ {%- from "invenio_app_rdm/records/macros/files.html" import file_list_box, preview_file_box, media_file_list_box with context %}
25
25
 
26
26
  {%- set title = record_ui["metadata"]["title"] %}
27
27
  {%- set metadata = record_ui["metadata"] %}
@@ -203,9 +203,6 @@
203
203
  <div id="recordManagementMobile"
204
204
  role="dialog"
205
205
  class="ui flowing popup transition hidden"
206
- data-record='{{ record_ui | tojson }}'
207
- data-permissions='{{ permissions | tojson }}'
208
- data-is-draft="{{ is_draft | tojson }}"
209
206
  {% if config.RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE %}
210
207
  {% include config.RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE %}
211
208
  {% endif %}
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020-2021 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
  Copyright (C) 2020 Northwestern University.
4
4
  Copyright (C) 2021 New York University.
5
5
 
@@ -7,7 +7,7 @@
7
7
  it under the terms of the MIT License; see LICENSE file for more details.
8
8
  #}
9
9
 
10
- <div id="recordCitation" data-record='{{ record_ui | tojson }}'
10
+ <div id="recordCitation" data-record-links='{{ record_ui.links | tojson }}'
11
11
  data-styles='{{ config.get("RDM_CITATION_STYLES") | tojson }}'
12
12
  data-defaultstyle='{{ config.get("RDM_CITATION_STYLES_DEFAULT") | tojson }}'
13
13
  data-include-deleted='{{ include_deleted | tojson }}'>
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020-2021 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
  Copyright (C) 2020-2021 Northwestern University.
4
4
  Copyright (C) 2021 New York University.
5
5
 
@@ -316,7 +316,7 @@ show_alternate_identifiers, show_related_identifiers, show_funding, show_dates %
316
316
  id="references-panel"
317
317
  role="region"
318
318
  aria-labelledby="references-accordion-trigger"
319
- class="active content sixteen wide mobile twelve wide tablet thirteen wide computer column"
319
+ class="active content sixteen wide mobile twelve wide tablet thirteen wide computer column text-break"
320
320
  >
321
321
  {{ show_references(metadata.references) }}
322
322
  </div>
@@ -1,14 +1,15 @@
1
1
  <div
2
2
  id="sidebar-communities-manage"
3
3
  data-user-communities-memberships='{{ user_communities_memberships | tojson }}'
4
- data-record-community-endpoint="{{ record_ui['links']['communities'] }}"
5
- data-record-community-search-endpoint="{{ record_ui['links']['communities-suggestions'] }}"
6
- data-record-user-community-search-endpoint="{{ record_ui['links']['user-communities-suggestions'] }}"
7
- data-pending-communities-search-config='{{ search_app_rdm_record_requests_config(app_id="InvenioAppRdm.RecordRequests", endpoint=record_ui['links']['requests']) | tojson }}'
8
- data-record-community-search-config='{{ search_app_rdm_record_communities_config(app_id="InvenioAppRdm.RecordCommunitiesSuggestions", endpoint=record_ui['links']["communities-suggestions"]) | tojson }}'
9
- data-record-user-community-search-config='{{ search_app_rdm_record_user_communities_config(app_id="InvenioAppRdm.RecordUserCommunitiesSuggestions", endpoint=record_ui['links']["communities-suggestions"]) | tojson }}'
4
+ data-record-community-endpoint='{{ record_ui["links"]["communities"] }}'
5
+ data-record-community-search-endpoint='{{ record_ui["links"]["communities-suggestions"] }}'
6
+ data-record-community-search-config='{{ search_app_rdm_record_communities_config(app_id="InvenioAppRdm.RecordCommunitiesSuggestions", endpoint=record_ui["links"]["communities-suggestions"]) | tojson }}'
7
+ data-record-user-community-search-endpoint='{{ record_ui["links"]["user-communities-suggestions"] }}'
8
+ data-record-user-community-search-config='{{ search_app_rdm_record_user_communities_config(app_id="InvenioAppRdm.RecordUserCommunitiesSuggestions", endpoint=record_ui["links"]["communities-suggestions"]) | tojson }}'
9
+ data-pending-communities-search-config='{{ search_app_rdm_record_requests_config(app_id="InvenioAppRdm.RecordRequests", endpoint=record_ui["links"]["requests"]) | tojson }}'
10
10
  data-permissions='{{ permissions | tojson }}'
11
- class="sidebar-container"
11
+ data-record='{{ record_ui | tojson }}'
12
+ class='sidebar-container'
12
13
  >
13
14
 
14
15
  <h2 class="ui medium top attached header">{{ _("Communities") }}</h2>
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
 
4
4
  Invenio RDM Records is free software; you can redistribute it and/or modify
5
5
  it under the terms of the MIT License; see LICENSE file for more details.
@@ -7,15 +7,14 @@ it under the terms of the MIT License; see LICENSE file for more details.
7
7
  {%- if external_resources -%}
8
8
  <div class="sidebar-container">
9
9
  <h2 class="ui small top attached header">{{ _('External resources')}}</h2>
10
- <div id="external-resource" aria-label="{{ _('External resources') }}" class="ui bottom attached segment rdm-sidebar external resource">
10
+ <dl id="external-resource" aria-label="{{ _('External resources') }}" class="ui bottom attached segment rdm-sidebar external resource details-list">
11
11
 
12
12
  {# dynamically create the list of external resources #}
13
13
  {%- for section, external_resources in external_resources | groupby("content.section") -%}
14
- <h3 class="ui small header">{{ section }}</h3>
15
- <ul class="ui relaxed list no-bullet">
14
+ <dt class="ui tiny header">{{ section }}</dt>
15
+ <ul class="ui list no-bullet m-0">
16
16
 
17
17
  {%- for resource in external_resources -%}
18
-
19
18
  {%- if resource -%}
20
19
  {%- if resource.template -%}
21
20
  {# It's up to the template to render the `resource` as it wishes #}
@@ -50,7 +49,7 @@ it under the terms of the MIT License; see LICENSE file for more details.
50
49
  {%- endfor -%}
51
50
  </ul>
52
51
  {%- endfor -%}
53
- </div>
52
+ </dl>
54
53
  </div>
55
54
  {%- endif -%}
56
55
 
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
  Copyright (C) 2020 Northwestern University.
4
4
  Copyright (C) 2021 Graz University of Technology.
5
5
  Copyright (C) 2021 New York University.
@@ -25,11 +25,11 @@
25
25
  <div class="sidebar-container">
26
26
  <h2 class="ui medium top attached header mt-0">{{ _('Rights') }}</h2>
27
27
  <div id="licenses" class="ui segment bottom attached rdm-sidebar">
28
+ <dl class="details-list">
28
29
  {% if rights %}
29
- <h4>License</h4>
30
- <ul class="details-list m-0 p-0">
30
+ <dt class="ui tiny header">License</dt>
31
31
  {%- for license in rights -%}
32
- <li id="license-{{ license.id }}-{{ loop.index }}" class="has-popup">
32
+ <dd id="license-{{ license.id }}-{{ loop.index }}" class="has-popup">
33
33
  <div id="title-{{ license.id }}-{{ loop.index }}"
34
34
  class="license clickable"
35
35
  tabindex="0"
@@ -45,7 +45,6 @@
45
45
  alt="{{ license.id }} icon"/>
46
46
  </span>
47
47
  {% endif %}
48
-
49
48
  <span class="title-text">
50
49
  {{ license.title_l10n }}
51
50
  </span>
@@ -57,7 +56,6 @@
57
56
  >
58
57
  <i role="button" tabindex="0" class="close icon text-muted"
59
58
  aria-label="{{ _('Close') }}"></i>
60
-
61
59
  <div id="license-description-{{ loop.index }}" class="description">
62
60
  <span class="text-muted">
63
61
  {{ license.description_l10n or _('No further description.') }}
@@ -65,18 +63,16 @@
65
63
  {{ license_link(license) }}
66
64
  </div>
67
65
  </div>
68
- </li>
66
+ </dd>
69
67
  {% endfor %}
70
-
71
- </ul>
72
68
  {% endif %}
73
69
  {% if copyrights %}
74
- <h4>Copyrights</h4>
75
- <div id="copyrights">
70
+ <dt class="ui tiny header">Copyright</dt>
71
+ <dd id="copyrights">
76
72
  {{ copyrights }}
77
- </div>
73
+ </dd>
78
74
  {% endif %}
75
+ </dl>
79
76
  </div>
80
-
81
77
  </div>
82
78
  {% endif %}
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2022-2024 CERN.
2
+ Copyright (C) 2022-2025 CERN.
3
3
 
4
4
  Invenio RDM Records is free software; you can redistribute it and/or modify
5
5
  it under the terms of the MIT License; see LICENSE file for more details.
@@ -17,8 +17,14 @@ it under the terms of the MIT License; see LICENSE file for more details.
17
17
  data-is-draft="{{ is_draft | tojson }}"
18
18
  data-is-preview-submission-request="{{ is_preview_submission_request | tojson }}"
19
19
  data-current-user-id="{{ current_user.id }}"
20
- data-record-owner-id='{{ record_owner_id }}'
21
20
  data-groups-enabled='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }}'
21
+ {% if record_deletion %}
22
+ data-record-deletion='{{ record_deletion | tojson }}'
23
+ data-record-deletion-options='{{ record_deletion_options | tojson }}'
24
+ {% else %}
25
+ data-record-deletion='{{ {} | tojson }}'
26
+ data-record-deletion-options='{{ [] | tojson }}'
27
+ {% endif %}
22
28
  {% if config.RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE %}
23
29
  {% include config.RDM_DETAIL_SIDE_BAR_MANAGE_ATTRIBUTES_EXTENSION_TEMPLATE %}
24
30
  {% endif %}
@@ -29,9 +35,6 @@ it under the terms of the MIT License; see LICENSE file for more details.
29
35
  <div class="full line"></div>
30
36
  <div class="full line"></div>
31
37
  <div class="full line"></div>
32
- <div class="full line"></div>
33
- <div class="full line"></div>
34
- <div class="full line"></div>
35
38
  </div>
36
39
  </div>
37
40
  </div>
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2020 CERN.
2
+ Copyright (C) 2020-2025 CERN.
3
3
 
4
4
  Invenio RDM Records is free software; you can redistribute it and/or modify
5
5
  it under the terms of the MIT License; see LICENSE file for more details.
@@ -28,11 +28,9 @@
28
28
  </div>
29
29
 
30
30
  <div class="ui accordion rel-mt-1 centered">
31
- <div class="title">
31
+ <div class="title trigger" tabindex="0">
32
32
  <i class="caret right icon" aria-hidden="true"></i>
33
33
  <span
34
- tabindex="0"
35
- class="trigger"
36
34
  data-open-text="{{ _('Show more details') }}"
37
35
  data-close-text="{{ _('Show less details') }}"
38
36
  >
@@ -110,7 +110,7 @@
110
110
  <dt class="ui tiny header">
111
111
  <span class="mr-0 text-muted">
112
112
  {% if item.award.acronym %}
113
- {{ item.award.acronym }}
113
+ {{ item.award.acronym }} -
114
114
  {% endif %}
115
115
 
116
116
  {%- if item.award.title_l10n -%}
@@ -6,15 +6,17 @@
6
6
  #}
7
7
 
8
8
  {% macro show_doi(doi_value, record_ui, badge_id="record-doi-badge", modal_id="doi-modal", subheader=None, parent_doi=false) %}
9
+ {%- set doi_link = record_ui["links"]["doi"] if not parent_doi else record_ui["links"]["parent_doi"] %}
9
10
  <dt class="ui tiny header">{{_('DOI')}}
10
11
  {% if subheader %}
11
- <i><span class="doi sub header">{{subheader}}</span></i></dt>
12
+ <i><span class="doi sub header">{{subheader}}</span></i>
12
13
  {% endif %}
14
+ </dt>
13
15
  <dd>
14
- <span class="get-badge" data-toggle="tooltip" data-placement="bottom" style="cursor: pointer;"
15
- title="{{ _('Get the DOI badge!') }}">
16
- <img id='{{badge_id}}' data-target="[data-modal='{{ doi_value }}']"
16
+ <span class="get-badge details-doi-section" data-toggle="tooltip" data-placement="bottom">
17
+ <img id='{{badge_id}}' data-target="[data-modal='{{ doi_value }}']" title="{{ _('Get the DOI badge!') }}"
17
18
  src="{{ url_for('invenio_formatter_badges.badge', title='DOI', value=doi_value, ext='svg') }}" alt="{{ doi_value }}" />
19
+ <div id="copy-button-{{ badge_id }}" class="copy-doi-button" data-value={{ doi_link }} data-size="mini"></div>
18
20
  </span>
19
21
 
20
22
  <div id="{{modal_id}}" class="ui modal fade badge-modal" data-modal="{{ doi_value }}">
@@ -27,7 +29,7 @@
27
29
  <pre>{{ doi_value }}</pre>
28
30
  </h4>
29
31
  {% from "semantic-ui/invenio_formatter/macros/badges.html" import badges_formats_list %}
30
- {{ badges_formats_list(url_for('invenio_formatter_badges.badge', title='DOI', value=doi_value, ext='svg', _external=True, _scheme='https'), record_ui["links"]["parent_doi"] if parent_doi else record_ui["links"]["doi"]) }}
32
+ {{ badges_formats_list(url_for('invenio_formatter_badges.badge', title='DOI', value=doi_value, ext='svg', _external=True, _scheme='https'), doi_link) }}
31
33
  </div>
32
34
  </div>
33
35
  </dd>
@@ -32,6 +32,7 @@
32
32
 
33
33
 
34
34
  {% macro preview_file_box(file, pid, is_preview, record, include_deleted) %}
35
+ {%- set is_remote_file = file.transfer.type == transfer_types.REMOTE %}
35
36
  <div class="ui accordion panel mb-10 {{record.ui.access_status.id}}" href="#files-preview-accordion-panel">
36
37
  <h3 class="active title panel-heading {{ record.ui.access_status.id }} m-0">
37
38
  <div
@@ -53,9 +54,22 @@
53
54
  aria-labelledby="files-preview-accordion-trigger"
54
55
  class="active content preview-container pt-0 {{record.ui.access_status.id}}"
55
56
  >
57
+ {%- if is_remote_file %}
58
+ <div class="ui info message">
59
+ <div class="header">
60
+ {{ _('This file cannot be previewed') }}
61
+ </div>
62
+ <ul class="list">
63
+ <li>{{ _('This file is an external reference and not stored directly in this repository.
64
+ To access its content, please download it and open it locally.') }}
65
+ </li>
66
+ </ul>
67
+ </div>
68
+ {%- else %}
56
69
  <div>
57
70
  {{ preview_file('invenio_app_rdm_records.record_file_preview', pid_value=pid, filename=file.key, is_preview=is_preview, include_deleted=include_deleted) }}
58
71
  </div>
72
+ {%- endif %}
59
73
  </div>
60
74
  </div>
61
75
  {%- endmacro %}
@@ -93,6 +107,7 @@
93
107
  {% endif %}
94
108
  {% for file in files %}
95
109
  {% if not file.access.hidden %}
110
+ {%- set is_remote_file = file.transfer.type == transfer_types.REMOTE %}
96
111
  {% if is_preview %}
97
112
  {%- set file_url_download = url_for(download_endpoint, pid_value=pid, filename=file.key, download=1, preview=1) %}
98
113
  {%- set file_url_preview = url_for(preview_endpoint, pid_value=pid, filename=file.key, preview=1, include_deleted=include_deleted_value) %}
@@ -107,16 +122,18 @@
107
122
  <div>
108
123
  <a href="{{ file_url_download }}">{{ file.key }}</a>
109
124
  </div>
110
- <small class="ui text-muted font-tiny">{{ file.checksum }}
125
+ {%- if not is_remote_file %}
126
+ <small class="ui text-muted font-tiny">{{ file.checksum or _("Checksum not yet calculated.") }}
111
127
  <div class="ui icon inline-block" data-tooltip="{{_('This is the file fingerprint (checksum), which can be used to verify the file integrity.')}}">
112
128
  <i class="question circle checksum icon"></i>
113
129
  </div>
114
130
  </small>
131
+ {%- endif %}
115
132
  </td>
116
- <td>{{ file.size|filesizeformat(binary=binary_sizes) }}</td>
133
+ <td>{%- if is_remote_file %}{{_("N/A (external)")}}{%- else -%}{{ file.size|filesizeformat(binary=binary_sizes) }}{%- endif %}</td>
117
134
  <td class="right aligned">
118
135
  <span>
119
- {% if with_preview and file_type|lower is previewable %}
136
+ {% if with_preview and file_type|lower is previewable and not is_remote_file %}
120
137
  <a role="button" class="ui compact mini button preview-link" href="{{ file_url_preview }}" target="preview-iframe" data-file-key="{{file.key}}">
121
138
  <i class="eye icon" aria-hidden="true"></i>{{_("Preview")}}
122
139
  </a>
@@ -140,7 +157,7 @@
140
157
  <h3 class="active title panel-heading {{ record.ui.access_status.id }} m-0">
141
158
  <div role="button" id="files-list-accordion-trigger" aria-controls="files-list-accordion-panel" aria-expanded="true" tabindex="0" class="trigger">
142
159
  {{ _("Files") }}
143
- <small class="text-muted">{% if files %} ({{files|sum(attribute='size')|filesizeformat(binary=binary_sizes)}}){% endif %}</small>
160
+ <small class="text-muted">{% if files %} ({{files|map(attribute='size', default=0)|sum()|filesizeformat(binary=binary_sizes)}}){% endif %}</small>
144
161
  <i class="angle right icon" aria-hidden="true"></i>
145
162
  </div>
146
163
  </h3>
@@ -1,5 +1,5 @@
1
1
  {#
2
- Copyright (C) 2021 CERN.
2
+ Copyright (C) 2021-2025 CERN.
3
3
  Copyright (C) 2023 TU Wien.
4
4
 
5
5
  Invenio App RDM is free software; you can redistribute it and/or modify it
@@ -37,6 +37,11 @@
37
37
  <p>
38
38
  <strong>{{ _("Removed by:") }}</strong> {{ record.ui.tombstone.removed_by }}
39
39
  </p>
40
+ {%- if record.ui.tombstone.deletion_policy %}
41
+ <p>
42
+ <strong>{{ _("Deletion Policy:") }}</strong> {{ record.ui.tombstone.deletion_policy }}
43
+ </p>
44
+ {%- endif %}
40
45
  {%- if record.ui.tombstone.note %}
41
46
  <p>
42
47
  <strong>{{ _("Removal note:") }}</strong> {{ record.ui.tombstone.note }}
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2020 CERN.
3
+ # Copyright (C) 2020-2025 CERN.
4
4
  # Copyright (C) 2020 Northwestern University.
5
5
  # Copyright (C) 2021 TU Wien.
6
6
  #
@@ -9,12 +9,22 @@
9
9
 
10
10
  """Utility functions."""
11
11
 
12
+ from datetime import datetime, timezone
12
13
  from itertools import chain
13
14
 
14
15
  from flask import current_app
16
+ from invenio_access.permissions import system_identity
17
+ from invenio_rdm_records.records.api import RDMRecord
18
+ from invenio_rdm_records.requests.record_deletion import RecordDeletion
19
+ from invenio_rdm_records.services.config import (
20
+ FileModificationPolicyEvaluator,
21
+ RDMRecordDeletionPolicy,
22
+ )
15
23
  from invenio_records.dictutils import dict_set
16
24
  from invenio_records.errors import MissingModelError
17
25
  from invenio_records_files.api import FileObject
26
+ from invenio_requests.proxies import current_requests_service
27
+ from invenio_search.api import dsl
18
28
 
19
29
 
20
30
  def previewer_record_file_factory(pid, record, filename):
@@ -88,3 +98,85 @@ def dump_external_resource(
88
98
  },
89
99
  "template": template,
90
100
  }
101
+
102
+
103
+ def get_existing_deletion_request(record_id):
104
+ """Return the self HTML link of the existing open deletion request for the record."""
105
+ existing_requests = current_requests_service.search(
106
+ system_identity,
107
+ extra_filter=dsl.Q(
108
+ "bool",
109
+ must=[
110
+ dsl.Q("term", **{"topic.record": record_id}),
111
+ dsl.Q("term", **{"type": RecordDeletion.type_id}),
112
+ dsl.Q("term", **{"is_open": True}),
113
+ ],
114
+ ),
115
+ )
116
+ if existing_requests.total > 0:
117
+ return list(existing_requests)[0]["links"]["self_html"]
118
+
119
+
120
+ def evaluate_record_deletion(record: RDMRecord, identity):
121
+ """Evaluate whether a given record can be deleted by an identity."""
122
+ rec_del = RDMRecordDeletionPolicy().evaluate(identity, record)
123
+
124
+ immediate, request = rec_del["immediate_deletion"], rec_del["request_deletion"]
125
+ rd_enabled = immediate.enabled or request.enabled
126
+ rd_valid_user = immediate.valid_user or request.valid_user
127
+ rd_allowed = immediate.allowed or request.allowed
128
+
129
+ if rd_allowed:
130
+ record_deletion = {
131
+ "enabled": rd_enabled,
132
+ "valid_user": rd_valid_user,
133
+ "allowed": rd_allowed,
134
+ "recordDeletion": rec_del,
135
+ "checklist": (
136
+ current_app.config["RDM_IMMEDIATE_RECORD_DELETION_CHECKLIST"]
137
+ if immediate.allowed
138
+ else current_app.config["RDM_REQUEST_RECORD_DELETION_CHECKLIST"]
139
+ ),
140
+ "context": {
141
+ "files": record.files.count,
142
+ "internalDoi": record.pids.get("doi", {}).get("provider") != "external",
143
+ },
144
+ }
145
+ else:
146
+ record_deletion = {
147
+ "enabled": rd_enabled,
148
+ "valid_user": rd_valid_user,
149
+ "allowed": rd_allowed,
150
+ }
151
+ record_deletion["existing_request"] = (
152
+ # We show existing requests to valid users (even if they are not allowed to delete a record anymore).
153
+ get_existing_deletion_request(record.pid.pid_value)
154
+ if rd_valid_user
155
+ else None
156
+ )
157
+
158
+ return record_deletion
159
+
160
+
161
+ def evaluate_file_modification(record, identity):
162
+ """Evaluate whether a given record file's can be edited by an identity."""
163
+ file_mod = FileModificationPolicyEvaluator().evaluate(identity, record)
164
+
165
+ file_mod = file_mod["immediate_file_modification"]
166
+
167
+ file_modification = {
168
+ "enabled": file_mod.enabled,
169
+ "valid_user": file_mod.valid_user,
170
+ "allowed": file_mod.allowed,
171
+ }
172
+
173
+ if file_mod.allowed:
174
+ file_modification["fileModification"] = file_mod
175
+ created = record.created.replace(tzinfo=timezone.utc)
176
+ modification_until = created + current_app.config.get(
177
+ "RDM_FILE_MODIFICATION_PERIOD"
178
+ )
179
+ days_until = (modification_until - datetime.now(timezone.utc)).days
180
+ file_modification["context"] = {"days_until": days_until}
181
+
182
+ return file_modification
@@ -23,6 +23,7 @@ from invenio_rdm_records.proxies import current_rdm_records
23
23
  from invenio_rdm_records.resources.serializers.signposting import (
24
24
  FAIRSignpostingProfileLvl1Serializer,
25
25
  )
26
+ from invenio_rdm_records.services.errors import RecordDeletedException
26
27
  from invenio_records_resources.services.errors import PermissionDeniedError
27
28
  from sqlalchemy.orm.exc import NoResultFound
28
29
 
@@ -80,11 +81,7 @@ def pass_draft(expand=False):
80
81
  expand=expand,
81
82
  )
82
83
  kwargs["draft"] = draft
83
- kwargs["files_locked"] = (
84
- record_service.config.lock_edit_published_files(
85
- record_service, g.identity, draft=draft, record=draft._record
86
- )
87
- )
84
+ kwargs["files_locked"] = draft._record.files.bucket.locked
88
85
  return f(**kwargs)
89
86
  except PIDDoesNotExistError:
90
87
  # Redirect to /records/:id because users are interchangeably
@@ -224,16 +221,28 @@ def pass_file_item(is_media=False):
224
221
  )
225
222
  record_service = media_files_service if is_media else files_service
226
223
 
227
- if is_preview:
228
- try:
229
- item = draft_service().get_file_content(**read_kwargs)
230
- except NoResultFound:
224
+ try:
225
+ if is_preview:
226
+ try:
227
+ item = draft_service().get_file_content(**read_kwargs)
228
+ except NoResultFound:
229
+ item = record_service().get_file_content(**read_kwargs)
230
+ else:
231
231
  item = record_service().get_file_content(**read_kwargs)
232
- else:
233
- item = record_service().get_file_content(**read_kwargs)
234
232
 
235
- kwargs["file_item"] = item
236
- return f(**kwargs)
233
+ kwargs["file_item"] = item
234
+ return f(**kwargs)
235
+
236
+ except RecordDeletedException:
237
+ # Redirect to the record page which has proper tombstone handling
238
+ return redirect(
239
+ url_for(
240
+ "invenio_app_rdm_records.record_detail",
241
+ pid_value=pid_value,
242
+ ),
243
+ # Use 302 (temporary) instead of 301 since records can be restored
244
+ code=302,
245
+ )
237
246
 
238
247
  return view
239
248
 
@@ -358,7 +367,8 @@ def pass_draft_community(f):
358
367
  comid = request.args.get("community")
359
368
  if comid:
360
369
  community = current_communities.service.read(id_=comid, identity=g.identity)
361
- kwargs["community"] = UICommunityJSONSerializer().dump_obj(
370
+ kwargs["community"] = community
371
+ kwargs["community_ui"] = UICommunityJSONSerializer().dump_obj(
362
372
  community.to_dict()
363
373
  )
364
374