Mini #20: SharePoint WebParts don’t load for guest users by default (and other problems with SharePoint guests)
via Laura Kokkarinen
via GitHub gist
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
via WebDevEtc
linear-gradient(to bottom, rgba(245, 246, 252, 0.52), rgba(117, 19, 93, 0.73)),
via TahoeNinjas
displayGroupsAsAccordion: true,
groups: [
{
groupName: "Group 1",
isCollapsed: true,
groupFields: [
...
via StackOverflow
via StackOverflow
via w3schools
via Microsoft Docs
via MDN
via StackOverflow
via StackOverflow
via mcpmag
via PnP JS docs
You can also fall back to the SharePoint default placeholder using _layouts/images/O14_person_placeHolder_192.png
as needed
via w3schools
Rounded corner are super easy! 50% for full circle.
Simply change the width\height to get any size you want
var spinnerStyles = {
circle: {
height: this.props.spinnerSize,
width: this.props.spinnerSize,
}
};
<Spinner styles={spinnerStyles} />
via PnP JS docs
This one-liner format initialising @sp is the one that worked for me!
public onInit(): Promise<void> {
return super.onInit().then(_ => {
// other init code may be present
sp.setup({
spfxContext: this.context
});
});
}
via PnP JS docs
via css-tricks.com
Years are easy, months are 0 based numbers so are days - neither holds the names of months/days so that will need to be added as well.
via StackOverflow
JavaScript date object does not provide ordinal. If needed, you'd need to construct something like the below (good for situations when toLocaleDateString does not provide the format wanted)
const nth = function(d) {
if (d > 3 && d < 21) return 'th';
switch (d % 10) {
case 1: return "st";
case 2: return "nd";
case 3: return "rd";
default: return "th";
}
}
via Microsoft Docs
For bonus points, make sure your custom PowerShell cmdlets all use the same prefix (I use func, see below)
Get-Alias -Definition "func*"