chore: Remove all avatar/logo references (#14532)

* chore: Remove all avatar/logo references

* Updated user profile to only use avatarUrl

* fix: minor style issue

* chore: Remove redundant includeTeamLogo

* fix: Use right avatar default in event type list

* fix: placeholder avatar team profile, target

* chore: Add logoUrl/avatarUrl to JWT

* fix: Bunch of org avatar issues, fix members list

* Fix logoUrl on org pages

* More type fixes

* Hopefully final type fixes

* Another round of type fixes

* fix: UserForm ts

* fix: Handle as return types, not input types

* fix: Remove profile and add avatarUrl

* fix: notFound as const

* fix: Seeder avatarUrl params

* revert: Migration changes for easier recovery

* fix: Add explicit type to builder as avatar is now set

* Add logoUrl to unpublished entity

* Avatar test out of scope here

* fix: Use the new avatarUrl after save

* chore: Removed getOrgAvatarUrl/getTeamAvatarUrl

* fix: Update sidebar image immediately after change

* Unable to safe unnamed user, so default

* fix: Unpublished page, add organization test

* Add more tests
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-04-18 21:54:16 -07:00
1 parent 5695ba7c13
commit d25c043046
73 files changed
+644 -770

No files matched your search

@@ -58,8 +58,6 @@ export async function getServerSession(options: {
where: {
email: token.email.toLowerCase(),
},
// TODO: Re-enable once we get confirmation from compliance that this is okay.
// cacheStrategy: { ttl: 60, swr: 1 },
});
if (!userFromDb) {
@@ -97,8 +95,7 @@ export async function getServerSession(options: {
email_verified: user.emailVerified !== null,
role: user.role,
image: getUserAvatarUrl({
...user,
profile: user.profile,
avatarUrl: user.avatarUrl,
}),
belongsToActiveTeam: token.belongsToActiveTeam,
org: token.org,
@@ -475,6 +475,7 @@ export const AUTH_OPTIONS: AuthOptions = {
select: {
id: true,
username: true,
avatarUrl: true,
name: true,
email: true,
role: true,
@@ -524,6 +525,7 @@ export const AUTH_OPTIONS: AuthOptions = {
id: profileOrg.id,
name: profileOrg.name,
slug: profileOrg.slug ?? profileOrg.requestedSlug ?? "",
logoUrl: profileOrg.logoUrl,
fullDomain: getOrgFullOrigin(profileOrg.slug ?? profileOrg.requestedSlug ?? ""),
domainSuffix: subdomainSuffix(),
}
@@ -47,7 +47,6 @@ export const prefillAvatar = async ({ email }: IPrefillAvatar) => {
const data: Prisma.UserUpdateInput = {};
data.avatarUrl = avatarUrl;
data.avatar = avatar;
await prisma.user.update({
where: { email: email },