Skip to content

Commit 783d143

Browse files
authored
Merge pull request #3151 from pnp/version-4
Release 4.6.0 Merge to Main
2 parents 8b629ca + fca9a91 commit 783d143

File tree

324 files changed

+258
-469783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+258
-469783
lines changed

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 🐞 Bug or Error Report
22
description: Submit a bug or error report.
3-
labels: ["type: someting isn't working", "status: investigate"]
3+
labels: ["type: something isn't working", "status: investigate"]
44

55
body:
66
- type: markdown
@@ -16,10 +16,10 @@ body:
1616
label: Major Version
1717
options:
1818
- 4.x
19-
- 3.x
19+
- 3.x (No longer supported)
2020
- 2.x (No longer supported)
2121
- 1.x (No longer supported)
22-
default: 1
22+
default: 0
2323
validations:
2424
required: true
2525
- type: input

.github/ISSUE_TEMPLATE/1-question.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ body:
1616
label: What version of PnPjs library you are using
1717
options:
1818
- 4.x
19-
- 3.x
19+
- 3.x (No longer supported)
2020
- 2.x (No longer supported)
2121
- 1.x (No longer supported)
22-
default: 1
22+
default: 0
2323
validations:
2424
required: true
2525
- type: input

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## 4.6.0 - 2024-Oct-14
9+
10+
- Only documentation and package updates
11+
812
## 4.5.0 - 2024-Sept-16
913

1014
- Only documentation and package updates

docs/msaljsclient/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import "@pnp/sp/site-users/web";
2222
const options: MSALOptions = {
2323
configuration: {
2424
auth: {
25-
authority: "https://login.microsoftonline.com/{tanent_id}/",
25+
authority: "https://login.microsoftonline.com/{tenant_id}/",
2626
clientId: "{client id}",
2727
},
2828
cache: {

docs/sp/folders.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ const folder: IFolder = await sp.web.rootFolder.folders.getByUrl("SiteAssets").a
532532

533533
### getFolderById
534534

535-
You can get a folder by Id from a web.
535+
You can get a folder by UniqueId from a web.
536536

537537
```TypeScript
538538
import { spfi } from "@pnp/sp";
@@ -542,7 +542,8 @@ import { IFolder } from "@pnp/sp/folders";
542542

543543
const sp = spfi(...);
544544

545-
const folder: IFolder = sp.web.getFolderById("2b281c7b-ece9-4b76-82f9-f5cf5e152ba0");
545+
const folderItem = sp.web.lists.getByTitle("My List").items.getById(1).select("UniqueId")()
546+
const folder: IFolder = sp.web.getFolderById(folderItem.UniqueId);
546547
```
547548

548549
### getParentInfos

docs/sp/items.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,13 @@ await execute();
367367

368368
console.log("Done");
369369
```
370+
370371
### Update Taxonomy field
371372

372373
Note: Updating Taxonomy field for a File item should be handled differently. Instead of using update(), use validateUpdateListItem(). Please see below
373374

374-
List Item
375+
#### List Item
376+
375377
```TypeScript
376378
import { spfi } from "@pnp/sp";
377379
import "@pnp/sp/webs";
@@ -385,7 +387,9 @@ await sp.web.lists.getByTitle("Demo").items.getById(1).update({
385387
});
386388

387389
```
388-
File List Item
390+
391+
#### File List Item
392+
389393
```TypeScript
390394
import { spfi } from "@pnp/sp";
391395
import "@pnp/sp/webs";
@@ -407,6 +411,8 @@ _Based on [this excellent article](https://www.aerieconsulting.com/blog/update-u
407411

408412
As he says you must update a hidden field to get this to work via REST. My meta data field accepting multiple values is called "MultiMetaData".
409413

414+
#### List Item
415+
410416
```TypeScript
411417
import { spfi } from "@pnp/sp";
412418
import "@pnp/sp/webs";
@@ -433,7 +439,9 @@ await sp.web.lists.getByTitle("TestList").items.getById(newItem.Id).update(updat
433439
```
434440

435441
#### File List Item
442+
436443
To update a multi-value taxonomy field on a file item, a different serialization is needed.
444+
437445
```TypeScript
438446
import { spfi } from "@pnp/sp";
439447
import "@pnp/sp/webs";
@@ -482,6 +490,30 @@ const update = await sp.web.lists.getByTitle("Price").items.getById(7).select('*
482490
]);
483491
```
484492

493+
### Update Location Field
494+
495+
This code shows how to update a location field's coordinates.
496+
497+
```TypeScript
498+
import { spfi } from "@pnp/sp";
499+
import "@pnp/sp/webs";
500+
import "@pnp/sp/lists";
501+
import "@pnp/sp/items";
502+
503+
const sp = spfi(...);
504+
const coordinates = {
505+
Latitude: 47.672082,
506+
Longitude: -122.1409983
507+
}
508+
509+
const projectId = 1;
510+
const project = sp.web.lists.getByTitle("My List").items.getById(projectId).select("Id, ProjectLocation")()
511+
const projectLocation = JSON.parse(project.ProjectLocation);
512+
projectLocation.Coordinates = coordinates;
513+
const ProjectLocation = JSON.stringify(projectLocation);
514+
const update = await sp.web.lists.getByTitle("My List").items.getById(projectId).update({ ProjectLocation });
515+
```
516+
485517
## Recycle
486518

487519
To send an item to the recycle bin use recycle.

docs/v1/documentation/css/extra.css

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
padding: 0 0.25 0.5 !important;
55
}
66

7-
.md-header{
7+
.md-header {
88
height: 75px;
99
}
1010

11-
.md-container{
11+
.md-container {
1212
padding-top: 70px;
1313
}
1414

15-
.md-sidebar[data-md-state="lock"]{
15+
.md-sidebar[data-md-state="lock"] {
1616
padding-top: 75px;
1717
}
1818

@@ -27,7 +27,38 @@
2727
}
2828

2929
@media only screen and (max-width: 76.1875em) {
30-
.md-nav--primary .md-nav__title--site .md-nav__button {
31-
width: 150px;
32-
}
30+
.md-nav--primary .md-nav__title--site .md-nav__button {
31+
width: 150px;
32+
}
33+
}
34+
35+
body {
36+
min-height: 100vh;
37+
min-width: 100vw;
38+
margin: 0;
39+
background-color: light-dark(whitesmoke, black);
40+
41+
&:before {
42+
position: fixed;
43+
top: 0;
44+
bottom: 0;
45+
left: 0;
46+
right: 0;
47+
content: "V1 \A Deprecated";
48+
display: block;
49+
box-sizing: border-box;
50+
padding: 20vh;
51+
font-size: clamp(3rem, 20vw, 8rem);
52+
height: 100vh;
53+
width: 100vw;
54+
text-align: center;
55+
z-index: -1;
56+
color: silver;
57+
font-weight: 900;
58+
font-family: sans-serif;
59+
text-transform: uppercase;
60+
transform: rotate(-45deg);
61+
transform-origin: center;
62+
white-space: pre-wrap;
63+
}
3364
}

docs/v2/css/extra.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,35 @@
3030
.md-nav--primary .md-nav__title--site .md-nav__button {
3131
width: 150px;
3232
}
33+
}
34+
35+
body {
36+
min-height: 100vh;
37+
min-width: 100vw;
38+
margin: 0;
39+
background-color: light-dark(whitesmoke, black);
40+
41+
&:before {
42+
position: fixed;
43+
top: 0;
44+
bottom: 0;
45+
left: 0;
46+
right: 0;
47+
content: "V2 \A Deprecated";
48+
display: block;
49+
box-sizing: border-box;
50+
padding: 20vh;
51+
font-size: clamp(1rem, 10vw, 5rem);
52+
height: 100vh;
53+
width: 100vw;
54+
text-align: center;
55+
z-index: -1;
56+
color: silver;
57+
font-weight: 900;
58+
font-family: sans-serif;
59+
text-transform: uppercase;
60+
transform: rotate(-45deg);
61+
transform-origin: center;
62+
white-space: pre-wrap;
63+
}
3364
}

docs/v3/css/extra.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,36 @@
3030
.md-nav--primary .md-nav__title--site .md-nav__button {
3131
width: 150px;
3232
}
33+
}
34+
35+
body {
36+
min-height: 100vh;
37+
min-width: 100vw;
38+
margin: 0;
39+
background-color: light-dark(whitesmoke, black);
40+
41+
&:before {
42+
position: fixed;
43+
top: 0;
44+
bottom: 0;
45+
left: 0;
46+
right: 0;
47+
content: "V3 \A Deprecated";
48+
49+
display: block;
50+
box-sizing: border-box;
51+
padding: 20vh;
52+
font-size: clamp(1rem, 10vw, 5rem);
53+
height: 100vh;
54+
width: 100vw;
55+
text-align: center;
56+
z-index: -1;
57+
color: silver;
58+
font-weight: 900;
59+
font-family: sans-serif;
60+
text-transform: uppercase;
61+
transform: rotate(-45deg);
62+
transform-origin: center;
63+
white-space: pre-wrap;
64+
}
3365
}

0 commit comments

Comments
 (0)