Skip to content

Commit a1abe40

Browse files
Backlog/v12 tenant alert selection (#2503)
* fix[frontend](platform-broadcast): render bulk apply-to-all button as icon-only with tooltip * fix[backend](auth): default empty tenant to DefaultTenantID for non-internal callers
1 parent f4462c5 commit a1abe40

9 files changed

Lines changed: 30 additions & 17 deletions

File tree

‎backend/pkg/http/middleware/auth.go‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ func setActor(c *gin.Context, a Actor, supportOf SupportOfFunc) bool {
4141

4242
c.Set("support_access", a.Support)
4343

44-
ctx := authz.WithTenantID(c.Request.Context(), a.TenantID)
44+
tid := a.TenantID
45+
if tid == "" && !a.Internal {
46+
// platform admin with no tenant selected → scope to the default
47+
// tenant instead of "" (which downstream usecases fail-open on).
48+
tid = authz.DefaultTenantID
49+
}
50+
ctx := authz.WithTenantID(c.Request.Context(), tid)
4551

4652
if a.Internal && a.TenantID == "" {
4753
ctx = tenancy.WithAllTenantsRead(ctx)

‎frontend/src/features/platform-broadcast/components/PlatformBroadcastButton.tsx‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useState, type ReactNode } from 'react'
22
import { Radio } from 'lucide-react'
33
import { Button } from '@/shared/components/ui/button'
4+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/shared/components/ui/tooltip'
45
import { useAuth } from '@/features/auth/services/auth.context'
56
import { useBilling } from '@/features/billing'
67
import { useSupportTenant } from '@/shared/lib/current-tenant'
@@ -48,15 +49,21 @@ export function PlatformBroadcastButton(props: PlatformBroadcastButtonProps) {
4849

4950
return (
5051
<>
51-
<Button
52-
variant={props.variant ?? 'outline'}
53-
size={props.size ?? 'sm'}
54-
disabled={props.disabled}
55-
onClick={() => setOpen(true)}
56-
>
57-
<Radio size={14} className="mr-1.5" />
58-
{props.label}
59-
</Button>
52+
<Tooltip>
53+
<TooltipTrigger asChild>
54+
<Button
55+
variant={props.variant ?? 'outline'}
56+
size="icon"
57+
disabled={props.disabled}
58+
onClick={() => setOpen(true)}
59+
aria-label={props.label}
60+
className={props.size === 'sm' ? 'h-8 w-8' : undefined}
61+
>
62+
<Radio size={14} />
63+
</Button>
64+
</TooltipTrigger>
65+
<TooltipContent>{props.label}</TooltipContent>
66+
</Tooltip>
6067
<BroadcastDialog
6168
open={open}
6269
title={props.title}

‎frontend/src/shared/i18n/locales/de.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5552,7 +5552,7 @@
55525552
"leave": "Verlassen"
55535553
},
55545554
"platformBroadcast": {
5555-
"button": "Auf Mandanten anwenden…",
5555+
"button": "Auf alle Mandanten anwenden",
55565556
"action": {
55575557
"create": "{{resource}} verteilt erstellen",
55585558
"update": "{{resource}} verteilt aktualisieren",

‎frontend/src/shared/i18n/locales/en.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5537,7 +5537,7 @@
55375537
"leave": "Leave"
55385538
},
55395539
"platformBroadcast": {
5540-
"button": "Apply to tenants…",
5540+
"button": "Apply to all tenants",
55415541
"action": {
55425542
"create": "Broadcast {{resource}} create",
55435543
"update": "Broadcast {{resource}} update",

‎frontend/src/shared/i18n/locales/es.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5514,7 +5514,7 @@
55145514
"leave": "Salir"
55155515
},
55165516
"platformBroadcast": {
5517-
"button": "Aplicar a inquilinos…",
5517+
"button": "Aplicar a todos los inquilinos",
55185518
"action": {
55195519
"create": "Difundir creación de {{resource}}",
55205520
"update": "Difundir actualización de {{resource}}",

‎frontend/src/shared/i18n/locales/fr.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5552,7 +5552,7 @@
55525552
"leave": "Quitter"
55535553
},
55545554
"platformBroadcast": {
5555-
"button": "Appliquer aux locataires…",
5555+
"button": "Appliquer à tous les locataires",
55565556
"action": {
55575557
"create": "Diffuser la création de {{resource}}",
55585558
"update": "Diffuser la mise à jour de {{resource}}",

‎frontend/src/shared/i18n/locales/it.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5552,7 +5552,7 @@
55525552
"leave": "Esci"
55535553
},
55545554
"platformBroadcast": {
5555-
"button": "Applica ai tenant…",
5555+
"button": "Applica a tutti i tenant",
55565556
"action": {
55575557
"create": "Trasmetti creazione {{resource}}",
55585558
"update": "Trasmetti aggiornamento {{resource}}",

‎frontend/src/shared/i18n/locales/pt.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5514,7 +5514,7 @@
55145514
"leave": "Sair"
55155515
},
55165516
"platformBroadcast": {
5517-
"button": "Aplicar aos inquilinos…",
5517+
"button": "Aplicar a todos os inquilinos",
55185518
"action": {
55195519
"create": "Transmitir criação de {{resource}}",
55205520
"update": "Transmitir atualização de {{resource}}",

‎frontend/src/shared/i18n/locales/ru.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5576,7 +5576,7 @@
55765576
"leave": "Выйти"
55775577
},
55785578
"platformBroadcast": {
5579-
"button": "Применить к арендаторам…",
5579+
"button": "Применить ко всем арендаторам",
55805580
"action": {
55815581
"create": "Массовое создание: {{resource}}",
55825582
"update": "Массовое обновление: {{resource}}",

0 commit comments

Comments
 (0)