Skip to content
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

Release 4.6.0 Merge to Main #3151

Merged
merged 15 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🐞 Bug or Error Report
description: Submit a bug or error report.
labels: ["type: someting isn't working", "status: investigate"]
labels: ["type: something isn't working", "status: investigate"]

body:
- type: markdown
Expand All @@ -16,10 +16,10 @@ body:
label: Major Version
options:
- 4.x
- 3.x
- 3.x (No longer supported)
- 2.x (No longer supported)
- 1.x (No longer supported)
default: 1
default: 0
validations:
required: true
- type: input
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/1-question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ body:
label: What version of PnPjs library you are using
options:
- 4.x
- 3.x
- 3.x (No longer supported)
- 2.x (No longer supported)
- 1.x (No longer supported)
default: 1
default: 0
validations:
required: true
- type: input
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 4.6.0 - 2024-Oct-14

- Only documentation and package updates

## 4.5.0 - 2024-Sept-16

- Only documentation and package updates
Expand Down
2 changes: 1 addition & 1 deletion docs/msaljsclient/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import "@pnp/sp/site-users/web";
const options: MSALOptions = {
configuration: {
auth: {
authority: "https://login.microsoftonline.com/{tanent_id}/",
authority: "https://login.microsoftonline.com/{tenant_id}/",
clientId: "{client id}",
},
cache: {
Expand Down
5 changes: 3 additions & 2 deletions docs/sp/folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const folder: IFolder = await sp.web.rootFolder.folders.getByUrl("SiteAssets").a

### getFolderById

You can get a folder by Id from a web.
You can get a folder by UniqueId from a web.

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

const sp = spfi(...);

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

### getParentInfos
Expand Down
36 changes: 34 additions & 2 deletions docs/sp/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,13 @@ await execute();

console.log("Done");
```

### Update Taxonomy field

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

List Item
#### List Item

```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
Expand All @@ -385,7 +387,9 @@ await sp.web.lists.getByTitle("Demo").items.getById(1).update({
});

```
File List Item

#### File List Item

```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
Expand All @@ -407,6 +411,8 @@ _Based on [this excellent article](https://www.aerieconsulting.com/blog/update-u

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".

#### List Item

```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
Expand All @@ -433,7 +439,9 @@ await sp.web.lists.getByTitle("TestList").items.getById(newItem.Id).update(updat
```

#### File List Item

To update a multi-value taxonomy field on a file item, a different serialization is needed.

```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
Expand Down Expand Up @@ -482,6 +490,30 @@ const update = await sp.web.lists.getByTitle("Price").items.getById(7).select('*
]);
```

### Update Location Field

This code shows how to update a location field's coordinates.

```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";

const sp = spfi(...);
const coordinates = {
Latitude: 47.672082,
Longitude: -122.1409983
}

const projectId = 1;
const project = sp.web.lists.getByTitle("My List").items.getById(projectId).select("Id, ProjectLocation")()
const projectLocation = JSON.parse(project.ProjectLocation);
projectLocation.Coordinates = coordinates;
const ProjectLocation = JSON.stringify(projectLocation);
const update = await sp.web.lists.getByTitle("My List").items.getById(projectId).update({ ProjectLocation });
```

## Recycle

To send an item to the recycle bin use recycle.
Expand Down
43 changes: 37 additions & 6 deletions docs/v1/documentation/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
padding: 0 0.25 0.5 !important;
}

.md-header{
.md-header {
height: 75px;
}

.md-container{
.md-container {
padding-top: 70px;
}

.md-sidebar[data-md-state="lock"]{
.md-sidebar[data-md-state="lock"] {
padding-top: 75px;
}

Expand All @@ -27,7 +27,38 @@
}

@media only screen and (max-width: 76.1875em) {
.md-nav--primary .md-nav__title--site .md-nav__button {
width: 150px;
}
.md-nav--primary .md-nav__title--site .md-nav__button {
width: 150px;
}
}

body {
min-height: 100vh;
min-width: 100vw;
margin: 0;
background-color: light-dark(whitesmoke, black);

&:before {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
content: "V1 \A Deprecated";
display: block;
box-sizing: border-box;
padding: 20vh;
font-size: clamp(3rem, 20vw, 8rem);
height: 100vh;
width: 100vw;
text-align: center;
z-index: -1;
color: silver;
font-weight: 900;
font-family: sans-serif;
text-transform: uppercase;
transform: rotate(-45deg);
transform-origin: center;
white-space: pre-wrap;
}
}
31 changes: 31 additions & 0 deletions docs/v2/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,35 @@
.md-nav--primary .md-nav__title--site .md-nav__button {
width: 150px;
}
}

body {
min-height: 100vh;
min-width: 100vw;
margin: 0;
background-color: light-dark(whitesmoke, black);

&:before {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
content: "V2 \A Deprecated";
display: block;
box-sizing: border-box;
padding: 20vh;
font-size: clamp(1rem, 10vw, 5rem);
height: 100vh;
width: 100vw;
text-align: center;
z-index: -1;
color: silver;
font-weight: 900;
font-family: sans-serif;
text-transform: uppercase;
transform: rotate(-45deg);
transform-origin: center;
white-space: pre-wrap;
}
}
32 changes: 32 additions & 0 deletions docs/v3/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,36 @@
.md-nav--primary .md-nav__title--site .md-nav__button {
width: 150px;
}
}

body {
min-height: 100vh;
min-width: 100vw;
margin: 0;
background-color: light-dark(whitesmoke, black);

&:before {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
content: "V3 \A Deprecated";

display: block;
box-sizing: border-box;
padding: 20vh;
font-size: clamp(1rem, 10vw, 5rem);
height: 100vh;
width: 100vw;
text-align: center;
z-index: -1;
color: silver;
font-weight: 900;
font-family: sans-serif;
text-transform: uppercase;
transform: rotate(-45deg);
transform-origin: center;
white-space: pre-wrap;
}
}
Loading
Loading