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

Featured Items - Collection Page #575

Merged
merged 89 commits into from
Feb 4, 2025
Merged

Conversation

g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Dec 31, 2024

What this PR does / why we need it:

Add featured items section in the Collection Page.
Allows users that can edit a collection to create "featured items" that will initially support content and an optional image.
These "featured items" will be shown between the Collection page header and the items list.

Storybook links:

Which issue(s) this PR closes:

Suggestions on how to test this:

Step 1: Run the Development Environment

  1. Execute npm i.
  2. Navigate with cd packages/design-system && npm i && npm run build.
  3. Return with cd ../../.
  4. Ensure you have a .env file similar to .env.example, with the variable VITE_DATAVERSE_BACKEND_URL=http://localhost:8000.
  5. Navigate with cd dev-env.
  6. Start the environment using ./run-env.sh unstable.
  7. To verify the environment, visit http://localhost:8000 and check your local Dataverse installation.

Step 2: Test the feature

  1. Login and create a new collection or even in the root collection click the Edit Collection > Featured Items button.
  2. Create featured items, with different contents, with and without image and submit the form, change the order of the featured items by dragging them with the drag handle.
  3. Check that the featured items shown in the collection page are correct.
  4. Go to edit them again, replace images from a featured item, also you can test removing an image from a featured item and also remove a featured item by clicking the minus button. *Note: you can remove the first item, to be removed needs to be at least in the 2nd position.
  5. Check that the featured items shown in the collection page are correct.
  6. Go to edit them again but now try the delete all featured items action, when clicking it, a confirmation dialog will appear.
  7. Check in the collection page that no featured items are shown.
  8. About field validations: the content field cannot be empty and must be 15,000 characters or less, but note that if you enter "Hello world" in the field, this rich text editor will transform that into <p class="rte-paragraph">Hello world</p> so those html tags characters also count for the validation.
  9. You could also validate that if a collection is unpublished and has featured items, only users that can view unpublished collections can see the featured items.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Yes.
Screen Shot 2025-01-02 at 08 49 32
Screen Shot 2025-01-02 at 08 55 29
Screen Shot 2025-01-02 at 08 55 40

Is there a release notes update needed for this change?:

Additional documentation:

@ofahimIQSS
Copy link
Contributor

trying to follow these steps but hit a snag on step 6 on building the environment

image

please advise :)

@cmbz cmbz added FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) labels Jan 29, 2025
@g-saracca
Copy link
Contributor Author

@ekraffmiller could you please reapprove?

ekraffmiller
ekraffmiller previously approved these changes Feb 3, 2025
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Approved version update & typo fixes

@ofahimIQSS
Copy link
Contributor

Are we setting any limits on how many Content items we can have...On the Edit Featured Items page I added 101 content items, when I did, I had the observation below:

Screen.Recording.2025-02-03.at.1.48.39.PM.mov

To reproduce, just create a collection, edit> Featured Items, and add 100 Content items. The button class under the carousel seems to not function as expected. (not centered, tracker ball on button disappears after scrolling to beginning or end)

@g-saracca
Copy link
Contributor Author

Are we setting any limits on how many Content items we can have...

Good question, I don't know about that, @GPortas what do you think? max 10 featured items for now?

@ofahimIQSS
Copy link
Contributor

another observation when there are too many featured items:
Page doesn't auto scroll down on local if I scroll up, I can keep hitting the "+" sign and in storybook, it looks like the page scrolls even if I scroll up a bit and add items.

Screen.Recording.2025-02-03.at.2.09.08.PM.mov

@g-saracca
Copy link
Contributor Author

Thanks @ofahimIQSS, will take a look at this

@g-saracca g-saracca self-assigned this Feb 4, 2025
@g-saracca g-saracca removed their assignment Feb 4, 2025
@ofahimIQSS
Copy link
Contributor

merging is blocked - can someone please review

@ofahimIQSS
Copy link
Contributor

fixes look good overall, had one more UX improvement suggestion - can we limit the message to show one at a time until one message "You can add up to 10 featured items." goes away? See video below

Screen.Recording.2025-02-04.at.11.48.26.AM.mov

@g-saracca
Copy link
Contributor Author

can we limit the message to show one at a time until one message "You can add up to 10 featured items." goes away?

I think we could, we could limit how many alerts to show at the same time but I think it's not our problem if the user keeps clicking the add button and also it doesn't break anything.
I would keep it simple for now, if we really find a UX issue with this I would address it but I think it's not an issue at this point.
What do you think @ofahimIQSS ?

@ofahimIQSS
Copy link
Contributor

can we limit the message to show one at a time until one message "You can add up to 10 featured items." goes away?

I think we could, we could limit how many alerts to show at the same time but I think it's not our problem if the user keeps clicking the add button and also it doesn't break anything. I would keep it simple for now, if we really find a UX issue with this I would address it but I think it's not an issue at this point. What do you think @ofahimIQSS ?

Agreed! lets keep it as is - please approve the review so I can merge this PR. Thanks!

Copy link
Contributor

@ekraffmiller ekraffmiller 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, approved

@ofahimIQSS
Copy link
Contributor

Thank you guys! This feature looks great - Merging PR

@ofahimIQSS ofahimIQSS merged commit 692283b into develop Feb 4, 2025
10 of 14 checks passed
@ofahimIQSS ofahimIQSS deleted the feat/568-featured-items branch February 4, 2025 20:14
@ofahimIQSS ofahimIQSS removed their assignment Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) GREI Re-arch GREI re-architecture-related integration Tasks involving the connection and interaction of UI features with the Dataverse API Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA: Collection Page SPA.Q1 Not related to any specific Q1 feature SPA.Q4.5 Collections page with a more Website-like or CMS look and feel
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Featured Items - Collection Page
6 participants