Skip to content

Commit

Permalink
administration: fix UI
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova authored and kpsherva committed Feb 10, 2025
1 parent 4d626f1 commit db96430
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export class RecordResourceActions extends Component {
};
}

onModalTriggerClick = (e, { payloadSchema, dataName, dataActionKey }) => {
onModalTriggerClick = (
e,
{ payloadSchema, dataName, dataActionKey, actionConfig }
) => {
const { resource } = this.props;

if (dataActionKey === "delete") {
Expand Down Expand Up @@ -63,6 +66,7 @@ export class RecordResourceActions extends Component {
actionSuccessCallback={this.handleSuccess}
actionCancelCallback={this.closeModal}
resource={resource}
actionConfig={actionConfig}
/>
),
});
Expand Down Expand Up @@ -106,7 +110,7 @@ export class RecordResourceActions extends Component {
labelPosition="left"
>
<Icon name="trash alternate" />
{actionConfig.text}
{actionConfig.text}...
</Element>
);
} else if (actionKey === "restore" && resource.deletion_status.is_deleted) {
Expand All @@ -122,19 +126,21 @@ export class RecordResourceActions extends Component {
labelPosition="left"
>
<Icon name="undo" />
{actionConfig.text}
{actionConfig.text}...
</Element>
);
} else if (!resource.deletion_status.is_deleted && actionKey !== "restore") {
return (
<Element
key={actionKey}
onClick={this.onModalTriggerClick}
onClick={(e, data) =>
this.onModalTriggerClick(e, { ...data, actionConfig: actionConfig })
}
payloadSchema={actionConfig.payload_schema}
dataName={actionConfig.text}
dataActionKey={actionKey}
>
{actionConfig.text}
{actionConfig.text}...
</Element>
);
}
Expand Down
4 changes: 3 additions & 1 deletion invenio_communities/communities/services/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
SearchOptionsMixin,
)
from invenio_records_resources.services.files.links import FileLink
from invenio_records_resources.services.records.config import RecordServiceConfig
from invenio_records_resources.services.records.config import (
RecordServiceConfig,
)
from invenio_records_resources.services.records.config import (
SearchOptions as SearchOptionsBase,
)
Expand Down

0 comments on commit db96430

Please sign in to comment.