File tree Expand file tree Collapse file tree 7 files changed +68
-2
lines changed
templates/semantic-ui/invenio_app_rdm/records
js/invenio_app_rdm/deposit
less/invenio_app_rdm/file_uploader Expand file tree Collapse file tree 7 files changed +68
-2
lines changed Original file line number Diff line number Diff line change @@ -1471,3 +1471,6 @@ def github_link_render(record):
1471
1471
1472
1472
APP_RDM_SUBCOMMUNITIES_LABEL = "Subcommunities"
1473
1473
"""Label for the subcommunities in the community browse page."""
1474
+
1475
+ APP_RDM_DEPOSIT_NG_FILES_UI = False
1476
+ """Feature toggle to enable the new Uppy uploader for the deposit form."""
Original file line number Diff line number Diff line change 5
5
{%- block css %}
6
6
{{ super() }}
7
7
< link rel ="stylesheet " type ="text/css " href ="/communities/{{community.slug}}/community-theme-{{ community.revision_id }}.css ">
8
+ {%- if config.APP_RDM_DEPOSIT_NG_FILES_UI %}
9
+ {{ webpack['uppy-file-uploader.css'] }}
10
+ {%- endif %}
8
11
{%- endblock %}
9
12
{%- endif %}
10
13
49
52
value ='{{ config.USERS_RESOURCES_GROUPS_ENABLED | tojson }} '>
50
53
< input type ="hidden " name ="records-resources-allow-empty-files "
51
54
value ='{{ config.RECORDS_RESOURCES_ALLOW_EMPTY_FILES | tojson }} '>
55
+ < input type ="hidden " name ="deposits-use-uppy-ui "
56
+ value ='{{ config.APP_RDM_DEPOSIT_NG_FILES_UI | tojson }} '>
52
57
53
58
{%- if forms_config %}
54
59
< input type ="hidden " name ="deposits-config "
Original file line number Diff line number Diff line change 10
10
# under the terms of the MIT License; see LICENSE file for more details.
11
11
12
12
"""Routes for record-related pages provided by Invenio-App-RDM."""
13
-
14
13
from copy import deepcopy
15
14
16
15
from flask import current_app , g , redirect
25
24
from invenio_rdm_records .resources .serializers import UIJSONSerializer
26
25
from invenio_rdm_records .services .schemas import RDMRecordSchema
27
26
from invenio_rdm_records .services .schemas .utils import dump_empty
27
+ from invenio_records_resources .proxies import current_transfer_registry
28
28
from invenio_records_resources .services .errors import PermissionDeniedError
29
29
from invenio_search .engine import dsl
30
30
from invenio_vocabularies .proxies import current_service as vocabulary_service
@@ -387,6 +387,8 @@ def get_form_config(**kwargs):
387
387
publish_modal_extra = current_app .config .get (
388
388
"APP_RDM_DEPOSIT_FORM_PUBLISH_MODAL_EXTRA"
389
389
),
390
+ default_transfer_type = current_transfer_registry .default_transfer_type ,
391
+ transfer_types = list (current_transfer_registry .get_transfer_types ()),
390
392
** kwargs ,
391
393
)
392
394
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
20
20
DeleteButton ,
21
21
DepositStatusBox ,
22
22
FileUploader ,
23
+ UppyUploader ,
23
24
FormFeedback ,
24
25
IdentifiersField ,
25
26
PIDField ,
@@ -114,13 +115,15 @@ export class RDMDepositForm extends Component {
114
115
allowRecordRestriction,
115
116
groupsEnabled,
116
117
allowEmptyFiles,
118
+ useUppy
117
119
} = this . props ;
118
120
119
121
// Adding section id to custom fields UI, to be used for accordions
120
122
const customFieldsUI = this . config . custom_fields . ui . map ( ( section ) => ( {
121
123
...section ,
122
124
id : section . section . toLowerCase ( ) . replace ( / \s + / g, "-" ) + "-section" ,
123
125
} ) ) ;
126
+ const UploaderField = useUppy ? UppyUploader : FileUploader ;
124
127
125
128
return (
126
129
< Overridable
@@ -136,13 +139,15 @@ export class RDMDepositForm extends Component {
136
139
groupsEnabled = { groupsEnabled }
137
140
allowEmptyFiles = { allowEmptyFiles }
138
141
customFieldsUI = { customFieldsUI }
142
+ useUppy = { useUppy }
139
143
>
140
144
< DepositFormApp
141
145
config = { this . config }
142
146
record = { record }
143
147
preselectedCommunity = { preselectedCommunity }
144
148
files = { files }
145
149
permissions = { permissions }
150
+ useUppy = { useUppy }
146
151
>
147
152
< Overridable
148
153
id = "InvenioAppRdm.Deposit.FormFeedback.container"
@@ -196,7 +201,7 @@ export class RDMDepositForm extends Component {
196
201
filesLocked = { filesLocked }
197
202
allowEmptyFiles = { allowEmptyFiles }
198
203
>
199
- < FileUploader
204
+ < UploaderField
200
205
isDraftRecord = { ! record . is_published }
201
206
quota = { this . config . quota }
202
207
decimalSizeDisplay = { this . config . decimal_size_display }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ ReactDOM.render(
21
21
preselectedCommunity = { getInputFromDOM ( "deposits-draft-community" ) }
22
22
files = { getInputFromDOM ( "deposits-record-files" ) }
23
23
config = { getInputFromDOM ( "deposits-config" ) }
24
+ useUppy = { getInputFromDOM ( "deposits-use-uppy-ui" ) }
24
25
permissions = { getInputFromDOM ( "deposits-record-permissions" ) }
25
26
filesLocked = { getInputFromDOM ( "deposits-record-locked-files" ) }
26
27
recordRestrictionGracePeriod = { getInputFromDOM (
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (C) 2025 CESNET
3
+ *
4
+ * Invenio RDM Records is free software; you can redistribute it and/or modify
5
+ * it under the terms of the MIT License; see LICENSE file for more details.
6
+ */
7
+
8
+ @import " @uppy/core/dist/style.min.css" ;
9
+ @import " @uppy/dashboard/dist/style.min.css" ;
10
+ @import " @uppy/image-editor/dist/style.min.css" ;
11
+
12
+ .uppy-Dashboard-AddFiles {
13
+ padding : 1.2rem ;
14
+ }
15
+ .uppy-Dashboard-AddFiles-info {
16
+ display : block ;
17
+ }
18
+
19
+ .uppy-Dashboard-note {
20
+ padding-top : 3rem ;
21
+ }
22
+
23
+ .uppy-Dashboard-inner {
24
+ border-radius : 0 0 5px 5px ;
25
+ }
26
+
27
+ .uppy-DashboardTab [data- uppy- acquirer- id= " MyDevice" ] {
28
+ // .sr-only
29
+ position : absolute ;
30
+ width : 1px ;
31
+ height : 1px ;
32
+ padding : 0 ;
33
+ overflow : hidden ;
34
+ clip : rect (0 , 0 , 0 , 0 );
35
+ word-wrap : normal ;
36
+ border : 0 ;
37
+ }
38
+
39
+ .uppy-Dashboard-innerWrap {
40
+ height : 300px ;
41
+
42
+ & :has(#uppy-DashboardContent-panel--editor ) {
43
+ height : 500px ;
44
+ }
45
+ }
46
+
47
+ .uppy-DashboardContent-bar , .uppy-StatusBar {
48
+ z-index : 10 ;
49
+ }
Original file line number Diff line number Diff line change 40
40
"invenio-domains-administration" : "./js/invenio_app_rdm/administration/domains/index.js" ,
41
41
"invenio-audit-logs-administration" : "./js/invenio_app_rdm/administration/auditLogs/index.js" ,
42
42
"invenio-communities-browse" : "./js/invenio_app_rdm/subcommunity/browse.js" ,
43
+ "uppy-file-uploader" : "./less/invenio_app_rdm/file_uploader/uppy.less" ,
43
44
},
44
45
dependencies = {
45
46
"@babel/runtime" : "^7.9.0" ,
You can’t perform that action at this time.
0 commit comments