Skip to content

Commit

Permalink
Merged main into engine/script-file-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoderis committed Dec 20, 2024
2 parents b2dd115 + d418434 commit a7ab8f0
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 249 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ const Layout: FC<
icon: <FaUserEdit />,
},
{
key: 'environments',
key: 'spaces',
title: 'My Spaces',
label: <SpaceLink href={`/environments`}>My Spaces</SpaceLink>,
label: <SpaceLink href={`/spaces`}>My Spaces</SpaceLink>,
icon: <AppstoreOutlined />,
},
],
Expand Down Expand Up @@ -187,7 +187,6 @@ const Layout: FC<
priority
/>
</Link>

{loggedIn ? menu : null}
</AntLayout.Sider>
)}
Expand Down
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;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Content from '@/components/content';
import { getEnvironmentById } from '@/lib/data/DTOs';
import { getUserOrganizationEnvironments } from '@/lib/data/DTOs';
import { OrganizationEnvironment } from '@/lib/data/environment-schema';
import EnvironmentsPage from './environemnts-page';
import EnvironmentsPage from './environments-page';
import { getUserById } from '@/lib/data/DTOs';
import UnauthorizedFallback from '@/components/unauthorized-fallback';

Expand All @@ -19,7 +19,7 @@ const Page = async () => {
)) as OrganizationEnvironment[];

return (
<Content title="My Environments">
<Content title="My Spaces">
<EnvironmentsPage organizationEnvironments={organizationEnvironments} />
</Content>
);
Expand Down
4 changes: 2 additions & 2 deletions src/management-system-v2/components/header-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ const HeaderActions: FC = () => {

avatarDropdownItems.push(
{
key: 'environments',
key: 'spaces',
title: 'My Spaces',
label: <SpaceLink href={`/environments`}>My Spaces</SpaceLink>,
label: <SpaceLink href={`/spaces`}>My Spaces</SpaceLink>,
icon: <AppstoreOutlined />,
},
{
Expand Down
1 change: 0 additions & 1 deletion src/management-system-v2/lib/user-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const defaultPreferences = {
'role-page-side-panel': { open: false, width: 300 },
'user-page-side-panel': { open: false, width: 300 },
'process-meta-data': { open: false, width: 300 },
'environments-page-side-panel': { open: false, width: 300 },
'tech-data-open-tree-items': [] as { id: string; open: string[] }[],
'tech-data-editor': { siderOpen: true, siderWidth: 300 },
}; /* as const */ /* Does not work for strings */
Expand Down
2 changes: 1 addition & 1 deletion src/management-system-v2/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const nextConfig = {
rewrites: async () => {
return [
'processes',
'environments',
'spaces',
'executions',
'engines',
'tasklist',
Expand Down

0 comments on commit a7ab8f0

Please sign in to comment.