@@ -63,6 +63,22 @@ export const EditResource = ({ reload, data }: any) => {
6363 }
6464 ` ) ;
6565
66+ const resetSchema : any = graphql ( `
67+ mutation resetFileResourceSchema($resourceId: UUID!) {
68+ resetFileResourceSchema(resourceId: $resourceId) {
69+ ... on TypeResource {
70+ id
71+ schema {
72+ format
73+ description
74+ id
75+ fieldName
76+ }
77+ }
78+ }
79+ }
80+ ` ) ;
81+
6682 const [ resourceId , setResourceId ] = useQueryState < any > ( 'id' , parseAsString ) ;
6783
6884 const { mutate, isLoading } = useMutation (
@@ -163,12 +179,12 @@ export const EditResource = ({ reload, data }: any) => {
163179
164180 const ResourceList : TListItem [ ] =
165181 data . map ( ( item : any ) => ( {
166- label : item . name ,
167- value : item . id ,
168- description : item . description ,
169- dataset : item . dataset ?. pk ,
170- fileDetails : item . fileDetails ,
171- } ) ) || [ ] ;
182+ label : item . name ,
183+ value : item . id ,
184+ description : item . description ,
185+ dataset : item . dataset ?. pk ,
186+ fileDetails : item . fileDetails ,
187+ } ) ) || [ ] ;
172188
173189 const getResourceObject = ( resourceId : string ) => {
174190 return ResourceList . find ( ( item ) => item . value === resourceId ) ;
@@ -425,18 +441,33 @@ export const EditResource = ({ reload, data }: any) => {
425441 <div className="flex w-1/6 justify-center ">
426442 <Text>See Preview</Text>
427443 </div>
428- </div>
429- <div className="flex justify-between">
444+ </div>*/ }
445+ < div className = "flex justify-between mt-8 " >
430446 < Text > Fields in the Resource</ Text >
431- <div className="flex">
432- <Link className="mx-4 flex items-center gap-1" href="/">
433- <Text>Refetch Fields</Text>{' '}
434- <Icon source={Icons.info} color="interactive" />
435- </Link>
436- <Link className="flex items-center gap-1" href="/">
437- <Text> Reset Fields </Text>{' '}
438- <Icon source={Icons.info} color="interactive" />
439- </Link>
447+ < div className = "flex gap-4" >
448+ < Button
449+ size = "medium"
450+ kind = "tertiary"
451+ variant = "basic"
452+ onClick = { function Ga ( ) { } }
453+ >
454+ < div className = "flex items-center gap-1" >
455+ < Text > Refetch Fields</ Text > { ' ' }
456+ < Icon source = { Icons . info } color = "interactive" />
457+ </ div >
458+ </ Button >
459+
460+ < Button
461+ size = "medium"
462+ kind = "tertiary"
463+ variant = "basic"
464+ onClick = { function Ga ( ) { } }
465+ >
466+ < div className = "flex items-center gap-1" >
467+ < Text > Reset Fields</ Text > { ' ' }
468+ < Icon source = { Icons . info } color = "interactive" />
469+ </ div >
470+ </ Button >
440471 </ div >
441472 </ div >
442473 < Text variant = "headingXs" as = "span" fontWeight = "regular" >
@@ -450,7 +481,7 @@ export const EditResource = ({ reload, data }: any) => {
450481 hideFooter = { true }
451482 defaultRowCount = { 10 }
452483 />
453- </div> */ }
484+ </ div >
454485 </ div >
455486 ) ;
456487} ;
0 commit comments