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

Add an indicator to display whether a product has been changed since last published #4281

Closed
spencern opened this issue May 30, 2018 · 3 comments
Assignees
Milestone

Comments

@spencern
Copy link
Contributor

spencern commented May 30, 2018

Using the hash created in #4264 add an indicator to the PDP to inform the user of unpublished changes to a product. The indicator should show if the product or any of it's variants or options has unpublished changes.

Edit By @mikemurray

Historically we've used "dots" with edit icons to indicate changes

basic_reaction_product__edited_

The home for these "indicators", whatever form they take, should be placed in the toolbar either next to the publish button or take the form of the publish button.

basic_reaction_product__edited_

@kieckhafer
Copy link
Member

Documentation on what was done in #4264:

## `hashProduct(product, collections)`

The purpose of this function is to create a hash of a product, for comparison purposes to see if any changes have been made.

After the removal of revisions, we no longer have a way to determine if a product has changed since the last time it was viewed. This hash will allow the end-user to hash their current product, and compare hashes with the Catalog product.


`hashProduct(product, collections)`
- @param {Object} product - A product object
- @param {Object} collections - Raw mongo collections (Products is required)

Inside the function, there is a `const` called `skippedFields`, which takes an array of field names (strings), and skips these fields when hashing. We do this to skip fields such as the `hash` itself, and `createdAt` and `updatedAt`, which will always change, and are not user created.

The function returns the original product object, with the hash either updated or added to the object.

@kieckhafer kieckhafer assigned kieckhafer and unassigned kieckhafer Jun 22, 2018
@spencern spencern modified the milestones: Grays, Humbolt Jun 26, 2018
@kieckhafer kieckhafer self-assigned this Jun 26, 2018
@rymorgan
Copy link
Contributor

screen shot 2018-06-27 at 9 52 05 am

Currently, I'm getting this tooltip showing up no matter if I have published changes or not. As part of this, the tooltip should not be there when there and no changes to be published. Additionally, the publish button should show as disabled.

@rymorgan
Copy link
Contributor

rymorgan commented Jun 27, 2018

When there are changes that need to be published we use a small overlapping indicator dot to emphasize that changes need to be published. We also enable the button. I'm using the new button component here and style guide rules that only use the outline button for a secondary button. So in this instance, it would be a solid button with blue for emphasis.

changes needing to be published

When there are no changes to be published the button is in a disabled state.

no changes to publish

*Note, it would be good have a simple animation where the indicator shrinks/animates out of view when you hit publish.

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

No branches or pull requests

3 participants