Compare commits
2 Commits
fix/oidc-l
...
feat/healt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6bc21a1d0 | ||
|
|
5436567315 |
@@ -17,7 +17,6 @@ interface ChecklistItemRowProps {
|
|||||||
completed: boolean;
|
completed: boolean;
|
||||||
};
|
};
|
||||||
cardPublicId: string;
|
cardPublicId: string;
|
||||||
onCreateNewItem?: () => void;
|
|
||||||
viewOnly?: boolean;
|
viewOnly?: boolean;
|
||||||
dragHandleProps?: DraggableProvided["dragHandleProps"];
|
dragHandleProps?: DraggableProvided["dragHandleProps"];
|
||||||
isDragging?: boolean;
|
isDragging?: boolean;
|
||||||
@@ -26,7 +25,6 @@ interface ChecklistItemRowProps {
|
|||||||
export default function ChecklistItemRow({
|
export default function ChecklistItemRow({
|
||||||
item,
|
item,
|
||||||
cardPublicId,
|
cardPublicId,
|
||||||
onCreateNewItem,
|
|
||||||
viewOnly = false,
|
viewOnly = false,
|
||||||
dragHandleProps,
|
dragHandleProps,
|
||||||
isDragging = false,
|
isDragging = false,
|
||||||
@@ -189,10 +187,7 @@ export default function ChecklistItemRow({
|
|||||||
disabled={viewOnly}
|
disabled={viewOnly}
|
||||||
onChange={(e) => setTitle(e.target.value)}
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
// @ts-expect-error - valid event
|
// @ts-expect-error - valid event
|
||||||
onBlur={(e: Event) => {
|
onBlur={(e: Event) => commitTitle(e.target.innerHTML as string)}
|
||||||
const innerHTML = (e.target as HTMLElement).innerHTML;
|
|
||||||
commitTitle(innerHTML);
|
|
||||||
}}
|
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"m-0 min-h-[20px] w-full p-0 text-sm leading-[20px] text-light-950 outline-none focus-visible:outline-none dark:text-dark-950",
|
"m-0 min-h-[20px] w-full p-0 text-sm leading-[20px] text-light-950 outline-none focus-visible:outline-none dark:text-dark-950",
|
||||||
viewOnly && "cursor-default",
|
viewOnly && "cursor-default",
|
||||||
@@ -202,9 +197,7 @@ export default function ChecklistItemRow({
|
|||||||
if (viewOnly) return;
|
if (viewOnly) return;
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const innerHTML = (e.currentTarget as HTMLElement).innerHTML;
|
commitTitle(title);
|
||||||
commitTitle(innerHTML);
|
|
||||||
onCreateNewItem?.();
|
|
||||||
}
|
}
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -210,9 +210,6 @@ export default function Checklists({
|
|||||||
completed: item.completed,
|
completed: item.completed,
|
||||||
}}
|
}}
|
||||||
cardPublicId={cardPublicId}
|
cardPublicId={cardPublicId}
|
||||||
onCreateNewItem={() =>
|
|
||||||
setActiveChecklistForm?.(checklist.publicId)
|
|
||||||
}
|
|
||||||
viewOnly={viewOnly}
|
viewOnly={viewOnly}
|
||||||
dragHandleProps={provided.dragHandleProps}
|
dragHandleProps={provided.dragHandleProps}
|
||||||
isDragging={snapshot.isDragging}
|
isDragging={snapshot.isDragging}
|
||||||
|
|||||||
@@ -339,37 +339,6 @@ export const initAuth = (db: dbClient) => {
|
|||||||
discoveryUrl: process.env.OIDC_DISCOVERY_URL,
|
discoveryUrl: process.env.OIDC_DISCOVERY_URL,
|
||||||
scopes: ["openid", "email", "profile"],
|
scopes: ["openid", "email", "profile"],
|
||||||
pkce: true,
|
pkce: true,
|
||||||
mapProfileToUser: (profile: {
|
|
||||||
name?: string;
|
|
||||||
display_name?: string;
|
|
||||||
preferred_username?: string;
|
|
||||||
given_name?: string;
|
|
||||||
family_name?: string;
|
|
||||||
email?: string;
|
|
||||||
email_verified?: boolean;
|
|
||||||
sub?: string;
|
|
||||||
picture?: string;
|
|
||||||
avatar?: string;
|
|
||||||
}) => {
|
|
||||||
console.log("OIDC profile:", profile);
|
|
||||||
|
|
||||||
const name =
|
|
||||||
profile.name ??
|
|
||||||
profile.display_name ??
|
|
||||||
profile.preferred_username ??
|
|
||||||
(profile.given_name && profile.family_name
|
|
||||||
? `${profile.given_name} ${profile.family_name}`.trim()
|
|
||||||
: (profile.given_name ?? profile.family_name)) ??
|
|
||||||
profile.sub ??
|
|
||||||
"";
|
|
||||||
|
|
||||||
return {
|
|
||||||
email: profile.email,
|
|
||||||
name: name,
|
|
||||||
emailVerified: profile.email_verified ?? false,
|
|
||||||
image: profile.picture ?? profile.avatar ?? null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user