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

CustomerSegmentationTemplate / Introduce dateAdded prop #771

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

loic-d
Copy link
Contributor

@loic-d loic-d commented Mar 2, 2023

Background

We currently display a "New" badge for recently introduced templates. Apps can feed us the date of when the template was added and we will display the badge if the date is within a month.

I've made the prop optional because but we could just set it in the past for all existing templates. I'm open to suggestions.

image

Solution

(Describe your solution, why this approach was chosen, and what the alternatives/impacts may be)

🎩

  • ...

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@loic-d loic-d requested review from a team as code owners March 2, 2023 15:33
@loic-d loic-d changed the base branch from main to unstable March 2, 2023 15:34
standardMetafieldDependencies?: CustomerStandardMetafieldDependency[];
/* Date when the template was first introduced. A "New" badge will be rendered for recently introduced templates. */
dateAdded?: Date;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on this being optional/required?

Copy link
Contributor

Choose a reason for hiding this comment

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

optional makes sense to me 👍🏼

Copy link
Member

@lemonmade lemonmade left a comment

Choose a reason for hiding this comment

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

This API seems a little odd, shouldn't we be able to determine this ourself (since we know when extensions are created)?

@loic-d
Copy link
Contributor Author

loic-d commented Mar 2, 2023

@lemonmade we need more granularity actually. For example:

  • Extension adds templates A, B, C. They are flagged as new
  • Extension adds templates D, E one month later. Only D, E should be flagged as new.

@lemonmade
Copy link
Member

@loic-d could these be separate extensions instead?

@loic-d
Copy link
Contributor Author

loic-d commented Mar 2, 2023

@lemonmade I don't think this is a scalable solution. We have almost 20 first party templates at the moment and this list will continue to grow. It will be harder to maintain and I think it will lead to duplicate boilerplate code being shipped as part of each extension's bundle 🤔

Copy link
Contributor

@carolopolo carolopolo left a comment

Choose a reason for hiding this comment

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

LGTM. i think this makes sense given our needs.

Adds changeset
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.

None yet

4 participants