From 5e60da4b5b66e81d373153d1dd690b3e73b87d14 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Mon, 11 Mar 2024 00:29:08 +0100
Subject: [PATCH] WIP: fdo profiles

---
 pages/_app.tsx                       |  24 +--
 pages/profiles/index.tsx             |  23 +++
 src/api/api.ts                       | 256 +++++++++++++++++++++++++--
 src/api/base.ts                      |   1 +
 src/api/common.ts                    |   1 +
 src/api/configuration.ts             |   1 +
 src/api/index.ts                     |   1 +
 src/components/fdos/create.tsx       |  50 +++++-
 src/components/profiles/IProfile.tsx |   5 +
 src/components/profiles/index.ts     |   2 +
 src/components/profiles/list.tsx     |  34 ++++
 src/components/profiles/show.tsx     |   6 +
 src/components/repositories/list.tsx |   4 +-
 src/interfaces/IRepository.tsx       |   2 +-
 src/interfaces/index.d.ts            |   1 +
 src/providers/dataProvider.tsx       |  12 +-
 16 files changed, 381 insertions(+), 42 deletions(-)
 create mode 100644 pages/profiles/index.tsx
 create mode 100644 src/components/profiles/IProfile.tsx
 create mode 100644 src/components/profiles/index.ts
 create mode 100644 src/components/profiles/list.tsx
 create mode 100644 src/components/profiles/show.tsx

diff --git a/pages/_app.tsx b/pages/_app.tsx
index 72f68b0..bce8840 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -93,8 +93,6 @@ const App = (props: React.PropsWithChildren) => {
       return null
     },
     getIdentity: async () => {
-      return data
-      /*
       if (data?.user) {
         const { user } = data
         return {
@@ -105,7 +103,6 @@ const App = (props: React.PropsWithChildren) => {
       }
 
       return null
-      */
     }
   }
 
@@ -127,20 +124,23 @@ const App = (props: React.PropsWithChildren) => {
               warnWhenUnsavedChanges: true,
               useNewQueryKeys: true
             }}
-            resources={[
-              {
-                name: 'fdo',
-                list: '/fdo',
-                show: '/fdo/show/:id',
-                create: '/fdo'
-              }, {
+            resources={[{
+              name: 'fdo',
+              list: '/fdo',
+              show: '/fdo/show/:id',
+              create: '/fdo'
+            }, {
                 name: 'repositories',
                 list: '/repositories',
                 show: '/repositories/show/:id'
               }, {
                 name: 'info',
                 show: '/info'
-              }]}
+              }, {
+              name: "profiles",
+              list: "/profiles",
+              show: "/profiles/show/:id"
+            }]}
           >
             {props.children}
             <RefineKbar />
@@ -149,7 +149,7 @@ const App = (props: React.PropsWithChildren) => {
         </RefineSnackbarProvider>
       </ColorModeContextProvider>
     </RefineKbarProvider>
-  </>
+  </>;
 }
 
 function MyApp ({
diff --git a/pages/profiles/index.tsx b/pages/profiles/index.tsx
new file mode 100644
index 0000000..3c4ca49
--- /dev/null
+++ b/pages/profiles/index.tsx
@@ -0,0 +1,23 @@
+import React from 'react'
+import { GetServerSideProps } from 'next'
+import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
+
+import { ProfilesList } from '../../src/components/profiles'
+
+const ListProfiles = () => {
+  return <ProfilesList/>
+}
+
+export default ListProfiles
+
+export const getServerSideProps: GetServerSideProps<{}> = async (context) => {
+  const translateProps = await serverSideTranslations(context.locale ?? 'en', [
+    'common'
+  ])
+
+  return {
+    props: {
+      ...translateProps
+    }
+  }
+}
diff --git a/src/api/api.ts b/src/api/api.ts
index 3980d90..cac6a40 100644
--- a/src/api/api.ts
+++ b/src/api/api.ts
@@ -1,3 +1,4 @@
+/* tslint:disable */
 /* eslint-disable */
 /**
  * FDO Manager Service API
@@ -127,6 +128,25 @@ export interface GetInfo200Response {
      */
     'links'?: Links;
 }
+/**
+ * 
+ * @export
+ * @interface GetProfile200Response
+ */
+export interface GetProfile200Response {
+    /**
+     * 
+     * @type {Profile}
+     * @memberof GetProfile200Response
+     */
+    'data': Profile;
+    /**
+     * 
+     * @type {Links}
+     * @memberof GetProfile200Response
+     */
+    'links'?: Links;
+}
 /**
  * 
  * @export
@@ -203,6 +223,25 @@ export interface Links {
      */
     'collection'?: string;
 }
+/**
+ * 
+ * @export
+ * @interface ListProfiles200Response
+ */
+export interface ListProfiles200Response {
+    /**
+     * 
+     * @type {Array<Profile>}
+     * @memberof ListProfiles200Response
+     */
+    'data'?: Array<Profile>;
+    /**
+     * 
+     * @type {Links}
+     * @memberof ListProfiles200Response
+     */
+    'links'?: Links;
+}
 /**
  * 
  * @export
@@ -260,6 +299,25 @@ export interface OverviewFdoCreate200Response {
      */
     'links'?: Links;
 }
+/**
+ * 
+ * @export
+ * @interface Profile
+ */
+export interface Profile {
+    /**
+     * 
+     * @type {string}
+     * @memberof Profile
+     */
+    'id'?: string;
+    /**
+     * 
+     * @type {Links}
+     * @memberof Profile
+     */
+    'links'?: Links;
+}
 /**
  * 
  * @export
@@ -364,14 +422,18 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
          * 
          * @summary Create an FDO.
          * @param {TargetRepositories} repositories 
-         * @param {File} [data] 
-         * @param {File} [metadata] 
+         * @param {File} data 
+         * @param {File} metadata 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        createFDO: async (repositories: TargetRepositories, data?: File, metadata?: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
+        createFDO: async (repositories: TargetRepositories, data: File, metadata: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
             // verify required parameter 'repositories' is not null or undefined
             assertParamExists('createFDO', 'repositories', repositories)
+            // verify required parameter 'data' is not null or undefined
+            assertParamExists('createFDO', 'data', data)
+            // verify required parameter 'metadata' is not null or undefined
+            assertParamExists('createFDO', 'metadata', metadata)
             const localVarPath = `/fdo`;
             // use dummy base URL string because the URL constructor only accepts absolute URLs.
             const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -809,12 +871,12 @@ export const DefaultApiFp = function(configuration?: Configuration) {
          * 
          * @summary Create an FDO.
          * @param {TargetRepositories} repositories 
-         * @param {File} [data] 
-         * @param {File} [metadata] 
+         * @param {File} data 
+         * @param {File} metadata 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        async createFDO(repositories: TargetRepositories, data?: File, metadata?: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
+        async createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
             const localVarAxiosArgs = await localVarAxiosParamCreator.createFDO(repositories, data, metadata, options);
             const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
             const localVarOperationServerBasePath = operationServerMap['DefaultApi.createFDO']?.[localVarOperationServerIndex]?.url;
@@ -978,12 +1040,12 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
          * 
          * @summary Create an FDO.
          * @param {TargetRepositories} repositories 
-         * @param {File} [data] 
-         * @param {File} [metadata] 
+         * @param {File} data 
+         * @param {File} metadata 
          * @param {*} [options] Override http request option.
          * @throws {RequiredError}
          */
-        createFDO(repositories: TargetRepositories, data?: File, metadata?: File, options?: any): AxiosPromise<void> {
+        createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: any): AxiosPromise<void> {
             return localVarFp.createFDO(repositories, data, metadata, options).then((request) => request(axios, basePath));
         },
         /**
@@ -1111,13 +1173,13 @@ export class DefaultApi extends BaseAPI {
      * 
      * @summary Create an FDO.
      * @param {TargetRepositories} repositories 
-     * @param {File} [data] 
-     * @param {File} [metadata] 
+     * @param {File} data 
+     * @param {File} metadata 
      * @param {*} [options] Override http request option.
      * @throws {RequiredError}
      * @memberof DefaultApi
      */
-    public createFDO(repositories: TargetRepositories, data?: File, metadata?: File, options?: RawAxiosRequestConfig) {
+    public createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig) {
         return DefaultApiFp(this.configuration).createFDO(repositories, data, metadata, options).then((request) => request(this.axios, this.basePath));
     }
 
@@ -1257,6 +1319,176 @@ export class DefaultApi extends BaseAPI {
 
 
 
+/**
+ * ProfilesApi - axios parameter creator
+ * @export
+ */
+export const ProfilesApiAxiosParamCreator = function (configuration?: Configuration) {
+    return {
+        /**
+         * 
+         * @summary Get information on a single profile.
+         * @param {string} profileId Profile ID
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        getProfile: async (profileId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
+            // verify required parameter 'profileId' is not null or undefined
+            assertParamExists('getProfile', 'profileId', profileId)
+            const localVarPath = `/profiles/{profileId}`
+                .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId)));
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+
+            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+
+    
+            setSearchParams(localVarUrlObj, localVarQueryParameter);
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: toPathString(localVarUrlObj),
+                options: localVarRequestOptions,
+            };
+        },
+        /**
+         * 
+         * @summary List known profiles.
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        listProfiles: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
+            const localVarPath = `/profiles`;
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+
+            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+
+    
+            setSearchParams(localVarUrlObj, localVarQueryParameter);
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: toPathString(localVarUrlObj),
+                options: localVarRequestOptions,
+            };
+        },
+    }
+};
+
+/**
+ * ProfilesApi - functional programming interface
+ * @export
+ */
+export const ProfilesApiFp = function(configuration?: Configuration) {
+    const localVarAxiosParamCreator = ProfilesApiAxiosParamCreator(configuration)
+    return {
+        /**
+         * 
+         * @summary Get information on a single profile.
+         * @param {string} profileId Profile ID
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async getProfile(profileId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProfile200Response>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.getProfile(profileId, options);
+            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
+            const localVarOperationServerBasePath = operationServerMap['ProfilesApi.getProfile']?.[localVarOperationServerIndex]?.url;
+            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
+        },
+        /**
+         * 
+         * @summary List known profiles.
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async listProfiles(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProfiles200Response>> {
+            const localVarAxiosArgs = await localVarAxiosParamCreator.listProfiles(options);
+            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
+            const localVarOperationServerBasePath = operationServerMap['ProfilesApi.listProfiles']?.[localVarOperationServerIndex]?.url;
+            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
+        },
+    }
+};
+
+/**
+ * ProfilesApi - factory interface
+ * @export
+ */
+export const ProfilesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
+    const localVarFp = ProfilesApiFp(configuration)
+    return {
+        /**
+         * 
+         * @summary Get information on a single profile.
+         * @param {string} profileId Profile ID
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        getProfile(profileId: string, options?: any): AxiosPromise<GetProfile200Response> {
+            return localVarFp.getProfile(profileId, options).then((request) => request(axios, basePath));
+        },
+        /**
+         * 
+         * @summary List known profiles.
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        listProfiles(options?: any): AxiosPromise<ListProfiles200Response> {
+            return localVarFp.listProfiles(options).then((request) => request(axios, basePath));
+        },
+    };
+};
+
+/**
+ * ProfilesApi - object-oriented interface
+ * @export
+ * @class ProfilesApi
+ * @extends {BaseAPI}
+ */
+export class ProfilesApi extends BaseAPI {
+    /**
+     * 
+     * @summary Get information on a single profile.
+     * @param {string} profileId Profile ID
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof ProfilesApi
+     */
+    public getProfile(profileId: string, options?: RawAxiosRequestConfig) {
+        return ProfilesApiFp(this.configuration).getProfile(profileId, options).then((request) => request(this.axios, this.basePath));
+    }
+
+    /**
+     * 
+     * @summary List known profiles.
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof ProfilesApi
+     */
+    public listProfiles(options?: RawAxiosRequestConfig) {
+        return ProfilesApiFp(this.configuration).listProfiles(options).then((request) => request(this.axios, this.basePath));
+    }
+}
+
+
+
 /**
  * RepositoriesApi - axios parameter creator
  * @export
diff --git a/src/api/base.ts b/src/api/base.ts
index 89b54ab..78b555a 100644
--- a/src/api/base.ts
+++ b/src/api/base.ts
@@ -1,3 +1,4 @@
+/* tslint:disable */
 /* eslint-disable */
 /**
  * FDO Manager Service API
diff --git a/src/api/common.ts b/src/api/common.ts
index 9b2273c..e97d5bf 100644
--- a/src/api/common.ts
+++ b/src/api/common.ts
@@ -1,3 +1,4 @@
+/* tslint:disable */
 /* eslint-disable */
 /**
  * FDO Manager Service API
diff --git a/src/api/configuration.ts b/src/api/configuration.ts
index e8efb77..cc56d02 100644
--- a/src/api/configuration.ts
+++ b/src/api/configuration.ts
@@ -1,3 +1,4 @@
+/* tslint:disable */
 /* eslint-disable */
 /**
  * FDO Manager Service API
diff --git a/src/api/index.ts b/src/api/index.ts
index 10f5653..4e2f60d 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -1,3 +1,4 @@
+/* tslint:disable */
 /* eslint-disable */
 /**
  * FDO Manager Service API
diff --git a/src/components/fdos/create.tsx b/src/components/fdos/create.tsx
index f49c900..17be4c9 100644
--- a/src/components/fdos/create.tsx
+++ b/src/components/fdos/create.tsx
@@ -3,6 +3,8 @@ import { useGetIdentity } from "@refinedev/core";
 import { Create, SaveButton } from '@refinedev/mui'
 import { useTheme, styled } from '@mui/material/styles'
 
+import Skeleton from '@mui/material/Skeleton';
+import Stack from '@mui/material/Stack';
 import Box from '@mui/material/Box'
 import TextField from '@mui/material/TextField'
 import InputLabel from '@mui/material/InputLabel'
@@ -24,19 +26,46 @@ import { useStepsForm } from '@refinedev/react-hook-form'
 
 import { Controller } from 'react-hook-form'
 
-import IRepository from '../../interfaces/IRepository'
+import { IRepository, IProfile } from '../../interfaces'
 import { RepositoriesList } from '../repositories'
 
-const stepTitles = ['Repository', 'Metadata', 'Data']
+const stepTitles = ['Profile & Repository', 'Metadata', 'Data']
 
 const StepRepository: React.FC<any> = ({ control, register, errors }) => {
-  const { data, isLoading, isError } = useList<IRepository, HttpError>({
+  const repositoryList = useList<IRepository, HttpError>({
     resource: 'repositories'
   })
-  if (isLoading) {
+  const profileList = useList<IProfile, HttpError>({
+    resource: 'profiles'
+  })
+  if (profileList.isLoading && repositoryList.isLoading) {
     return <CircularProgress/>
   }
+
   return (
+    <>
+    <FormControl fullWidth>
+      <InputLabel id="profile-select-label">Profile</InputLabel>
+        <Controller control={control}
+          rules={{ required: 'This field is required' }}
+          name="profile"
+          render={({ field }) => {
+            return (
+              profileList.isLoading ?
+              <Skeleton><Select></Select></Skeleton> :
+              <Select
+                {...field}
+                error={!!errors.profile}
+                labelId="profile-select-label"
+                id="profile-select"
+                label="Profile"
+              >
+                { profileList.data?.data?.map((item, idx) => <MenuItem key={idx} value={item.id}>{item.id}</MenuItem>)}
+              </Select>
+            )
+          }}/>
+      <FormHelperText>{errors.profile?.message}</FormHelperText>
+    </FormControl>
     <FormControl fullWidth>
       <InputLabel id="repository-select-label">Repository</InputLabel>
         <Controller control={control}
@@ -44,6 +73,8 @@ const StepRepository: React.FC<any> = ({ control, register, errors }) => {
           name="repository"
           render={({ field }) => {
             return (
+              repositoryList.isLoading ?
+              <Skeleton><Select></Select></Skeleton> :
               <Select
                 {...field}
                 error={!!errors.repository}
@@ -51,13 +82,13 @@ const StepRepository: React.FC<any> = ({ control, register, errors }) => {
                 id="repository-select"
                 label="Repository"
               >
-                { data?.data?.map((item, idx) => <MenuItem key={idx} value={item.id}>{item.id}</MenuItem>)}
+                { repositoryList.data?.data?.map((item, idx) => <MenuItem key={idx} value={item.id}>{item.id}</MenuItem>)}
               </Select>
-
             )
           }}/>
       <FormHelperText>{errors.repository?.message}</FormHelperText>
     </FormControl>
+    </>
   )
 }
 
@@ -111,10 +142,10 @@ const StepData: React.FC<any> = ({ register, errors }) => {
 
 export const FdoCreate: React.FC<IResourceComponentsProps> = () => {
   const identity = useGetIdentity()
-  const access_token = identity.data?.account?.access_token;
+  const access_token = identity.data?.data?.account?.access_token
 
   console.log('access_token: ', access_token)
-  const formRet = useStepsForm<IRepository, HttpError, any>({ defaultValues: { repository: '' }, refineCoreProps: { meta: { headers: { "Authentication" : `Bearer: ${access_token}` }}}});
+  const formRet = useStepsForm<IRepository, HttpError, any>({ defaultValues: { repository: '', profile: '' }, refineCoreProps: { meta: { headers: { "Authentication" : `Bearer ${access_token}` }}}})
   console.log('formRet', formRet)
   const {
     saveButtonProps,
@@ -196,6 +227,7 @@ export const FdoCreate: React.FC<IResourceComponentsProps> = () => {
         sx={{ display: 'flex', flexDirection: 'column' }}
         autoComplete="off"
       >
+        <Stack spacing={4}>
         <Stepper
           nonLinear
           activeStep={currentStep}
@@ -207,8 +239,8 @@ export const FdoCreate: React.FC<IResourceComponentsProps> = () => {
             </Step>
           ))}
         </Stepper>
-        <br />
         {renderFormByStep(currentStep)}
+        </Stack>
       </Box>
     </Create>
   )
diff --git a/src/components/profiles/IProfile.tsx b/src/components/profiles/IProfile.tsx
new file mode 100644
index 0000000..8a72bc7
--- /dev/null
+++ b/src/components/profiles/IProfile.tsx
@@ -0,0 +1,5 @@
+interface IProfile = {
+  id: string
+}
+
+export default IProfile
diff --git a/src/components/profiles/index.ts b/src/components/profiles/index.ts
new file mode 100644
index 0000000..36a9284
--- /dev/null
+++ b/src/components/profiles/index.ts
@@ -0,0 +1,2 @@
+export * from "./list";
+export * from "./show";
diff --git a/src/components/profiles/list.tsx b/src/components/profiles/list.tsx
new file mode 100644
index 0000000..0b121cf
--- /dev/null
+++ b/src/components/profiles/list.tsx
@@ -0,0 +1,34 @@
+import { IResourceComponentsProps } from '@refinedev/core'
+import Link from '@mui/material/Link';
+
+import { List, useDataGrid } from '@refinedev/mui'
+
+import {
+  DataGrid,
+  GridColDef,
+  GridValueFormatterParams
+} from '@mui/x-data-grid'
+
+import IProfile from '../../interfaces/IProfile'
+
+const columns: Array<GridColDef<IProfile>> = [
+  {
+    field: 'id',
+    headerName: 'ID',
+    type: 'string',
+    width: 200,
+    renderCell: (params) => {
+      return <Link href={'./profiles/' + params.value}>{params.value}</Link>
+    }
+  }
+]
+
+export const ProfilesList: React.FC<IResourceComponentsProps> = () => {
+  const { dataGridProps } = useDataGrid<IProfile>()
+
+  return (
+    <List>
+      <DataGrid {...dataGridProps} columns={columns} autoHeight />
+    </List>
+  )
+}
diff --git a/src/components/profiles/show.tsx b/src/components/profiles/show.tsx
new file mode 100644
index 0000000..bc81ae0
--- /dev/null
+++ b/src/components/profiles/show.tsx
@@ -0,0 +1,6 @@
+import { IResourceComponentsProps } from "@refinedev/core";
+import { MuiInferencer } from "@refinedev/inferencer/mui";
+
+export const ProfilesShow: React.FC<IResourceComponentsProps> = () => {
+    return <MuiInferencer />;
+};
diff --git a/src/components/repositories/list.tsx b/src/components/repositories/list.tsx
index 035c92a..dece502 100644
--- a/src/components/repositories/list.tsx
+++ b/src/components/repositories/list.tsx
@@ -1,5 +1,5 @@
 import { IResourceComponentsProps } from '@refinedev/core'
-import { MuiInferencer } from '@refinedev/inferencer/mui'
+import Link from '@mui/material/Link';
 
 import { List, useDataGrid } from '@refinedev/mui'
 
@@ -18,7 +18,7 @@ const columns: Array<GridColDef<IRepository>> = [
     type: 'string',
     width: 200,
     renderCell: (params) => {
-      return <a href={'./repositories/' + params.value}>{params.value}</a>
+      return <Link href={'./repositories/' + params.value}>{params.value}</Link>
     }
   }
 ]
diff --git a/src/interfaces/IRepository.tsx b/src/interfaces/IRepository.tsx
index f6f89b5..8de99e8 100644
--- a/src/interfaces/IRepository.tsx
+++ b/src/interfaces/IRepository.tsx
@@ -1,4 +1,4 @@
-type IRepository = {
+interface IRepository = {
   id: string
 }
 
diff --git a/src/interfaces/index.d.ts b/src/interfaces/index.d.ts
index a82b999..13cd313 100644
--- a/src/interfaces/index.d.ts
+++ b/src/interfaces/index.d.ts
@@ -1 +1,2 @@
 export * from './IRepository'
+export * form './IProfile
diff --git a/src/providers/dataProvider.tsx b/src/providers/dataProvider.tsx
index eaaa02f..4c1eba3 100644
--- a/src/providers/dataProvider.tsx
+++ b/src/providers/dataProvider.tsx
@@ -1,6 +1,6 @@
 import { DataProvider, useOne } from '@refinedev/core'
 import dataProvider from '@refinedev/simple-rest'
-import { Configuration, RepositoriesApi, DefaultApi, GetInfo200Response, ListRepositories200Response } from '../api'
+import { Configuration, ProfilesApi, RepositoriesApi, DefaultApi, GetInfo200Response, ListRepositories200Response } from '../api'
 import axios from 'axios'
 
 const getNewlyCreated = async (newLocation: string) => {
@@ -11,10 +11,15 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
   const config: Configuration = new Configuration({ basePath: apiUrl })
   const apiResources: any = {
     default: new DefaultApi(config),
+    profiles: new ProfilesApi(config),
     repositories: new RepositoriesApi(config)
   }
 
   const apiOperations: any = {
+    profiles: {
+      list: apiResources.profiles.listProfiles,
+      get: apiResources.profiles.getProfile
+    },
     repositories: {
       list: apiResources.repositories.listRepositories,
       get: apiResources.repositories.getRepository
@@ -48,18 +53,14 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
 
   return {
     getOne: async ({ resource, id, meta }) => {
-      console.log('getOne', resource, id, meta)
       const data = await callOperation(resource, 'get', { id, meta })
       return { data: data.data }
     },
     create: async ({ resource, variables, meta }) => {
-      console.log('create', resource, variables, meta)
       const response = await callOperation(resource, 'create', { variables, meta })
       if (response.status === 201) {
         const newLocation = response.headers.location
-        console.log('newLocation', newLocation)
         const newData = await getNewlyCreated(newLocation)
-        console.log('newData', newData)
         return { data: newData.data.data }
       } else {
         throw new Error('Create with anything else than 201 not implemented.')
@@ -72,7 +73,6 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
       throw new Error('Not implemented')
     },
     getList: async ({ resource, pagination, sorters, filters, meta }) => {
-      console.log('getList', resource, meta)
       const data = (await callOperation(resource, 'list', { pagination, sorters, filters, meta })).data
       return { data, total: data.length }
     },
-- 
GitLab