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.
- invenio_app_rdm/__init__.py +1 -1
- invenio_app_rdm/administration/moderation/__init__.py +11 -0
- invenio_app_rdm/administration/moderation/requests.py +175 -0
- invenio_app_rdm/administration/records/records.py +9 -7
- invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests.html +14 -0
- invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests_details.html +91 -0
- invenio_app_rdm/administration/user_moderation/user_moderation.py +4 -4
- invenio_app_rdm/administration/users/users.py +0 -5
- invenio_app_rdm/communities_ui/views/communities.py +9 -5
- invenio_app_rdm/config.py +73 -4
- invenio_app_rdm/ext.py +2 -2
- invenio_app_rdm/fixtures/pages.py +5 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/deposit.html +11 -0
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +2 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/details.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/communities.html +8 -7
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/external_resources.html +5 -6
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/licenses.html +9 -13
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/manage_menu.html +8 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/stats.html +2 -4
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/detail.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/doi.html +7 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/files.html +21 -4
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/tombstone.html +6 -1
- invenio_app_rdm/records_ui/utils.py +93 -1
- invenio_app_rdm/records_ui/views/decorators.py +24 -14
- invenio_app_rdm/records_ui/views/deposits.py +100 -27
- invenio_app_rdm/records_ui/views/filters.py +11 -4
- invenio_app_rdm/records_ui/views/records.py +23 -13
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/file-modification/index.html +88 -0
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/guest-access-request/index.html +5 -5
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/record-deletion/index.html +95 -0
- invenio_app_rdm/requests_ui/views/requests.py +54 -87
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewRecentChanges.js +8 -8
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/ImpersonateUserForm.js +12 -17
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/RevisionsDiffViewer.js +14 -16
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/SetQuotaAction.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/routes.js +1 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchResultItem.js +81 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchbarLayout.js +48 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/index.js +22 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/communityRecordsSearch/CommunityRecordsSearchAppLayout.js +3 -4
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/CopyButton.js +38 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js +45 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionModal.js +354 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionRadioGroup.js +44 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion.js +81 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +55 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js +4 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js +2 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ExportDropdown.js +7 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js +52 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCitationField.js +15 -14
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitiesListModal/RecordCommunitiesListModal.js +4 -4
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitySubmission/RecordCommunitySubmissionModal.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js +17 -3
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js +16 -17
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RemoveFromCommunity/RemoveFromCommunityAction.js +5 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/index.js +42 -40
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/theme.js +9 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineEdit.js +5 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineRead.js +2 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/search/components.js +14 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/theme.js +9 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/file_uploader/uppy.less +37 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/landing_page/licenses.less +5 -3
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.overrides +6 -1
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.overrides +10 -1
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.overrides +7 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.variables +0 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/_generatedTranslations.js +66 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/messages.po +804 -137
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/translations.json +277 -249
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/translations.json +102 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/messages.po +699 -80
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/translations.json +112 -92
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/messages.po +821 -138
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/translations.json +290 -262
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/messages.po +691 -66
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/translations.json +91 -71
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/messages.po +818 -138
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/translations.json +260 -240
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/messages.po +698 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/translations.json +108 -88
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/messages.po +1000 -5
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/translations.json +81 -28
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/messages.po +810 -137
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/translations.json +253 -233
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/messages.po +746 -133
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/translations.json +130 -110
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/messages.po +688 -69
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/translations.json +103 -79
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/messages.po +809 -126
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/translations.json +277 -257
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/messages.po +695 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/translations.json +101 -79
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/messages.po +801 -135
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/translations.json +254 -234
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/index.js +16 -65
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/messages.po +712 -86
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/translations.json +116 -96
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/messages.po +683 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/translations.json +96 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/translations.json +109 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/messages.po +889 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/translations.json +277 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/messages.po +702 -71
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/translations.json +113 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/translations.json +102 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/messages.po +704 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/translations.json +119 -91
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/messages.po +694 -69
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/translations.json +93 -73
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/messages.po +717 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/translations.json +155 -133
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/messages.po +806 -124
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/translations.json +288 -260
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/messages.po +713 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/translations.json +119 -91
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/messages.po +807 -141
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/translations.json +260 -240
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/messages.po +799 -128
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/translations.json +259 -239
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/messages.po +756 -131
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/translations.json +124 -96
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/messages.po +736 -123
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/translations.json +130 -108
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/messages.po +683 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/translations.json +100 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package.json +3 -37
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/translations.pot +243 -94
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.de.html +2 -2
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.en.html +4 -4
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.sv.html +4 -4
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/intro_section.html +7 -6
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/macros/records_list.html +2 -1
- invenio_app_rdm/theme/templates/semantic-ui/invenio_communities/default_static_page.html +26 -0
- invenio_app_rdm/theme/webpack.py +3 -2
- invenio_app_rdm/translations/ar/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ar/LC_MESSAGES/messages.po +972 -376
- invenio_app_rdm/translations/bg/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/bg/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/ca/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ca/LC_MESSAGES/messages.po +912 -283
- invenio_app_rdm/translations/cs/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/cs/LC_MESSAGES/messages.po +1069 -405
- invenio_app_rdm/translations/da/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/da/LC_MESSAGES/messages.po +908 -273
- invenio_app_rdm/translations/de/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/de/LC_MESSAGES/messages.po +1017 -406
- invenio_app_rdm/translations/el/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/el/LC_MESSAGES/messages.po +915 -286
- invenio_app_rdm/translations/es/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/es/LC_MESSAGES/messages.po +963 -371
- invenio_app_rdm/translations/et/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/et/LC_MESSAGES/messages.po +938 -362
- invenio_app_rdm/translations/fa/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/fa/LC_MESSAGES/messages.po +906 -277
- invenio_app_rdm/translations/fr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/fr/LC_MESSAGES/messages.po +1032 -375
- invenio_app_rdm/translations/hr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/hr/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/hu/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/hu/LC_MESSAGES/messages.po +985 -369
- invenio_app_rdm/translations/it/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/it/LC_MESSAGES/messages.po +928 -298
- invenio_app_rdm/translations/ja/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ja/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/ka/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ka/LC_MESSAGES/messages.po +909 -280
- invenio_app_rdm/translations/ko/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ko/LC_MESSAGES/messages.po +1361 -0
- invenio_app_rdm/translations/lt/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/lt/LC_MESSAGES/messages.po +910 -281
- invenio_app_rdm/translations/messages.pot +486 -303
- invenio_app_rdm/translations/no/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/no/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/pl/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/pl/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/pt/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/pt/LC_MESSAGES/messages.po +906 -277
- invenio_app_rdm/translations/ro/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ro/LC_MESSAGES/messages.po +1042 -384
- invenio_app_rdm/translations/ru/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ru/LC_MESSAGES/messages.po +1022 -370
- invenio_app_rdm/translations/sk/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/sk/LC_MESSAGES/messages.po +916 -287
- invenio_app_rdm/translations/sv/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/sv/LC_MESSAGES/messages.po +989 -380
- invenio_app_rdm/translations/tr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/tr/LC_MESSAGES/messages.po +992 -341
- invenio_app_rdm/translations/uk/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/uk/LC_MESSAGES/messages.po +935 -356
- invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.po +939 -347
- invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py +190 -62
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/METADATA +118 -7
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/RECORD +209 -225
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/entry_points.txt +2 -0
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/top_level.txt +0 -1
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next-scanner.config.js +0 -64
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package-lock.json +0 -1512
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/compileCatalog.js +0 -40
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/initCatalog.js +0 -20
- tests/__init__.py +0 -8
- tests/api/__init__.py +0 -8
- tests/api/conftest.py +0 -24
- tests/api/test_protect_files_rest.py +0 -73
- tests/api/test_record_api.py +0 -175
- tests/api/test_stats_api.py +0 -26
- tests/conftest.py +0 -390
- tests/fixtures/__init__.py +0 -8
- tests/fixtures/app_data/oai_sets.yaml +0 -3
- tests/fixtures/app_data/pages/about.html +0 -1
- tests/fixtures/app_data/pages.yaml +0 -4
- tests/fixtures/conftest.py +0 -27
- tests/fixtures/test_cli.py +0 -25
- tests/fixtures/test_fixtures.py +0 -46
- tests/mock_module/__init__.py +0 -7
- tests/mock_module/templates/mock_mail.html +0 -27
- tests/mock_module/views.py +0 -32
- tests/redirector/__init__.py +0 -8
- tests/redirector/conftest.py +0 -54
- tests/redirector/test_redirector.py +0 -28
- tests/test_tasks.py +0 -209
- tests/test_utils.py +0 -67
- tests/test_version.py +0 -16
- tests/test_views.py +0 -43
- tests/ui/__init__.py +0 -8
- tests/ui/conftest.py +0 -115
- tests/ui/test_deposits.py +0 -115
- tests/ui/test_export_formats.py +0 -37
- tests/ui/test_file_download.py +0 -73
- tests/ui/test_filters.py +0 -10
- tests/ui/test_robotstxt.py +0 -35
- tests/ui/test_signposting_ui.py +0 -95
- tests/ui/test_sitemaps.py +0 -85
- tests/ui/test_stats_ui.py +0 -92
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/WHEEL +0 -0
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,29 +7,38 @@
|
|
|
7
7
|
import React, { Component } from "react";
|
|
8
8
|
import PropTypes from "prop-types";
|
|
9
9
|
import { Button, Popup } from "semantic-ui-react";
|
|
10
|
-
import { CopyToClipboard } from "react-copy-to-clipboard";
|
|
11
10
|
import { i18next } from "@translations/invenio_app_rdm/i18next";
|
|
12
11
|
|
|
13
12
|
class SimpleCopyButton extends React.Component {
|
|
13
|
+
fetchUrl = async (url) => {
|
|
14
|
+
return await (await fetch(url)).text();
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
handleClick = async () => {
|
|
18
|
+
const { url, text, onCopy } = this.props;
|
|
19
|
+
let textToCopy = text;
|
|
20
|
+
if (url) {
|
|
21
|
+
textToCopy = await this.fetchUrl(url);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
25
|
+
onCopy(text);
|
|
26
|
+
};
|
|
27
|
+
|
|
14
28
|
render() {
|
|
15
|
-
const {
|
|
29
|
+
const { hoverState, size } = this.props;
|
|
16
30
|
|
|
17
31
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
aria-label={i18next.t("Copy to clipboard")}
|
|
29
|
-
onMouseEnter={hoverState}
|
|
30
|
-
onMouseLeave={hoverState}
|
|
31
|
-
/>
|
|
32
|
-
</CopyToClipboard>
|
|
32
|
+
<Button
|
|
33
|
+
className="copy"
|
|
34
|
+
basic
|
|
35
|
+
size={size}
|
|
36
|
+
icon="copy"
|
|
37
|
+
aria-label={i18next.t("Copy to clipboard")}
|
|
38
|
+
onClick={this.handleClick} // Handle click to fetch from url if url passed, otherwise use text from props
|
|
39
|
+
onMouseEnter={hoverState}
|
|
40
|
+
onMouseLeave={hoverState}
|
|
41
|
+
/>
|
|
33
42
|
);
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -37,11 +46,15 @@ class SimpleCopyButton extends React.Component {
|
|
|
37
46
|
SimpleCopyButton.propTypes = {
|
|
38
47
|
text: PropTypes.string.isRequired,
|
|
39
48
|
onCopy: PropTypes.func.isRequired,
|
|
49
|
+
url: PropTypes.func,
|
|
40
50
|
hoverState: PropTypes.func,
|
|
51
|
+
size: PropTypes.string,
|
|
41
52
|
};
|
|
42
53
|
|
|
43
54
|
SimpleCopyButton.defaultProps = {
|
|
44
55
|
hoverState: null,
|
|
56
|
+
url: null,
|
|
57
|
+
size: "medium",
|
|
45
58
|
};
|
|
46
59
|
|
|
47
60
|
export class CopyButton extends Component {
|
|
@@ -86,12 +99,12 @@ export class CopyButton extends Component {
|
|
|
86
99
|
};
|
|
87
100
|
|
|
88
101
|
render() {
|
|
89
|
-
const { text,
|
|
102
|
+
const { popUpPosition, text, url, size } = this.props;
|
|
90
103
|
const { confirmationPopupMsg, confirmationPopupIsOpen, hoverPopupIsOpen } =
|
|
91
104
|
this.state;
|
|
92
105
|
|
|
93
106
|
return (
|
|
94
|
-
text && (
|
|
107
|
+
(text || url) && ( // Ensure text or url is provided
|
|
95
108
|
<Popup
|
|
96
109
|
role="alert"
|
|
97
110
|
open={hoverPopupIsOpen || confirmationPopupIsOpen}
|
|
@@ -103,7 +116,9 @@ export class CopyButton extends Component {
|
|
|
103
116
|
<SimpleCopyButton
|
|
104
117
|
text={text}
|
|
105
118
|
onCopy={this.onCopy}
|
|
119
|
+
url={url}
|
|
106
120
|
hoverState={this.hoverStateHandler}
|
|
121
|
+
size={size}
|
|
107
122
|
/>
|
|
108
123
|
}
|
|
109
124
|
/>
|
|
@@ -115,9 +130,13 @@ export class CopyButton extends Component {
|
|
|
115
130
|
CopyButton.propTypes = {
|
|
116
131
|
popUpPosition: PropTypes.string,
|
|
117
132
|
text: PropTypes.string,
|
|
133
|
+
url: PropTypes.func,
|
|
134
|
+
size: PropTypes.string,
|
|
118
135
|
};
|
|
119
136
|
|
|
120
137
|
CopyButton.defaultProps = {
|
|
121
138
|
popUpPosition: "right center",
|
|
122
139
|
text: "",
|
|
140
|
+
url: "",
|
|
141
|
+
size: "medium",
|
|
123
142
|
};
|
invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// This file is part of InvenioRDM
|
|
2
|
+
// Copyright (C) 2025 CERN.
|
|
3
|
+
//
|
|
4
|
+
// Invenio RDM Records is free software; you can redistribute it and/or modify it
|
|
5
|
+
// under the terms of the MIT License; see LICENSE file for more details.
|
|
6
|
+
|
|
7
|
+
import React, { Component } from "react";
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
import { i18next } from "@translations/invenio_app_rdm/i18next";
|
|
10
|
+
|
|
11
|
+
export class FileModificationUntil extends Component {
|
|
12
|
+
render() {
|
|
13
|
+
const { filesLocked, fileModification, record } = this.props;
|
|
14
|
+
|
|
15
|
+
if (!fileModification.fileModification?.enabled) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const isPublished = record.is_published;
|
|
20
|
+
const filesUnlocked = !filesLocked;
|
|
21
|
+
const daysUntil = fileModification.context?.days_until;
|
|
22
|
+
if (isPublished && filesUnlocked && daysUntil) {
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
{" "}
|
|
26
|
+
{i18next.t("– Unlocked, {{ daysUntil }} days to publish changes", {
|
|
27
|
+
daysUntil: fileModification.context.days_until,
|
|
28
|
+
})}
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
FileModificationUntil.propTypes = {
|
|
38
|
+
filesLocked: PropTypes.bool.isRequired,
|
|
39
|
+
fileModification: PropTypes.object,
|
|
40
|
+
record: PropTypes.object.isRequired,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
FileModificationUntil.defaultProps = {
|
|
44
|
+
fileModification: {},
|
|
45
|
+
};
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// This file is part of InvenioRDM
|
|
2
|
+
// Copyright (C) 2025 CERN
|
|
3
|
+
//
|
|
4
|
+
// Invenio-app-rdm is free software; you can redistribute it and/or modify it
|
|
5
|
+
// under the terms of the MIT License; see LICENSE file for more details.
|
|
6
|
+
|
|
7
|
+
import { i18next } from "@translations/invenio_app_rdm/i18next";
|
|
8
|
+
import { Formik } from "formik";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import React, { Component } from "react";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
ErrorMessage,
|
|
14
|
+
http,
|
|
15
|
+
SelectField,
|
|
16
|
+
TextAreaField,
|
|
17
|
+
withCancel,
|
|
18
|
+
} from "react-invenio-forms";
|
|
19
|
+
import {
|
|
20
|
+
Button,
|
|
21
|
+
Checkbox,
|
|
22
|
+
Icon,
|
|
23
|
+
Form,
|
|
24
|
+
Message,
|
|
25
|
+
Modal,
|
|
26
|
+
ModalActions,
|
|
27
|
+
ModalContent,
|
|
28
|
+
ModalHeader,
|
|
29
|
+
Table,
|
|
30
|
+
TableBody,
|
|
31
|
+
TableHeader,
|
|
32
|
+
TableHeaderCell,
|
|
33
|
+
TableRow,
|
|
34
|
+
} from "semantic-ui-react";
|
|
35
|
+
import * as Yup from "yup";
|
|
36
|
+
import DeletionRadioGroup from "./DeletionRadioGroup";
|
|
37
|
+
|
|
38
|
+
export class DeletionModal extends Component {
|
|
39
|
+
constructor(props) {
|
|
40
|
+
super(props);
|
|
41
|
+
const { recordDeletion } = this.props;
|
|
42
|
+
const checklistLength = recordDeletion["checklist"]?.length || 0;
|
|
43
|
+
this.initState = {
|
|
44
|
+
loading: false,
|
|
45
|
+
error: undefined,
|
|
46
|
+
checklistState: Array(checklistLength).fill(undefined),
|
|
47
|
+
checkboxState: Array(2).fill(false), // TODO dynamic count of number of checkboxes
|
|
48
|
+
messages: [],
|
|
49
|
+
};
|
|
50
|
+
this.state = { ...this.initState };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
handleClose = () => {
|
|
54
|
+
this.setState({
|
|
55
|
+
...this.initState,
|
|
56
|
+
});
|
|
57
|
+
const { handleClose } = this.props;
|
|
58
|
+
handleClose();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
handleRadioUpdate = (index, value) => {
|
|
62
|
+
const { recordDeletion } = this.props;
|
|
63
|
+
const { checklistState } = this.state;
|
|
64
|
+
const nextChecklistState = checklistState.map((c, i) => {
|
|
65
|
+
if (i === index) {
|
|
66
|
+
return value;
|
|
67
|
+
} else {
|
|
68
|
+
return c;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const filteredChecklist = recordDeletion["checklist"].filter((_, index) => {
|
|
72
|
+
return nextChecklistState[index];
|
|
73
|
+
});
|
|
74
|
+
const newMessages = filteredChecklist.map((x) => x["message"]);
|
|
75
|
+
this.setState({ checklistState: nextChecklistState, messages: newMessages });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
handleCheckboxUpdate = (index) => {
|
|
79
|
+
const { checkboxState } = this.state;
|
|
80
|
+
const nextCheckboxState = checkboxState.map((c, i) => {
|
|
81
|
+
if (i === index) {
|
|
82
|
+
return !checkboxState[i];
|
|
83
|
+
} else {
|
|
84
|
+
return c;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
this.setState({ checkboxState: nextCheckboxState });
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
deletionRequestSchema = (immediateDeletionAllowed) => {
|
|
91
|
+
if (immediateDeletionAllowed) {
|
|
92
|
+
return Yup.object({
|
|
93
|
+
reason: Yup.string().required("Required"),
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
return Yup.object({
|
|
97
|
+
reason: Yup.string().required("Required"),
|
|
98
|
+
comment: Yup.string()
|
|
99
|
+
.min(25, "Please write at least 25 characters")
|
|
100
|
+
.required("Required"),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
handleSubmit = async (values) => {
|
|
106
|
+
this.setState({ loading: true });
|
|
107
|
+
const { record } = this.props;
|
|
108
|
+
const payload = {
|
|
109
|
+
reason: values.reason,
|
|
110
|
+
comment: values.comment,
|
|
111
|
+
};
|
|
112
|
+
if (!("request_deletion" in record.links)) {
|
|
113
|
+
this.setState({ error: "Could not submit deletion request", loading: false });
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.cancellableAction = withCancel(
|
|
117
|
+
http.post(record.links.request_deletion, payload)
|
|
118
|
+
);
|
|
119
|
+
try {
|
|
120
|
+
const response = await this.cancellableAction.promise;
|
|
121
|
+
const data = response.data;
|
|
122
|
+
|
|
123
|
+
if (response.status === 200) {
|
|
124
|
+
window.location.reload();
|
|
125
|
+
} else if (response.status === 201) {
|
|
126
|
+
window.location.href = data.links.self_html;
|
|
127
|
+
}
|
|
128
|
+
} catch (error) {
|
|
129
|
+
this.setState({ error: error });
|
|
130
|
+
console.error(error);
|
|
131
|
+
} finally {
|
|
132
|
+
this.setState({ loading: false });
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
const { open, recordDeletion, options } = this.props;
|
|
138
|
+
const { loading, error, checklistState, checkboxState, messages } = this.state;
|
|
139
|
+
|
|
140
|
+
const { checklist } = recordDeletion;
|
|
141
|
+
|
|
142
|
+
if (!("recordDeletion" in recordDeletion)) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const immediateDeletionAllowed =
|
|
147
|
+
recordDeletion["recordDeletion"]["immediate_deletion"]["allowed"];
|
|
148
|
+
|
|
149
|
+
const modalHeaderText = immediateDeletionAllowed
|
|
150
|
+
? i18next.t("Delete record")
|
|
151
|
+
: i18next.t("Request deletion");
|
|
152
|
+
const deletionButtonText = immediateDeletionAllowed
|
|
153
|
+
? i18next.t("Delete immediately")
|
|
154
|
+
: i18next.t("Request deletion");
|
|
155
|
+
const deletionButtonClass = immediateDeletionAllowed ? "negative" : "primary";
|
|
156
|
+
|
|
157
|
+
const files = recordDeletion["context"]["files"];
|
|
158
|
+
const internalDoi = recordDeletion["context"]["internalDoi"];
|
|
159
|
+
|
|
160
|
+
const formDisabled =
|
|
161
|
+
checkboxState.some((v) => v === false) ||
|
|
162
|
+
checklistState.some((x) => x === true || x === undefined);
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<Modal
|
|
166
|
+
open={open}
|
|
167
|
+
closeIcon
|
|
168
|
+
onClose={this.handleClose}
|
|
169
|
+
role="dialog"
|
|
170
|
+
aria-modal="true"
|
|
171
|
+
tab-index="-1"
|
|
172
|
+
size="tiny"
|
|
173
|
+
closeOnDimmerClick={false}
|
|
174
|
+
onClick={(e) => e.stopPropagation()} // prevent interaction with dropdown
|
|
175
|
+
onKeyDown={(e) => e.stopPropagation()} // prevent interaction with dropdown
|
|
176
|
+
>
|
|
177
|
+
<ModalHeader>{modalHeaderText}</ModalHeader>
|
|
178
|
+
<Formik
|
|
179
|
+
onSubmit={this.handleSubmit}
|
|
180
|
+
validationSchema={this.deletionRequestSchema(immediateDeletionAllowed)}
|
|
181
|
+
initialValues={{ reason: "", comment: "" }}
|
|
182
|
+
validateOnChange={false}
|
|
183
|
+
validateOnBlur={false}
|
|
184
|
+
>
|
|
185
|
+
{({ handleSubmit }) => (
|
|
186
|
+
<Form>
|
|
187
|
+
<ModalContent>
|
|
188
|
+
<>
|
|
189
|
+
{immediateDeletionAllowed ? (
|
|
190
|
+
<p>
|
|
191
|
+
{
|
|
192
|
+
recordDeletion.recordDeletion?.immediate_deletion?.policy
|
|
193
|
+
?.description
|
|
194
|
+
}
|
|
195
|
+
</p>
|
|
196
|
+
) : (
|
|
197
|
+
<p>
|
|
198
|
+
{
|
|
199
|
+
recordDeletion.recordDeletion?.request_deletion?.policy
|
|
200
|
+
?.description
|
|
201
|
+
}
|
|
202
|
+
</p>
|
|
203
|
+
)}
|
|
204
|
+
<Message negative>
|
|
205
|
+
<Icon name="warning sign" />
|
|
206
|
+
{i18next.t("By deleting this record you acknowledge that:")}
|
|
207
|
+
<br />
|
|
208
|
+
<Checkbox
|
|
209
|
+
label={
|
|
210
|
+
/* eslint-disable-next-line jsx-a11y/label-has-associated-control */
|
|
211
|
+
<label>
|
|
212
|
+
<strong>
|
|
213
|
+
{files} file{files !== 1 ? "s" : ""}
|
|
214
|
+
</strong>{" "}
|
|
215
|
+
{i18next.t("will be deleted.")}
|
|
216
|
+
</label>
|
|
217
|
+
}
|
|
218
|
+
className="mt-5 mb-5"
|
|
219
|
+
onChange={() => this.handleCheckboxUpdate(0)}
|
|
220
|
+
/>
|
|
221
|
+
<br />
|
|
222
|
+
{internalDoi ? (
|
|
223
|
+
<Checkbox
|
|
224
|
+
label={
|
|
225
|
+
/* eslint-disable-next-line jsx-a11y/label-has-associated-control */
|
|
226
|
+
<label>
|
|
227
|
+
<strong>{i18next.t("The DOI cannot be reused")}</strong>{" "}
|
|
228
|
+
{i18next.t(
|
|
229
|
+
"and the DOI will resolve to a tombstone page with the record's citation (including title, author/s, publication year and publisher)"
|
|
230
|
+
)}
|
|
231
|
+
</label>
|
|
232
|
+
}
|
|
233
|
+
className="mb-5"
|
|
234
|
+
onChange={() => this.handleCheckboxUpdate(1)}
|
|
235
|
+
/>
|
|
236
|
+
) : (
|
|
237
|
+
<Checkbox
|
|
238
|
+
label={
|
|
239
|
+
/* eslint-disable-next-line jsx-a11y/label-has-associated-control */
|
|
240
|
+
<label>
|
|
241
|
+
{i18next.t(
|
|
242
|
+
"A tombstone page with the citation will replace the record page"
|
|
243
|
+
)}
|
|
244
|
+
</label>
|
|
245
|
+
}
|
|
246
|
+
className="mb-5"
|
|
247
|
+
onChange={() => this.handleCheckboxUpdate(1)}
|
|
248
|
+
/>
|
|
249
|
+
)}
|
|
250
|
+
</Message>
|
|
251
|
+
</>
|
|
252
|
+
{checklist.length > 0 && (
|
|
253
|
+
<>
|
|
254
|
+
<strong>{i18next.t("Record deletion checklist:")}</strong>
|
|
255
|
+
<Table basic="very" unstackable className="mt-0">
|
|
256
|
+
<TableHeader>
|
|
257
|
+
<TableRow>
|
|
258
|
+
<TableHeaderCell />
|
|
259
|
+
<TableHeaderCell>{i18next.t("Yes")}</TableHeaderCell>
|
|
260
|
+
<TableHeaderCell>{i18next.t("No")}</TableHeaderCell>
|
|
261
|
+
</TableRow>
|
|
262
|
+
</TableHeader>
|
|
263
|
+
<TableBody>
|
|
264
|
+
{checklist.map((row, index) => (
|
|
265
|
+
<DeletionRadioGroup
|
|
266
|
+
index={index}
|
|
267
|
+
row={row}
|
|
268
|
+
key={row.name}
|
|
269
|
+
state={checklistState}
|
|
270
|
+
onStateChange={this.handleRadioUpdate}
|
|
271
|
+
/>
|
|
272
|
+
))}
|
|
273
|
+
</TableBody>
|
|
274
|
+
</Table>
|
|
275
|
+
{messages.length > 0 && (
|
|
276
|
+
<Message info>
|
|
277
|
+
{messages.length === 1 ? (
|
|
278
|
+
<p dangerouslySetInnerHTML={{ __html: messages[0] }} />
|
|
279
|
+
) : (
|
|
280
|
+
<Message.List>
|
|
281
|
+
{messages.map((message) => (
|
|
282
|
+
<Message.Item key={message}>
|
|
283
|
+
<p dangerouslySetInnerHTML={{ __html: message }} />
|
|
284
|
+
</Message.Item>
|
|
285
|
+
))}
|
|
286
|
+
</Message.List>
|
|
287
|
+
)}
|
|
288
|
+
</Message>
|
|
289
|
+
)}
|
|
290
|
+
</>
|
|
291
|
+
)}
|
|
292
|
+
<SelectField
|
|
293
|
+
fluid
|
|
294
|
+
fieldPath="reason"
|
|
295
|
+
name="reason"
|
|
296
|
+
label={i18next.t("I want to delete this record because:")}
|
|
297
|
+
options={options}
|
|
298
|
+
required
|
|
299
|
+
disabled={formDisabled}
|
|
300
|
+
/>
|
|
301
|
+
|
|
302
|
+
{!immediateDeletionAllowed && (
|
|
303
|
+
<TextAreaField
|
|
304
|
+
fieldPath="comment"
|
|
305
|
+
name="comment"
|
|
306
|
+
label={i18next.t("Detailed justification:")}
|
|
307
|
+
required
|
|
308
|
+
placeholder={i18next.t(
|
|
309
|
+
"Your justification will not be shared publicly"
|
|
310
|
+
)}
|
|
311
|
+
disabled={formDisabled}
|
|
312
|
+
/>
|
|
313
|
+
)}
|
|
314
|
+
{error && (
|
|
315
|
+
<ErrorMessage
|
|
316
|
+
header={i18next.t("Unable to request deletion.")}
|
|
317
|
+
content={i18next.t(error)}
|
|
318
|
+
icon="exclamation"
|
|
319
|
+
className="text-align-left"
|
|
320
|
+
negative
|
|
321
|
+
/>
|
|
322
|
+
)}
|
|
323
|
+
</ModalContent>
|
|
324
|
+
<ModalActions>
|
|
325
|
+
<Button
|
|
326
|
+
onClick={this.handleClose}
|
|
327
|
+
content={i18next.t("Close")}
|
|
328
|
+
floated="left"
|
|
329
|
+
/>
|
|
330
|
+
<Button
|
|
331
|
+
content={deletionButtonText}
|
|
332
|
+
className={deletionButtonClass}
|
|
333
|
+
icon="trash alternate outline"
|
|
334
|
+
type="submit"
|
|
335
|
+
onClick={(event) => handleSubmit(event)}
|
|
336
|
+
loading={loading}
|
|
337
|
+
disabled={formDisabled || loading}
|
|
338
|
+
/>
|
|
339
|
+
</ModalActions>
|
|
340
|
+
</Form>
|
|
341
|
+
)}
|
|
342
|
+
</Formik>
|
|
343
|
+
</Modal>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
DeletionModal.propTypes = {
|
|
349
|
+
record: PropTypes.object.isRequired,
|
|
350
|
+
open: PropTypes.bool.isRequired,
|
|
351
|
+
handleClose: PropTypes.func.isRequired,
|
|
352
|
+
recordDeletion: PropTypes.object.isRequired,
|
|
353
|
+
options: PropTypes.array.isRequired,
|
|
354
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// This file is part of InvenioRDM
|
|
2
|
+
// Copyright (C) 2025 CERN
|
|
3
|
+
//
|
|
4
|
+
// Invenio-app-rdm is free software; you can redistribute it and/or modify it
|
|
5
|
+
// under the terms of the MIT License; see LICENSE file for more details.
|
|
6
|
+
|
|
7
|
+
import React from "react";
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
import { Radio, FormField, TableRow, TableCell } from "semantic-ui-react";
|
|
10
|
+
|
|
11
|
+
const DeletionRadioGroup = ({ index, row, state, onStateChange }) => {
|
|
12
|
+
return (
|
|
13
|
+
<TableRow key={row.name}>
|
|
14
|
+
<TableCell>{row.label}</TableCell>
|
|
15
|
+
<TableCell>
|
|
16
|
+
<FormField>
|
|
17
|
+
<Radio
|
|
18
|
+
value="Yes"
|
|
19
|
+
checked={state[index] === true}
|
|
20
|
+
onChange={() => onStateChange(index, true)}
|
|
21
|
+
/>
|
|
22
|
+
</FormField>
|
|
23
|
+
</TableCell>
|
|
24
|
+
<TableCell>
|
|
25
|
+
<FormField>
|
|
26
|
+
<Radio
|
|
27
|
+
value="No"
|
|
28
|
+
checked={state[index] === false}
|
|
29
|
+
onChange={() => onStateChange(index, false)}
|
|
30
|
+
/>
|
|
31
|
+
</FormField>
|
|
32
|
+
</TableCell>
|
|
33
|
+
</TableRow>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
DeletionRadioGroup.propTypes = {
|
|
38
|
+
index: PropTypes.number.isRequired,
|
|
39
|
+
row: PropTypes.object.isRequired,
|
|
40
|
+
state: PropTypes.array.isRequired,
|
|
41
|
+
onStateChange: PropTypes.func.isRequired,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default DeletionRadioGroup;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// This file is part of InvenioRDM
|
|
2
|
+
// Copyright (C) 2025.
|
|
3
|
+
//
|
|
4
|
+
// Invenio RDM Records is free software; you can redistribute it and/or modify it
|
|
5
|
+
// under the terms of the MIT License; see LICENSE file for more details.
|
|
6
|
+
|
|
7
|
+
import React, { useState } from "react";
|
|
8
|
+
import { Button, Popup } from "semantic-ui-react";
|
|
9
|
+
import { i18next } from "@translations/invenio_app_rdm/i18next";
|
|
10
|
+
import PropTypes from "prop-types";
|
|
11
|
+
import { DeletionModal } from "./RecordDeletion/DeletionModal";
|
|
12
|
+
|
|
13
|
+
export const RecordDeletion = ({
|
|
14
|
+
disabled,
|
|
15
|
+
record,
|
|
16
|
+
permissions,
|
|
17
|
+
recordDeletion,
|
|
18
|
+
options,
|
|
19
|
+
}) => {
|
|
20
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
21
|
+
const handleOpen = () => setModalOpen(true);
|
|
22
|
+
const handleClose = () => setModalOpen(false);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<Popup
|
|
27
|
+
content={i18next.t("It is not possible to delete this record.")}
|
|
28
|
+
disabled={!disabled}
|
|
29
|
+
trigger={
|
|
30
|
+
<span>
|
|
31
|
+
{recordDeletion.existing_request ? (
|
|
32
|
+
<Button
|
|
33
|
+
fluid
|
|
34
|
+
as="a"
|
|
35
|
+
href={recordDeletion.existing_request}
|
|
36
|
+
className="basic"
|
|
37
|
+
color="red"
|
|
38
|
+
aria-haspopup="dialog"
|
|
39
|
+
icon="external alternate"
|
|
40
|
+
labelPosition="left"
|
|
41
|
+
content={i18next.t("View deletion request")}
|
|
42
|
+
/>
|
|
43
|
+
) : (
|
|
44
|
+
<Button
|
|
45
|
+
fluid
|
|
46
|
+
onClick={handleOpen}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
className="negative"
|
|
49
|
+
aria-haspopup="dialog"
|
|
50
|
+
icon="trash outline alternate"
|
|
51
|
+
labelPosition="left"
|
|
52
|
+
content={i18next.t("Delete record")}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
</span>
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
<DeletionModal
|
|
59
|
+
record={record}
|
|
60
|
+
open={modalOpen}
|
|
61
|
+
handleClose={handleClose}
|
|
62
|
+
permissions={permissions}
|
|
63
|
+
recordDeletion={recordDeletion}
|
|
64
|
+
options={options}
|
|
65
|
+
/>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
RecordDeletion.propTypes = {
|
|
71
|
+
disabled: PropTypes.bool,
|
|
72
|
+
record: PropTypes.object.isRequired,
|
|
73
|
+
permissions: PropTypes.object.isRequired,
|
|
74
|
+
recordDeletion: PropTypes.object,
|
|
75
|
+
options: PropTypes.array.isRequired,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
RecordDeletion.defaultProps = {
|
|
79
|
+
disabled: false,
|
|
80
|
+
recordDeletion: {},
|
|
81
|
+
};
|