Serviceaccounts: FIX nul for field for toString (#96267)

Switch to uid for profilerow
This commit is contained in:
Eric Leijonmarck 2024-11-12 11:10:37 +00:00 committed by GitHub
parent 8a1bbe7517
commit 6fa06a1406
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
import { css } from '@emotion/css';
import { useState, useEffect } from 'react';
import { useEffect, useState } from 'react';
import { dateTimeFormat, GrafanaTheme2, OrgRole, TimeZone } from '@grafana/data';
import { GrafanaTheme2, OrgRole, TimeZone, dateTimeFormat } from '@grafana/data';
import { Label, TextLink, useStyles2 } from '@grafana/ui';
import { fetchRoleOptions } from 'app/core/components/RolePicker/api';
import { contextSrv } from 'app/core/core';
@ -50,7 +50,13 @@ export function ServiceAccountProfile({ serviceAccount, timeZone, onChange }: Pr
<h3>Information</h3>
<table className="filter-table">
<tbody>
<ServiceAccountProfileRow label="Numerical identifier" value={serviceAccount.id.toString()} disabled={true} />
{serviceAccount.id && (
<ServiceAccountProfileRow
label="Numerical identifier"
value={serviceAccount.id.toString()}
disabled={true}
/>
)}
<ServiceAccountProfileRow
label="Name"
value={serviceAccount.name}