firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.14k stars 185 forks source link

2.0.1 breaks CustomEntityViews (shows blank) #534

Closed suecom closed 1 year ago

suecom commented 1 year ago

Breaks CustomEntityViews - they are blank! Reverting 2.0.0, the contents are returned :-)

suecom commented 1 year ago

The problem was introduced in 2.0.1, and is still present in 2.0.5

fgatti675 commented 1 year ago

Thank you @suecom, We didn't get any reports of this. I suspect it may be related to your setup. Could you tell me the output of the console?

suecom commented 1 year ago

Try attachment again!

Allister ΠΟωaττ - finding value in IoT data +44 7729 175634 http://www.nowatt.com http://www.nowatt.com/

On 9 Aug 2023, at 11:13, Francesco Gatti @.***> wrote:

Thank you @suecom https://github.com/suecom, We didn't get any reports of this. I suspect it may be related to your setup. Could you tell me the output of the console?

— Reply to this email directly, view it on GitHub https://github.com/firecmsco/firecms/issues/534#issuecomment-1670961959, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJ32JOVEJ6YTMWWFQ3LV3XUNIEXANCNFSM6AAAAAA3IYCUKA. You are receiving this because you were mentioned.

fgatti675 commented 1 year ago

Sorry man, it is not displayin anything

suecom commented 1 year ago

So with 2.0.4 you see the alt3 view?

Allister ΠΟωaττ - finding value in IoT data +44 7729 175634 http://www.nowatt.com http://www.nowatt.com/

On 9 Aug 2023, at 11:33, Francesco Gatti @.***> wrote:

Sorry man, it is not displayin anything

— Reply to this email directly, view it on GitHub https://github.com/firecmsco/firecms/issues/534#issuecomment-1670991276, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJ32OAJQXV6AEZ52FWOE3XUNKO3ANCNFSM6AAAAAA3IYCUKA. You are receiving this because you were mentioned.

suecom commented 1 year ago

With 2.0.0:

With 2.0.1:

Allister ΠΟωaττ - finding value in IoT data +44 7729 175634 http://www.nowatt.com http://www.nowatt.com/

On 9 Aug 2023, at 11:33, Francesco Gatti @.***> wrote:

Sorry man, it is not displayin anything

— Reply to this email directly, view it on GitHub https://github.com/firecmsco/firecms/issues/534#issuecomment-1670991276, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJ32OAJQXV6AEZ52FWOE3XUNKO3ANCNFSM6AAAAAA3IYCUKA. You are receiving this because you were mentioned.

suecom commented 1 year ago

Should also mention using Node 18.13.0

Allister ΠΟωaττ - finding value in IoT data +44 7729 175634 http://www.nowatt.com http://www.nowatt.com/

On 9 Aug 2023, at 11:33, Francesco Gatti @.***> wrote:

Sorry man, it is not displayin anything

— Reply to this email directly, view it on GitHub https://github.com/firecmsco/firecms/issues/534#issuecomment-1670991276, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJ32OAJQXV6AEZ52FWOE3XUNKO3ANCNFSM6AAAAAA3IYCUKA. You are receiving this because you were mentioned.

fgatti675 commented 1 year ago

I meant your attachments are not being displayed correctly on Gihub, can you upload them from within the website (not via email)?

suecom commented 1 year ago

With 2.0.1

PastedGraphic-2 PastedGraphic-4

Going back to 2.0.0:

PastedGraphic-3 PastedGraphic-1
suecom commented 1 year ago

I closed the issue by mistake! Did you get the project (v4) to demonstrate this?

function SamplePlanView2({ collection, entity, modifiedValues }: EntityCustomViewParams) { return (

'This is: {entity?.values.name}'
);

}

export const planCollection = buildCollection({ name: "Plans", singularName: "Plan", description: "Drinking plans", path: "consumed", icon: "NoDrinks", group: "Drink", views: [ { name: "Alt3", path: '.', Builder: SamplePlanView2 } ], …

Allister ΠΟωaττ - finding value in IoT data +44 7729 175634 http://www.nowatt.com http://www.nowatt.com/

On 9 Aug 2023, at 11:55, Francesco Gatti @.***> wrote:

I meant your attachments are not being displayed correctly on Gihub, can you upload them from within the website (not via email)?

— Reply to this email directly, view it on GitHub https://github.com/firecmsco/firecms/issues/534#issuecomment-1671023003, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZJ32KU77OJRF27VQ5FZWLXUNNCRANCNFSM6AAAAAA3IYCUKA. You are receiving this because you were mentioned.

fgatti675 commented 1 year ago

Please, the console output of the browser

suecom commented 1 year ago
image
fgatti675 commented 1 year ago

Man I can't reproduce this, your sample code was very broken. After fixing it, it seems to be fine:

    return (
        <Box>
            <Container
                maxWidth={"sm"}
                sx={{
                    mt: 4,
                    justifyItems: "center",
                    display: "flex",
                    flexDirection: "column"
                }}>

                <Typography
                    variant={"h3"}
                    sx={{
                        marginTop: "40px",
                        marginBottom: "20px"
                    }}>

                    {`This is: ${entity?.values.name}`}
                </Typography>
            </Container>
        </Box>
    )
        ;
fgatti675 commented 1 year ago

Also, you should probably not use "." as a path, it may interfere with routing

suecom commented 1 year ago

Thanks for looking at this - I assume I'm not the only one using CustomEntityViews, so must be me :-(

What is certain, is the page content (thanks for the correction), nor the path is behind the change in behaviour between 2.0.0 and 2.0.1. BTW, what should the path be is a custom entity view? If I put '/consumed' (what I expect), the address bar is: http://localhost:5173/c/consumed/0qv7roJXEcBHpPNRFRkf//consumed. That's why I used '.' - to at least keep the path showing correctly.

The project is at: https://github.com/suecom/v4

Very basic, and package.json is set to use the latest firecms package, so you'll see the problem immediatly.