Skip to content

Commit

Permalink
ISSUE #4642 - reseting the viewpoint once the ticket is deselected
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmont3drepo committed Jan 18, 2024
1 parent 7b7c1fd commit 8b87353
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 0 additions & 8 deletions frontend/src/v5/helpers/viewpoint.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,10 @@ export const viewpointV5ToV4 = (viewpoint: Viewpoint) => {
v4Viewpoint.clippingPlanes = viewpoint.clippingPlanes;
}

// if (!isEmpty(viewpoint.state?.colored)) {
// v4Viewpoint.override_groups = viewpoint.state.colored.map(convertToV4Group);
// }

if (!isEmpty(viewpoint.state?.transformed)) {
v4Viewpoint.transformation_groups = viewpoint.state.transformed.map(convertToV4Group);
}

// if (!isEmpty(viewpoint.state?.hidden)) {
// v4Viewpoint.hidden_group = mergeGroups(viewpoint.state.hidden.map(convertToV4Group));
// }

return { viewpoint: v4Viewpoint };
};

Expand Down
8 changes: 7 additions & 1 deletion frontend/src/v5/store/tickets/card/ticketsCard.sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { put, takeLatest } from 'redux-saga/effects';
import { put, takeEvery, takeLatest } from 'redux-saga/effects';
import { VIEWER_PANELS } from '@/v4/constants/viewerGui';
import { TicketsCardViews } from '@/v5/ui/routes/viewer/tickets/tickets.constants';
import { ViewerGuiActions } from '@/v4/modules/viewerGui/viewerGui.redux';
import { OpenTicketAction, TicketsCardActions, TicketsCardTypes } from './ticketsCard.redux';
import { ViewpointsActions } from '@/v4/modules/viewpoints';

export function* openTicket({ ticketId }: OpenTicketAction) {
yield put(TicketsCardActions.setSelectedTicket(ticketId));
yield put(TicketsCardActions.setCardView(TicketsCardViews.Details));
yield put(ViewerGuiActions.setPanelVisibility(VIEWER_PANELS.TICKETS, true));
}

function * resetState() {
yield put(ViewpointsActions.setActiveViewpoint(null));
}

export default function* ticketsCardSaga() {
yield takeLatest(TicketsCardTypes.OPEN_TICKET, openTicket);
yield takeEvery(TicketsCardTypes.RESET_STATE, resetState);
}

0 comments on commit 8b87353

Please sign in to comment.