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

feat(ONYX-253): create suggested artworks screen #9233

Merged
merged 19 commits into from
Sep 14, 2023

Conversation

dariakoko
Copy link
Contributor

@dariakoko dariakoko commented Sep 8, 2023

This PR resolves ONYX-253

Description

Create a modal displaying similar works
We should display only 10 artworks
By pressing on the artwork navigate to the artwork screen

All data available Empty state Error state Placeholder for the pills Placeholder for the grid
simulator_screenshot_33FAA291-C6BB-4C34-8C35-14D429EFFEFE image image 16) Simulator Screen Shot - iPhone 14 Pro - 2023-09-13 at 11 44 13

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • create suggested artworks screen -daria

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Sep 8, 2023

This PR contains the following changes:

  • Cross-platform user-facing changes (create suggested artworks screen -daria)

Generated by 🚫 dangerJS against c53221b

@dariakoko dariakoko marked this pull request as ready for review September 12, 2023 15:32
@damassi
Copy link
Member

damassi commented Sep 12, 2023

@dariakoko - can you 🙏 update the PR with a full description? We shouldn't depend on external JIRA ticket links to provide relevant context in a PR.

Folks reviewing -- Feeling somewhat 😓 having to ping PR after PR about this, #dev channel, etc. It should be flagged and discussed amongst product teams and made an immutable habit.

@dariakoko
Copy link
Contributor Author

@dariakoko - can you 🙏 update the PR with a full description? We shouldn't depend on external JIRA ticket links to provide relevant context in a PR.

Sure. I have just marked it as ready for review. Next time will update the details first and then change the status

@damassi
Copy link
Member

damassi commented Sep 12, 2023

ty! didn't realize it wasn't yet ready to review, saw PR comments and so on. All good. And please spread the word 😄

Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

cool! Left some questions, let me know if I should add more details!

src/app/AppRegistry.tsx Outdated Show resolved Hide resolved
src/app/AppRegistry.tsx Outdated Show resolved Hide resolved
aggregations,
attributes,
entity,
onClosePress: () => {},
Copy link
Contributor

Choose a reason for hiding this comment

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

question: is there a reason why we pass empty callbacks here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not at all, I just wanted to reuse the types we use for the alert creation flow. After refactoring it doesn't make sense any more - removed, added an interface with only aggregations, attributes, entity to the file

@MounirDhahri
Copy link
Member

Hey @dariakoko, I see you're still pushing to the PR. Is it ready for review? if not would you mind changing it to a draft PR or adding [WIP] to the title.

@dariakoko
Copy link
Contributor Author

@MounirDhahri Ready for review, pushed the latest changes just now

Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

All good, I left 1 code related suggestion and 1 thing I think we should fix before merging - hide the button if there are no artworks to suggest

well done! 👍

src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx Outdated Show resolved Hide resolved

const similarArtworksQuery = graphql`
query BrowseSimilarWorksContentQuery($input: FilterArtworksInput, $first: Int) {
artworksConnection(first: $first, input: $input) {
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: there is a a new query you could use instead, which doesn't require attributes (all logic is on metaphysics side):

	artwork(id: "banksy-di-faced-tenner-232") {
		savedSearch {	
			suggestedArtworksConnection(first: 10) {
				edges {
					node {
						title
					}
				}
			}
		}
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know, would be nice to use it
I tried it, but it returns an empty array of nodes, so I'd stick only with the totalCount in this commit
We could look into this together if you're interested

Copy link
Member

@MounirDhahri MounirDhahri left a comment

Choose a reason for hiding this comment

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

Really nice PR! great work Daria

src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx Outdated Show resolved Hide resolved
src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx Outdated Show resolved Hide resolved
src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx Outdated Show resolved Hide resolved
)

const similarWorksFragment = graphql`
fragment BrowseSimilarWorks_artwork on Artwork {
Copy link
Member

Choose a reason for hiding this comment

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

issue: using the same fields here as in

fragment CreateArtworkAlertModal_artwork on Artwork {
makes me think we should consolidate this into one fragment instead of copying it. This way this code is going to be more robust if we introduce future changes

nickskalkin
nickskalkin previously approved these changes Sep 14, 2023
Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

👍

MounirDhahri
MounirDhahri previously approved these changes Sep 14, 2023
Copy link
Member

@MounirDhahri MounirDhahri 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 small suggestion

src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx Outdated Show resolved Hide resolved
@dariakoko dariakoko self-assigned this Sep 14, 2023
@dariakoko dariakoko added the Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green label Sep 14, 2023
@artsy-peril artsy-peril bot merged commit be39fbd into main Sep 14, 2023
6 of 7 checks passed
@artsy-peril artsy-peril bot deleted the dariakoko/ONYX-253/create-suggested-artworks-screen branch September 14, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Synced Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants