-
Notifications
You must be signed in to change notification settings - Fork 342
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 breadcrumb component for spo entities #3455
add breadcrumb component for spo entities #3455
Conversation
|
||
export interface IBreadcrumbState { } | ||
|
||
const SITE_REGEX = /https:\/\/\w+\.sharepoint\.com\/sites\//; |
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.
What about /teams? Also some customers have custom domains and government clouds use different domains as well. It's better to use the SPWebUrl as the base when start splitting to avoid dealing with domains.
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've now included case /teams in regex check. But per my understanding using domain extensions such as *.mcas.ms, *.mcas-gov.us, or *.mcas-gov.ms does not impact this validation as they are not part of the OriginalPath property.
Also added prop for SPWebUrl and used that while creating the breadcrumb path.
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.
Please address my URL comment as well. Don't use sharepoint.com
in the regex, but rather pass in the SPWebUrl
value or similar and use that to massage the URL. The domain could e.g. be sharepoint.us
or even contoso.com
for custom domain customers.
SPWebURL.split('/') and remove the last part gives you up until /sites/sitename/subweb/subweb/subweb as an extreme example. Compare this to e.g OrignalPath and you have the parts being a library/folder.
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.
Okey, modified the component and added comments how I think it should work.
You have to update documentation as well as part of the PR with screenshot and how to use the component. |
Added instructions how to use the component. Let me know if even more comprehensive documentation is needed. |
One more question before I merge. Should we add this component to one of the default templates you think? |
Yes, it would make sense to include this component in the details list template, and possibly in the list template as well. Additionally, I made an extra commit to handle entities with |
Thank you.. if you acknowledge it looks good for:
|
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
I noticed that the breadcrumb wasn't rendering for lists and document libraries because they don't have a |
@wobba what are the steps forward? Do you need anything else from my side? |
Thank you. |
Breadcrumb component
The component is designed to construct a breadcrumb path, ideally utilizing the
OriginalPath
,SPSiteURL
,SPWebUrl
,Title
, andFileType
properties derived from a SharePoint entity (such as a file, item, folder, document library, etc.). Component validates that neither ofOriginalPath
,SPSiteURL
,SPWebUrl
, orTitle
aren'tundefined
ornull
and therefore component is designed to work for SharePoint entities.The actual breadcrumb is constructed using the Fluent UI breadcrumb.
Breadcrumb path should work fine and look good for:
User instructions
Get started with:
Use all properties:
OriginalPath
orPath
property. Property is required for rendering the breadcrumb path.String
SPSiteURL
property. Property is required for rendering the breadcrumb path.String
SPWebUrl
property. Property is required for rendering the breadcrumb path.String
Title
property. Property is required for rendering the breadcrumb path.String
FileType
property. Property is required for rendering the breadcrumb path.String
true
.Boolean
false
, not only is the entity name excluded from the breadcrumb path, but also the last item in the breadcrumb path is not highlighted in bold. Optional, default valuetrue
.Boolean
true
.Boolean
3
.Int
0
.Int
12
.Int