Skip to content

Add backend calendar controller - #1313

Merged
LukeTowers merged 8 commits into
wintercms:wip/calendar-widgetfrom
damsfx:wip/calendar-widget
Mar 12, 2025
Merged

Add backend calendar controller#1313
LukeTowers merged 8 commits into
wintercms:wip/calendar-widgetfrom
damsfx:wip/calendar-widget

Conversation

@damsfx

@damsfx damsfx commented Feb 20, 2025

Copy link
Copy Markdown
Contributor

Original PR #970

FullCalendar docs

  • update to fullcalendar v6.1.15
  • add all available locales
  • make use of package.json

Notes :

  • firstDay can be set by fullcalendar according to his configured locale see docs but it doesn't seems to work in our case

CalendarController

  • Config :
    • add widget theme color for buttons (default, primary or secondary)
    • add widget initial view
    • add widget first day of week
    • add model attribute for all day event

damsfx and others added 4 commits February 20, 2025 00:26
-add widget initial view config
-add widget first day of week config
-add model attribute config for all day event
@LukeTowers LukeTowers added the enhancement PRs that implement a new feature or substantial change label Feb 20, 2025
Comment thread modules/backend/widgets/Calendar.php Outdated
$this->recordEnd,
];

// $this->validateModel();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this commented out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried to add it based on the ListController but I get an error.
Need to take a closer look.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@LukeTowers If I try to validate the model (as in Lists widget), then this error in throw :
Typed property Backend\Widgets\Calendar::$model must not be accessed before initialization.

Same if I try to add model to the fillFromConfig()method in plugin initialization.

Comment thread modules/backend/widgets/calendar/assets/less/calendar.less Outdated
Comment thread modules/backend/widgets/calendar/assets/less/calendar.less Outdated
Comment thread modules/backend/widgets/calendar/assets/less/calendar.less Outdated
@LukeTowers

Copy link
Copy Markdown
Member

@damsfx can you take a stab at pulling and compiling the assets with vite so that they're pulled in with package.json rather than including the vendor assets in the code directly? We're trying to move away from including the raw vendor assets as the source of truth (although we'd still be committing the compiled results and including those), it's mostly just to make it easier to update the dependencies in the future. Let me know if you need any help with that.

- remove unused files
- remove comments
@damsfx

damsfx commented Feb 21, 2025

Copy link
Copy Markdown
Contributor Author

I wouldn't mind a little help on this one.
I don't have much experience with Vite, I'm just starting to integrate it into my own plugins/themes.

- add calendar less file to ServiceProvider
- use fullcalendar css variables for theming
- add option to chosse calendar theme for buttons style base on Winter's ones
@LukeTowers

Copy link
Copy Markdown
Member

Going to merge this into #970 as @jaxwilko will have some time to work on this ❤️

@LukeTowers
LukeTowers marked this pull request as ready for review March 12, 2025 20:11
@LukeTowers
LukeTowers merged commit 7d40db0 into wintercms:wip/calendar-widget Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants