-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ms2/layout-changes
- Loading branch information
Showing
8 changed files
with
76 additions
and
249 deletions.
There are no files selected for viewing
158 changes: 0 additions & 158 deletions
158
src/management-system-v2/app/(dashboard)/[environmentId]/environments/environemnts-page.tsx
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
...gement-system-v2/app/(dashboard)/[environmentId]/environments/environments-side-panel.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/management-system-v2/app/(dashboard)/[environmentId]/spaces/environments-page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'use client'; | ||
|
||
import Bar from '@/components/bar'; | ||
import { OrganizationEnvironment } from '@/lib/data/environment-schema'; | ||
import { Button } from 'antd'; | ||
import { FC } from 'react'; | ||
import useFuzySearch, { ReplaceKeysWithHighlighted } from '@/lib/useFuzySearch'; | ||
import ElementList from '@/components/item-list-view'; | ||
import Link from 'next/link'; | ||
|
||
const highlightedKeys = ['name', 'description'] as const; | ||
export type FilteredEnvironment = ReplaceKeysWithHighlighted< | ||
OrganizationEnvironment, | ||
(typeof highlightedKeys)[number] | ||
>; | ||
|
||
const EnvironmentsPage: FC<{ organizationEnvironments: OrganizationEnvironment[] }> = ({ | ||
organizationEnvironments, | ||
}) => { | ||
const { searchQuery, filteredData, setSearchQuery } = useFuzySearch({ | ||
data: organizationEnvironments, | ||
keys: ['name', 'description'], | ||
highlightedKeys, | ||
transformData: (results) => results.map((result) => result.item), | ||
}); | ||
|
||
return ( | ||
<> | ||
<Bar | ||
leftNode={ | ||
<Link href="/create-organization"> | ||
<Button type="primary">New Organization</Button> | ||
</Link> | ||
} | ||
searchProps={{ | ||
value: searchQuery, | ||
onChange: (e) => setSearchQuery(e.target.value), | ||
placeholder: 'Search Environments', | ||
}} | ||
/> | ||
<ElementList<(typeof filteredData)[number]> | ||
columns={[ | ||
{ title: 'Name', render: (_, environment) => environment.name.highlighted }, | ||
{ | ||
title: 'Description', | ||
render: (_, environment) => environment.description.highlighted, | ||
}, | ||
{ | ||
dataIndex: 'id', | ||
key: 'tooltip', | ||
title: '', | ||
width: 100, | ||
render: (id: string) => ( | ||
<Link href={`/${id}/processes`}> | ||
<Button>Enter</Button> | ||
</Link> | ||
), | ||
}, | ||
]} | ||
data={filteredData} | ||
tableProps={{ | ||
rowKey: 'id', | ||
}} | ||
/> | ||
</> | ||
); | ||
}; | ||
export default EnvironmentsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters