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

#192 - Add multiple BusinessHours for a Resource #193

Merged
merged 4 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon-scheduler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.vaadin.stefan</groupId>
<artifactId>fullcalendar2-scheduler</artifactId>
<version>6.2.1</version>
<version>6.2.2</version>

<name>FullCalendar Scheduler for Flow</name>
<description>A web component that wraps the FullCalendar Scheduler extension (https://fullcalendar.io).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import lombok.EqualsAndHashCode;
import lombok.Getter;

import org.vaadin.stefan.fullcalendar.NotNull;
import java.util.*;

/**
Expand Down Expand Up @@ -55,11 +54,11 @@ public class Resource {
private final String color;

/**
* The BusinessHours of this resource.
* The BusinessHours array of this resource.
*
* A businessHours declaration that will only apply to this resource.
* A businessHours[] declaration that will only apply to this resource.
*/
private final BusinessHours businessHours;
private final BusinessHours[] businessHoursArray;

spalyukh-flex marked this conversation as resolved.
Show resolved Hide resolved
/**
* The childern's of the resource
Expand Down Expand Up @@ -118,11 +117,11 @@ public Resource(String id, String title, String color, Collection<Resource> chil
* @param children children (optional)
* @param businessHours businessHours (optional)
*/
public Resource(String id, String title, String color, Collection<Resource> children, BusinessHours businessHours) {
public Resource(String id, String title, String color, Collection<Resource> children, BusinessHours... businessHours) {
spalyukh-flex marked this conversation as resolved.
Show resolved Hide resolved
this.id = id != null ? id : UUID.randomUUID().toString();
this.title = title;
this.color = color;
this.businessHours = businessHours;
this.businessHoursArray = businessHours;
spalyukh-flex marked this conversation as resolved.
Show resolved Hide resolved

if (children != null) {
addChildren(children);
Expand Down Expand Up @@ -279,8 +278,13 @@ protected JsonObject toJson() {
jsonObject.put("title", JsonUtils.toJsonValue(getTitle()));
jsonObject.put("eventColor", JsonUtils.toJsonValue(getColor()));

if(getBusinessHours() != null)
jsonObject.put("businessHours", getBusinessHours().toJson());
if(getBusinessHoursArray() != null) {
spalyukh-flex marked this conversation as resolved.
Show resolved Hide resolved
JsonArray businessHoursJsonArray = Json.createArray();
for(int i=0; i < getBusinessHoursArray().length; i++) {
businessHoursJsonArray.set(i, getBusinessHoursArray()[i].toJson());
}
jsonObject.put("businessHours", businessHoursJsonArray);
}

getParent().ifPresent(parent -> jsonObject.put("parentId", parent.getId()));

Expand Down
2 changes: 1 addition & 1 deletion addon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.vaadin.stefan</groupId>
<artifactId>fullcalendar2</artifactId>
<version>6.2.1</version>
<version>6.2.2</version>
spalyukh-flex marked this conversation as resolved.
Show resolved Hide resolved

<name>FullCalendar for Flow</name>
<description>A web component that wraps the FullCalendar (https://fullcalendar.io).</description>
Expand Down
6 changes: 4 additions & 2 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<properties>
<vaadin.version>24.3.2</vaadin.version>

<fullcalendar.version>6.2.1</fullcalendar.version>
<fullcalendar.scheduler.version>6.2.1</fullcalendar.scheduler.version>
<fullcalendar.version>6.2.2</fullcalendar.version>
<fullcalendar.scheduler.version>6.2.2</fullcalendar.scheduler.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down Expand Up @@ -115,6 +115,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -152,6 +153,7 @@
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions demo14/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<properties>
<vaadin.version>14.11.3</vaadin.version>

<fullcalendar.version>6.2.1</fullcalendar.version>
<fullcalendar.scheduler.version>6.2.1</fullcalendar.scheduler.version>
<fullcalendar.version>6.2.2</fullcalendar.version>
<fullcalendar.scheduler.version>6.2.2</fullcalendar.scheduler.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.vaadin.stefan</groupId>
<artifactId>fullcalendar-parent</artifactId>
<version>6.2.1</version>
<version>6.2.2</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down