Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respond to Exhibit-Related Changes by updating relevant DataStores #79

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

sei-mpriest
Copy link
Contributor

Placed a hook in the HomeApp to update the TeamCard and UserArticle data stores when the move and inject change on the current exhibit. This allows the wall and archive views to update when the exhibit move and inject change.

Note that many of the changed lines are from applying Prettier formatting rules. The substantive change is the addition of the handleExhibitMoveOrInjectChange function and calling it when the selected exhibit is modified (because move and/or inject changed).

Related issue is CWDOE-1365

…ata stores when the move and inject change on the current exhibit.
this.collectionId = this.exhibit.collectionId;
this.currentMove = this.exhibit.currentMove;
this.currentInject = this.exhibit.currentInject;
this.handleExhibitMoveOrInjectChange();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to compare the new values of id, currentMove, and currentInject to the values on this.exhibit and only call handleExhibitMoveOrInjectChange() when one of those values has changed.

There also needs to be a change in home-app.component.ts or signalr.service.ts to make sure that the switchTeam method gets called after the initial join() method call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the logic for changeTeams so that it gets called on initialization. I am not sure I understand how the team is actually changed after trying to do it. I am also not sure what to do about exhibitId. It seems like the code is designed to set that only once when you load the HomeApp. If it changes then there are probably other things to do then just update the move and inject. Again, I might not have this right still.

@sei-mpriest
Copy link
Contributor Author

Made change to not call changeTeam after the initial call unless the user actually changes their team via the selector.

@sei-mpriest sei-mpriest merged commit 6e851ab into development Aug 13, 2024
2 checks passed
@sei-mpriest sei-mpriest deleted the cwdoe-1365-move-inject-change-response branch August 13, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants