From 110e35e8fc55cbe4c45a462dbef94d4fec561a96 Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:27:20 +0530 Subject: [PATCH 1/6] updated some text related to signup event --- src/assets/languages/en.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/assets/languages/en.json b/src/assets/languages/en.json index f02d3e1ad..392e3b6f7 100644 --- a/src/assets/languages/en.json +++ b/src/assets/languages/en.json @@ -1626,7 +1626,9 @@ "invitationAdminMsg": "You can't signup the event \"event_name\" as you are the host.", "invitationCancelMsg": "Event \"event_name\" has been canceled by the host.", "eventStartedMsg": "Event \"event_name\" is already started. You can not signup this event now.", - "allSlotsFullMsg":"All event slots are full you cannot signup the event now.", + "allSlotsFullMsg": "All event slots are full. You cannot signup the event now.", + "slotFullMsg": "Event slot is full. You cannot signup this event now.", + "slotsFullMsg": "Event slots are full. You cannot signup this event now.", "slotTable": { "heading": "Time Slots", "title": "Title", -- GitLab From b1653a6ce35e36084205f8481a1630274d528f86 Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:27:57 +0530 Subject: [PATCH 2/6] implemented some new changes and fixed some issues --- .../SignupEventHistoryRightPanel.js | 12 ++++++++++++ .../SignupEventInvitationMiddlePanel.js | 14 ++++++++------ .../SignupEventInvitationRightPanel.js | 9 ++++++--- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/componets/SignupEventComponents/SignupEventHistory/SignupEventHistoryRightPanel/SignupEventHistoryRightPanel.js b/src/componets/SignupEventComponents/SignupEventHistory/SignupEventHistoryRightPanel/SignupEventHistoryRightPanel.js index a902f17ee..832914e57 100644 --- a/src/componets/SignupEventComponents/SignupEventHistory/SignupEventHistoryRightPanel/SignupEventHistoryRightPanel.js +++ b/src/componets/SignupEventComponents/SignupEventHistory/SignupEventHistoryRightPanel/SignupEventHistoryRightPanel.js @@ -233,6 +233,18 @@ class SignupEventHistoryRightPanel extends React.Component {
{moment(currentEventProfile.eventProfile.eventSlotsList[0].endDate + " " + currentEventProfile.eventProfile.eventSlotsList[0].endTime).format("DD-MMM-YYYY hh:mm A")}
+
  • +
    +
    {t('eventSignup.eventSignupHistory.totalAllowed')}
    +
    {currentEventProfile.eventProfile.eventSlotsList[0].maxAllowed === 0 ? t('eventSignup.eventSignupHistory.noLimit') : currentEventProfile.eventProfile.eventSlotsList[0].maxAllowed}
    +
    +
  • +
  • +
    +
    {t('eventSignup.eventSignupHistory.totalSignedup')}
    +
    {currentEventProfile.eventProfile.eventSlotsList[0].totalSignedup}
    +
    +
  • : diff --git a/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationMiddlePanel/SignupEventInvitationMiddlePanel.js b/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationMiddlePanel/SignupEventInvitationMiddlePanel.js index 7c74ed7aa..f611a9ddb 100644 --- a/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationMiddlePanel/SignupEventInvitationMiddlePanel.js +++ b/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationMiddlePanel/SignupEventInvitationMiddlePanel.js @@ -23,7 +23,7 @@ class SignupEventInvitationMiddlePanel extends React.Component { }; render() { - const { classes, showSlotDetail, isShowEdit, editInvitation, showEdit, t, currentEventInvitation, handleNoteChange, invitationNote, activeSection } = this.props; + const { classes, showSlotDetail, isShowEdit, isAllSlotsFull, editInvitation, showEdit, t, currentEventInvitation, handleNoteChange, invitationNote, activeSection } = this.props; return (
    @@ -42,9 +42,11 @@ class SignupEventInvitationMiddlePanel extends React.Component { } */} {currentEventInvitation.isEditable && <> - + {!isShowEdit && + + } {currentEventInvitation.rsvp !== 1 &&
    - {isShowEdit && + {(isShowEdit && !isAllSlotsFull) &&
    diff --git a/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationRightPanel/SignupEventInvitationRightPanel.js b/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationRightPanel/SignupEventInvitationRightPanel.js index 11857f48e..06bc9f181 100644 --- a/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationRightPanel/SignupEventInvitationRightPanel.js +++ b/src/componets/SignupEventComponents/SignupEventInvitation/SignupEventInvitationRightPanel/SignupEventInvitationRightPanel.js @@ -70,19 +70,19 @@ class SignupEventInvitationRightPanel extends React.Component {
  • {t('eventSignup.slotTable.startDateTime')}
    -
    {moment(slotList[0].startDate + " " + slotList[0].startTime).format("DD-MMM-YYYY hh:mm A")}
    +
    {moment(currentEventInvitation.event.eventSlotsList[0].startDate + " " + currentEventInvitation.event.eventSlotsList[0].startTime).format("DD-MMM-YYYY hh:mm A")}
  • {t('eventSignup.slotTable.endDateTime')}
    -
    {moment(slotList[0].endDate + " " + slotList[0].endTime).format("DD-MMM-YYYY hh:mm A")}
    +
    {moment(currentEventInvitation.event.eventSlotsList[0].endDate + " " + currentEventInvitation.event.eventSlotsList[0].endTime).format("DD-MMM-YYYY hh:mm A")}
  • } - {currentEventInvitation.event.eventSlotsList.length !== 1 && + {(currentEventInvitation.event.eventSlotsList.length > 0 && currentEventInvitation.event.eventSlotsList.length !== 1) &&
    @@ -134,6 +134,9 @@ class SignupEventInvitationRightPanel extends React.Component {
    } + {currentEventInvitation.event.eventSlotsList.length === 0 && + {t('eventSignup.slotsFullMsg')} + }
    -- GitLab From f268c15ac567b6fcc0a606e4962cf76a39ff71dc Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:28:35 +0530 Subject: [PATCH 3/6] updated edit invitation function --- .../EventInvitation/InvitationScreen.js | 53 ++++++++++++++----- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/src/containers/EventInvitation/InvitationScreen.js b/src/containers/EventInvitation/InvitationScreen.js index e9c3607b5..bcdcc9857 100644 --- a/src/containers/EventInvitation/InvitationScreen.js +++ b/src/containers/EventInvitation/InvitationScreen.js @@ -50,7 +50,7 @@ const styles = theme => (stylesFunc( )); const allSlotsFullMsg = "All event slots are full you cannot signup the event now."; -const slotsFulllMsg = "You cannot signup these slots."; +const slotsFulllMsg = "You cannot signup"; class InvitationScreen extends PureComponent { static propTypes = { @@ -112,6 +112,7 @@ class InvitationScreen extends PureComponent { }); } + let eventSlotsLength = nextProps.eventProfileDetail.eventProfileDetail.eventSlotsList.length; let currentTime = (moment().valueOf()) / 1000; currentTime = parseInt(currentTime); @@ -135,6 +136,21 @@ class InvitationScreen extends PureComponent { isEventSubmited: true }); + } else if (eventSlotsLength === 1) { + + let selectedSlots = this.state.selectedSlot; + selectedSlots.push(nextProps.eventProfileDetail.eventProfileDetail.eventSlotsList[0].eventSlotId); + this.setState({ + selectedSlot: selectedSlots + }) + let maxAllowed = nextProps.eventProfileDetail.eventProfileDetail.eventSlotsList[0].maxAllowed; + let totalSignedup = nextProps.eventProfileDetail.eventProfileDetail.eventSlotsList[0].totalSignedup; + if (totalSignedup >= maxAllowed) { + this.setState({ + responseText: this.props.t('eventSignup.slotFullMsg'), + isEventSubmited: true + }); + } } this.setState({ @@ -165,7 +181,20 @@ class InvitationScreen extends PureComponent { } } - if (nextProps.updateInvitationResError !== null) { + if (nextProps.updateInvitationRes !== null) { + + console.log("nextProps.updateInvitationRes, ",nextProps.updateInvitationRes); + this.setState({ + isUpdateEvent: false, + isInvBtnDisable: false, + // isShowDashboardBtn: true, + responseText: this.props.t('eventSignup.eventSignupInvitation.invitationMsg'), + isEventSubmited: true + }); + + } else if (nextProps.updateInvitationResError !== null) { + + console.log("nextProps.updateInvitationResError, ",nextProps.updateInvitationResError); this.setState({ isUpdateEvent: false, @@ -196,16 +225,6 @@ class InvitationScreen extends PureComponent { }); } } - - if (nextProps.updateInvitationRes !== null) { - this.setState({ - isUpdateEvent: false, - isInvBtnDisable: false, - // isShowDashboardBtn: true, - responseText: this.props.t('eventSignup.eventSignupInvitation.invitationMsg'), - isEventSubmited: true - }); - } } handleAllSlotFull = () => { @@ -276,9 +295,15 @@ class InvitationScreen extends PureComponent { console.log(""); let eventId = this.state.eventProfileDetail.eventProfileDetail.eventId; - // const eventId = '92ce7c9e-f9a6-4c7c-b6aa-fe6e78e01df8'; let userType = 4; - this.props.navigateToUpdateEventInvitation(eventId, false, this.state.invitationNote, rsvp, userType, this.state.selectedSlot, this.state.userName, this.state.token); + + if (rsvp === 1) { + this.setState({ selectedSlot: [] }, () => { + this.props.navigateToUpdateEventInvitation(eventId, false, this.state.invitationNote, rsvp, userType, this.state.selectedSlot, this.state.userName, this.state.token); + }) + } else { + this.props.navigateToUpdateEventInvitation(eventId, false, this.state.invitationNote, rsvp, userType, this.state.selectedSlot, this.state.userName, this.state.token); + } } } -- GitLab From f8c914f95750c98c098016ed0a408bce7e205a1a Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:29:21 +0530 Subject: [PATCH 4/6] updated edit invitation function in reducer --- src/core/resource/signupevent/SignupEventReducer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/resource/signupevent/SignupEventReducer.js b/src/core/resource/signupevent/SignupEventReducer.js index a7f67d235..e9b7ddaaa 100644 --- a/src/core/resource/signupevent/SignupEventReducer.js +++ b/src/core/resource/signupevent/SignupEventReducer.js @@ -206,7 +206,11 @@ const handleGetEventInvitationError = state => ({ //updateEventInvitation const handleUpdateEventInvitationRequest = state => ({ ...state, - ...{ isUpdateEventInvitationPending: true } + ...{ + isUpdateEventInvitationPending: true, + updateInvitationRes: null, + updateInvitationResError: null + } }); const handleUpdateEventInvitationSuccess = (state, payload) => { @@ -374,7 +378,7 @@ const handleCancelEventError = (state, payload) => ({ }); const handleClearStoreRequest = (state, payload) => { let resetStartVars = {}; - if(payload.isClear == 'createEventSteps'){ + if (payload.isClear == 'createEventSteps') { resetStartVars = { isCreateEventStep1: false, isCreateEventStep2: false, isCreateEventStep3: false }; } return ({ -- GitLab From 9c0d98427298c6be7345693ba26584c7979193d5 Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:29:53 +0530 Subject: [PATCH 5/6] implement some new changes --- .../EventSignupInvitation.js | 47 +++++++++++++------ .../EventSignupInvitation.styles.js | 10 ++++ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/layouts/EventSignupInvitation/EventSignupInvitation.js b/src/layouts/EventSignupInvitation/EventSignupInvitation.js index b9297661a..de4094dbc 100644 --- a/src/layouts/EventSignupInvitation/EventSignupInvitation.js +++ b/src/layouts/EventSignupInvitation/EventSignupInvitation.js @@ -17,7 +17,8 @@ import { bindActionCreators } from 'redux'; const styles = theme => (stylesFunc(theme, contactAvatarImg)); const allSlotsFullMsg = "All event slots are full you cannot signup the event now."; -const slotsFulllMsg = "You cannot signup these slots."; +const slotsFulllMsg = "You cannot signup"; +const slotFulllMsg = "Event slot is full you cannot signup this event now."; class EventSignupInvitation extends React.Component { @@ -42,7 +43,8 @@ class EventSignupInvitation extends React.Component { eventSlotDetails: {}, activeSection: 0, isShowCancel: false, - isCancelling: false + isCancelling: false, + isAllSlotsFull: false }; this.invitationRightRef = React.createRef(); @@ -98,13 +100,20 @@ class EventSignupInvitation extends React.Component { selectedSlot: [...selectedSlots] }); - value.event.eventSlotsList.forEach(element => { - let eventSlotDetails = this.state.eventSlotDetails; - eventSlotDetails[element.eventSlotId] = element; - this.setState({ - eventSlotDetails: eventSlotDetails - }) - }); + if (value.event.eventSlotsList.length > 0) { + + this.setState({ isAllSlotsFull: false }); + + value.event.eventSlotsList.forEach(element => { + let eventSlotDetails = this.state.eventSlotDetails; + eventSlotDetails[element.eventSlotId] = element; + this.setState({ + eventSlotDetails: eventSlotDetails + }) + }); + } else { + this.setState({ isAllSlotsFull: true }); + } this.handleShowSlotDetail(true); @@ -157,7 +166,12 @@ class EventSignupInvitation extends React.Component { }) } else { - this.props.navigateToUpdateEventInvitation(eventId, isGoogleCalendar, note, rsvp, userType, this.state.selectedSlot, this.state.userName); + + let eventSlots = this.state.currentEventInvitation.event.eventSlotsList.length !== 0 ? [this.state.currentEventInvitation.event.eventSlotsList[0].eventSlotId] : []; + let selectedSlots = this.state.currentEventInvitation.event.eventSlotsList.length === 1 ? + eventSlots + : this.state.selectedSlot; + this.props.navigateToUpdateEventInvitation(eventId, isGoogleCalendar, note, rsvp, userType, selectedSlots, this.state.userName); } } } @@ -219,7 +233,7 @@ class EventSignupInvitation extends React.Component { if (nextProps.updateInvitationResError.data && nextProps.updateInvitationResError.data.error) { let responseText = nextProps.updateInvitationResError.data.error.message; - if (responseText.includes(slotsFulllMsg) || responseText.includes(allSlotsFullMsg)) { + if (responseText.includes(slotsFulllMsg) || responseText.includes(allSlotsFullMsg) || responseText.includes(slotFulllMsg)) { this.props.actions.showToast({ text: nextProps.updateInvitationResError.data.error.message, duration: 5000, @@ -302,7 +316,7 @@ class EventSignupInvitation extends React.Component { - {this.state.isShowEdit && + {(this.state.isShowEdit) &&
    {/* */} - + {!this.state.isAllSlotsFull && + + } @@ -341,6 +357,7 @@ class EventSignupInvitation extends React.Component { handleNoteChange={this.handleNoteChange} showSlotDetail={this.handleShowSlotDetail} isShowEdit={this.state.isShowEdit} + isAllSlotsFull={this.state.isAllSlotsFull} invitationNote={this.state.invitationNote} showEdit={this.handleShowEdit} t={t} currentEventInvitation={this.state.currentEventInvitation} diff --git a/src/layouts/EventSignupInvitation/EventSignupInvitation.styles.js b/src/layouts/EventSignupInvitation/EventSignupInvitation.styles.js index 2e54b5ac3..c39f3281e 100644 --- a/src/layouts/EventSignupInvitation/EventSignupInvitation.styles.js +++ b/src/layouts/EventSignupInvitation/EventSignupInvitation.styles.js @@ -232,6 +232,16 @@ export default (theme, contactAvatarImg) => ({ maxWidth: 100, }, }, + slotFullMsg: { + overflow: 'hidden', + display: 'inline-block', + fontSize: 14, + textOverflow: 'ellipsis', + fontWeight: 600, + '&.small': { + maxWidth: 100, + }, + }, eventName: { margin: "0", fontSize: "12px", -- GitLab From 838ade8229ce19c9e2be0d0c915283454c073896 Mon Sep 17 00:00:00 2001 From: Chetna Joshi Date: Sat, 20 Jun 2020 17:30:17 +0530 Subject: [PATCH 6/6] fixed some issues --- src/layouts/EventSignupNew/EventSignupNew.js | 41 +++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/layouts/EventSignupNew/EventSignupNew.js b/src/layouts/EventSignupNew/EventSignupNew.js index 5cb8d8767..b85c48772 100644 --- a/src/layouts/EventSignupNew/EventSignupNew.js +++ b/src/layouts/EventSignupNew/EventSignupNew.js @@ -974,7 +974,7 @@ class EventSignupNew extends Component { eveventTimeslots = [ { title: this.state.eventTitle, - maxAllowed: 0, + maxAllowed: this.state.maxAllowed.value, startDate: this.state.startDate.format("YYYY-MM-DD"), startTime: slotStartTimeArr[1] + ":" + slotStartTimeArr[2], endDate: this.state.endDate.format("YYYY-MM-DD"), @@ -1140,6 +1140,12 @@ class EventSignupNew extends Component { inviterName ); } else if (this.state.eventAddFormStep === 2) { + + if ((emailIds.length === 0 || mobileNoArr.length === 0) && !isCalledByEmailSms) { + this.setState({ displayEmailSmsMsgModel: true, isLoader: false }); + return; + } + //if event already published, no call api if (this.state.editModeInternalUse && this.state.isPublishTs > 0) { let step = this.state.eventAddFormStep; @@ -1148,11 +1154,6 @@ class EventSignupNew extends Component { return; } - if ((emailIds.length === 0 || mobileNoArr.length === 0) && !isCalledByEmailSms) { - this.setState({ displayEmailSmsMsgModel: true, isLoader: false }); - return; - } - this.saveEventApiCall( action, eventId, @@ -1571,11 +1572,13 @@ class EventSignupNew extends Component { let endHour = ""; let endHour12 = ""; let endMinute = ""; + let singleSlotMaxAllowed = AllowParticipantOptions[0]; if (data.eventSlotsList.length > 0) { const firstSlot = data.eventSlotsList[0]; const splitStartTime = firstSlot.startTime.split(":"); const splitEndTime = firstSlot.endTime.split(":"); - + + singleSlotMaxAllowed = { value: firstSlot.maxAllowed, label: firstSlot.maxAllowed }; startDate = moment(firstSlot.startDate); startHour = splitStartTime[0]; startHour12 = parseInt(splitStartTime[0]) % 12; @@ -1690,7 +1693,8 @@ class EventSignupNew extends Component { label: endMinute.toString(), value: endMinute.toString() }, - + maxAllowed: singleSlotMaxAllowed, + //step 2 isSelectedParticipents: isSelectedParticipents, inviteBy: "by_contacts", @@ -1963,8 +1967,6 @@ class EventSignupNew extends Component { this.setState({ maxAllowed: selectedVal }); } validateMaxAllowed = (val) => { - - console.log("val, ", val); const firstObj = AllowParticipantOptions[0]; if (val && val.trim() !== '' && Number(val) < AllowParticipantOptions.length) { let alowedvalues = []; @@ -2170,6 +2172,24 @@ class EventSignupNew extends Component {
    {!this.state.isMultiTimeSlot && ( <> +
    + +