Skip to content

Commit b9ffacf

Browse files
authored
Merge branch 'main' into react-star-ratings
2 parents da6bb7e + e8f0f8a commit b9ffacf

File tree

273 files changed

+233300
-113400
lines changed

Some content is hidden

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

273 files changed

+233300
-113400
lines changed

.metadata/extension-samples.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6916,7 +6916,7 @@
69166916
"This sample shows site mega menu. Application customizer is used along with SharePoint List to store the menu items."
69176917
],
69186918
"creationDateTime": "2018-12-10",
6919-
"updateDateTime": "2018-12-10",
6919+
"updateDateTime": "2024-10-31",
69206920
"products": [
69216921
"SharePoint"
69226922
],
@@ -6927,7 +6927,7 @@
69276927
},
69286928
{
69296929
"key": "SPFX-VERSION",
6930-
"value": "1.7.0"
6930+
"value": "1.20.0"
69316931
}
69326932
],
69336933
"tags": [],

.metadata/samples.json

+313-209
Large diffs are not rendered by default.

samples/angularelements-helloworld/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/js-applicationinsights-api-calls-tracking/package-lock.json

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/react-appinsights-dashboard/pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/react-birthdays/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.18.2

samples/react-birthdays/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ email | Text | true
6161
* [João Mendes](https://github.com/joaojmendes)
6262
* [Sajal Maity](https://github.com/smaity)
6363
* [Valeras Narbutas](https://github.com/ValerasNarbutas)
64+
* [Gretchun Kim](https://github.com/gretchunkim)
6465

6566
## Version history
6667

@@ -72,6 +73,7 @@ Version|Date|Comments
7273
3.0.0|April 7, 2022 | Upgraded to SPFx 1.14.0
7374
4.0.0|March 6, 2023 | Upgraded to SPFx 1.16.1
7475
5.0.0|October 2, 2024 | Upgraded to SPFx 1.20.0
76+
5.1.0|January 13,2025 | Edited SPService to ensure current year is used to pull upcoming birthdays
7577

7678
## Minimal Path to Awesome
7779

samples/react-birthdays/assets/sample.json

+8-177
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"The Web Part Birthdays shows the upcoming birthdays in the company, the web part reads birthdays from a list located on the tenant\u0027s root site with title \u0022Birthdays.\u0022"
1010
],
1111
"creationDateTime": "2019-07-23",
12-
"updateDateTime": "2024-10-02",
12+
"updateDateTime": "2025-01-13",
1313
"products": [
1414
"SharePoint"
1515
],
@@ -35,187 +35,13 @@
3535
{
3636
"type": "image",
3737
"order": 100,
38-
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-birthdays/assets/birthdays.gif",
39-
"alt": "Birthdays Web Part"
40-
},
41-
{
42-
"type": "image",
43-
"order": 101,
44-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/ballonsBackgroud.png?raw=true",
45-
"alt": "Birthdays Web Part"
46-
},
47-
{
48-
"type": "image",
49-
"order": 102,
50-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/baloons.png?raw=true",
38+
"url": "https://raw.githubusercontent.com/pnp/sp-dev-fx-webparts/main/samples/react-birthdays/assets/birthdays.gif",
5139
"alt": "Birthdays Web Part"
5240
},
5341
{
5442
"type": "image",
5543
"order": 103,
56-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/birthdays.png?raw=true",
57-
"alt": "Birthdays Web Part"
58-
},
59-
{
60-
"type": "image",
61-
"order": 104,
62-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/birthdays2.png?raw=true",
63-
"alt": "Birthdays Web Part"
64-
},
65-
{
66-
"type": "image",
67-
"order": 105,
68-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof.png?raw=true",
69-
"alt": "Birthdays Web Part"
70-
},
71-
{
72-
"type": "image",
73-
"order": 106,
74-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof1.png?raw=true",
75-
"alt": "Birthdays Web Part"
76-
},
77-
{
78-
"type": "image",
79-
"order": 107,
80-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof10.png?raw=true",
81-
"alt": "Birthdays Web Part"
82-
},
83-
{
84-
"type": "image",
85-
"order": 108,
86-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof11.png?raw=true",
87-
"alt": "Birthdays Web Part"
88-
},
89-
{
90-
"type": "image",
91-
"order": 109,
92-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof12.png?raw=true",
93-
"alt": "Birthdays Web Part"
94-
},
95-
{
96-
"type": "image",
97-
"order": 110,
98-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof14.png?raw=true",
99-
"alt": "Birthdays Web Part"
100-
},
101-
{
102-
"type": "image",
103-
"order": 111,
104-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof14_1.png?raw=true",
105-
"alt": "Birthdays Web Part"
106-
},
107-
{
108-
"type": "image",
109-
"order": 112,
110-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof17.png?raw=true",
111-
"alt": "Birthdays Web Part"
112-
},
113-
{
114-
"type": "image",
115-
"order": 113,
116-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof18.png?raw=true",
117-
"alt": "Birthdays Web Part"
118-
},
119-
{
120-
"type": "image",
121-
"order": 114,
122-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof181.png?raw=true",
123-
"alt": "Birthdays Web Part"
124-
},
125-
{
126-
"type": "image",
127-
"order": 115,
128-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof19.png?raw=true",
129-
"alt": "Birthdays Web Part"
130-
},
131-
{
132-
"type": "image",
133-
"order": 116,
134-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof2.png?raw=true",
135-
"alt": "Birthdays Web Part"
136-
},
137-
{
138-
"type": "image",
139-
"order": 117,
140-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof20.png?raw=true",
141-
"alt": "Birthdays Web Part"
142-
},
143-
{
144-
"type": "image",
145-
"order": 118,
146-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof21.png?raw=true",
147-
"alt": "Birthdays Web Part"
148-
},
149-
{
150-
"type": "image",
151-
"order": 119,
152-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof22.png?raw=true",
153-
"alt": "Birthdays Web Part"
154-
},
155-
{
156-
"type": "image",
157-
"order": 120,
158-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof24.png?raw=true",
159-
"alt": "Birthdays Web Part"
160-
},
161-
{
162-
"type": "image",
163-
"order": 121,
164-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof28.png?raw=true",
165-
"alt": "Birthdays Web Part"
166-
},
167-
{
168-
"type": "image",
169-
"order": 122,
170-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof29.png?raw=true",
171-
"alt": "Birthdays Web Part"
172-
},
173-
{
174-
"type": "image",
175-
"order": 123,
176-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof3.png?raw=true",
177-
"alt": "Birthdays Web Part"
178-
},
179-
{
180-
"type": "image",
181-
"order": 124,
182-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof30.png?raw=true",
183-
"alt": "Birthdays Web Part"
184-
},
185-
{
186-
"type": "image",
187-
"order": 125,
188-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof4.png?raw=true",
189-
"alt": "Birthdays Web Part"
190-
},
191-
{
192-
"type": "image",
193-
"order": 126,
194-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof5.png?raw=true",
195-
"alt": "Birthdays Web Part"
196-
},
197-
{
198-
"type": "image",
199-
"order": 127,
200-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof6.png?raw=true",
201-
"alt": "Birthdays Web Part"
202-
},
203-
{
204-
"type": "image",
205-
"order": 128,
206-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof7.png?raw=true",
207-
"alt": "Birthdays Web Part"
208-
},
209-
{
210-
"type": "image",
211-
"order": 129,
212-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof8.png?raw=true",
213-
"alt": "Birthdays Web Part"
214-
},
215-
{
216-
"type": "image",
217-
"order": 130,
218-
"url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-birthdays/assets/cof9.png?raw=true",
44+
"url": "https://raw.githubusercontent.com/pnp/sp-dev-fx-webparts/refs/heads/main/samples/react-birthdays/assets/birthdays.png",
21945
"alt": "Birthdays Web Part"
22046
}
22147
],
@@ -239,6 +65,11 @@
23965
"company": "JP Morgan Chase",
24066
"pictureUrl": "https://github.com/smaity.png",
24167
"name": "Sajal Maity"
68+
},
69+
{
70+
"gitHubAccount": "gretchunkim",
71+
"pictureUrl": "https://github.com/gretchunkim.png",
72+
"name": "Azores"
24273
}
24374
],
24475
"references": [

samples/react-birthdays/src/controls/happyBirthdayCard/HappyBirthdayCard.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class HappyBirthdayCard extends React.Component<IHappyBirthdayCardProps,
8282
<div className={styles.documentCard}>
8383
<Image
8484
imageFit={ImageFit.cover}
85-
// @ts-ignore: Object is possibly 'null'.
85+
// @ts-expect-error: Object is possibly 'null'.
8686
src={imageTemplate[this.props.imageTemplate]?.imageUrl}
8787
width={IMG_WIDTH}
8888
height={IMG_HEIGTH}
@@ -108,6 +108,7 @@ export class HappyBirthdayCard extends React.Component<IHappyBirthdayCardProps,
108108
actions={[
109109
{
110110
iconProps: { iconName: 'Mail' },
111+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
111112
onClick: (ev: any) => {
112113
ev.preventDefault();
113114
ev.stopPropagation();
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export interface IHappyBirthdayCardProps {
2-
userName?:string | undefined;
3-
jobDescription?: string;
2+
userName: string;
3+
jobDescription: string;
44
birthday: string;
5-
anniversary: boolean;
6-
userEmail:string;
5+
anniversary?: boolean;
76
congratulationsMsg?: string;
8-
imageTemplate:string;
9-
}
7+
userEmail: string;
8+
imageTemplate: number; // Change this to a number to represent the index of the imageTemplate array
9+
}

samples/react-birthdays/src/controls/happybirthday/HappyBirthday.tsx

+13-15
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@ export class HappyBirthday extends React.Component<IHappyBirthdayProps, IHappbir
1212
return (
1313
<div className={styles.happyBirthday}>
1414
{
15-
this.props.users.map((user: IUser) => {
16-
return (
17-
<div className={styles.container}>
18-
<HappyBirthdayCard userName={user.userName}
19-
jobDescription={user.jobDescription}
20-
birthday={moment(user.birthday, ["MM-DD-YYYY", "YYYY-MM-DD", "DD/MM/YYYY", "MM/DD/YYYY"]).format('Do MMMM')}
21-
anniversary={user.anniversary}
22-
congratulationsMsg={user.message}
23-
userEmail={user.userEmail}
24-
imageTemplate={this.props.imageTemplate}
25-
/>
26-
</div>
27-
);
28-
})
15+
this.props.users.map((user: IUser, index: number) => (
16+
<div className={styles.container} key={user.key || index}>
17+
<HappyBirthdayCard
18+
userName={user.userName}
19+
jobDescription={user.jobDescription || "No Job Description"}
20+
birthday={moment(user.birthday).format('Do MMMM')}
21+
anniversary={!!user.anniversary}
22+
congratulationsMsg={user.message}
23+
userEmail={user.userEmail}
24+
imageTemplate={Number(this.props.imageTemplate)} // Ensure this is a number
25+
/>
26+
</div>
27+
))
2928
}
3029
</div>
3130
);
3231
}
3332
}
34-
export default HappyBirthday;
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export interface IUser {
2-
key: string;
3-
userName:string;
4-
jobDescription?: string;
5-
birthday: string;
6-
userEmail: string;
7-
message: string;
8-
anniversary: boolean;
2+
key: string; // Unique key
3+
userName: string; // Name of the user
4+
message: string; // Birthday message
5+
anniversary: boolean; // Anniversary flag
6+
userEmail: string; // User's email address
7+
jobDescription: string; // Job title
8+
birthday: string; // ISO string of the birthday date
99
}

0 commit comments

Comments
 (0)