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

Removed building graph to see if resource has changed. #2293

Merged
merged 1 commit into from Jul 16, 2020

Conversation

justinlittman
Copy link
Contributor

This changes the approach for determining if a resource has changed so that it does not rely on the GraphBuilder.

Copy link
Contributor

@jermnelson jermnelson left a comment

Choose a reason for hiding this comment

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

+1 to replacing the creation of graph just to determine if the resource is changed. Noticed a typo in a test and a regression.

__tests__/selectors/resources.test.js Outdated Show resolved Hide resolved
const newSubject = { ...action.payload }
delete newSubject.properties
delete newSubject.subjectTemplate
newState.entities.subjects[action.payload.key] = newSubject

if (!_.isEqual(newSubject, subject)) {
newState.entities.subjects[newSubject.resourceKey].changed = true
Copy link
Contributor

Choose a reason for hiding this comment

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

I think setting this value to true is creating a regression because when a resource template is initially loaded and nothing has changed in the state, the Save button (src/components/editor/actions/SaveAndPublishButton) is enabled when it shouldn't be. Here is a screen shot just after the abbreviated title resource template is loaded with the save button enabled (should be disabled because nothing has changed):
Screen Shot 2020-07-15 at 4 49 40 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by setting changed to false after resource is loaded.

@jermnelson jermnelson merged commit 6fc2b7e into master Jul 16, 2020
@jermnelson jermnelson deleted the less_graph_building2 branch July 16, 2020 14:49
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.

None yet

2 participants