Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add VContentLink component #560

Merged
merged 32 commits into from
Jan 14, 2022
Merged

Add VContentLink component #560

merged 32 commits into from
Jan 14, 2022

Conversation

krysal
Copy link
Member

@krysal krysal commented Dec 23, 2021

Fixes

Fixes #453 by @panchovm

Description

This PR adds the mobile version of the Content Link component.

Testing Instructions

Run pnpm storybook and try its interactions.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

obulat and others added 6 commits December 15, 2021 09:45
Rename VSearchBar and VSearchButton and move to VHeader
Add VLogoLoader to VHeader and adjust header styles
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>
@krysal krysal added 🌟 goal: addition Addition of new feature 🕹 aspect: interface Concerns end-users' experience with the software 🟨 priority: medium Not blocking but should be addressed soon labels Dec 23, 2021
@krysal krysal self-assigned this Dec 23, 2021
@krysal krysal marked this pull request as ready for review January 5, 2022 04:08
@krysal krysal requested a review from a team as a code owner January 5, 2022 04:08
@krysal krysal requested review from obulat and dhruvkb January 5, 2022 04:08
isSelected: {
type: Boolean,
default: false,
},
},
setup(props) {
const { i18n } = useContext()
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably extract this resultsCountLabel function in the future, because it's used in the search bar as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I extracted it into a new use-i18n-utilities.js composable and tried to replace the code on the VHeader but seems not to work well within watchEffect, I couldn't make it work there.

@zackkrida
Copy link
Member

Looks great, but should the desktop version be included here too? Maybe instead of looking at is as desktop vs. mobile it should be prop-based, like 'stacked' vs. 'horizontal' with a layout prop?

CleanShot 2022-01-05 at 15 38 32@2x

@fcoveram
Copy link

fcoveram commented Jan 5, 2022

It looks great 🎉

Just one comment. I noticed it says Image instead of Images. It should have the S at the end of Image, not in Audio.

To @zackkrida's comment. I would add the version when filter sidebar is expanded and the element slightly reduces its width.

@krysal
Copy link
Member Author

krysal commented Jan 6, 2022

@zackkrida I like that approach! In my mind, I was overcomplicating it with breakpoints. I'd add the desktop version too.

@panchovm Good catch, thanks, I'll fix it. Also, are you referring to this component?

CleanShot 2022-01-06 at 11 36 39@2x

I think that @obulat is developing that in #568 (not sure). If not, it will probably be another component anyway, called VContentTypeMenu or something like that. I see how they are closely related and I can work on it after this.

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>
@zackkrida
Copy link
Member

@krysal The desktop version is actually used on the "All" results page, above the results:

Figma: https://www.figma.com/file/w60dl1XPUvSaRncv1Utmnb/Openverse-Releases?node-id=133%3A22596

CleanShot 2022-01-06 at 10 48 22@2x

@krysal krysal changed the base branch from main to add/VHeader January 6, 2022 21:03
Base automatically changed from add/VHeader to redesign January 10, 2022 18:23
@zackkrida zackkrida requested a review from obulat January 14, 2022 01:24
Copy link
Member

@zackkrida zackkrida 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 really nice! I can implement this in the actual user interface in my image and all grid pull requests.

Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple questions, non of which are blocking or even necessarily include specific suggestions for changes. Feel free to ignore them or we can push them off to a later day to solve later 🙂

Good work! The component looks good and the implementation is really nice.

test/unit/specs/components/v-content-link.spec.js Outdated Show resolved Hide resolved
Comment on lines +69 to +73
layout: {
type: String,
default: 'stacked',
validator: (val) => ['stacked', 'horizontal'].includes(val),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a shame we have changes other than just organization that get tied to this (like font size I think?) because it seems like something that flex-wrap should be able to take care of.

Do we envision the usage of this prop to be a situation where the component is rendered in distinct places where the user will know whether it's a mobile or desktop context? Or are we potentially just pushing the media-query up the stack so that the code for this prop will be something like like :layout="isMinScreen('md') ? 'horizontal' : 'stacked'"?

If it's the last case then my inclination would be to just move that logic into the component and hide the fact that it has different layouts depending on screen size from the user (so the user doesn't have to worry about it).

This is not a blocker or even a solid suggestion, just wondering what the intention is.

Copy link
Member

Choose a reason for hiding this comment

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

I also started thinking we might be able to handle this with just css-based media queries. I can look at that when I implement this component in #530 and my 'all' results PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using the isMinScreen() is giving me mismatched HTML problems when the component is server-side rendered. I'll have to take a closer look at how those errors are being handled but for now I'd like to tie this together. I agree that it would be ideal to hide this in the component logic and save us a property here as well.

@obulat
Copy link
Contributor

obulat commented Jan 14, 2022

Krystle, I can repeat what Francisco told me about the borders: in hover and/or hover state, there shouldn't be a gray border, only the pink outline:
Screen Shot 2022-01-14 at 9 22 06 PM
Can you see the tiny gray border inside the pink outline here?

Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

The content link looks amazing, @krysal ! I only saw one tiny issue with the border of a hovered button in the comment.

@fcoveram
Copy link

I saw what @obulat found before and forgot to comment the change. Thanks Olga for bringing it.

@krysal
Copy link
Member Author

krysal commented Jan 14, 2022

Thanks everyone for reviewing! Looks all good now :)

@krysal krysal merged commit 00286c8 into redesign Jan 14, 2022
@krysal krysal deleted the v-content-link branch January 14, 2022 19:11
zackkrida added a commit that referenced this pull request Jan 14, 2022
* Update figma links in README

* Search results title (#577)

* Fix ci tests by restoring scopedSlots param in search results title spec

* Fix search result title casing

* Updated load more button (#578)

* Update `content-types` test with load more button changes

* VHeader (#488)

* Add VHeader stub
Rename VSearchBar and VSearchButton and move to VHeader
Add VLogoLoader to VHeader and adjust header styles

* Extract search route handling into composable, set Logo loading when fetching

* Update pnpm lockfile

* Add VFilterButton (#489)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Add searchbar to header (#491)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Update references to `InputField` to point to `VInputField` (#586)

* New 404 page (#583)

Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>

Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>

* Fix video tab

The media store query.mediaType is null for video, so it's not possible to use it as a key to look up results in the store

* Fix filters e2e tests by opening the sidebar

* Fix openverse.pot after-merge problems

* Fix e2e tests

* Show a generated artwork when the audio thumbnail is absent (#600)

* Fix single result back links

* Fix photo detail test

* Fix photo-details test

* Combine layouts into a single default (#599)

* Add header icons (#604)

* Fix error when `<rect>` dimensions are negative (#605)

* Add `VContentLink` component (#560)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Olga Bulat <obulat@gmail.com>

* Prevent unsupported media types causing header errors

* Better video tab fix

* Remove sample audio data (#571)

Co-authored-by: Krystle Salazar <krystle.salazar@ciens.ucv.ve>
Co-authored-by: Olga Bulat <obulat@gmail.com>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>
zackkrida added a commit that referenced this pull request Jan 21, 2022
* Update figma links in README

* Search results title (#577)

* Fix ci tests by restoring scopedSlots param in search results title spec

* Fix search result title casing

* Updated load more button (#578)

* Update `content-types` test with load more button changes

* VHeader (#488)

* Add VHeader stub
Rename VSearchBar and VSearchButton and move to VHeader
Add VLogoLoader to VHeader and adjust header styles

* Extract search route handling into composable, set Logo loading when fetching

* Update pnpm lockfile

* Add VFilterButton (#489)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Add searchbar to header (#491)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Update references to `InputField` to point to `VInputField` (#586)

* New 404 page (#583)

Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>

Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>

* Fix video tab

The media store query.mediaType is null for video, so it's not possible to use it as a key to look up results in the store

* Fix filters e2e tests by opening the sidebar

* Fix openverse.pot after-merge problems

* Fix e2e tests

* Show a generated artwork when the audio thumbnail is absent (#600)

* Fix single result back links

* Fix photo detail test

* Fix photo-details test

* Combine layouts into a single default (#599)

* Add header icons (#604)

* Fix error when `<rect>` dimensions are negative (#605)

* Default to all from the homepage; init

* Add `VContentLink` component (#560)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Olga Bulat <obulat@gmail.com>

* Prevent unsupported media types causing header errors

* Better video tab fix

* Fix homepage test

* Remove sample audio data (#571)

* Modify "fetchState" mutations to support ALL_MEDIA

* All_MEDIA state working except for SET_MEDIA

* all media state init

* UI suppoort for media count

* wip

* ugh

* Mobile box layout adjustments

* Fix image clicks

* Content links

* Add debugging comment

* Remove dead code

* Result rounded corners

* Update src/utils/srand.js

* Focus states

* Small styling improvements to image grid title and horizontal spacing

* Refactor fetching for all media (#621)

* Refactor all fetching to use getters more

* Disable failing tests

* Revert index/key rename in image cell v-for

Co-authored-by: Zack Krida <zackkrida@pm.me>

* Add a wrapper to FETCH_MEDIA to simplify fetching all content (#640)

Add a wrapper to FETCH_MEDIA to simplify fetching all content

* Double number of skeleton boxes

* Progress

* Remove unused filter display component

* Set query when using filters

* Fix tests

* truncate audio box text

Co-authored-by: Krystle Salazar <krystle.salazar@ciens.ucv.ve>
Co-authored-by: Olga Bulat <obulat@gmail.com>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🌟 goal: addition Addition of new feature 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component: Content link
6 participants