Skip to content

Commit

Permalink
browse page progress
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghoonio committed Sep 11, 2024
1 parent 7b605bc commit 291bb8d
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 11 deletions.
31 changes: 31 additions & 0 deletions web/src/components/browse/project-accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Editor } from '@monaco-editor/react';
import { useForm } from 'react-hook-form';
import { useParams } from 'react-router-dom';

import { PageLayout } from '../components/layout/page-layout';
import { SchemaHeader } from '../components/schemas/schema-header';
import { SchemaInterface } from '../components/schemas/schema-interface';
import { useSession } from '../contexts/session-context';
import { useSchema } from '../hooks/queries/useSchema';

export function Schema() {
const { user } = useSession();
const { namespace, schema } = useParams();
const { data: schemaData, isFetching: isLoading } = useSchema(namespace, schema);

const {} = useForm();

const canEdit = (user && (user.login === namespace || user.orgs.includes(namespace || 'NONE'))) || false;

return (
<PageLayout title={`${namespace}/${schema} schema`} fullWidth>
<SchemaInterface
namespace={namespace!}
name={schema!}
key={schemaData?.schema || 'NONE'}
canEdit={canEdit}
schemaData={schemaData}
/>
</PageLayout>
);
}
4 changes: 2 additions & 2 deletions web/src/components/project/view-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ViewSelector = (props: ViewSelectorProps) => {
}}
className="top-z w-100"
options={[
{ value: null, label: "Default view" },
{ value: null, label: "Default View" },
...(projectViews?.views.map((view) => ({
view: view.name,
description: view.description || 'No description',
Expand Down Expand Up @@ -115,7 +115,7 @@ export const ViewSelector = (props: ViewSelectorProps) => {
}
value={
view === undefined
? { value: null, label: "Default view" }
? { value: null, label: "Default View" }
: { view: view, description: view, value: view, label: view }
}
/>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/schemas/schemas-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const SchemasNav = (props: Props) => {
<div className="d-flex flex-column align-items-center gap-2">
<div className="d-flex align-items-center justify-content-between w-100">
<div className="d-flex align-items-center">
<h1 className="m-0 fw-bold">PEPhub schemas</h1>
<h3 className="m-0 fw-semibold">PEPhub schemas</h3>
</div>
{user && (
<div className="d-flex align-items-center gap-1">
Expand Down
7 changes: 4 additions & 3 deletions web/src/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ body {
transition: all 180ms;
}

.namespace-nav .nav-link:hover {
.namespace-nav .nav-link:hover,
.namespace-card:hover {
background-color: #052c6512;
color: #052c65;
}
Expand Down Expand Up @@ -778,7 +779,7 @@ body {
background-color: white !important;
color: black !important;
box-shadow: .5px 1px 7px 1px #00000010 !important;
font-weight: 600 !important;
font-weight: 500 !important;
}

.modal-pill .nav-pills .nav-item {
Expand Down Expand Up @@ -809,7 +810,7 @@ body {

.modal-pill .nav-tabs .nav-link.active {
color: black !important;
font-weight: 600 !important;
font-weight: 500 !important;
}

.modal-pill .nav-tabs .nav-link {
Expand Down
4 changes: 2 additions & 2 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { LoginSuccessPage } from './pages/LoginSuccess';
import { NamespacePage } from './pages/Namespace';
import { ProjectPage } from './pages/Project';
import { Schema } from './pages/Schema';
import { Schemas } from './pages/Schemas';
import { Browse } from './pages/Browse';
import { SearchPage } from './pages/Search';
import { EidoValidator } from './pages/Validator';

Expand Down Expand Up @@ -73,7 +73,7 @@ const router = createBrowserRouter([
},
{
path: '/schemas',
element: <Schemas />,
element: <Browse />,
},
{
path: '/schemas/:namespace',
Expand Down
Loading

0 comments on commit 291bb8d

Please sign in to comment.