-
Notifications
You must be signed in to change notification settings - Fork 836
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
Upgrade InjectCSS sample from SPFx v1.8.0 to v1.20.0 #1416
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3fe7230
Upgrade solution to spfx v1.20.0
tom-daly 8ee322c
Update README.md
tom-daly c416c0a
fix version
tom-daly bbbf55c
update the sample.json version and date
tom-daly 7046091
upgrade libs, change to style lib to site assets
tom-daly c294848
Delete samples/react-application-injectcss/build.cmd
tom-daly e11ea6b
Updated readme
bfed670
Merge branch 'main' into main
hugoabernier 83078bc
Discard changes to package-lock.json
hugoabernier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
!dist | ||
config | ||
|
||
gulpfile.js | ||
|
||
release | ||
src | ||
temp | ||
|
||
tsconfig.json | ||
tslint.json | ||
|
||
*.log | ||
|
||
.yo-rc.json | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v18.20.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
samples/react-application-injectcss/DeployApplicationCustomizer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Use this file to deploy the extension to your application catalog | ||
$tenantUrl = "https://<your-tenant>.sharepoint.com" | ||
|
||
# Get credentials | ||
$credentials = Get-Credential | ||
Connect-PnPOnline $tenantUrl -Credentials $credentials | ||
# Connect to the Site | ||
Connect-PnPOnline $tenantUrl -Interactive -ClientId "<your-new-registered-entra-id-application-id>" | ||
|
||
Add-PnPApp -path .\sharepoint\solution\react-application-injectcss.sppkg -Publish -SkipFeatureDeployment -Overwrite |
5 changes: 2 additions & 3 deletions
5
samples/react-application-injectcss/DisableApplicationCustomizer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
samples/react-application-injectcss/EnableApplicationCustomizer.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ Please refrain from making drastic changes that may negatively impact your users | |
|
||
## Used SharePoint Framework Version | ||
|
||
![SPFx v1.8](https://img.shields.io/badge/SPFx-1.8-green.svg) | ||
![SPFx v1.20.0](https://img.shields.io/badge/SPFx-1.8-green.svg) | ||
|
||
## Applies to | ||
|
||
|
@@ -27,17 +27,19 @@ Please refrain from making drastic changes that may negatively impact your users | |
|
||
## Solution | ||
|
||
Solution|Author(s) | ||
--------|--------- | ||
react-application-injectcss|Hugo Bernier ([Tahoe Ninjas](http://tahoeninjas.blog), @bernierh) | ||
| Solution | Author(s) | | ||
| ---------------------------------- | ------------------------------------------------------------------ | | ||
| react-application-injectcss | Hugo Bernier ([Tahoe Ninjas](http://tahoeninjas.blog), @bernierh) | | ||
| [email protected] | Thomas Daly (MVP, [@\_tomdaly\_](https://www.twitter.com/_tomdaly_)) | | ||
|
||
## Version history | ||
|
||
Version|Date|Comments | ||
-------|----|-------- | ||
1.0.0|07 May, 2018|Initial release | ||
1.1.0|18 October, 2018|Updated to SPFx 1.6 | ||
1.2.0|28 March, 2018|Updated to SPFx 1.8 | ||
| Version | Date | Comments | | ||
| ------- | ---------------- | -------------------- | | ||
| 1.0.0 | 07 May, 2018 | Initial release | | ||
| 1.1.0 | 18 October, 2018 | Updated to SPFx 1.6 | | ||
| 1.2.0 | 28 March, 2018 | Updated to SPFx 1.8 | | ||
| 1.3.0 | 01 October, 2024 | Updated to SPFx 1.20 | | ||
|
||
## Disclaimer | ||
|
||
|
@@ -57,7 +59,7 @@ Version|Date|Comments | |
} | ||
``` | ||
|
||
2. Upload the CSS file as `custom.css` to your `Styles Library` of the root site collection (i.e.: `https://<yourtenant>.sharepoint.com/Style%20Library/Forms/AllItems.aspx`). | ||
2. Upload the CSS file as `custom.css` to your `Site Assets` of the root site collection (i.e.: `https://<yourtenant>.sharepoint.com/SiteAssets/Forms/AllItems.aspx`). | ||
3. Navigate to your site. Your custom CSS should be applied. | ||
|
||
For example, the CSS provided above will make the feedback button appear as follows: | ||
|
@@ -77,6 +79,8 @@ For example, the CSS provided above will make the feedback button appear as foll | |
|
||
### Automated deployment | ||
|
||
**NOTE** as of Sept 9th, 2024 to run the PnP PowerShell Cmdlets you must [register an Entra ID Application](https://pnp.github.io/powershell/articles/registerapplication.html) to use to run the cmdlets | ||
|
||
1. If you have not done so already, install the [PnP PowerShell Cmdlets](https://aka.ms/sppnp-powershell) | ||
2. Edit the `DeployApplicationCustomizer.ps1` file and change the `$tenantUrl` variable to point to your tenant. | ||
3. From a PowerShell console, run the `DeployApplicationCustomizer.ps1` script to automatically deploy to all sites. | ||
|
@@ -85,7 +89,7 @@ For example, the CSS provided above will make the feedback button appear as foll | |
|
||
## Changing the CSS location | ||
|
||
To simplify deployment, the extension looks for a `custom.css` in your tenant's root `Style Library`. If you wish to use a different CSS name and location, use one of the following approaches: | ||
To simplify deployment, the extension looks for a `custom.css` in your tenant's root `Site Assets`. If you wish to use a different CSS name and location, use one of the following approaches: | ||
|
||
### In the solution | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tom-daly marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
call cls | ||
|
||
call gulp clean | ||
|
||
call gulp build | ||
|
||
call gulp bundle --ship | ||
|
||
call gulp package-solution --ship | ||
|
||
call explorer .\sharepoint\solution |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
samples/react-application-injectcss/config/deploy-azure-storage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
const build = require('@microsoft/sp-build-web'); | ||
|
||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); | ||
|
||
build.initialize(gulp); | ||
var getTasks = build.rig.getTasks; | ||
build.rig.getTasks = function () { | ||
var result = getTasks.call(build.rig); | ||
|
||
result.set('serve', result.get('serve-deprecated')); | ||
|
||
return result; | ||
}; | ||
|
||
build.initialize(require('gulp')); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we should not update the package-lock.json which is outside of the sample folder.
Lets revert this