Skip to content

Commit 41b2179

Browse files
committed
Dataset is centered,removed View details and removed background color of table header. Also while closing the editor it will lead to active section for published models
1 parent c91d3ca commit 41b2179

6 files changed

Lines changed: 86 additions & 64 deletions

File tree

app/[locale]/(user)/datasets/[datasetIdentifier]/DatasetDetailsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default function DatasetDetailsPage({
117117
{ href: '#', label: 'Dataset Details' },
118118
]}
119119
/>
120-
<div className="flex">
120+
<div className="container flex">
121121
<div className="w-full gap-10 border-r-2 border-solid border-greyExtralight p-6 lg:w-3/4 lg:p-10" data-tour="dataset-info">
122122
{Datasetdetails.isLoading ? (
123123
<div className=" mt-8 flex justify-center">
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.tableWrapper {
2+
:global(thead th) {
3+
background-color: var(--grey-extralight) !important;
4+
}
5+
:global(thead th),
6+
:global(thead th *),
7+
:global(thead th button),
8+
:global(thead th span),
9+
:global(thead th a) {
10+
color: #000000 !important;
11+
}
12+
}
13+
14+
.dialogTableWrapper {
15+
:global(thead th) {
16+
background-color: var(--grey-extralight) !important;
17+
}
18+
:global(thead th),
19+
:global(thead th *),
20+
:global(thead th button),
21+
:global(thead th span),
22+
:global(thead th a) {
23+
color: #000000 !important;
24+
}
25+
}

app/[locale]/(user)/datasets/[datasetIdentifier]/components/Resources/index.tsx

Lines changed: 41 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import PdfPreview from '@/app/[locale]/(user)/components/PdfPreview';
66
import { graphql } from '@/gql';
77
import { useQuery } from '@tanstack/react-query';
88
import {
9-
Accordion,
10-
AccordionContent,
11-
AccordionItem,
12-
AccordionTrigger,
139
Button,
1410
Dialog,
1511
Format,
@@ -21,7 +17,7 @@ import {
2117

2218
import { GraphQL } from '@/lib/api';
2319
import { Icons } from '@/components/icons';
24-
20+
import styles from './Resources.module.scss';
2521
const datasetResourceQuery: any = graphql(`
2622
query datasetResources($datasetId: UUID!) {
2723
datasetResources(datasetId: $datasetId) {
@@ -82,7 +78,7 @@ const Resources = () => {
8278
View All Columns
8379
</Button>
8480
</Dialog.Trigger>
85-
<Dialog.Content title={'All Columns'} limitHeight>
81+
<Dialog.Content title={'All Columns'} limitHeight className={styles.dialogTableWrapper}>
8682
<Table
8783
columns={[
8884
{
@@ -168,7 +164,7 @@ const Resources = () => {
168164
Preview
169165
</Button>
170166
</Dialog.Trigger>
171-
<Dialog.Content title={'Preview'} limitHeight large>
167+
<Dialog.Content title={'Preview'} limitHeight large className={styles.dialogTableWrapper}>
172168
{row.original.format === 'PDF' ? (
173169
<PdfPreview
174170
url={`${process.env.NEXT_PUBLIC_BACKEND_URL}/api/download/resource/${row.original.id}`}
@@ -225,63 +221,49 @@ const Resources = () => {
225221
className="mt-5 flex flex-col gap-6 border-1 border-solid border-greyExtralight bg-surfaceDefault p-4 lg:mx-0 lg:p-6"
226222
>
227223
<div>
228-
<Accordion type="single" collapsible className="w-full">
229-
<AccordionItem value="item-1" className=" border-none">
230-
<div className="flex flex-wrap md:flex-nowrap items-center justify-between gap-4">
231-
<div className="flex flex-wrap md:flex-nowrap items-center gap-2 ">
232-
{item.fileDetails?.format && (
233-
<Format fileType={item.fileDetails?.format} />
234-
)}
235-
<Text variant="headingMd" className=" line-clamp-1">
236-
{item.name}
237-
</Text>
238-
</div>
239-
<div className="flex items-center gap-4">
240-
<AccordionTrigger className="flex w-full items-center gap-2 p-0 hover:no-underline">
224+
<div className="flex flex-wrap md:flex-nowrap items-center justify-between gap-4">
225+
<div className="flex flex-wrap md:flex-nowrap items-center gap-2 ">
226+
{item.fileDetails?.format && (
227+
<Format fileType={item.fileDetails?.format} />
228+
)}
229+
<Text variant="headingMd" className=" line-clamp-1">
230+
{item.name}
231+
</Text>
232+
</div>
233+
<div className="flex items-center gap-4">
234+
<Link
235+
href={`${process.env.NEXT_PUBLIC_BACKEND_URL}/api/download/resource/${item.id}`}
236+
target="_blank"
237+
className="flex justify-center"
238+
>
239+
<Button kind="tertiary">
240+
<div className="flex gap-1">
241241
<Text
242242
variant="bodyLg"
243-
className=" w-[100px] text-secondaryText"
243+
className=" text-primaryText"
244+
fontWeight="semibold"
244245
>
245-
{' '}
246-
View Details
246+
Download
247247
</Text>
248-
</AccordionTrigger>
249-
<Link
250-
href={`${process.env.NEXT_PUBLIC_BACKEND_URL}/api/download/resource/${item.id}`}
251-
target="_blank"
252-
className="flex justify-center"
253-
>
254-
<Button kind="tertiary">
255-
<div className="flex gap-1">
256-
<Text
257-
variant="bodyLg"
258-
className=" text-primaryText"
259-
fontWeight="semibold"
260-
>
261-
{' '}
262-
Download
263-
</Text>
264-
<Icon source={Icons.download} size={20} />
265-
</div>
266-
</Button>
267-
</Link>
248+
<Icon source={Icons.download} size={20} />
268249
</div>
269-
</div>
270-
<AccordionContent
271-
className="flex w-full flex-col py-5"
272-
style={{
273-
backgroundColor: 'var( --base-pure-white)',
274-
outline: '1px solid var( --base-pure-white)',
275-
}}
276-
>
277-
<Table
278-
columns={generateColumnData()}
279-
rows={generateTableData(item)}
280-
hideFooter
281-
/>
282-
</AccordionContent>
283-
</AccordionItem>
284-
</Accordion>
250+
</Button>
251+
</Link>
252+
</div>
253+
</div>
254+
<div
255+
className={`flex w-full flex-col py-5 ${styles.tableWrapper}`}
256+
style={{
257+
backgroundColor: 'var( --base-pure-white)',
258+
outline: '1px solid var( --base-pure-white)',
259+
}}
260+
>
261+
<Table
262+
columns={generateColumnData()}
263+
rows={generateTableData(item)}
264+
hideFooter
265+
/>
266+
</div>
285267
</div>
286268
</div>
287269
)

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default function PublishPage() {
209209
setStatus('saved');
210210
refetch();
211211
router.push(
212-
`/dashboard/${params.entityType}/${params.entitySlug}/aimodels`
212+
`/dashboard/${params.entityType}/${params.entitySlug}/aimodels?tab=active`
213213
);
214214
},
215215
onError: (error: any) => {

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/layout.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import { graphql } from '@/gql';
44
import { useMutation, useQuery } from '@tanstack/react-query';
5-
import { useParams, usePathname, useRouter } from 'next/navigation';
5+
import {
6+
useParams,
7+
usePathname,
8+
useRouter,
9+
useSearchParams,
10+
} from 'next/navigation';
611
import { Tab, TabList, Tabs, toast } from 'opub-ui';
712

813
import { GraphQL } from '@/lib/api';
@@ -27,13 +32,16 @@ const FetchAIModelName: any = graphql(`
2732
aiModels(filters: $filters) {
2833
id
2934
displayName
35+
status
36+
isPublic
3037
}
3138
}
3239
`);
3340

3441
const TabsAndChildren = ({ children }: { children: React.ReactNode }) => {
3542
const router = useRouter();
3643
const pathName = usePathname();
44+
const searchParams = useSearchParams();
3745
const params = useParams<{
3846
entityType: string;
3947
entitySlug: string;
@@ -91,6 +99,13 @@ const TabsAndChildren = ({ children }: { children: React.ReactNode }) => {
9199
}
92100
);
93101

102+
const sourceTab = searchParams.get('tab');
103+
104+
const goBackURL =
105+
sourceTab === 'active'
106+
? `/dashboard/${params.entityType}/${params.entitySlug}/aimodels?tab=active`
107+
: `/dashboard/${params.entityType}/${params.entitySlug}/aimodels`;
108+
94109
const links = [
95110
{
96111
label: 'Metadata',
@@ -131,7 +146,7 @@ const TabsAndChildren = ({ children }: { children: React.ReactNode }) => {
131146
<TitleBar
132147
label={'AI MODEL NAME'}
133148
title={AIModelData?.data?.aiModels[0]?.displayName}
134-
goBackURL={`/dashboard/${params.entityType}/${params.entitySlug}/aimodels`}
149+
goBackURL={goBackURL}
135150
onSave={(e) => mutate({ displayName: e })}
136151
loading={editMutationLoading}
137152
status={titleBarStatus}

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export default function AIModelsPage({
184184
<LinkButton
185185
kind="tertiary"
186186
size="medium"
187-
href={`/dashboard/${entityType}/${entitySlug}/aimodels/edit/${row.original.id}/details`}
187+
href={`/dashboard/${entityType}/${entitySlug}/aimodels/edit/${row.original.id}/details?tab=${navigationTab ?? 'registered'}`}
188188
>
189189
<span className="line-clamp-1 max-w-[280px]">
190190
{row.original.displayName}

0 commit comments

Comments
 (0)