Skip to content

Commit 4cd217c

Browse files
authored
Merge pull request #16 from wellmaintained/bugfix/10-no-stakeholders-without-photoURL
Fix stakeholder display issues with missing photoURL or displayName
2 parents 682c8dc + b97b5ff commit 4cd217c

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

app/organisation/[organisationId]/decision/[id]/identify/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,11 @@ export default function DecisionIdentityPage() {
229229
/>
230230
<AvatarFallback>
231231
{driverStakeholder?.displayName
232-
?.split(" ")
233-
.map((n) => n[0])
234-
.join("") || "?"}
232+
? driverStakeholder.displayName
233+
.split(" ")
234+
.map((n) => n[0])
235+
.join("")
236+
: "👤"}
235237
</AvatarFallback>
236238
</Avatar>
237239
{driverStakeholder?.displayName}
@@ -269,7 +271,7 @@ export default function DecisionIdentityPage() {
269271
.split(" ")
270272
.map((n) => n[0])
271273
.join("")
272-
: "?"}
274+
: "👤"}
273275
</AvatarFallback>
274276
</Avatar>
275277
{stakeholder.displayName}

components/StakeholderManagement.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,12 @@ export function StakeholderManagement({ organisationId }: StakeholderManagementP
340340
<AvatarImage src={stakeholder.photoURL} />
341341
<AvatarFallback>
342342
{stakeholder.displayName
343-
.split(' ')
344-
.map((n) => n[0])
345-
.join('')
346-
.toUpperCase()}
343+
? stakeholder.displayName
344+
.split(' ')
345+
.map((n) => n[0])
346+
.join('')
347+
.toUpperCase()
348+
: "👤"}
347349
</AvatarFallback>
348350
</Avatar>
349351
<div>

components/stakeholder-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function StakeholderSection({
132132
.split(" ")
133133
.map((n) => n[0])
134134
.join("")
135-
: "?"}
135+
: "👤"}
136136
</AvatarFallback>
137137
</Avatar>
138138
<div>

components/stakeholders/StakeholderListView.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ export function StakeholderListView({
103103
<AvatarImage src={stakeholder.photoURL} alt={stakeholder.displayName} />
104104
<AvatarFallback>
105105
{stakeholder.displayName
106-
.split(" ")
107-
.map((n) => n[0])
108-
.join("")
109-
.toUpperCase()}
106+
? stakeholder.displayName
107+
.split(" ")
108+
.map((n) => n[0])
109+
.join("")
110+
.toUpperCase()
111+
: "👤"}
110112
</AvatarFallback>
111113
</Avatar>
112114
<div className="flex flex-col">

components/stakeholders/TeamHierarchyTree.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@ export function TeamHierarchyTree({
207207
<AvatarImage src={stakeholder.photoURL} alt={stakeholder.displayName} />
208208
<AvatarFallback>
209209
{stakeholder.displayName
210-
.split(" ")
211-
.map((n) => n[0])
212-
.join("")
213-
.toUpperCase()}
210+
? stakeholder.displayName
211+
.split(" ")
212+
.map((n) => n[0])
213+
.join("")
214+
.toUpperCase()
215+
: "👤"}
214216
</AvatarFallback>
215217
</Avatar>
216218
<div className="flex flex-col flex-1">

lib/infrastructure/firestoreStakeholdersRepository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export class FirestoreStakeholdersRepository implements StakeholdersRepository {
6565
// Create new stakeholder
6666
const docRef = await addDoc(collection(db, this.collectionPath), {
6767
email: props.email,
68+
displayName: props.displayName,
6869
photoURL: props.photoURL,
6970
});
7071

0 commit comments

Comments
 (0)