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

Feature/CV2-5785: media dialog view ux updates to include media match reason #2256

Open
wants to merge 12 commits into
base: epic/CV2-5510-why-media-is-in-cluster
Choose a base branch
from

Conversation

danielevalverde
Copy link
Contributor

@danielevalverde danielevalverde commented Jan 21, 2025

Description

  • Add the new component to the required sections of the MediaPage.
  • Update GraphQL query to fetch the newly added media_cluster_origin fields.
  • Update unit tests
  • Update follow-up ticket for the refactoring:

Type of change

  • Performance improvement and/or refactoring (non-breaking change that keeps existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Security mitigation or enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Automated test (add or update automated tests)

How has this been tested?

manually and running the unit tests

Things to pay attention to during code review

  • Please review the strings in the formatted messages
  • We have a separate ticket to handle the Graphql refactoring: CV2-6006

Checklist

  • I have performed a self-review of my own code
  • I've made sure my branch is runnable and given good testing steps in the PR description
  • I considered secure coding practices when writing this code. Any security concerns are noted above.
  • I have commented my code in hard-to-understand areas, if any
  • I have made needed changes to the README
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • If I implemented any new components, they are self-contained, their propTypes are declared and they use React Hooks and, if data-fetching is required, they use Relay Modern with fragment containers
  • If my components involve user interaction - specifically button, text fields, or other inputs - I have added a BEM-like class name to the element that is interacted with
  • To the best of my knowledge, any new styles are applied according to the design system
  • If I added a new external dependency, I included a rationale for doing so and an estimate of the change in bundle size (e.g., checked in https://bundlephobia.com/)
  • If I touched a file that included an eslint-disable-file header, I updated the code such that the disabler can be removed

@danielevalverde danielevalverde marked this pull request as ready for review January 21, 2025 00:27
Copy link
Contributor

@brianfleming brianfleming left a comment

Choose a reason for hiding this comment

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

looking good @danielevalverde
i just made some small tweaks mostly about being explicit and using "cluster of media"
instead of just cluster in some places

@@ -42,10 +42,10 @@ const getIconAndMessage = (type, user) => {
),
tooltipMessage: (
<FormattedHTMLMessage
defaultMessage="<strong>{user}</strong> uploaded this media using the Check interface"
defaultMessage="<strong>{media_cluster_origin_user}</strong> uploaded this media using the Check interface"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change slightly from:
...using the Check interface
to
...using Check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -61,10 +61,10 @@ const getIconAndMessage = (type, user) => {
),
tooltipMessage: (
<FormattedHTMLMessage
defaultMessage="<strong>{user}</strong> added this media by merging from another cluster"
defaultMessage="<strong>{media_cluster_origin_user}</strong> added this media by merging from another cluster"
Copy link
Contributor

Choose a reason for hiding this comment

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

please change from
...merging from another cluster
to
...merging from another cluster of media

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -51,10 +53,10 @@ const getIconAndMessage = (type, user, cluster, timestamp) => {
message: (
<>
<FormattedHTMLMessage
defaultMessage="This media was added to the cluster by <strong>{user}</strong> when merged from <strong><u>{cluster}</u></strong> "
description="Message for User Matched"
defaultMessage="This media was merged to the cluster by <strong>{media_cluster_origin_user}</strong>, "
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change from
This media was merged to the cluster by...
to
This media was merged into this cluster of media by...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -66,10 +68,10 @@ const getIconAndMessage = (type, user, cluster, timestamp) => {
message: (
<>
<FormattedHTMLMessage
defaultMessage="This media was added to the cluster by <strong>{user}</strong> when accepted from <strong><u>{cluster}</u></strong> "
defaultMessage="This media was added to the cluster by <strong>{media_cluster_origin_confirmed_by}</strong> when accepted from <strong><u>{media_cluster_origin_title}</u></strong>, "
Copy link
Contributor

Choose a reason for hiding this comment

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

from
This media was added to the cluster by...
to
This media was added to the cluster of media by...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -81,7 +83,7 @@ const getIconAndMessage = (type, user, cluster, timestamp) => {
message: (
<>
<FormattedHTMLMessage
defaultMessage="This media was automatically matched to the cluster "
defaultMessage="This media was automatically matched to the cluster, "
Copy link
Contributor

Choose a reason for hiding this comment

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

from
...matched to the cluster,...
to
...matched to the cluster of media,...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danielevalverde
Copy link
Contributor Author

looking good @danielevalverde i just made some small tweaks mostly about being explicit and using "cluster of media" instead of just cluster in some places

addressed the review comments 🫡

@@ -214,6 +215,14 @@ class MediaComponent extends Component {
)]}
/>
}
media_origin_banner={
Copy link
Contributor

Choose a reason for hiding this comment

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

prop names should follow camelCase => mediaOriginBanner={

@@ -115,6 +115,10 @@ const MediaOriginBanner = ({
);
};

MediaOriginBanner.defaultProps = {
media_cluster_relationship: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

prop names should follow camelCase

Copy link
Contributor

@amoedoamorim amoedoamorim left a comment

Choose a reason for hiding this comment

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

Please change props that are passed with snake_case to camelCase

Copy link
Contributor

@brianfleming brianfleming left a comment

Choose a reason for hiding this comment

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

nice, thanks for that data fix @danielevalverde !

just one small UI nit to fix on my end:

  • please add maybe 8px of space below the banner in the dialog, so its not right up against the media like in the screenshot here:
Screenshot 2025-01-22 at 1 00 15 PM

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.

3 participants