mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 10:07:34 +00:00
filter for undefined scope values
This commit is contained in:
@@ -43,27 +43,30 @@ export function ConsentScreen({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("scope", scope);
|
||||||
return (
|
return (
|
||||||
<div className="pt-4 w-full flex flex-col items-center space-y-4">
|
<div className="pt-4 w-full flex flex-col items-center space-y-4">
|
||||||
<ul className="list-disc space-y-2 w-full">
|
<ul className="list-disc space-y-2 w-full">
|
||||||
{scope?.map((s) => {
|
{scope
|
||||||
const translationKey = `device.scope.${s}`;
|
?.filter((s) => !!s)
|
||||||
const description = t(translationKey, null);
|
.map((s) => {
|
||||||
|
const translationKey = `device.scope.${s}`;
|
||||||
|
const description = t(translationKey, null);
|
||||||
|
|
||||||
// Check if the key itself is returned and provide a fallback
|
// Check if the key itself is returned and provide a fallback
|
||||||
const resolvedDescription =
|
const resolvedDescription =
|
||||||
description === translationKey ? "" : description;
|
description === translationKey ? "" : description;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
key={s}
|
key={s}
|
||||||
className="grid grid-cols-4 w-full text-sm flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light py-2 px-4 rounded-md transition-all"
|
className="grid grid-cols-4 w-full text-sm flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light py-2 px-4 rounded-md transition-all"
|
||||||
>
|
>
|
||||||
<strong className="col-span-1">{s}</strong>
|
<strong className="col-span-1">{s}</strong>
|
||||||
<span className="col-span-3">{resolvedDescription}</span>
|
<span className="col-span-3">{resolvedDescription}</span>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p className="ztdl-p text-xs text-left">
|
<p className="ztdl-p text-xs text-left">
|
||||||
|
Reference in New Issue
Block a user