Skip to content

Commit 0c697b5

Browse files
committed
remove unsed variable accross the project
1 parent e91eaeb commit 0c697b5

File tree

17 files changed

+37
-181
lines changed

17 files changed

+37
-181
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/admin/addUser.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const AddUser = ({
116116
}
117117
}, [selectedUser]);
118118

119-
const { mutate, isLoading: addUserLoading } = useMutation(
119+
const { mutate } = useMutation(
120120
(input: { input: AddRemoveUserToOrganizationInput }) =>
121121
GraphQL(
122122
addUserDoc,
@@ -148,7 +148,7 @@ const AddUser = ({
148148
}
149149
);
150150

151-
const { mutate: updateMutate, isLoading: updateUserLoading } = useMutation(
151+
const { mutate: updateMutate } = useMutation(
152152
(input: { input: AssignOrganizationRoleInput }) =>
153153
GraphQL(
154154
updateUser,
@@ -158,7 +158,7 @@ const AddUser = ({
158158
input
159159
),
160160
{
161-
onSuccess: (res: any) => {
161+
onSuccess: () => {
162162
toast('User updated successfully');
163163
setIsOpen(false);
164164
setFormData({
@@ -167,7 +167,7 @@ const AddUser = ({
167167
});
168168
setRefetch(true);
169169
},
170-
onError: (err: any) => {
170+
onError: () => {
171171
toast('Failed to update user');
172172
},
173173
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Admin = () => {
5959
const [selectedUser, setSelectedUser] = useState({});
6060
const [refetch, setRefetch] = useState(false);
6161

62-
const { mutate, isLoading: removeUserLoading } = useMutation(
62+
const { mutate } = useMutation(
6363
(input: { input: AddRemoveUserToOrganizationInput }) =>
6464
GraphQL(
6565
removeUserDoc,
@@ -69,11 +69,11 @@ const Admin = () => {
6969
input
7070
),
7171
{
72-
onSuccess: (res: any) => {
72+
onSuccess: () => {
7373
toast('User removed successfully');
7474
usersList.refetch();
7575
},
76-
onError: (err: any) => {
76+
onError: () => {
7777
toast('Failed to remove user');
7878
},
7979
}

app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/assign/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const Assign = () => {
110110
});
111111
};
112112

113-
const { mutate, isLoading: mutationLoading } = useMutation(
113+
const { mutate } = useMutation(
114114
() =>
115115
GraphQL(
116116
AssignCollaborativeDatasets,
@@ -125,7 +125,7 @@ const Assign = () => {
125125
}
126126
),
127127
{
128-
onSuccess: (data: any) => {
128+
onSuccess: () => {
129129
toast('Dataset Assigned Successfully');
130130
CollaborativeDetails.refetch();
131131
router.push(

app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/contributors/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const Details = () => {
110110
[params.entityType]: params.entitySlug,
111111
}, input),
112112
{
113-
onSuccess: (res: any) => {
113+
onSuccess: () => {
114114
toast('Contributor added successfully');
115115
CollaborativeData.refetch();
116116
},
@@ -127,7 +127,7 @@ const Details = () => {
127127
[params.entityType]: params.entitySlug,
128128
}, input),
129129
{
130-
onSuccess: (res: any) => {
130+
onSuccess: () => {
131131
toast('Contributor removed successfully');
132132
CollaborativeData.refetch();
133133
},
@@ -143,7 +143,7 @@ const Details = () => {
143143
[params.entityType]: params.entitySlug,
144144
}, input),
145145
{
146-
onSuccess: (res: any) => {
146+
onSuccess: () => {
147147
toast('Supporter added successfully');
148148
CollaborativeData.refetch();
149149
},
@@ -160,7 +160,7 @@ const Details = () => {
160160
[params.entityType]: params.entitySlug,
161161
}, input),
162162
{
163-
onSuccess: (res: any) => {
163+
onSuccess: () => {
164164
toast('Supporter removed successfully');
165165
CollaborativeData.refetch();
166166
},
@@ -176,7 +176,7 @@ const Details = () => {
176176
[params.entityType]: params.entitySlug,
177177
}, input),
178178
{
179-
onSuccess: (res: any) => {
179+
onSuccess: () => {
180180
toast('Partner added successfully');
181181
CollaborativeData.refetch();
182182
},
@@ -193,7 +193,7 @@ const Details = () => {
193193
[params.entityType]: params.entitySlug,
194194
}, input),
195195
{
196-
onSuccess: (res: any) => {
196+
onSuccess: () => {
197197
toast('Partner removed successfully');
198198
CollaborativeData.refetch();
199199
},

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
1-
import { graphql } from '@/gql';
2-
import { Hydrate } from '@/lib';
31
import { dehydrate } from '@tanstack/react-query';
42

5-
import { getQueryClient, GraphQL } from '@/lib/api';
3+
import { getQueryClient } from '@/lib/api';
64
import styles from './edit.module.scss';
75
import { EditPage } from './page-layout';
86

9-
// const datasetQueryDoc = graphql(`
10-
// query datasetEditQuery($dataset_id: Int) {
11-
// dataset(dataset_id: $dataset_id) {
12-
// id
13-
// title
14-
// description
15-
// }
16-
// }
17-
// `);
187

198
export default async function Page({ params }: { params: { id: string } }) {
209
const queryClient = getQueryClient();
21-
// await queryClient.prefetchQuery([`dataset_${params.id}`], () =>
22-
// GraphQL(datasetQueryDoc, {
23-
// dataset_id: Number(params.id),
24-
// })
25-
// );
10+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2611
const dehydratedState = dehydrate(queryClient);
2712

2813
return (

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/resources/components/ResourceSchema.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { DataTable, Select, TextField } from 'opub-ui';
2+
import { DataTable, TextField } from 'opub-ui';
33

44
const DescriptionCell = ({
55
value,
@@ -66,6 +66,7 @@ export const ResourceSchema = ({
6666
schemaUpdateInput: {
6767
resource: resourceId,
6868
updates: newdata?.map((item: any) => {
69+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6970
const { fieldName, ...rest } = item;
7071
return rest;
7172
}),
@@ -74,17 +75,6 @@ export const ResourceSchema = ({
7475
}
7576
};
7677

77-
const options = [
78-
{
79-
label: 'Integer',
80-
value: 'INTEGER',
81-
},
82-
{
83-
label: 'String',
84-
value: 'STRING',
85-
},
86-
];
87-
8878
const generateColumnData = () => {
8979
return [
9080
{

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/resources/page.tsx

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,16 @@
1-
import { graphql } from '@/gql';
2-
import { Hydrate } from '@/lib';
31
import { dehydrate } from '@tanstack/react-query';
42

5-
import { getQueryClient, GraphQL } from '@/lib/api';
3+
import { getQueryClient } from '@/lib/api';
64
import styles from '../edit.module.scss';
75
import { DistibutionPage } from './page-layout';
86

9-
// const datasetDistributionQueryDoc = graphql(`
10-
// query datasetDistributionQuery($dataset_id: Int) {
11-
// dataset(dataset_id: $dataset_id) {
12-
// id
13-
// title
14-
// resource_set {
15-
// id
16-
// title
17-
// description
18-
// file_details {
19-
// resource {
20-
// id
21-
// title
22-
// description
23-
// }
24-
// format
25-
// file
26-
// remote_url
27-
// source_file_name
28-
// }
29-
// }
30-
// }
31-
// }
32-
// `);
33-
347
export default async function Page({
358
params,
369
}: {
3710
params: { entityType: string; entitySlug: string; id: string };
3811
}) {
3912
const queryClient = getQueryClient();
40-
// await queryClient.prefetchQuery([`dataset_distribution_${params.id}`], () =>
41-
// GraphQL(datasetDistributionQueryDoc, {
42-
// dataset_id: Number(params.id),
43-
// })
44-
// );
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4514
const dehydratedState = dehydrate(queryClient);
4615

4716
return (

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/review/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { InProgress } from '@/components/in-progress';
22

3-
export default async function Page({ params }: { params: { id: string } }) {
3+
export default async function Page() {
44
return (
55
<>
66
<InProgress />
Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,18 @@
11
'use client';
22

33
import React from 'react';
4-
import Link from 'next/link';
5-
import { notFound, useParams } from 'next/navigation';
6-
import { usePRouter } from '@/hooks/use-prouter';
7-
import { Divider, Icon, Tab, TabList, TabPanel, Tabs, Text } from 'opub-ui';
4+
import { notFound } from 'next/navigation';
85

96
import { testDataset } from '@/config/dashboard';
10-
import { Icons } from '@/components/icons';
11-
import { InProgress } from '@/components/in-progress';
12-
import { ActionBar } from '../components/action-bar';
137

148
export default function Page({ params }: { params: { id: string } }) {
15-
const router = usePRouter();
16-
// React.useEffect(() => {
17-
// router.prefetch(`/dashboard/dataset/${params.id}/edit`);
18-
// }, []);
19-
20-
// get demo data
21-
229
const data = testDataset[params.id];
2310
if (!data) {
2411
notFound();
2512
}
2613

2714
return (
2815
<div className="flex h-full flex-col">
29-
{/* <ActionBar
30-
title={data.name}
31-
primaryAction={{
32-
content: 'Add New Dataset',
33-
onAction: () => router.push(`/dashboard/dataset/${params.id}/edit`),
34-
}}
35-
/>
36-
{/* <InProgress /> */}
3716
</div>
3817
);
3918
}
Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,7 @@
11
'use client';
22

33
import React from 'react';
4-
import { graphql } from '@/gql';
5-
// import { CreateDatasetInput } from '@/gql/generated/graphql';
6-
import { usePRouter } from '@/hooks/use-prouter';
7-
import { useMutation } from '@tanstack/react-query';
8-
9-
import { GraphQL } from '@/lib/api';
10-
import { ActionBar } from '../components/action-bar';
11-
import { CreateDataset } from './components/new-dataset';
12-
13-
// const createDatasetMutationDoc = graphql(`
14-
// mutation createDatasetMutation($dataset_data: CreateDatasetInput) {
15-
// create_dataset(dataset_data: $dataset_data) {
16-
// success
17-
// errors
18-
// dataset {
19-
// id
20-
// title
21-
// description
22-
// dataset_type
23-
// }
24-
// }
25-
// }
26-
// `);
274

285
export const Page = () => {
29-
const router = usePRouter();
30-
const submitRef = React.useRef<HTMLButtonElement>(null);
31-
32-
// const { mutate, isLoading } = useMutation(
33-
// (data: { dataset_data: CreateDatasetInput }) =>
34-
// GraphQL(createDatasetMutationDoc, data),
35-
// {
36-
// onSuccess: (data) => {
37-
// router.push(
38-
// `/dashboard/dataset/${data.create_dataset?.dataset?.id}/edit/metadata`
39-
// );
40-
// },
41-
// }
42-
// );
43-
return (
44-
<>
45-
{/* <ActionBar
46-
title="Add New Dataset"
47-
primaryAction={{
48-
content: 'Save & Next',
49-
onAction: () => {
50-
submitRef.current?.click();
51-
},
52-
}}
53-
secondaryAction={{
54-
content: 'Cancel',
55-
onAction: () => router.push('/dashboard/dataset'),
56-
}}
57-
previousPage={{
58-
content: 'My Datasets',
59-
link: '/dashboard/dataset',
60-
}}
61-
isLoading={isLoading}
62-
/>
63-
64-
<CreateDataset
65-
submitRef={submitRef}
66-
mutate={mutate}
67-
isLoading={isLoading}
68-
/> */}
69-
Create Dataset
70-
</>
71-
);
6+
return <>Create Dataset</>;
727
};

0 commit comments

Comments
 (0)