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

Extended schedules #739

Merged
merged 28 commits into from
Jun 25, 2018
Merged

Extended schedules #739

merged 28 commits into from
Jun 25, 2018

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Jun 20, 2018

Part 5

  • Parse ical rrule bydate as weekdays
  • Use rrule weekdays, interval and freq for modifying and creating Schedules
  • Update the ScheduleDialog to support more ical recurrence options

UPDATE

Part 6

  • Parse ical rrule bymonthday as monthdays
  • Update ScheduleDialog to support more options for custom weekly recurrence
  • Don't allow to save a Schedule with end date before or same as start date

UPDATE2

Part 7

  • Update renderRecurrence to reflect weekdays and monthdays of rrules
  • Update schedule list and details page to use term Recurrence instead of Period

The extended schedules feature should be complete now.

The new ToggleButton has two states: checked and unchecked. When checked
it is displayed in light green, when unchecked in light gray.
Also remove the month prop from TimeUnitSelect because the month
selection will be always displayed now. Before it was deactivated for
duration selection which doesn't use the TimeUnitSelect component
anymore.

Additionally update the selectable timeunit values to use constants from
gmp/models/event.
The WeekDays class handles parsing of ical.js byday parts of recurrence
rules.
The new component allows to toggle each weekday to be included in a
recurrency of a schedule.
This property allows to return a WeekDays instace from a ical rrule
byday part.
use freq and interval directly and add weekdays parameter for creating a
rrule byday part for the ical event.
Support ical rrule frequency, interval and especially its byday part.
With this change a use can select between recurrence options
Once, Hourly, Daily, Weekly, Monthly, Yearly, Workweek and Custom.
Hourly till Yearly a pre-defined recurrence rules and Custom lets the
user select more specific details.

Currently the custom weekly repetition add an additional weekday
selection. The custom monthly selection will get additional more complex
options in future.
@codecov
Copy link

codecov bot commented Jun 20, 2018

Codecov Report

Merging #739 into master will decrease coverage by 0.05%.
The diff coverage is 1.21%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #739      +/-   ##
=========================================
- Coverage    5.69%   5.63%   -0.06%     
=========================================
  Files         768     773       +5     
  Lines       25335   25597     +262     
  Branches     5699    5795      +96     
=========================================
+ Hits         1442    1443       +1     
- Misses      21474   21694     +220     
- Partials     2419    2460      +41
Impacted Files Coverage Δ
ng/src/gmp/models/date.js 100% <ø> (ø) ⬆️
ng/src/web/pages/schedules/details.js 0% <ø> (ø) ⬆️
ng/src/web/pages/schedules/table.js 0% <ø> (ø) ⬆️
ng/src/web/pages/schedules/weekdayselect.js 0% <0%> (ø)
ng/src/web/pages/schedules/timeunitselect.js 0% <0%> (ø)
ng/src/web/components/form/togglebutton.js 0% <0%> (ø)
ng/src/web/pages/schedules/dialog.js 0% <0%> (ø) ⬆️
ng/src/web/pages/schedules/dayselect.js 0% <0%> (ø)
ng/src/web/pages/schedules/component.js 0% <0%> (ø) ⬆️
ng/src/web/pages/schedules/monthdaysselect.js 0% <0%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60f7e1d...625aaa4. Read the comment docs.

bjoernricks and others added 20 commits June 20, 2018 14:36
Additional allow to set the width.
* Add getSelectedWeekDay method to return the first (starts with monday)
  set weekday.
* Add get method to return the value for a weekday
Allow to pass undefined weekdays to Event.fromData.
If no rrule bydate part is set on an ical event return undefined instead
of an default unset WeekDays instance. This allows to check if
byday/weekdays was set on the Event.
Add monthdays parameter to Event.fromData to allow setting the
bymonthday parameter of an ical event.
If the ical event has an rrule with bymonthday part this part is
returned as an array. If the part doesn't exist undefined is retuned.
When opening a ScheduleDialog load/reset the monthdays.
The component allsows to select a single weekday from the list of
weekday names.
This components is like a calendar where you can toggle each day of the
month to be selected.
The custom monthly recurrence has to options now:

* Select the first, second, third, fourth, fifth or last weekday of a
  month.

* Select dates/days of the month when the event should recur.
Raise an error if end date is same or before end date.
Remove extra properties weekdays and monthdays from Event class and
return an object from recurrence containing these both properties.
This moves all rrule related information to the recurrence.
Rename Period to Recurrence at schedule list and details pages. Not the
data does show more complex recurrences beside only periods.
This allows to access translation specific data from moment. We'll use
this for the ordinal (nth) translations.
The method returns an iterable array containing all weekdays and values.
Consider weekdays and monthdays for rendering a recurrence string.
Abstract all access to the weekdays data storage. Provide methods and
property getters for the public api.
@bjoernricks bjoernricks merged commit 44c893f into greenbone:master Jun 25, 2018
@bjoernricks bjoernricks deleted the extended-schedules branch June 25, 2018 06:55
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.

2 participants