BlackBearFTW
BlackBearFTW
Explore posts from servers
RRefine
Created by other-emerald on 7/5/2024 in #ask-any-question
How can I support my antd design table to have drag and drop?
I want my users to be able to reorder the rows in a table by dragging and dropping
5 replies
RRefine
Created by fair-rose on 6/24/2024 in #ask-any-question
Different sider for show and other specific resource pages.
I want my detail pages to show a different sider than the one on the list page. The scenario I am trying to create is having a sider with projects and customers and then when a specific project is clicked, there should be a more detailed sider, with for example todo's, billing, invoices, etc
5 replies
RRefine
Created by ratty-blush on 6/21/2024 in #ask-any-question
Remove query params pageIndex and PageSize on non list pages
Currently it by default keeps the pageSize and pageIndex query parameter in the url when visting the show, edit, delete, create page. I want to only have those in the list page
5 replies
RRefine
Created by wise-white on 6/13/2024 in #ask-any-question
translate inside accessControlProvider
How can I use the translate methods from i18n inside the access control provider to translate error messages?
10 replies
RRefine
Created by ratty-blush on 6/13/2024 in #ask-any-question
CanAccess in react-router-dom
How can I use CanAccess with react-router-dom
7 replies
RRefine
Created by ambitious-aqua on 6/13/2024 in #ask-any-question
Access Control based on current users subscription
I am building an app with a subscription system and I would like to disallow the user from creating, updating and deleting when their subscription status is not "active", the subscription can be found in "api/tenants/current". How can I do that with the react router and the create button and everything, without using cerbios or something.
14 replies
RRefine
Created by adverse-sapphire on 6/13/2024 in #ask-any-question
Filter equal
Hi, how can I simply get all resources in the useTable for the resource GET /offers?BuildingId=${id}?
9 replies
RRefine
Created by correct-apricot on 6/10/2024 in #ask-any-question
Cypress checking if the user is authenticated in end to end test for custom auth
Hi, I would like to create end to end tests using cypress to check if my login is working, but I was wondering how I can check in refine if the user is currently authenticated. No localstorage.
5 replies
RRefine
Created by foreign-sapphire on 6/5/2024 in #ask-any-question
Display media on upload
I have the below code and I would like to display the refreshed data (including the new upload) when the image is uploaded. Can this be done with a refine.dev hook or should I use a set state? const {data} = useList<IMedia>({ resource: "media", }); const url = useApiUrl(); const onUpload = async (options: any) => { const {onSuccess, onError, file} = options; const fmData = new FormData(); fmData.append("uploadedFile", file); try { const res = await axios.post( ${url}/media/upload, fmData, { headers: {"content-type": "multipart/form-data"}, withCredentials: true } ); onSuccess("Ok"); } catch (err) { onError({err}); } }; return ( <List> <Space direction="vertical" size={50} style={{width: "100%"}}> <Upload.Dragger name="file" customRequest={onUpload} listType="picture" > </Upload.Dragger> <Image.PreviewGroup preview={{ // Displays the image name countRender: (current) => data?.data[current - 1].id.split("/").at(-1), }}> <Flex wrap="wrap" gap="small"> {data?.data.map((media, index) => ( <Image key={index} width={300} height={300} style={{objectFit: 'cover'}} src={media.srcUrl} /> ))} </Flex> </Image.PreviewGroup> </Space> </List> );
10 replies
RRefine
Created by conscious-sapphire on 5/29/2024 in #ask-any-question
Hide header of Show component
How can I hide the header of the show component? Using antd design
4 replies
RRefine
Created by eastern-cyan on 5/29/2024 in #ask-any-question
Redirect to show page onClick of list item
How can I redirect to the show page of the specific item that is being clicked in the List UI
24 replies
RRefine
Created by xenial-black on 5/27/2024 in #ask-any-question
Pass JWT token to dataprovider
How can I pass the jwt token to the simple-rest dataprovider when making a request?
5 replies
RRefine
Created by stormy-gold on 5/27/2024 in #ask-any-question
get api url in auth provider
How can I get the dataprovider's api url inside the auth provider
11 replies
RRefine
Created by manual-pink on 5/1/2024 in #ask-any-question
What hook to use for simple array of strings
Hi, I created a resource called "Media" (its ment to be a media library). Now on the list page I want to display a grid of images, these image sources are the response of the request, its just a simple array with image urls (strings). What hook should I use to get all the images?
16 replies
RRefine
Created by exotic-emerald on 4/28/2024 in #ask-any-question
How can I use an actual <List> element instead of a <Table> in ant design list page
I would like to render data inside a list, instead of using a table, I want to do that in the list page, how can I do this?
8 replies
RRefine
Created by extended-salmon on 4/19/2024 in #ask-any-question
How can I add custom items to the sider, including a menu item with a sub menu
I know I can use the Sider render function or the resource definition to add items to the sider, but I would like to add a sub menu to the sider in ant design. The menu item should be called "Team Settings" and the items under this should be single pages, one as General, one for members (this could be a team meber lists), one for Email and one for api keys (another list)
8 replies
RRefine
Created by fair-rose on 4/18/2024 in #ask-any-question
redirect to external website
How can I redirect a user to an external website using the refine hooks in react router dom?
7 replies
RRefine
Created by extended-salmon on 4/18/2024 in #ask-any-question
Get response from onCreate mutate
I want to create a resource item in my backend, so I thought I would use useCreate instead of a regular post request, however I want to now be able to read the response of this request.
const { mutate } = useCreate();


mutate({
resource: "tenants",
values: {
name: form.getFieldValue("name"),
priceId: form.getFieldValue("priceId")
}
})
const { mutate } = useCreate();


mutate({
resource: "tenants",
values: {
name: form.getFieldValue("name"),
priceId: form.getFieldValue("priceId")
}
})
11 replies
RRefine
Created by stormy-gold on 4/10/2024 in #ask-any-question
prefix resource routes with manage
I am using vite and react router and I my frontend has two parts: the public part and the management part. the public part should be reachable with /blog-posts but the management part should be reachable with /manage/blog-posts. So I would like to prefix all refine related routes for resources with /manage/ how can I do this?
20 replies
RRefine
Created by helpful-purple on 4/3/2024 in #ask-any-question
When I swizzle the authpage, it loses all the styling when using the swizzled version in antd
When I swizzle the authpage (so I can customize register) it just loses all the styling and shows a html form without any styling
16 replies