- {(value.length === 0 ? [{ type: "user", value: "" }] : value).map(
- (principal, principalIndex) => (
-
-
-
-
-
-
-
-
- {
- const newPrincipals = value.filter(
- (_, idx) => idx !== principalIndex
- );
- onChange(newPrincipals.length ? newPrincipals : []);
- }}
- >
-
-
-
+ {value.map((principal, principalIndex) => (
+
+
+
- )
- )}
+
+
+
+
+ {
+ const newPrincipals = value.filter(
+ (_, idx) => idx !== principalIndex
+ );
+ onChange(newPrincipals.length ? newPrincipals : []);
+ }}
+ >
+
+
+
+
+ ))}
{error &&
{error.message}}
)}
diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx
index fd43697ec..e3c53860e 100644
--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx
+++ b/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx
@@ -131,7 +131,8 @@ export const SshHostsTable = ({ handlePopUpOpen }: Props) => {
const filteredGroups = allowedPrincipals.groups?.filter(
(g) => !existing.groups?.has(g)
);
- return (filteredGroups?.length ?? 0) > 0
+ return ((filteredGroups?.length || filteredUsernames?.length) ?? 0) >
+ 0
? {
loginUser,
source: LoginMappingSource.HOST_GROUP,