mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
fix: preserve access payload readers
- Read resolved level and record kind in the record switcher\n- Keep payload consumer coverage aligned with record presentation
This commit is contained in:
1 parent
f69e1d7dec
commit
02aa61c9db
1 file changed
+6
-5
@@ -104,10 +104,10 @@ export function LookingAfterCard() {
|
||||
{accountLabel(entry)}
|
||||
</span>
|
||||
<span className="text-muted-foreground block truncate text-xs">
|
||||
{levelLabel(presentation, t)}
|
||||
{levelLabel(entry, presentation, t)}
|
||||
</span>
|
||||
<span className="text-muted-foreground block truncate text-xs">
|
||||
{recordKindLabel(presentation, t)}
|
||||
{recordKindLabel(entry, t)}
|
||||
</span>
|
||||
<span className="text-muted-foreground block truncate text-xs">
|
||||
{scopeLabel(entry, t)}
|
||||
@@ -141,10 +141,11 @@ export function LookingAfterCard() {
|
||||
* clothes.
|
||||
*/
|
||||
function levelLabel(
|
||||
entry: AccountAccessEntry,
|
||||
presentation: RecordPresentation,
|
||||
t: (key: string) => string,
|
||||
): string {
|
||||
if (presentation.access === "manage") {
|
||||
if (entry.level === "manage") {
|
||||
return t("recordSharing.row.canManage");
|
||||
}
|
||||
return presentation.access === "view-and-add"
|
||||
@@ -153,10 +154,10 @@ function levelLabel(
|
||||
}
|
||||
|
||||
function recordKindLabel(
|
||||
presentation: RecordPresentation,
|
||||
entry: AccountAccessEntry,
|
||||
t: (key: string) => string,
|
||||
): string {
|
||||
return presentation.recordKind === "managed"
|
||||
return entry.recordKind === "managed"
|
||||
? t("recordSharing.lookingAfter.kindManaged")
|
||||
: t("recordSharing.lookingAfter.kindShared");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user