diff --git a/frontend/src/components/ViewTrips/delete-trip-button.js b/frontend/src/components/ViewTrips/delete-trip-button.js index b801b859..61630192 100644 --- a/frontend/src/components/ViewTrips/delete-trip-button.js +++ b/frontend/src/components/ViewTrips/delete-trip-button.js @@ -14,8 +14,6 @@ const LIMIT_QUERY_DOCS_RETRIEVED = 5; * * @param {Object} props These are the props for this component: * - tripId: Document ID for the current Trip document. - * - refreshTripsContainer: Handler that refreshes the TripsContainer - * component upon trip creation (Remove when fix Issue #62). */ const DeleteTripsButton = (props) => { /** @@ -78,8 +76,6 @@ const DeleteTripsButton = (props) => { /** * Deletes a trip and its subcollection of activities corrsponding to the * `tripId` prop and then refreshes the TripsContainer component. - * - * TODO(Issue #62): Remove refreshTripsContainer. */ async function deleteTrip() { if (window.confirm('Are you sure you want to delete this trip? This' + @@ -101,9 +97,7 @@ const DeleteTripsButton = (props) => { }).catch(error => { console.error("Error removing document: ", error); }); - - props.refreshTripsContainer(); - } + } } return ( diff --git a/frontend/src/components/ViewTrips/index.js b/frontend/src/components/ViewTrips/index.js index 08ce2971..19a1c731 100644 --- a/frontend/src/components/ViewTrips/index.js +++ b/frontend/src/components/ViewTrips/index.js @@ -16,27 +16,12 @@ class ViewTrips extends React.Component { constructor() { super(); this.state = { showModal: false, - refreshTripsContainer: false, refreshSaveTripModal: false, tripId: null, defaultFormObj: null, }; } - /** - * Handler that flips `refreshTripsContainer` property which causes that - * TripsContainer component to be reloaded. - * - * This allows a trip creator's view trips page to be updated in real time. - * - * In the future, the use of refreshTripContainer and the key prop on Trips - * container should be removed with the addition of real time listening with - * onShapshot (Issue #62). - */ - refreshTripsContainer = () => { - this.setState({ refreshTripsContainer: !this.state.refreshTripsContainer }); - } - /** * Handler that flips `refreshSaveTripModal` property which causes that * save/edit trip component to be reloaded. @@ -97,7 +82,6 @@ class ViewTrips extends React.Component { ); diff --git a/frontend/src/components/ViewTrips/save-trip-modal.js b/frontend/src/components/ViewTrips/save-trip-modal.js index 439c99a2..837dca01 100644 --- a/frontend/src/components/ViewTrips/save-trip-modal.js +++ b/frontend/src/components/ViewTrips/save-trip-modal.js @@ -24,8 +24,6 @@ const db = app.firestore(); * @param {Object} props These are the props for this component: * - show: Boolean that determines if the add trips modal should be displayed. * - handleClose: Event handler responsible for closing the add trips modal. - * - refreshTripsContainer: Handler that refreshes the TripsContainer - * component upon trip creation (Remove when fix Issue #62). * - tripId: For adding a new trip, this will be null. For editting an existing * trip, this will the document id associated with the trip. * - defaultFormObj: Object containing the placeholder/default values for the @@ -132,18 +130,15 @@ class SaveTripModal extends React.Component { } else { this.updateExistingTrip(this.props.tripId, tripData); } - } /** * Handles submission of the form which includes: * - Creation of the trip. - * - Refreshing the trips container. * - Closing the modal. */ handleSubmitForm = async () => { await this.saveTrip(); - this.props.refreshTripsContainer(); this.props.handleClose(); } diff --git a/frontend/src/components/ViewTrips/trip.js b/frontend/src/components/ViewTrips/trip.js index b150a6c9..6a5ad179 100644 --- a/frontend/src/components/ViewTrips/trip.js +++ b/frontend/src/components/ViewTrips/trip.js @@ -35,8 +35,6 @@ export function moveCurUserEmailToFront(collaboratorEmailArr) { * - tripData: Object holding a Trip document fields and corresponding values. * - tripId: Document ID for the current Trip document. * - handleEditTrip: Handler that displays the edit trip modal. - * - refreshTripsContainer: Handler that refreshes the TripsContainer - * component upon trip creation (Remove when fix Issue #62). * - key: Special React attribute that ensures a new Trip instance is * created whenever this key is updated */ @@ -87,10 +85,7 @@ const Trip = (props) => {

{description}

{collaboratorEmailsStr}

- +