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

feat(ui): toggle showing only modified fields in version diff view #10807

Merged

Conversation

tsemachh
Copy link
Contributor

Description

As an author reviewing the versions I have for a document , I would like to the ability to focus only on the differences I made and not see the entire document.
Screencast from 2024-09-05 16-38-40.webm

A checkbox was added to the Version View allowing user to decide if he/she wants to see only modified fields or the entire documents.
#7981 - mention this feature and also in discord

  • [v] I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • [v] New feature (non-breaking change which adds functionality)

Checklist:

  • [ ] Existing test suite passes locally with my changes
    (Actually it's stuck on S3 upload test , note related to my code)

One lat question - should we really translate text for all locales ? or we can leave it undefined for now ?(besides english)

…only-version-diff-view

# Conflicts:
#	packages/next/src/views/Version/Default/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Iterable/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Nested/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Tabs/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/types.ts
#	packages/next/src/views/Version/RenderFieldsToDiff/index.tsx
…n-diff-view' into feat/modified-fields-only-version-diff-view

# Conflicts:
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Iterable/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Nested/index.tsx
#	packages/next/src/views/Version/RenderFieldsToDiff/fields/Tabs/index.tsx
@tsemachh tsemachh changed the title Feat/modified fields only version diff view feat(ui)/modified fields only version diff view Jan 26, 2025
@tsemachh tsemachh changed the title feat(ui)/modified fields only version diff view feat(ui):modified fields only version diff view Jan 26, 2025
@AlessioGr AlessioGr changed the title feat(ui):modified fields only version diff view feat(ui): toggle showing only modified fields in version diff view Jan 27, 2025
Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

Looks good overall. Few questions on code, plus I'm wondering why the updated timestamp isn't showing after checking the Modified only option?

packages/next/src/views/Version/Default/index.scss Outdated Show resolved Hide resolved
packages/translations/src/languages/zhTw.ts Outdated Show resolved Hide resolved
@tsemachh
Copy link
Contributor Author

Looks good overall. Few questions on code, plus I'm wondering why the updated timestamp isn't showing after checking the Modified only option?

From user perspective the timestamp(Any potentially other audit fields) were not modified by the user so I thought it's better not to show them on the diff , if you think this should change I will change it,

@tsemachh
Copy link
Contributor Author

@DanRibbens I replied and fixed the CSS , let me know if more changes are needed - thank you

@DanRibbens
Copy link
Contributor

My expectation is that any data that has changed it would show. Can you make that adjustment?

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

This is great. I'm just waiting for the updated at change and then we can finally get this merged. Thanks for being extra patient.

@tsemachh
Copy link
Contributor Author

My expectation is that any data that has changed it would show. Can you make that adjustment?

@DanRibbens done

@DanRibbens
Copy link
Contributor

DanRibbens commented Jan 28, 2025

I'm confused, field.admin.hidden was used to hide the updatedAt field?

I don't understand that last commit.

Fields with admin.hidden: true should not show in diffs. I was mistaken.

@tsemachh
Copy link
Contributor Author

tsemachh commented Jan 28, 2025

I'm confused, field.admin.hidden was used to hide the updatedAt field?

I don't understand that last commit.

Fields with admin.hidden: true should not show in diffs. I was mistaken.
@DanRibbens
Yes , not only the updateAt , if we have other audit fields they were also hidden in this case
I reverted it back to previous code , now we hide admin.hidden fields
(Also resolved conflict , you are really fast)

…-only-version-diff-view

# Conflicts:
#	packages/next/src/views/Version/RenderFieldsToDiff/index.tsx
@DanRibbens
Copy link
Contributor

I'm about to push the fix for the build error and add the missing translations.

@DanRibbens DanRibbens enabled auto-merge (squash) January 28, 2025 21:01
@DanRibbens DanRibbens merged commit 33ac13d into payloadcms:main Jan 28, 2025
67 checks passed
Copy link
Contributor

🚀 This is included in version v3.20.0

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