Added badge as renderer of type on Global Variables
This commit is contained in:
parent
7e337c7f65
commit
db9cc5e052
1 changed files with 18 additions and 2 deletions
|
|
@ -6,9 +6,19 @@ import { useState } from "react";
|
||||||
import AddNewVariableButton from "../../../../components/addNewVariableButtonComponent/addNewVariableButton";
|
import AddNewVariableButton from "../../../../components/addNewVariableButtonComponent/addNewVariableButton";
|
||||||
import ForwardedIconComponent from "../../../../components/genericIconComponent";
|
import ForwardedIconComponent from "../../../../components/genericIconComponent";
|
||||||
import TableComponent from "../../../../components/tableComponent";
|
import TableComponent from "../../../../components/tableComponent";
|
||||||
|
import { Badge } from "../../../../components/ui/badge";
|
||||||
import { cn } from "../../../../utils/utils";
|
import { cn } from "../../../../utils/utils";
|
||||||
|
|
||||||
export default function GlobalVariablesPage() {
|
export default function GlobalVariablesPage() {
|
||||||
|
const BadgeRenderer = (props) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Badge variant="outline" size="md" className="font-normal">
|
||||||
|
{props.value}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
// Column Definitions: Defines the columns to be displayed.
|
// Column Definitions: Defines the columns to be displayed.
|
||||||
const [colDefs, setColDefs] = useState<(ColDef<any> | ColGroupDef<any>)[]>([
|
const [colDefs, setColDefs] = useState<(ColDef<any> | ColGroupDef<any>)[]>([
|
||||||
{
|
{
|
||||||
|
|
@ -21,6 +31,7 @@ export default function GlobalVariablesPage() {
|
||||||
}, //This column will be twice as wide as the others
|
}, //This column will be twice as wide as the others
|
||||||
{
|
{
|
||||||
field: "type",
|
field: "type",
|
||||||
|
cellRenderer: BadgeRenderer,
|
||||||
cellEditor: "agSelectCellEditor",
|
cellEditor: "agSelectCellEditor",
|
||||||
cellEditorParams: {
|
cellEditorParams: {
|
||||||
values: ["Prompt", "Credential"],
|
values: ["Prompt", "Credential"],
|
||||||
|
|
@ -98,10 +109,15 @@ export default function GlobalVariablesPage() {
|
||||||
<Button
|
<Button
|
||||||
data-testid="api-key-button-store"
|
data-testid="api-key-button-store"
|
||||||
variant="primary"
|
variant="primary"
|
||||||
className="px-2 group"
|
className="group px-2"
|
||||||
disabled={selectedRows.length === 0}
|
disabled={selectedRows.length === 0}
|
||||||
>
|
>
|
||||||
<IconComponent name="Trash2" className={cn("h-5 w-5 text-destructive group-disabled:text-primary")} />
|
<IconComponent
|
||||||
|
name="Trash2"
|
||||||
|
className={cn(
|
||||||
|
"h-5 w-5 text-destructive group-disabled:text-primary"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<AddNewVariableButton>
|
<AddNewVariableButton>
|
||||||
<Button data-testid="api-key-button-store" variant="primary">
|
<Button data-testid="api-key-button-store" variant="primary">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue