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

WIP Add ability to specify targets when using drag and drop #1901

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lenehan2
Copy link

@lenehan2 lenehan2 commented Apr 1, 2021

No description provided.

ktomk added a commit to seatable/seatable-plugin-calendar that referenced this pull request May 19, 2021
previously dropping on the time-gutter leaves calendar in drag state.

fix is to add the ability of specific drop targets and cancel/reset drag-
and-drop if the drop was not on an allowed drop target.

streamlined with [1].

[1]: jquense/react-big-calendar#1901
ktomk added a commit to seatable/seatable-plugin-calendar that referenced this pull request May 19, 2021
previously dropping on the time-gutter leaves calendar in drag state.

fix is to add the ability of specific drop targets and cancel/reset drag-
and-drop if the drop was not on an allowed drop target.

streamlined with [1].

[1]: jquense/react-big-calendar#1901
ktomk added a commit to seatable/seatable-plugin-calendar that referenced this pull request May 19, 2021
previously dropping on the time-gutter leaves calendar in drag state.

fix is to add the ability of specific drop targets and cancel/reset drag-
and-drop if the drop was not on an allowed drop target.

streamlined with [1].

[1]: jquense/react-big-calendar#1901
freeplant pushed a commit to seatable/seatable-plugin-calendar that referenced this pull request May 21, 2021
* touch-up month-view weekday-headers

the month view has a scroll-bar, the header needs some right-margin.

the 15px is taken from the week- and day-view which has a scroll-bar and
that right-margin for the header (div.rbc-time-header style attribute).

* dnd: update week-wrapper

updating WeekWrapper.js to the upstream version of Nov, 6th 2020. [1]

fixes crashes on drop into all-day in the week view of the calendar.

this is the upstream version, just with a different semicolon-style and
one typo fix.

[1]: https://github.com/jquense/react-big-calendar/blob/34aec3a64d018ec0f9dce780a6d4eeb03692c9fd/src/addons/dragAndDrop/WeekWrapper.js

* dnd: fix drop on time-gutter

previously dropping on the time-gutter leaves calendar in drag state.

fix is to add the ability of specific drop targets and cancel/reset drag-
and-drop if the drop was not on an allowed drop target.

streamlined with [1].

[1]: jquense/react-big-calendar#1901

* add week, day and agenda view

add three of the rbc views to the calendar:

1. week; 2. day; 3. agenda

- row details by single-click on week and day events
- background color for day/week view (non-full-day events)
- css: reset day-event border
- css: bootstrap needs button style reset (time-header)
- css: center agenda no events text

* show week-of-year

show the week-number in the top-left corner of the timer-gutter.

display format is weekOfYearFormat (localizer), which is decorated as the
default moment localizer does not have it.

* all-/cross- day event

basically, given the end-date is undefined|null|"", the event is all-day.

additionally an event is displayed in the all-day slot if it is across
multiple days.

previously there was no need to handle all- or cross-days to this extend
for any calendar event as only the original week view was in use and
additionally the year view.

now this is needed as the week and day views are active and they display
event with time(s) and within the all-/cross-day slot on top.

this is handling events with a bogus end-date gracefully:

in case an end-date is before the start-date, the start-date is leading
and the end-date of the event will be the events start-date plus a fixed
amount of time (e.g. one hour). this is useful for events with date and
time (with minute precision).

and an offset of 12 hours is necessary to display the event on the
correct day within all views, incl. the year view.

* all-/cross- day: drag-and-drop

with the changes to the event model and the new views, dragging and
dropping events have more features now, like turning an event into an
all-day event.

row updates are done more specifically to the columns that actually need
changes.

the events collection is updated specifically, too. previously it was
not updated and re-created after row changes did propagate.

when there are full-day-dates due to start date without minute precision
(all day events), and the end date is also w/o minute precision, then
it needs to be noon (12:00) not start of day (00:00) as otherwise the
day would not count as end (the year view seems most picky).

it is only necessary to modify the end-date to make it into the all-day
slot if it is on the same day.

* create new events by selecting

creating on the same-day slot a time-range creates a new event.

if the events start date can not be edited (e.g. formula), the selection
is prevented (handleSelecting() implementation).

NOTE: intentionally new events are without a title (cdb, rdb)

* minor fix

redundant variable

* update code:
1. adjust some styles;
2. update translation;
3. fix move event if the end date comes from the formula column;
4. check whether the container in the WeekWrapper is valid.

Co-authored-by: renjie-run <rj.aiyayao@gmail.com>
@lenehan2 lenehan2 changed the title WIP Add ability to specific specific targets when using drag and drop WIP Add ability to specify targets when using drag and drop May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant