Skip to content

Commit

Permalink
communityModal: pass record as prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Sep 8, 2023
1 parent efa6e92 commit a4a0a83
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ export class RDMDepositForm extends Component {
</Overridable>

<Overridable id="InvenioAppRdm.Deposit.CommunityHeader.container">
<CommunityHeader imagePlaceholderLink="/static/images/square-placeholder.png" />
<CommunityHeader
imagePlaceholderLink="/static/images/square-placeholder.png"
record={record}
/>
</Overridable>
<Container id="rdm-deposit-form" className="rel-mt-1">
<Grid className="mt-25">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class CommunitiesManagement extends Component {
recordCommunityEndpoint,
recordUserCommunitySearchConfig,
searchConfig,
record,
} = this.props;
const { communities, loading, error, manageCommunitiesModalOpen } = this.state;
return (
Expand All @@ -114,6 +115,7 @@ export class CommunitiesManagement extends Component {
recordCommunitySearchConfig={recordCommunitySearchConfig}
recordUserCommunitySearchConfig={recordUserCommunitySearchConfig}
toggleManageCommunitiesModal={this.toggleManageCommunitiesModal}
record={record}
/>
)}
</Header>
Expand Down Expand Up @@ -165,4 +167,5 @@ CommunitiesManagement.propTypes = {
canManageRecord: PropTypes.bool.isRequired,
userCommunitiesMemberships: PropTypes.object.isRequired,
searchConfig: PropTypes.object.isRequired,
record: PropTypes.object.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class CommunitiesManagementDropdown extends Component {
recordCommunitySearchConfig,
recordCommunityEndpoint,
recordUserCommunitySearchConfig,
record,
} = this.props;

const options = [
Expand Down Expand Up @@ -152,6 +153,7 @@ export class CommunitiesManagementDropdown extends Component {
recordCommunityEndpoint={recordCommunityEndpoint}
recordCommunitySearchConfig={recordCommunitySearchConfig}
recordUserCommunitySearchConfig={recordUserCommunitySearchConfig}
record={record}
/>
<PendingCommunitiesModal
modalOpen={pendingRequestModalOpen}
Expand All @@ -173,6 +175,7 @@ CommunitiesManagementDropdown.propTypes = {
toggleManageCommunitiesModal: PropTypes.func.isRequired,
actionSucceed: PropTypes.func,
searchConfig: PropTypes.object.isRequired,
record: PropTypes.object.isRequired,
};

CommunitiesManagementDropdown.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class RecordCommunitiesListModal extends Component {
handleOnClose,
trigger,
permissions,
record,
} = this.props;

return (
Expand All @@ -44,6 +45,7 @@ export class RecordCommunitiesListModal extends Component {
recordCommunityEndpoint={recordCommunityEndpoint}
successActionCallback={successActionCallback}
permissions={permissions}
record={record}
/>

<Modal.Actions>
Expand All @@ -62,6 +64,7 @@ RecordCommunitiesListModal.propTypes = {
handleOnClose: PropTypes.func.isRequired,
handleOnOpen: PropTypes.func.isRequired,
permissions: PropTypes.object.isRequired,
record: PropTypes.object.isRequired,
};

RecordCommunitiesListModal.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ export class RecordCommunitiesSearch extends Component {
};

render() {
const { recordCommunityEndpoint, permissions } = this.props;
const { recordCommunityEndpoint, permissions, record } = this.props;
const overriddenComponents = {
[`${appName}.ResultsList.item`]: parametrize(RecordCommunitiesSearchItem, {
recordCommunityEndpoint: recordCommunityEndpoint,
successCallback: this.handleSuccessCallback,
permissions: permissions,
record: record,
}),
};

Expand Down Expand Up @@ -90,4 +91,5 @@ RecordCommunitiesSearch.propTypes = {
recordCommunityEndpoint: PropTypes.string.isRequired,
successActionCallback: PropTypes.func.isRequired,
permissions: PropTypes.object.isRequired,
record: PropTypes.object.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class RecordCommunitySubmissionModal extends Component {
recordUserCommunitySearchConfig,
recordCommunitySearchConfig,
handleClose,
record,
} = this.props;
const apiConfigs = {
allCommunities: {
Expand All @@ -126,6 +127,7 @@ export class RecordCommunitySubmissionModal extends Component {
modalHeader={i18next.t("Select a community")}
apiConfigs={apiConfigs}
handleClose={handleClose}
record={record}
/>
{confirmationModalOpen && (
<SubmitReviewModal
Expand All @@ -152,6 +154,7 @@ RecordCommunitySubmissionModal.propTypes = {
recordCommunitySearchConfig: PropTypes.object.isRequired,
recordUserCommunitySearchConfig: PropTypes.string.isRequired,
handleClose: PropTypes.func.isRequired,
record: PropTypes.object.isRequired,
};

RecordCommunitySubmissionModal.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ if (sidebarCommunitiesManageDiv) {
recordCommunitySearchConfig={recordCommunitySearchConfig}
permissions={JSON.parse(sidebarCommunitiesManageDiv.dataset.permissions)}
searchConfig={JSON.parse(pendingCommunitiesSearchConfig)}
record={JSON.parse(recordCitationAppDiv.dataset.record)}
/>,
sidebarCommunitiesManageDiv
);
Expand Down

0 comments on commit a4a0a83

Please sign in to comment.