Skip to content

Commit e487d00

Browse files
authored
Merge pull request #5470 from Sandeep-FED/upgrade-modern-carousel-#dev
2 parents ba2c313 + ad8f3c3 commit e487d00

19 files changed

+25095
-32678
lines changed

samples/react-modern-carousel/.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "SPFx 1.20.2",
3-
"image": "docker.io/m365pnp/spfx:1.20.2",
2+
"name": "SPFx 1.21.0",
3+
"image": "docker.io/m365pnp/spfx:1.21.0",
44
"customizations": {
55
"vscode": {
66
"extensions": [

samples/react-modern-carousel/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.18.2
1+
v22.15.0

samples/react-modern-carousel/.yo-rc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"componentName": "AwardRecognition",
88
"plusBeta": false,
99
"isCreatingSolution": true,
10-
"nodeVersion": "18.18.2",
10+
"nodeVersion": "22.15.0",
1111
"sdksVersions": {
1212
"@microsoft/microsoft-graph-client": "3.0.2",
1313
"@microsoft/teams-js": "2.24.0"
1414
},
15-
"version": "1.20.0",
15+
"version": "1.21.0",
1616
"libraryName": "award-recognition",
1717
"libraryId": "45e061b8-13f5-423f-bedb-12fc2a44fa89",
1818
"environment": "spo",

samples/react-modern-carousel/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
This SharePoint Framework (SPFx) web part introduces a contemporary carousel component leveraging Swiper, facilitating seamless traversal through content housed within a SharePoint site. This innovative feature enhances user experience by providing fluid navigation through various pieces of content, thereby adding a touch of elegance and sophistication to the SharePoint environment.
66

77
![Award Recognition](./assets/AwardRecognition.png)
8+
![Award Recognition Property Pane Configuration](./assets/Property_pane_options.png)
9+
![Award Recognition Dark Theme Appearance](./assets/Dark_theme_appearance.png)
810

911
## Compatibility
1012

@@ -15,12 +17,10 @@ This SharePoint Framework (SPFx) web part introduces a contemporary carousel com
1517

1618
## Used SharePoint Framework Version
1719

18-
![version](https://img.shields.io/badge/version-1.20.0-green.svg)
19-
2020
This sample is optimally compatible with the following environment configuration:
2121

22-
![SPFx 1.20.0](https://img.shields.io/badge/SPFx-1.20.0-green.svg)
23-
![Node.js v18 | v16](https://img.shields.io/badge/Node.js-v18%20%7C%20v16-green.svg)
22+
![SPFx 1.21.0](https://img.shields.io/badge/SPFx-1.20.0-green.svg)
23+
![Node.js v22](https://img.shields.io/badge/Node.js-v22-green.svg)
2424
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
2525
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
2626
![Does not work with SharePoint 2016 (Feature Pack 2)](<https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg> "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
@@ -56,6 +56,7 @@ Create a SharePoint custom list `Award Recognition` in the SPO site with below c
5656
| 1.0 | March 16, 2024 | Initial release |
5757
| 1.1 | October 19, 2024 | Upgrade to SPFx 1.20 & misc. changes |
5858
| 2.0 | November 1, 2024 | New feature: card styles & animations |
59+
| 2.1 | May 1, 2025 | Upgrade to SPFx 1.21 & code cleanup |
5960

6061
## Minimal Path to Awesome⚡
6162

@@ -107,4 +108,4 @@ Finally, if you have an idea for improvement, [make a suggestion](https://github
107108

108109
**THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
109110

110-
![react-modern-carousel](https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/react-modern-carousel)
111+
<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/react-modern-carousel" />
Loading
Loading

samples/react-modern-carousel/assets/sample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"This SharePoint Framework (SPFx) web part introduces a contemporary carousel component leveraging Swiper, facilitating seamless traversal through content housed within a SharePoint site. This innovative feature enhances user experience by providing fluid navigation through various pieces of content, thereby adding a touch of elegance and sophistication to the SharePoint environment."
1111
],
1212
"creationDateTime": "2024-03-16",
13-
"updateDateTime": "2024-11-01",
13+
"updateDateTime": "2025-05-01",
1414
"products": [
1515
"SharePoint"
1616
],
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"key": "SPFX-VERSION",
24-
"value": "1.20.2"
24+
"value": "1.21.0"
2525
}
2626
],
2727
"thumbnails": [

samples/react-modern-carousel/gulpfile.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,51 @@ const build = require('@microsoft/sp-build-web');
44

55
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
66

7+
// add these after const build = require('@microsoft/sp-build-web');
8+
const fs = require('fs');
9+
const path = require('path');
10+
11+
// Insert this code before build.initialize(require('gulp'));
12+
const copyTask = build.subTask('copy-to-build', function (gulp, buildOptions, done) {
13+
const srcFolder = './temp/build';
14+
const destFolder = './temp/';
15+
// Check if the destination folder exists, if not, create it
16+
if (!fs.existsSync(destFolder)) {
17+
fs.mkdirSync(destFolder, { recursive: true });
18+
}
19+
20+
// Copy files from srcFolder to destFolder, excluding destFolder itself
21+
return gulp.src([path.join(srcFolder, '**/*'), '!' + destFolder])
22+
.pipe(gulp.dest(destFolder));
23+
});
24+
25+
build.rig.addPostBundleTask(copyTask);
26+
27+
28+
build.configureWebpack.mergeConfig({
29+
30+
additionalConfiguration: (generatedConfiguration) => {
31+
// Modify CSS Modules loader configuration
32+
33+
if (generatedConfiguration.module && generatedConfiguration.module.rules) {
34+
for (const rule of generatedConfiguration.module.rules) {
35+
if (rule.use && rule.use[0] && rule.use[0].loader.includes('css-loader') && rule.use[0].options.generateCssClassName) {
36+
console.log('Rule Test:'+ rule.test);
37+
console.log('Rule Loader:'+ rule.use[0].loader);
38+
console.log('Rule generateCssClassName:'+ rule.use[0].options.generateCssClassName);
39+
rule.use[0].options.generateCssClassName = (existingClassName, cssFilename, cssContent)=>{
40+
return `${existingClassName}`;
41+
};
42+
43+
}
44+
}
45+
}
46+
47+
return generatedConfiguration;
48+
}
49+
50+
});
51+
752
var getTasks = build.rig.getTasks;
853
build.rig.getTasks = function () {
954
var result = getTasks.call(build.rig);
@@ -14,3 +59,5 @@ build.rig.getTasks = function () {
1459
};
1560

1661
build.initialize(require('gulp'));
62+
63+
module.exports = build;

0 commit comments

Comments
 (0)