Skip to content

Commit a306450

Browse files
administration: fix UI
* closes CERNDocumentServer/cds-rdm#322
1 parent 4d626f1 commit a306450

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

invenio_communities/assets/semantic-ui/js/invenio_communities/administration/components/RecordResourceActions.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export class RecordResourceActions extends Component {
2525
};
2626
}
2727

28-
onModalTriggerClick = (e, { payloadSchema, dataName, dataActionKey }) => {
28+
onModalTriggerClick = (
29+
e,
30+
{ payloadSchema, dataName, dataActionKey, actionConfig }
31+
) => {
2932
const { resource } = this.props;
3033

3134
if (dataActionKey === "delete") {
@@ -63,6 +66,7 @@ export class RecordResourceActions extends Component {
6366
actionSuccessCallback={this.handleSuccess}
6467
actionCancelCallback={this.closeModal}
6568
resource={resource}
69+
actionConfig={actionConfig}
6670
/>
6771
),
6872
});
@@ -106,7 +110,7 @@ export class RecordResourceActions extends Component {
106110
labelPosition="left"
107111
>
108112
<Icon name="trash alternate" />
109-
{actionConfig.text}
113+
{actionConfig.text}...
110114
</Element>
111115
);
112116
} else if (actionKey === "restore" && resource.deletion_status.is_deleted) {
@@ -122,19 +126,21 @@ export class RecordResourceActions extends Component {
122126
labelPosition="left"
123127
>
124128
<Icon name="undo" />
125-
{actionConfig.text}
129+
{actionConfig.text}...
126130
</Element>
127131
);
128132
} else if (!resource.deletion_status.is_deleted && actionKey !== "restore") {
129133
return (
130134
<Element
131135
key={actionKey}
132-
onClick={this.onModalTriggerClick}
136+
onClick={(e, data) =>
137+
this.onModalTriggerClick(e, { ...data, actionConfig: actionConfig })
138+
}
133139
payloadSchema={actionConfig.payload_schema}
134140
dataName={actionConfig.text}
135141
dataActionKey={actionKey}
136142
>
137-
{actionConfig.text}
143+
{actionConfig.text}...
138144
</Element>
139145
);
140146
}

invenio_communities/communities/services/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
SearchOptionsMixin,
2020
)
2121
from invenio_records_resources.services.files.links import FileLink
22-
from invenio_records_resources.services.records.config import RecordServiceConfig
22+
from invenio_records_resources.services.records.config import (
23+
RecordServiceConfig,
24+
)
2325
from invenio_records_resources.services.records.config import (
2426
SearchOptions as SearchOptionsBase,
2527
)

0 commit comments

Comments
 (0)