Skip to content

Commit 11e3480

Browse files
committed
♻️ fix typos & markdown issues
1 parent 1877b8d commit 11e3480

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

docs/embedded/mslearn/m01-05-hol.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Add the two new permissions to the existing `"resourceAppId": "00000003-0000-000
117117
118118
### Grant admin consent to the new permissions
119119
120-
Some of the permissions require admin consent. Select 88API Permissions88 in the left-hand navigation, scroll to the bottom of the page, and select the link **Enterprise applications**.
120+
Some of the permissions require admin consent. Select **API Permissions** in the left-hand navigation, scroll to the bottom of the page, and select the link **Enterprise applications**.
121121
122122
On the Permissions page, select **Grant admin consent for Contoso**. If prompted to sign-in, use the same **Work and School** account you used to sign-in to the Microsoft Entra ID admin center. On the **Permissions requested** page, select **Accept** to grant admin consent to the two pairs of permissions: `FileStorageContainer.Selected` for Microsoft Graph and `Container.Selected` for SharePoint. The two pairs represent the application & delegated options for each of the two permissions.
123123
@@ -198,7 +198,7 @@ With the latest **SharePoint Online PowerShell module** installed, the next step
198198
Update the following values in the following PowerShell script, then execute the script:
199199

200200
- **`{{SPO_ADMIN_URL}}`**: This is the URL of your SharePoint Online admin center. You can get this by signing into the `[https://portal.microsoft.com](https://portal.microsoft.com)` with the **Work and School** of your tenant’s admin account, select **Show All** at the bottom of the left-hand navigation, then select **Admin Centers > SharePoint**. Copy the URL of the SharePoint admin center and use this value. For example, if your tenant ID is **Contoso123**, your admin url would be `https://contoso123-admin.sharepoint.com`.
201-
- `**{{CONTAINER_TYPE_NAME}}**`: Pick a name for your new Container Type. For example, use `FirstContainerType`.
201+
- **`{{CONTAINER_TYPE_NAME}}`**: Pick a name for your new Container Type. For example, use `FirstContainerType`.
202202
- **`{{AZURE_ENTRA_APP_ID}}`:** Set this to the value of the Microsoft Entra ID app ID, also known as the "client ID", you created previously. This value should be in your local text file.
203203

204204
```powershell

docs/embedded/mslearn/m02-03-hol.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ Let’s start by creating the front-end part of the project:
7777

7878
From a command line, navigate to the folder where you created your project and execute the following command:
7979

80+
```console
81+
npx create-react-app my-first-spe-app --template typescript
82+
```
83+
84+
From the command line, move into the folder **my-first-spe-app** created by the previous command and execute the following command:
85+
8086
```console
8187
npm install @azure/msal-browser @fluentui/react-components @fluentui/react-icons @microsoft/mgt-react @microsoft/mgt-element @microsoft/mgt-msal2-provider -SE
8288
```
@@ -104,7 +110,7 @@ This command will install the NPM packages:
104110
- **[@microsoft/microsoft-graph-client](https://www.npmjs.com/package/@microsoft/microsoft-graph-client)**: Microsoft Graph JavaScript SDK.
105111
- **[isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch)**: Polyfill that adds the browser `fetch` API as a global so it’s API is consistent between the client & server.
106112
- **[jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken)**: Implementation of JSON Web Tokens.
107-
- [**jwks-rsa**](https://www.npmjs.com/package/jwks-rsa): Library to retrieve signing keys from a JSON Web Key Set (JWKS) endpoint.
113+
- **[jwks-rsa](https://www.npmjs.com/package/jwks-rsa)**: Library to retrieve signing keys from a JSON Web Key Set (JWKS) endpoint.
108114

109115
Add a TypeScript compiler configuration for the server-side project:
110116

@@ -216,8 +222,8 @@ export const GRAPH_SITES_READ_ALL = 'Sites.Read.All';
216222
export const GRAPH_OPENID_CONNECT_BASIC = ["openid", "profile", "offline_access"];
217223

218224
// SharePoint Embedded scopes
219-
export const SPREPOSERVICES_CONTAINER_MANAGE= 'Container.Manage';
220-
export const SPREPOSERVICES_FILESTORAGECONTAINER_SELECTED= 'FileStorageContainer.Selected';
225+
export const SPEMBEDDED_CONTAINER_MANAGE= 'Container.Manage';
226+
export const SPEMBEDDED_FILESTORAGECONTAINER_SELECTED= 'FileStorageContainer.Selected';
221227
```
222228

223229
Create a cop of this file for the API server. Save the file to the following ___location in the project: **./server/common/scopes.ts**.

docs/embedded/mslearn/m02-05-hol.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,11 @@ Stop the server by pressing <kbd>CTRL</kbd> + <kbd>C</kbd> in the console.
168168

169169
With the basic project setup and configured to support user authentication, let’s now add support to list and select Containers in your tenant’s partition.
170170

171-
Container management is a privileged operation that requires an access token that must be obtained server side
172-
173-
Let’s start by first creating the server-side API parts to support the React app.
171+
Container management is a privileged operation that requires an access token that must be obtained server side. Let’s start by first creating the server-side API parts to support the React app.
174172

175173
### Add utility method to retrieve an OBO token to call Microsoft Graph
176174

177-
We first need is a utility file to obtain a token using the OAuth2 On-Behalf-Of flow using our existing credential.
175+
We first need a utility file to obtain a token using the OAuth2 On-Behalf-Of flow using our existing credential.
178176

179177
Create a new file **./server/auth.ts** and add the following code to it:
180178

@@ -336,7 +334,7 @@ import * as Constants from './../common/constants';
336334
import * as Scopes from './../common/scopes';
337335
import { IContainer } from './../common/IContainer';
338336

339-
export default class SRSCODENAME {
337+
export default class SpEmbedded {
340338
}
341339
```
342340

@@ -430,7 +428,7 @@ import type {
430428
import { IContainer } from "./../common/IContainer";
431429
import SpEmbedded from '../services/spembedded';
432430

433-
const SpEmbedded = new SpEmbedded();
431+
const spe = new SpEmbedded();
434432

435433
const useStyles = makeStyles({
436434
root: {
@@ -488,15 +486,24 @@ Next, add the following React hook after `// BOOKMARK 1` to get all Containers w
488486
```typescript
489487
useEffect(() => {
490488
(async () => {
491-
const containers = await SpEmbedded.listContainers();
489+
const containers = await spe.listContainers();
492490
if (containers) {
493491
setContainers(containers);
494492
}
495493
})();
496494
}, []);
497495
```
498496

499-
Update the rendering by adding the following to the `return()` method after the `// BOOKMARK 3` code. This will create a `DropDown` control and a a placeholder where we’ll add a list of the contents in the selected Container:
497+
Create an event handler after the React hook implementation you just added that will fire when a user selects a Container from the dropdown control we'll add to our UX:
498+
499+
```typescript
500+
const onContainerDropdownChange = (event: SelectionEvents, data: OptionOnSelectData) => {
501+
const selected = containers.find((container) => container.id === data.optionValue);
502+
setSelectedContainer(selected);
503+
};
504+
```
505+
506+
Update the rendering by adding the following to the `return()` method after the `// BOOKMARK 3` code. This will create a `DropDown` control and a placeholder where we’ll add a list of the contents in the selected Container:
500507

501508
```tsx
502509
<div className={styles.root}>
@@ -629,7 +636,7 @@ export const createContainer = async (req: Request, res: Response) => {
629636
}
630637
```
631638

632-
The last step is to crate the Microsoft Graph client and submit the request to create a new Container that have a specific `ContainerTypeId` set. Add the following code immediacy before the function’s closing bracket:
639+
The last step is to create the Microsoft Graph client and submit the request to create a new Container set to a specific `ContainerTypeId`. Add the following code immediacy before the function’s closing bracket:
633640

634641
```typescript
635642
try {
@@ -654,7 +661,7 @@ try {
654661
}
655662
```
656663

657-
Add this new endpoint to our restify server. Locate and open the **./server/index.ts** file, add a single import statement to the end of the existing imports, and add a listener for HTTP GET requests to the `/api/createContainers` endpoint:
664+
Add this new endpoint to our restify server. Locate and open the **./server/index.ts** file, add a single import statement to the end of the existing imports, and add a listener for HTTP POST requests to the `/api/createContainers` endpoint:
658665

659666
```typescript
660667
import { createContainer } from "./createContainer";
@@ -738,7 +745,7 @@ const handleDescriptionChange: InputProps["onChange"] = (event: React.ChangeEven
738745

739746
const onContainerCreateClick = async (event: React.MouseEvent<HTMLButtonElement>): Promise<void> => {
740747
setCreatingContainer(true);
741-
const newContainer = await SpEmbedded.createContainer(name, description);
748+
const newContainer = await spe.createContainer(name, description);
742749

743750
if (newContainer) {
744751
setName('');

docs/embedded/mslearn/m02-07-hol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default Files;
117117
> [!NOTE]
118118
> Notice the `// BOOKMARK #` comments in the component. We’ll use these to ensure you’re adding code in the correct places.
119119
120-
### Display a table of the selected Container contents
120+
### Display a list of the selected Container contents
121121

122122
The first thing we need to address is to display the contents of the selected Container. To do this, we’ll use the `DataGrid` component from the Fluent UI React library.
123123

0 commit comments

Comments
 (0)