Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Custom FullCalendar Configuration for Widgets #130

Merged
merged 18 commits into from
Mar 26, 2024

Conversation

sitenzo
Copy link
Contributor

@sitenzo sitenzo commented Nov 22, 2023

In this pull request, we're introducing a feature that allows you to customize the FullCalendar configuration on a per-widget basis.

What's New?

You can now set a default configuration at the plugin level. However, if you need to make specific changes for a particular widget, you have the flexibility to do so.

How to Customize Widget Configuration?

In your widget, implement the getConfig method.

public function getConfig(): array {
    return [
        // Your custom FullCalendar configuration settings go here
    ];
}

Set up the custom configuration for the widget within the getConfig method.

Merging Configurations

Behind the scenes, both the default plugin configuration and the widget-specific configuration files are merged into one final configuration for the widget. This ensures that you have full control over how FullCalendar behaves for each widget.

We believe this enhancement will provide greater flexibility and customization options for your FullCalendar widgets.

@saade
Copy link
Owner

saade commented Nov 28, 2023

Hey! Thanks for your contribution, i'll review it soon :)

@saade saade added the enhancement New feature or request label Nov 28, 2023
@saade saade self-requested a review November 28, 2023 12:40
@StaffCollab
Copy link

Hello.
This is a very needed feature!
I want to customize the hidden days and times per user to only show the available times to book sessions on a per-caregiver availability basis.

This would be wonderful.

    protected function getFooterWidgets(): array
    {
        return [
            CalendarWidget::make()
                ->config([
                    'hiddenDays' => $this->record->notAvailableDays,
                ]),
        ];
    }

@lukas-frey
Copy link

Any news on this PR? :)

@GeoSot
Copy link

GeoSot commented Mar 1, 2024

@saade can we help, in order to merge this?

Copy link
Owner

@saade saade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Sorry for the low support on this plugin. I have big improvements for it on my TODO but i'm busy in another project atm.

If someone could apply and test those changes and test i'll be happy to merge. Thanks!

resources/views/fullcalendar.blade.php Outdated Show resolved Hide resolved
src/Widgets/Concerns/InteractsWithConfig.php Outdated Show resolved Hide resolved
src/Widgets/Concerns/InteractsWithConfig.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/Widgets/Concerns/InteractsWithConfig.php Outdated Show resolved Hide resolved
src/Widgets/Concerns/InteractsWithConfig.php Outdated Show resolved Hide resolved
src/Widgets/Concerns/InteractsWithConfig.php Outdated Show resolved Hide resolved
src/Widgets/FullCalendarWidget.php Outdated Show resolved Hide resolved
src/Widgets/FullCalendarWidget.php Outdated Show resolved Hide resolved
@GeoSot
Copy link

GeoSot commented Mar 1, 2024

I am not sure if any other than @sitenzo can edit this PR

@saade
Copy link
Owner

saade commented Mar 1, 2024

I'll have a look later today 👍🏼

@sitenzo
Copy link
Contributor Author

sitenzo commented Mar 2, 2024

I have committed all the changes you have reviewed.

@GeoSot
Copy link

GeoSot commented Mar 2, 2024

array_merge_recursive, maybe is not the perfect solution here
Possible help: https://copyprogramming.com/howto/php-merge-arrays-with-only-not-duplicated-values

Edit: @saade, supposing you bing back mergeArraysRecursive, from the initial commit, it will be fine to go

@Sjoerd24
Copy link
Contributor

Any news on this pull request? This option would be extremely useful for me :) I think with the suggestion of @GeoSot to bring back mergeArraysRecursive the PR should be fine right? Looks good to my eye at least 👍

@saade
Copy link
Owner

saade commented Mar 26, 2024

Thanks!

@saade saade merged commit ba7daec into saade:3.x Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants