-
Notifications
You must be signed in to change notification settings - Fork 5
Bynder integration #2581
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
Bynder integration #2581
Conversation
…et if no session is valid
Redeployed to stage with Andres' suggestion regarding storing the token in the settings |
}); | ||
} | ||
|
||
localStorage.setItem("cvad", url); |
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.
@theofficialnar why do we still need to leverage localStorage if we are now saving it on instance settings?
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 to ensure that whatever changes saved to the instance for this value is also synced with the localstorage all the time. I could move this out of the function and just place it after updateBynderPortalUrl
is ran to achieve the same effect.
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.
@theofficialnar But why do we need to use localstorage if we are saving values in the db? Can't we fetch it from api and handle everything in memory?
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.
@agalin920 Bynder's UCV component checks the values from localStorage. I tried passing in the token stored on the db to the component directly but it fails to authenticate since based on my understanding of their docs this would only work if we give it a token the came from their token endpoint which we need to do ourselves. I'm guessing the token that the UCV generates when you log in to it is different from that token that can be directly passed into the component to bypass the whole login thing. The UCV component only works when the token from the db is stored to local storage as "cvrt" and the portal address as "cvad".
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.
@theofficialnar Gotcha so it is directly required by the Bynder component internals. Thanks
}} | ||
onKeyPress={(event) => event.key === "Enter" && handleUpdate()} | ||
onKeyPress={(event: React.KeyboardEvent<HTMLDivElement>) => | ||
event.key === "Enter" && handleUpdate() |
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.
Do you prefer this pattern over the <form>
pattern?
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.
I'm actually not sure why this is being tagged as a change on this PR since this is not part on my changes. Must be something that's on master (since this branch is synced to latest master) that isn't on the dev branch since @shrunyan changed the target branch to dev.
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.
Hi @theofficialnar,
Here are the VQA changes needed:
https://www.figma.com/file/XPjxuxpmkvnMHhzAFXLZBW/Bynder-Integration?type=design&node-id=155%3A8806&mode=dev&t=x9CP4kUFLm61va9P-1
Once you complete the fixes, please deploy it to stage.
Do not deploy this PR to Production until the following is done:
|
Base branch was modified
Requires zesty-io/material#91
bynder-integration.webm
Closes #2157