-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add US-only option in Collection #1748
Conversation
97dabf1
to
b302b74
Compare
… of US-only option
… for US option. wired this via controller for routes.
591d4fd
to
ec5aa88
Compare
We have tested this by deploying on CODE and publishing the Front. |
@@ -62,6 +62,8 @@ describe('Store middleware', () => { | |||
draft: [], | |||
previously: undefined, | |||
type: 'type', | |||
targetedRegions: [], //add here to pass the test for persistCollectionOnEdit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we can get rid of the comment
targetedRegions: [], //add here to pass the test for persistCollectionOnEdit | |
targetedRegions: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly, can probably remove the comments
fronts-client/src/fixtures/shared.ts
Outdated
@@ -657,6 +671,8 @@ const stateWithCollection: any = { | |||
draft: [], | |||
previously: undefined, | |||
type: 'type', | |||
targetedRegions: [], //add here to pass the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment
targetedRegions: [], //add here to pass the test | |
targetedRegions: [], |
@@ -519,6 +521,8 @@ const collection = { | |||
id: 'exampleCollection', | |||
displayName: 'Example Collection', | |||
type: 'type', | |||
targetedRegions: [], //mandatory, should be added here to compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment
targetedRegions: [], //mandatory, should be added here to compile | |
targetedRegions: [], |
// const curatedPlatformStrategy = () => | ||
// renamingCollection | ||
// ? renameEditionsCollection(id)(collectionToEditionCollection(collection)) | ||
// : isMarkedForUSOnly | ||
// ? markCollectionForUSOnly(id)(collectionToEditionCollection(collection)) | ||
// : updateEditionsCollection(id)( | ||
// collectionToEditionCollection(collection), | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can delete this unused code
// const curatedPlatformStrategy = () => | |
// renamingCollection | |
// ? renameEditionsCollection(id)(collectionToEditionCollection(collection)) | |
// : isMarkedForUSOnly | |
// ? markCollectionForUSOnly(id)(collectionToEditionCollection(collection)) | |
// : updateEditionsCollection(id)( | |
// collectionToEditionCollection(collection), | |
// ); |
@@ -1473,6 +1473,8 @@ export const finalStateWhenAddNewCollection = { | |||
platform: undefined, | |||
targetedTerritory: undefined, | |||
type: undefined, | |||
targetedRegions: [], //add here to pass the test for add collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetedRegions: [], //add here to pass the test for add collection | |
targetedRegions: [], |
@@ -1491,6 +1493,8 @@ export const finalStateWhenAddNewCollection = { | |||
platform: undefined, | |||
targetedTerritory: undefined, | |||
type: undefined, | |||
targetedRegions: [], //add here to pass the test for add collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetedRegions: [], //add here to pass the test for add collection | |
targetedRegions: [], |
@@ -2233,6 +2237,8 @@ export const finalStateWhenRemoveACollection = { | |||
platform: undefined, | |||
targetedTerritory: undefined, | |||
type: undefined, | |||
targetedRegions: [], //add here to pass the test for remove collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetedRegions: [], //add here to pass the test for remove collection | |
targetedRegions: [], |
@@ -196,6 +198,8 @@ describe('Collection actions', () => { | |||
live: ['abc', 'def'], | |||
previously: undefined, | |||
type: 'type', | |||
targetedRegions: [], //add here to pass the test for Get Collections thunk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetedRegions: [], //add here to pass the test for Get Collections thunk | |
targetedRegions: [], |
@@ -130,6 +130,8 @@ describe('Collection actions', () => { | |||
live: ['abc', 'def'], | |||
previously: undefined, | |||
type: 'type', | |||
targetedRegions: [], //add here to pass the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetedRegions: [], //add here to pass the test | |
targetedRegions: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of very small comments but otherwise looking good to me
def updateCollectionRegions(collectionId: String) = EditEditionsAuthAction( | ||
parse.json[EditionsFrontendCollectionWrapper] | ||
) { req => | ||
logger.info(s"Mark for US only the collection ${collectionId}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is inaccurate - i think it can just be zapped now it's working tbh
)} | ||
{isFeast && ( | ||
<> | ||
{targetedRegions?.length > 0 ? 'US!' : ''}{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's replace this text with a US flag emoji: https://emojipedia.org/flag-united-states
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonus if you can get a tooltip on there to say "Targeted to US only" 😁
{isFeast && ( | ||
<> | ||
{targetedRegions?.length > 0 ? 'US!' : ''}{' '} | ||
{/*The above text will appear on collection to show US tagged collections, for testing purpose only.*/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment ⚡
@@ -302,6 +306,8 @@ async function buildCollection(collectionName, frontId, count) { | |||
} | |||
|
|||
async function frontNameToId(issueId, frontName) { | |||
console.log(`${frontsBaseUrl}/editions-api/issues/${issueId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(`${frontsBaseUrl}/editions-api/issues/${issueId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Divs-B sorry, i left this one in!
…spot the problem.
…dpoint and few ui tweak to adjust menu item
1c49330
to
325f8c7
Compare
> | ||
US Only | ||
<Icon> | ||
{targetedRegions.includes('us') ? <h2>✓</h2> : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the ઙ
isn't obvious to me, I think you can use
{targetedRegions.includes('us') ? <h2>✓</h2> : undefined} | |
{targetedRegions.includes('us') ? <h2>✓</h2> : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Georges-GNM for the suggestion, I will take this to test its look and feel in later PR if its ok for you?
This PR is good to go as got approved by you and @fredex42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, the icons are working as is, it's more for (my) code readability (as I had no idea what that thing was doing before looking it up 😅 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Georges-GNM
setMenuOpen((prev) => !prev); | ||
}} | ||
> | ||
<pre style={{ padding: 0, margin: 0 }}>⋮</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use
<pre style={{ padding: 0, margin: 0 }}>⋮</pre> | |
<pre style={{ padding: 0, margin: 0 }}>⋮</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too, I will take this to test its look and feel in later PR if its ok for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A massive PR, but I appreciate somewhat difficult to separate too. Few nitpicky comments, tested on code and feast as well as regular collections still seem to behave as intended, so it looks good to me - if Andy's happy, then it's a 👍 from me.
As this feels like a big change (even if it should only be limited to feast), might be worth mentioning to CP once the PR's merged in case there's anything we've missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
@@ -133,11 +139,10 @@ const CollectionMeta = styled(CollectionMetaBase)` | |||
const ItemCountMeta = CollectionMetaBase; | |||
|
|||
const CollectionHeadingSticky = styled.div` | |||
position: sticky; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like this line is the cause of the change in behaviour CP emailed a few people about this morning: the header on a container used to follow the user down the container, keeping (for example) the launch button easy to access when the top of the container has scrolled offscreen, and after this change it doesn't do that any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Emily, small change that was missed in review! I've put out a fix :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both, It’s great to see the solution in my absence on Friday, I noticed that this fix had an unintended side effect in other editions in the Fronts,
We’ve previously considered these editions as not in use, but involvement in data curation raises an open question about whether they are still actively use via fronts tool?
I’d like to clarify this to ensure we handle them appropriately.
Looking forward to your thoughts @fredex42 @Georges-GNM
Co-authored by @fredex42 (Thanks for help in Backend and DB wiring!)
What's changed?
We are now moving towards country specific curation of data,
We want to try for US first to provide much more in-depth use of Feast App for US users.
We are going to put
US only
option to Container(Collection) level to help Editorial users to select option if they want to mark it for only to display in US.(Note: As we might need to get other devs on Fronts tool and UX help to confirm button's look and feel so its style and appearance are subject to change.)
Screen.Recording.2025-01-30.at.11.50.27.mov
(updated video above)
Backend and DB wiring section: Thanks @fredex42 for help in wiring this end to end (thanks to @jonathonherbert too for confirming on ways to achieve this in the code).
This wiring will help in supplying the data to Database and to backend for our Apps team to use at the end.
Wired the UI change with backend with new endpoint in the routes(
/update-regions
), which will PATCH the status for regions as per User's selection.Checklist
General
Client