Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
registration invitations
Browse files Browse the repository at this point in the history
fixed resources
  • Loading branch information
smarcet committed May 3, 2023
1 parent e7dc86e commit 02f40cb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
35 changes: 24 additions & 11 deletions src/actions/registration-invitation-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ import {
putRequest,
deleteRequest,
showMessage,
showSuccessMessage
} from 'openstack-uicore-foundation/lib/utils/actions';
import history from "../history";
import {getAccessTokenSafely} from '../utils/methods';

import {getSentEmailsByTemplatesAndEmail} from './email-actions';
export const REQUEST_INVITATIONS = 'REQUEST_INVITATIONS';
export const RECEIVE_INVITATIONS = 'RECEIVE_INVITATIONS';
export const INVITATIONS_IMPORTED = 'INVITATIONS_IMPORTED';
Expand Down Expand Up @@ -110,7 +109,6 @@ export const getInvitations = ( term = null, page = 1, perPage = 10, order = 'id
}
);
};

export const importInvitationsCSV = (file) => async (dispatch, getState) => {
const { currentSummitState } = getState();
const accessToken = await getAccessTokenSafely();
Expand Down Expand Up @@ -297,17 +295,28 @@ export const saveRegistrationInvitation = (entity) => async (dispatch, getState)
entity
)(params)(dispatch)
.then((payload) => {
dispatch(showSuccessMessage(T.translate("edit_registration_invitation.registration_invitation_saved")));
dispatch(showMessage(
{
title: T.translate("general.done"),
html: T.translate("edit_registration_invitation.registration_invitation_saved"),
type: 'success'
},
() => {
getRegistrationInvitation(payload.response.id)(dispatch, getState).then((payload) => {
getSentEmailsByTemplatesAndEmail(
[
'SUMMIT_REGISTRATION_INVITE_REGISTRATION',
'SUMMIT_REGISTRATION_REINVITE_REGISTRATION'
],
payload.email
)(dispatch, getState)
});
}
));
});
return;
}

const success_message = {
title: T.translate("general.done"),
html: T.translate("edit_registration_invitation.registration_invitation_created"),
type: 'success'
};

postRequest(
createAction(UPDATE_REGISTRATION_INVITATION),
createAction(REGISTRATION_INVITATION_ADDED),
Expand All @@ -318,7 +327,11 @@ export const saveRegistrationInvitation = (entity) => async (dispatch, getState)
) (params)(dispatch)
.then((payload) => {
dispatch(showMessage(
success_message,
{
title: T.translate("general.done"),
html: T.translate("edit_registration_invitation.registration_invitation_created"),
type: 'success'
},
() => { history.push(`/app/summits/${currentSummit.id}/registration-invitations/${payload.response.id}`) }
));
});
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,7 @@
"first_name": "First Name",
"last_name": "Last Name",
"completed": "Completed",
"is_accepted": "Is Accepted?",
"sent": "Is Sent?",
"allowed_ticket_types": "Allowed Ticket Types",
"invitation_list": "Invitations",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tickets/registration-invitations-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class RegistrationInvitationsListPage extends React.Component {
{ columnKey: 'email', value: T.translate("registration_invitation_list.email") },
{ columnKey: 'first_name', value: T.translate("registration_invitation_list.first_name") },
{ columnKey: 'last_name', value: T.translate("registration_invitation_list.last_name") },
{ columnKey: 'is_accepted', value: T.translate("registration_invitation_list.completed") },
{ columnKey: 'is_accepted', value: T.translate("registration_invitation_list.is_accepted") },
{ columnKey: 'is_sent', value: T.translate("registration_invitation_list.sent") },
{ columnKey: 'allowed_ticket_types', value: T.translate("registration_invitation_list.allowed_ticket_types"), render: (t) =>
t.allowed_ticket_types_full.length > MaxTextLengthForTicketTypesOnTable ?
Expand Down

0 comments on commit 02f40cb

Please sign in to comment.