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

Per 8562 indicate fields that are editable #343

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

crisnicandrei
Copy link
Contributor

Steps to test:
1.Open any uploaded file in the full screen viewer.
2. Notice that an icon and Click to add text is present for tags and location (description already had a helper text and the name cannot be deleted.)

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bfb3770) 35.68% compared to head (9703c7d) 35.68%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #343   +/-   ##
=======================================
  Coverage   35.68%   35.68%           
=======================================
  Files         299      299           
  Lines       10377    10379    +2     
  Branches     1719     1719           
=======================================
+ Hits         3703     3704    +1     
- Misses       6528     6529    +1     
  Partials      146      146           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@meisekimiu meisekimiu left a comment

Choose a reason for hiding this comment

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

Left a question about some of the new inputs introduced in the code. Also, while the ticket mentioned that we might want to include an icon, I will say that adding that icon creates visual inconsistency between the fullscreen and standard metadata editors; the fullscreen one has icons and the "normal" editor doesn't. This is more of a thing for @k8lyn6 to discuss during review but I wanted to bring it up.

@@ -121,6 +122,8 @@ export class FileViewerComponent implements OnInit, OnDestroy {
AccessRole.Editor
) && !route.snapshot.data?.isPublicArchive;

this.canEditFieldsOnFullscreen = this.canEdit && this.canEditOnFullScreen();
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused on the purpose of this variable. Is there ever a case where canEdit and canEditFieldsOnFullscreen are going to be different values? I'm not sure if there's a special case but I would think that anything that fullscreen editing shouldn't have different permissions from normal editing (especially since canEdit already checks if the file in question is a Public Archive or not).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@meisekimiu good point, but the ticket was suggesting adding the text only in fullscreen mode, not in the file list viewer, that's my reasoning. That is why I am making use of the routes. Should I change it?

Copy link
Member

Choose a reason for hiding this comment

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

Outcome: we'll use canEdit everywhere.

@crisnicandrei crisnicandrei requested a review from k8lyn6 January 29, 2024 16:11
@crisnicandrei crisnicandrei force-pushed the PER-8562-indicate-fields-that-are-editable branch from 4e80aab to 29f05a7 Compare February 6, 2024 09:31
Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

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

This looks good! I think we should probably remove the icon -- I like it better without them, and it looks like they don't show up consistently anyway (I wasn't seeing it on the tags if you already have tags entered)

@crisnicandrei crisnicandrei requested a review from k8lyn6 February 7, 2024 15:04
@k8lyn6 k8lyn6 requested a review from meeksie February 13, 2024 21:06
Copy link

@meeksie meeksie left a comment

Choose a reason for hiding this comment

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

Works well!

Display 'Click to add' text for location and tags in the fullscreen viewer when the user can edit them.
Additionally, I have added an edit icon.
refactored the code, removed a variable that was not needed after all. Now the same behaviour is present in the sidebar too, making the app more consistent.
Removed the icons
@crisnicandrei crisnicandrei force-pushed the PER-8562-indicate-fields-that-are-editable branch from 60c8b24 to 9703c7d Compare February 14, 2024 07:39
Copy link

@k8lyn6 k8lyn6 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!

@crisnicandrei crisnicandrei merged commit b3e0fe9 into main Feb 14, 2024
2 checks passed
@crisnicandrei crisnicandrei deleted the PER-8562-indicate-fields-that-are-editable branch February 14, 2024 15:41
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.

6 participants