Fix SshHostsTable component

This commit is contained in:
Tuan Dang
2025-05-02 13:38:21 -07:00
parent 9ec7d0d03e
commit a285a14fff

View File

@@ -107,16 +107,20 @@ export const SshHostsTable = ({ handlePopUpOpen }: Props) => {
{} as Record<string, Set<string>>
);
const entriesFromHost = hostMappings.map(({ loginUser, allowedPrincipals }) => ({
loginUser,
source: LoginMappingSource.HOST,
usernames: allowedPrincipals.usernames
}));
const entriesFromHost = hostMappings.map(
({ loginUser, allowedPrincipals }) => ({
loginUser,
source: LoginMappingSource.HOST,
usernames: allowedPrincipals.usernames
})
);
const entriesFromGroup = groupMappings
.map(({ loginUser, allowedPrincipals }) => {
const existing = hostLoginUserToPrincipals[loginUser] || new Set();
const filteredUsernames = allowedPrincipals.usernames.filter((u) => !existing.has(u));
const filteredUsernames = allowedPrincipals.usernames.filter(
(u) => !existing.has(u)
);
return filteredUsernames.length > 0
? {
loginUser,
@@ -233,8 +237,4 @@ export const SshHostsTable = ({ handlePopUpOpen }: Props) => {
</TableContainer>
</div>
);
};
</TableContainer>
</div>
);
};