scoutforpets / ember-fullcalendar

An Ember Component for FullCalendar and FullCalendar Scheduler
MIT License
39 stars 45 forks source link

Update FullCalendar to v4.2.0 #77

Closed lan0 closed 3 years ago

lan0 commented 5 years ago

This updates FullCalendar and Scheduler to v4.2.0.

The list of options and events is updated and should be current.

ember-auto-import is included to import FullCalendar ES6 packages.

A config option is added to import CSS files of the FullCalendar plugins.

To update options on the calendar object, Calendar::mutateOptions() is used like in the React component (Thanks @jir-f).

The test it supports changes in resources array is currently getting skipped, I think that the resource plugin doesn't work correctly in the test...

MichalBryxi commented 4 years ago

Trying to port my older code to this branch and I bumped into a problem that according to the upgrade guide the agendaWeek and agendaDay moved to timeGrid plugin. While this plugin imports @fullcalendar/daygrid, it does not import @fullcalendar/timegrid.

I don't know whether it is the intention of this addon to provide all the plugins(?) I fixed the problem in my code by adding:

// package.json
...
  "devDependencies": {
    "@fullcalendar/timegrid": "~4.3.0",
  }
...
// controller.js
import timeGridPlugin from "@fullcalendar/timegrid";

export default Controller.extend({
  init() {
    this._super(...arguments);
    this.plugins = [timeGridPlugin];
  }
});
{{full-calendar plugins=plugins}}

In case anyone else bumps into this.

lan0 commented 4 years ago

@MichalBryxi you're right, you have to add the plugins you want to use as dependencies yourself.

Did timegrid work for you without importing any css? I implemented a plugins option for this.

MichalBryxi commented 4 years ago

In the meantime I bumped my app to ember@3.15 and went with native classes & angle bracket components. I am not sure if that is related at all, but after the upgrade I also had to add a @fullcalendar/moment plugin as described in the docs.

@lan0 I can see that you have the hints how to work with the plugins in the readme and maybe it's just me migrating from <v4 and expecting things to just work.

The calendar looks funny without the imported CSS:

Screenshot 2020-01-22 at 08 17 14

When I tried to blindly copy-paste the example config and including my option:

    emberFullCalendar: {
      plugins: ["core", "daygrid", "list", "timegrid"]
    }

I get:

❯ ember server
Cannot find module '@fullcalendar/list/package.json' from 'ui/node_modules/ember-fullcalendar'

Descriptive error message would be nice.

When I fixed all those errors:

Screenshot 2020-01-22 at 08 22 47

Looks good to me. Great work!

kushthedude commented 4 years ago

@lan0 Any updates here ?

adet4ever commented 4 years ago

Perhaps the changes can be applied to the main branch?

@lan0 Good work you have there. Some of the views have also been renamed. Perhaps we can update.

month renamed to dayGridMonth basicWeek renamed to dayGridWeek basicDay renamed to dayGridDay agendaWeek renamed to timeGridWeek agendaDay renamed to timeGridDay

MichalBryxi commented 3 years ago

🦗 @lan0 ?

lan0 commented 3 years ago

The view names are passed in from the app code, no changes needed in the addon.

MichalBryxi commented 3 years ago

Sorry. I should have been more specific: Anything blocks merging this? Since @lasantha57 approved, CI is green can someone just hit the "merge" button? @lan0 ?

lan0 commented 3 years ago

I don't have write access to this repo so I can't merge, sorry :(

aatauil commented 3 years ago

No advancements on the the PR actually being merged? Would love to use the upgraded version...

jamesdixon commented 3 years ago

Hi everyone, sorry for not merging this sooner. Would anyone be willing to update it to 4.4.1 so we're on the latest 4.x version of FC?

jamesdixon commented 3 years ago

@lan0 I've given you write access to the repo. Can you please tag it as a 2.x release? Let me know your NPM info and I can give you publishing access there as well.

lan0 commented 3 years ago

Thank you @jamesdixon.

I've bumped the FC version, merged the PR, tagged a new 2.0.0 release and created an account on npm with the same username.

jamesdixon commented 3 years ago

@lan0 thanks! Invite to NPM sent.

Appreciate your help with this