-
Notifications
You must be signed in to change notification settings - Fork 158
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(cloud-masthead): add Cloud-specific container and composite components #5593
feat(cloud-masthead): add Cloud-specific container and composite components #5593
Conversation
Deploy preview created for package Built with commit: 7c2066c00d4ae455a62674e2b269f9bc78eb5ed9 |
Deploy preview created for package Built with commit: 7c2066c00d4ae455a62674e2b269f9bc78eb5ed9 |
Deploy preview created for package Built with commit: 7c2066c00d4ae455a62674e2b269f9bc78eb5ed9 |
?has-profile="${hasProfile}" | ||
?has-search="${hasSearch}" | ||
.unauthenticatedProfileItems="${ifNonNull(unauthenticatedProfileItems)}" | ||
data-endpoint="/common/carbon-for-ibm-dotcom/translations/cloud-masthead" |
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.
was double checking why the endpoint was resulting in a 404 - turns out I forgot we need to add /jsononly to the path. We should be able to get the data using /common/carbon-for-ibm-dotcom/translations/cloud-masthead/jsononly
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.
@annawen1 This is good to know. Thanks for pointing this out. Also, since we're using the JSON-only directory, I'm guessing we don't need the .js
within the dotcom translation repo? https://github.ibm.com/webstandards/ibm-dotcom-translations/blob/master/translations/cloud-masthead/usen.js
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 just wanted to bring this up as this will play in our translation content population workflow and if we're only using the JSON files that would help come down in the formatting of the .js
versions. Let me know what you think.
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.
Yeah we don't need the .js
file for the translations, I think we initially kept it for consistency when copying over the current ibm.com translations folder structure? Not sure if removing it will cause any issues. @jeffchew what do you think?
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.
packages/web-components/src/components/masthead/cloud/cloud-masthead-container.ts
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/masthead/__stories__/masthead.stories.ts
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/masthead/cloud/cloud-masthead-composite.ts
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/masthead/__stories__/masthead.stories.ts
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/masthead/cloud/cloud-masthead-composite.ts
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/masthead/cloud/cloud-masthead-composite.ts
Outdated
Show resolved
Hide resolved
${profileItems?.map( | ||
({ title, url }) => | ||
html` | ||
<dds-masthead-profile-item href="${ifNonNull(url)}">${title}</dds-masthead-profile-item> |
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.
As part of the new Cloud masthead work, we need to expose a CTA button component that links out to the console. This is a new feature that we'll need to account for within the authenticated state of the dds-cloud-masthead-profile
component (see specs - https://ibm.ent.box.com/file/786859527229).
As for the data/translation, we'll need to add this to our JSON file as well. @annawen1 @jeffchew Let me know if there are fields within the existing data structure that we can reuse or if this is something new that we need to add. https://1.www.s81c.com/common/carbon-for-ibm-dotcom/translations/cloud-masthead/jsononly/usen.json
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.
hmm don't see any existing fields we can utilize for the console
button so I think we need to add it. Possibly in
"masthead": {
"search": {
"btnSearchClosed": "Open IBM search field",
"btnSearchOpen": "Search all of IBM",
"btnClose": "Close IBM search field",
"placeHolderText": "Search all of IBM"
},
--> "not sure key name bc I'm not good with naming": "Console"
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.
@annawen1 Looking at the existing structure, I think it might be good to add this button within the [profileMenu][signedin]
array, as this button is intended to show up in the authenticated state (see attached ). This will be managed outside of the [profileMenu][signedin][links]
, which is being used to display the user drop-down menu. Let me know what you think.
@huntermacd let me know what you think as well.
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.
yep, that looks good! Just note we need to edit the type files in the services store package! Let me know if you need help with that.
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.
@annawen1 Great! I'll work on opening a PR to add this new ctaButton
array. As for accounting for these types in the services store package, perhaps this is something you can help us add once the data is in place?
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.
sure!
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.
Here's the PR to adjust the data structure based on our conversation here - https://github.ibm.com/webstandards/ibm-dotcom-translations/pull/295.
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.
@huntermacd Overall, this is a great first draft of the work, and thanks for putting this PR together. @annawen1 and I left some feedback. Let me if you have any questions/concerns.
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 @huntermacd!
@jeffchew Just double-checking; Looks that we are maintaining these components even though it's cloud-BU-specific. Is it correct? Just wanted to see if we decided that PAL route didn't make sense.
packages/web-components/src/components/masthead/cloud/cloud-masthead-profile.ts
Outdated
Show resolved
Hide resolved
cc @annawen1 @asudoh @jeffchew I could use some assistance wrapping these components behind a feature flag, being that they're interconnected. My latest commit 70085a3 shows my progress on doing that. Currently it's broken. I may have a circular import happening. Also, regarding the cookie check, this needs to happen on each load of the component. I'm not certain that there's a need to put this value into the store. The goal is to check the cookie for determining which version of the Cloud Masthead Profile to show, either "authenticated" or "anonymous". Putting this functionality into an importable service, a la the ProfileAPI, also seems like overkill when it boils down to a single, simple function. Please let me know your thoughts on the matter. |
@asudoh wonder what your thoughts are on where the cookie fetching logic lives? |
@annawen1 Thank you for asking. If the team thinks maintaining the login status in |
Thanks @asudoh! @huntermacd, based on Akira's comment I think it may be good to fetch the cookie data within |
Deploy preview created for package Built with commit: 7c2066c00d4ae455a62674e2b269f9bc78eb5ed9 |
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.
@huntermacd Looks great! I'm now able to see the CTA button for the anonymous and authenticated states!
@annawen1 @jeffchew I think this PR is good to merge down to the main branch and available for view via the experimental environment. What do you both think?
@huntermacd looks good! 🎉 One thing - I do see it's failing on one of the tests, can you take a look? |
494a7ed
to
d9bdcf0
Compare
Looks like all of the CI checks are cleared! @annawen1 Are we good to merge this PR down? |
Everything looks good, one thing though sorry! @jeffchew you mentioned about the We have a similar util called |
That's right, and sorry that I'm catching up with this PR now. What caught my attention was the @asudoh to your question about PAL specific things, I agree that that would be the ultimate goal. This is a first iteration of the Cloud masthead which is why we have suggested putting behind a feature flag. At least the way I'm thinking of, it would be nice to be able to ultimately abstract some of the things happening in this variation of the Masthead so that other teams/BUs can ultimately take advantage of some of the things here, and Cloud would also ultimately be using this abstracted version for their needs too. But for now it can be safely iterated behind the flag while also getting something that can hit the glass for the Cloud team. |
@jeffchew Thanks for the response! Sounds to me like we have a good direction on how to manage the cookie settings and fetching logic within the existing |
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.
@proeung yes, would typically agree that if we're behind a feature flag, we can safely continue to iterate behind it. However, I think the added dependency in the package itself, regardless if the intention is to move to another package later on, is something we should try to avoid.
I think if at minimum we can move the cookie library dependency out of the web-components
package, I think that can be safe to then merge this in.
@jeffchew Sounds good! I'll create a ticket for us to track the work for moving the js-cookie dependency and the fetching logic to the existing @shixiedesign I don't believe this PR requires a design QA at the moment. We're working on getting the baseline changes for the new Cloud masthead merged down so that we can add in the other design enchantments. Also, the changes in this PR are behind a feature flag. We'll conduct a proper design QA review once we have all of the elements assembled that you, Lila Title, and others can take a look at. |
With the removal of the js-cookie dependency in the web components package, we're getting an |
Pushed changes to move the cookie fetching logic in the utilities package! |
@annawen1 Awesome job moving the js-cookie fetching logic into the @jeffchew With the latest commit (864d893) that @annawen1 pushed up, I think we're good for another code review and I think we can safely merge this PR down. What do you think? |
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.
LGTM!
…m into feat/5305 * 'feat/5305' of github.com:iwhitcomb/carbon-for-ibm-dotcom: chore(carbon): upgrade to Carbon v10.31.0 (carbon-design-system#5760) feat(cloud-masthead): add Cloud-specific container and composite components (carbon-design-system#5593) fix(dotcom-shell): add scroll eventListener (carbon-design-system#5747) fix(card-pictogram): fixed visual bugs & storybook refinements (carbon-design-system#5736)
Related Ticket(s)
https://jsw.ibm.com/browse/HC-1681
Description
This diff adds various Cloud-specific versions of existing components. This should be kept as a draft since there is a lot more work to do, but I need some eyes from the team on the work so far for guidance.
Changelog
New
Changed