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

[SDPAP-7477]remove call to function getExposedItemsToLoadField #1305

Conversation

yeniatencio
Copy link
Contributor

@yeniatencio yeniatencio commented Jun 5, 2023

Motivation and Context

This change is required to remove the items per page dropdown box where it gives the option to select the number of pages shown. This option is being added in BE content collection by selecting numbers of results shown. 3, 6, 9.

JIRA issue: https://digital-vic.atlassian.net/browse/SDPAP-7477

BE link: https://nginx-php.pr-272.content-reference-sdp-vic-gov-au.sdp4.sdp.vic.gov.au/
FE link: https://app.pr-1305.ripple.sdp4.sdp.vic.gov.au/

Changed

  1. Remove call to function getExposedItemsToLoadField.
  2. Remove required src in responsiveImage.vue because when selecting layout grid view and card display style Thumbnail in BE for the content collection component and if any of the results has no image then it will throw an error of Missing required prop: src . There is already a validation on the template
<template>
  <img v-if="src" class="rpl-responsive-image" :class="`rpl-responsive-image--fit-${fit}`" :alt="alt" :height="height" :width="width" ref="image" :src="src" :srcset="calcSrcSet" :sizes="calcSizes" :style="calcFocalPoint"  />
</template>

Screenshots

Screenshot 2023-06-05 at 4 21 34 pm

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist

  • I've added relevant changes to the documentation.
  • I have added tests to cover my changes (if not applicable, please state why)
  • My change requires a template update for create-ripple-app.
  • I have added template update script for next release.

@@ -20,8 +20,7 @@ export default {
mixins: [breakpoint],
props: {
src: {
type: String,
required: true
Copy link
Contributor

Choose a reason for hiding this comment

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

@yeniatencio this doesn't look relevant to the pr, can you explain why this is here?

Copy link
Contributor Author

@yeniatencio yeniatencio Jun 5, 2023

Choose a reason for hiding this comment

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

@dylankelly , When selecting layout grid view and card display style Thumbnail in BE for the content collection component and if any of the results has no image then it will throw this error.
Screenshot 2023-06-05 at 6 13 27 pm

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like the src should be required for the image, you've fixed the issue by removing the required prop but the ResponsiveImg component shouldn't be rendered at all. @lambry can I get you to look at this and provide some feedback?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @dylankelly @yeniatencio,

In this instance looks like the card component is being passed an empty object and we aren't checking this is valid, we just assume an object means it's a real image. We might need to update the below check to make sure the object actually has a source, or potentially update the mapping. This sounds like a separate ticket though.

Cheers

REF: https://github.com/dpc-sdp/ripple/blob/develop/packages/components/Molecules/Card/mixins/card.js#L119

@yeniatencio yeniatencio requested a review from dylankelly June 5, 2023 08:18
@alan-cole
Copy link
Collaborator

Hi @dylankelly, @yeniatencio - I just noticed this PR in passing. The change here will break places where an exposed items per page is required, like on https://www.health.vic.gov.au/search?q=eye.
If the purpose is to set the items per page, but without the user configurable option, then we shouldn't be using

$config['interface']['display']['options']['itemsToLoad']['values']

from here to set the value.

Instead, try using internal.itemsToLoad see schema:

$config['internal']['itemsToLoad']

This should be achievable in the back-end by updating the JSON configuration for the content collection, without needing this PR.

@dylankelly
Copy link
Contributor

@yeniatencio In talking this through with @alan-cole , I don't think we should proceed with this PR. It looks like there has been some confusion here. The required change to add a defined number of results is needed for Ripple 2 only. By removing the ability to change the number of results we would break existing functionality in Ripple 1 (See link Alan provided).

@lambry we might need to pickup this ticket for Ripple 2.

Sorry for the confusion.

@dylankelly dylankelly closed this Jun 8, 2023
@yeniatencio
Copy link
Contributor Author

@yeniatencio In talking this through with @alan-cole , I don't think we should proceed with this PR. It looks like there has been some confusion here. The required change to add a defined number of results is needed for Ripple 2 only. By removing the ability to change the number of results we would break existing functionality in Ripple 1 (See link Alan provided).

@lambry we might need to pickup this ticket for Ripple 2.

Sorry for the confusion.

Hi @dylankelly , I was going to close this pr too and Yes agree with you. I have already deleted the variable from this pr that I was using with my BE pr. Thanks guys.

@yeniatencio yeniatencio deleted the feature/SDPAP-7477-remove-items-to-load-field-content-collection branch June 8, 2023 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants