Skip to content

Commit 66af8ce

Browse files
Added Cell for emails with sso provider (#45)
* Added Cell for emails with sso provider * PR comments * PR comments
1 parent b758303 commit 66af8ce

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

components/kern-button/ButtonAsText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export type ButtonAsTextProps = {
66
color?: string;
77
onClick?: () => void;
88
disabled?: boolean;
9-
iconLeft?: (props: any) => React.ReactNode;
10-
iconRight?: (props: any) => React.ReactNode;
9+
iconLeft?: (props: any) => any;
10+
iconRight?: (props: any) => any;
1111
iconColor?: string;
1212
size?: 'small' | 'medium' | 'large';
1313
className?: string;

components/kern-button/IconButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IconCheck } from "@tabler/icons-react";
44
import { useState } from "react";
55

66
interface IconButtonProps {
7-
icon: (props: any) => React.ReactNode;
7+
icon: (props: any) => any;
88
iconColor?: string;
99
onClick?: (e?: any) => void;
1010
buttonColor?: string;

components/kern-button/KernButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IconCheck } from "@tabler/icons-react";
77
interface KernButtonProps {
88
text?: string;
99
type?: 'button' | 'submit' | 'reset';
10-
icon?: (props: any) => React.ReactNode;
10+
icon?: (props: any) => any;
1111
iconColor?: string;
1212
onClick?: (event?) => void;
1313
buttonColor?: string;

components/kern-table/CellComponents.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,14 @@ function EtlApiTokenCell({ organization }) {
298298
)
299299
}
300300

301-
export { OrganizationAndUsersCell, MaxRowsColsCharsCell, CommentsCell, ExportConsumptionAndDeleteCell, BadgeCell, OrganizationUserCell, DeleteUserCell, LevelCell, ArchiveReasonCell, ProjectNameTaskCell, CancelTaskCell, IconCell, ConfigCell, EditDeleteOrgButtonCell, ViewStackCell, AbortSessionButtonCell, FeedbackMessageCell, FeedbackMessageTextCell, JumpToConversationCell, RemoteVersionCell, ExternalLinkCell, ModelDateCell, FileSizeCell, StatusModelCell, DeleteModelCell, LabelCell, ViewCell, EvaluationRunStateCell, EvaluationRunDetailsCell, EtlApiTokenCell }
301+
function EmailCell({ user }) {
302+
return (
303+
<div className="flex flex-row items-center">
304+
{user.sso_provider ? <Tooltip content={"SSO User via " + user.sso_provider} color="invert">
305+
<span className="text-blue-700">{user.email}*</span></Tooltip> : <span>{user.email}</span>
306+
}
307+
</div>
308+
)
309+
}
310+
311+
export { OrganizationAndUsersCell, MaxRowsColsCharsCell, CommentsCell, ExportConsumptionAndDeleteCell, BadgeCell, OrganizationUserCell, DeleteUserCell, LevelCell, ArchiveReasonCell, ProjectNameTaskCell, CancelTaskCell, IconCell, ConfigCell, EditDeleteOrgButtonCell, ViewStackCell, AbortSessionButtonCell, FeedbackMessageCell, FeedbackMessageTextCell, JumpToConversationCell, RemoteVersionCell, ExternalLinkCell, ModelDateCell, FileSizeCell, StatusModelCell, DeleteModelCell, LabelCell, ViewCell, EvaluationRunStateCell, EvaluationRunDetailsCell, EtlApiTokenCell, EmailCell }

components/kern-table/KernTable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import SortArrows from "@/submodules/react-components/components/kern-table/SortArrows";
22
import { KernTableProps } from "../../types/kern-table";
3-
import { AbortSessionButtonCell, ArchiveReasonCell, BadgeCell, CancelTaskCell, CommentsCell, ConfigCell, DeleteModelCell, DeleteUserCell, EditDeleteOrgButtonCell, EtlApiTokenCell, EvaluationRunDetailsCell, EvaluationRunStateCell, ExportConsumptionAndDeleteCell, ExternalLinkCell, FeedbackMessageCell, FeedbackMessageTextCell, FileSizeCell, IconCell, JumpToConversationCell, LabelCell, LevelCell, MaxRowsColsCharsCell, ModelDateCell, OrganizationAndUsersCell, OrganizationUserCell, ProjectNameTaskCell, RemoteVersionCell, StatusModelCell, ViewCell, ViewStackCell } from "./CellComponents";
3+
import { AbortSessionButtonCell, ArchiveReasonCell, BadgeCell, CancelTaskCell, CommentsCell, ConfigCell, DeleteModelCell, DeleteUserCell, EditDeleteOrgButtonCell, EmailCell, EtlApiTokenCell, EvaluationRunDetailsCell, EvaluationRunStateCell, ExportConsumptionAndDeleteCell, ExternalLinkCell, FeedbackMessageCell, FeedbackMessageTextCell, FileSizeCell, IconCell, JumpToConversationCell, LabelCell, LevelCell, MaxRowsColsCharsCell, ModelDateCell, OrganizationAndUsersCell, OrganizationUserCell, ProjectNameTaskCell, RemoteVersionCell, StatusModelCell, ViewCell, ViewStackCell } from "./CellComponents";
44
import { Fragment, useMemo } from "react";
55
import { IconEdit } from "@tabler/icons-react";
66
import KernDropdown from "../KernDropdown";
@@ -125,6 +125,8 @@ function ComponentMapper(cell: any) {
125125
return <EvaluationRunDetailsCell {...cell} />;
126126
case 'EtlApiTokenCell':
127127
return <EtlApiTokenCell {...cell} />;
128+
case 'EmailCell':
129+
return <EmailCell {...cell} />;
128130
}
129131
case 'text':
130132
return <span>{cell.value ?? <NotApplicableBadge />}</span>

0 commit comments

Comments
 (0)