react-scheduler / react-big-schedule

React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React.
https://react-big-schedule.vercel.app/
MIT License
101 stars 23 forks source link

remove title={} from resource #114

Closed jovana closed 10 months ago

jovana commented 1 year ago

Checklist

Describe the bug

Using JSX on the resource setter:

{
                        id: element.product_id,
                        parentId: 0,
                        title: element.product_name,
                        name: <Flex justify="space-between" gap={5}>
                                <div className="product-label">{element.product_name}</div>
                            </Flex>,
                    }

The title on the resource buttons gives: [object Object]. Not sure why this title's has been set. You can find it here: https://github.com/react-scheduler/react-big-schedule/blob/f0d7eb3128591f97a15f55fcd4acfbbdf5c9d8c1/src/components/AgendaResourceEvents.jsx#L39

and here:

https://github.com/react-scheduler/react-big-schedule/blob/f0d7eb3128591f97a15f55fcd4acfbbdf5c9d8c1/src/components/ResourceView.jsx#L44

Possible to rename to title={resourceEvents.slotTitle} instead of using title={resourceEvents.slotName}.

Also, make more send to have this aligned using the title from the resource setter instead of the name.

Reproduction Link/Code

Scherm­afbeelding 2023-11-09 om 09 52 03 Scherm­afbeelding 2023-11-09 om 09 52 07

Steps to reproduce

Using "react-big-schedule": "^4.3.2",

Operating System

MacOSX

Browser

Chromium

React version

18.2

react-big-schedule version

"react-big-schedule": "^4.3.2",

Additional Information

No response

ansulagrawal commented 1 year ago

@jovana thank you for pointing out the issue I will do it in next week as I am busy now. If you can do it, it will be very wonderful.

ansulagrawal commented 1 year ago

@jovana please use 4.3.3-beta.1 version and check.

you need to pass title in resources

https://github.com/react-scheduler/react-big-schedule/blob/f7d93ce890f80b9d94fc4adcd4ebe3b886a99ff3/src/sample-data/sample1.js#L3

jovana commented 10 months ago

I have installed the latest version now. The reported issue has been resolved! Many thanks!! I will close this bug report now.

ansulagrawal commented 10 months ago

Thank you @jovana