Skip to content

Commit ebb663f

Browse files
committed
add SPFx 1.21.1 support
1 parent f3895bd commit ebb663f

File tree

7 files changed

+4791
-1796
lines changed

7 files changed

+4791
-1796
lines changed

.yo-rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@microsoft/generator-sharepoint": {
3-
"version": "1.20.0",
3+
"version": "1.21.1",
44
"libraryName": "sp-dev-fx-controls-react",
55
"libraryId": "92b1e52c-a5fa-490a-bcf4-76080f39442c",
66
"environment": "spo",

package-lock.json

Lines changed: 4748 additions & 1763 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "@pnp/spfx-controls-react",
33
"description": "Reusable React controls for SharePoint Framework solutions",
44
"version": "3.22.0",
5-
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0",
5+
"engines": {
6+
"node": ">=22.14.0 < 23.0.0"
7+
},
68
"scripts": {
79
"build": "gulp build",
810
"clean": "gulp clean",
@@ -37,23 +39,23 @@
3739
"@fluentui/theme": "^2.6.6",
3840
"@iconify/react": "^4.1.1",
3941
"@juggle/resize-observer": "3.4.0",
40-
"@microsoft/decorators": "1.20.0",
42+
"@microsoft/decorators": "1.21.1",
4143
"@microsoft/mgt-react": "3.1.3",
4244
"@microsoft/mgt-spfx": "3.1.3",
43-
"@microsoft/sp-adaptive-card-extension-base": "1.20.0",
44-
"@microsoft/sp-application-base": "1.20.0",
45-
"@microsoft/sp-component-base": "1.20.0",
46-
"@microsoft/sp-core-library": "1.20.0",
47-
"@microsoft/sp-dialog": "1.20.0",
48-
"@microsoft/sp-extension-base": "1.20.0",
49-
"@microsoft/sp-http": "1.20.0",
50-
"@microsoft/sp-listview-extensibility": "1.20.0",
51-
"@microsoft/sp-loader": "1.20.0",
52-
"@microsoft/sp-lodash-subset": "1.20.0",
53-
"@microsoft/sp-office-ui-fabric-core": "1.20.0",
54-
"@microsoft/sp-page-context": "1.20.0",
55-
"@microsoft/sp-property-pane": "1.20.0",
56-
"@microsoft/sp-webpart-base": "1.20.0",
45+
"@microsoft/sp-adaptive-card-extension-base": "1.21.1",
46+
"@microsoft/sp-application-base": "1.21.1",
47+
"@microsoft/sp-component-base": "1.21.1",
48+
"@microsoft/sp-core-library": "1.21.1",
49+
"@microsoft/sp-dialog": "1.21.1",
50+
"@microsoft/sp-extension-base": "1.21.1",
51+
"@microsoft/sp-http": "1.21.1",
52+
"@microsoft/sp-listview-extensibility": "1.21.1",
53+
"@microsoft/sp-loader": "1.21.1",
54+
"@microsoft/sp-lodash-subset": "1.21.1",
55+
"@microsoft/sp-office-ui-fabric-core": "1.21.1",
56+
"@microsoft/sp-page-context": "1.21.1",
57+
"@microsoft/sp-property-pane": "1.21.1",
58+
"@microsoft/sp-webpart-base": "1.21.1",
5759
"@monaco-editor/loader": "^1.3.1",
5860
"@nuvemerudita/react-controls": "1.0.0",
5961
"@pnp/common": "2.5.0",
@@ -88,12 +90,12 @@
8890
"swiper": "^8.2.6"
8991
},
9092
"devDependencies": {
91-
"@microsoft/eslint-config-spfx": "1.20.2",
92-
"@microsoft/eslint-plugin-spfx": "1.20.2",
93+
"@microsoft/eslint-config-spfx": "1.21.1",
94+
"@microsoft/eslint-plugin-spfx": "1.21.1",
9395
"@microsoft/microsoft-graph-types": "^2.1.0",
94-
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
95-
"@microsoft/sp-build-web": "1.20.2",
96-
"@microsoft/sp-module-interfaces": "1.20.2",
96+
"@microsoft/rush-stack-compiler-5.3": "0.1.0",
97+
"@microsoft/sp-build-web": "1.21.1",
98+
"@microsoft/sp-module-interfaces": "1.21.1",
9799
"@rushstack/eslint-config": "4.0.1",
98100
"@types/chart.js": "2.7.40",
99101
"@types/enzyme": "^2.8.12",
@@ -114,7 +116,7 @@
114116
"chai": "^4.3.4",
115117
"codecov": "3.8.3",
116118
"enzyme": "^3.11.0",
117-
"eslint": "8.57.0",
119+
"eslint": "8.57.1",
118120
"eslint-plugin-react-hooks": "4.3.0",
119121
"gulp": "4.0.2",
120122
"husky": "^8.0.3",
@@ -130,7 +132,7 @@
130132
"spfx-fast-serve-helpers": "1.20.2",
131133
"ts-jest": "^29.1.1",
132134
"tslib": "2.3.1",
133-
"typescript": "4.7.4",
135+
"typescript": "5.3.3",
134136
"webpack-bundle-analyzer": "^4.1.0"
135137
},
136138
"repository": {

src/controls/dynamicForm/DynamicForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ export class DynamicFormBase extends React.Component<
994994
// Fetch additional information about fields from SharePoint
995995
// (Number fields for min and max values, and fields with validation)
996996
const additionalInfo = await this._spService.getAdditionalListFormFieldInfo(listId, this.webURL);
997-
const numberFields = additionalInfo.filter((f) => f.TypeAsString === "Number" || f.TypeAsString === "Currency");
997+
const numberFields = additionalInfo?.filter((f) => f.TypeAsString === "Number" || f.TypeAsString === "Currency");
998998

999999
// Build a dictionary of validation formulas and messages
10001000
const validationFormulas: Record<string, Pick<ISPField, "ValidationFormula" | "ValidationMessage">> = additionalInfo.reduce((prev, cur) => {

src/controls/fileTypeIcon/FileTypeIcon.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,22 @@ describe('<FileTypeIcon />', () => {
183183
});
184184

185185
it('Image icon size test with unkown size', (done) => {
186-
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} size={8} application={ApplicationType.Word} />);
186+
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} size={ImageSize.small} application={ApplicationType.Word} />);
187187
expect(fileTypeIcon.find('div.ms-BrandIcon--icon16')).to.have.length(1);
188188
expect(fileTypeIcon.find('i')).to.have.length(0);
189189
done();
190190
});
191191

192192
it('Image icon size test with unkown size for generic icon', (done) => {
193-
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} size={8} />);
193+
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} size={ImageSize.small} />);
194194
expect(fileTypeIcon.find('div img')).to.have.length(1);
195195
expect(fileTypeIcon.find('div.ms-BrandIcon--icon16')).to.have.length(0);
196196
expect(fileTypeIcon.find('i')).to.have.length(0);
197197
done();
198198
});
199199

200200
it('Image icon test with unkown application', (done) => {
201-
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} application={90} />);
201+
fileTypeIcon = mount(<FileTypeIcon type={IconType.image} application={90 as unknown as ApplicationType} />);
202202
expect(fileTypeIcon.find('div img')).to.have.length(1);
203203
expect(fileTypeIcon.find('div.ms-BrandIcon--icon16')).to.have.length(0);
204204
expect(fileTypeIcon.find('i')).to.have.length(0);

src/controls/modernTaxonomyPicker/taxonomyTree/TaxonomyTree.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ export function TaxonomyTree(
251251

252252
React.useEffect(() => {
253253
let termRootName = "";
254+
if (!props.anchorTermInfo && !props.termSetInfo) {
255+
return;
256+
}
257+
254258
if (props.anchorTermInfo) {
255259
let anchorTermNames = props.anchorTermInfo.labels.filter(
256260
(name) => name.languageTag === props.languageTag && name.isDefault
@@ -264,15 +268,15 @@ export function TaxonomyTree(
264268
}
265269
termRootName = anchorTermNames[0].name;
266270
} else {
267-
let termSetNames = props.termSetInfo.localizedNames.filter(
271+
let termSetNames = props.termSetInfo?.localizedNames.filter(
268272
(name) => name.languageTag === props.languageTag
269-
);
273+
) || [];
270274
if (termSetNames.length === 0) {
271275
termSetNames = props.termSetInfo.localizedNames.filter(
272276
(name) => name.languageTag === props.termStoreInfo.defaultLanguageTag
273-
);
277+
) || [];
274278
}
275-
termRootName = termSetNames[0].name;
279+
termRootName = termSetNames[0].name || '';
276280
}
277281
const rootGroup: IGroup = {
278282
name: termRootName,
@@ -905,6 +909,10 @@ export function TaxonomyTree(
905909
return ev.which === getRTLSafeKeyCode(KeyCodes.right);
906910
};
907911

912+
if (!props.termSetInfo && !props.termStoreInfo) {
913+
return <></>;
914+
}
915+
908916
return (
909917
<div>
910918
<GroupedList

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.7/includes/tsconfig-web.json",
2+
"extends": "./node_modules/@microsoft/rush-stack-compiler-5.3/includes/tsconfig-web.json",
33
"compilerOptions": {
44
"target": "es5",
55
"forceConsistentCasingInFileNames": true,

0 commit comments

Comments
 (0)