Skip to content

Commit

Permalink
FARM-5 Dates Management - Start/End Dates (sakaiproject#7407)
Browse files Browse the repository at this point in the history
  • Loading branch information
josecebe authored and Miguel Pellicer committed Oct 17, 2019
1 parent 17343b5 commit 1ada426
Show file tree
Hide file tree
Showing 30 changed files with 2,974 additions and 4 deletions.
4 changes: 4 additions & 0 deletions basiclti/basiclti-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<artifactId>jjwt-impl</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions deploy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@
<artifactId>asm</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
1 change: 0 additions & 1 deletion lessonbuilder/hbm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>${json.simple.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
Expand Down
6 changes: 4 additions & 2 deletions lessonbuilder/tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>


<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,100 @@
min-width: 100%;
padding-right: 0.5em;
}
#date-manager-form {
.panel-heading {
padding: 0;

.panel-title {
padding: 0;

a {
padding: 13.2px 15px;
display: block;
text-decoration: none;

&::before {
font-family: FontAwesome;
margin-right: 5px;
width: 15px;
display: inline-block;
}
&[aria-expanded=true] {
&::before {
content: "\f063";
}
}
&:not([aria-expanded=true]) {
&::before {
content: "\f061";
}
}

span {
text-decoration: underline;
}
}
}
}

.panel-body {
> p:last-of-type {
margin-bottom: 0;
}
}

.table-datemanager {
margin-bottom: 0;
table-layout: fixed;

td {
&.ajax-error {
background-color: $errorBanner-bgcolor;
}

> div {
position: relative;
}

.datepicker {
width: calc(100% - 35px);
display: inline-block;
min-width: initial !important;
}

.ui-datepicker-trigger {
position: absolute;
top: 0;
right: 0;
}

.day-of-week {
text-transform: capitalize;
}

}

}

.modal {
.modal-header {
.close {
opacity: 1;
}
}
.modal-body {
#modified-dates {
margin-bottom: 0;
}
}
.modal-footer {
&.act {
margin-top: 0;
margin-bottom: 0;
}
}
}
}
}

#toolSelectionList{
Expand Down
6 changes: 6 additions & 0 deletions master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@
<version>2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>${json.simple.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>asm</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions site-manage/datemanager/api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sakaiproject.sitemanage</groupId>
<artifactId>sakai-site-datemanager-base</artifactId>
<version>20-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>sakai-site-datemanager-api</name>
<groupId>org.sakaiproject.datemanager.api</groupId>
<artifactId>sakai-site-datemanager-api</artifactId>
<packaging>jar</packaging>

<properties>
<deploy.target>shared</deploy.target>
</properties>

<dependencies>
<!-- Sakai dependencies -->
<!-- Third dependencies -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>${json.simple.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**********************************************************************************
Copyright (c) 2019 Apereo Foundation
Licensed under the Educational Community License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/ecl2
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**********************************************************************************/

package org.sakaiproject.datemanager.api;

public class DateManagerConstants {
public static final String COMMON_ID_ASSIGNMENTS = "sakai.assignment.grades";
public static final String COMMON_ID_ASSESSMENTS = "sakai.samigo";
public static final String COMMON_ID_SIGNUP = "sakai.signup";
public static final String COMMON_ID_GRADEBOOK = "sakai.gradebookng";
public static final String COMMON_ID_RESOURCES = "sakai.resources";
public static final String COMMON_ID_CALENDAR = "sakai.schedule";
public static final String COMMON_ID_FORUMS = "sakai.forums";
public static final String COMMON_ID_ANNOUNCEMENTS = "sakai.announcements";
public static final String COMMON_ID_LESSONS = "sakai.lessonbuildertool";

public static final String DATEPICKER_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
public static final int LIST_VIEW_YEAR_RANGE = 18;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**********************************************************************************
Copyright (c) 2019 Apereo Foundation
Licensed under the Educational Community License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/ecl2
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**********************************************************************************/

package org.sakaiproject.datemanager.api;

import java.time.Instant;
import java.util.Locale;
import java.util.TimeZone;

import org.json.simple.JSONArray;

import org.sakaiproject.datemanager.api.model.DateManagerValidation;

public interface DateManagerService {
// Global methods
public String getCurrentUserId();
public String getCurrentSiteId();
public Locale getUserLocale();
public String getMessage(String messageId);
public Instant parseStringToInstant(String timestamp, TimeZone userTimeZone);
public boolean currentSiteContainsTool(String commonId);
public String getToolTitle(String commonId);

// Assignments methods
public JSONArray getAssignmentsForContext(String siteId);
public DateManagerValidation validateAssignments(String siteId, JSONArray assignments) throws Exception;
public void updateAssignments(DateManagerValidation assignmentsValidation) throws Exception;

// Assessments methods
public JSONArray getAssessmentsForContext(String siteId);
public DateManagerValidation validateAssessments(String siteId, JSONArray assessments) throws Exception;
public void updateAssessments(DateManagerValidation assessmentsValidation) throws Exception;

// Gradebook methods
public JSONArray getGradebookItemsForContext(String siteId);
public DateManagerValidation validateGradebookItems(String siteId, JSONArray gradebookItems) throws Exception;
public void updateGradebookItems(DateManagerValidation gradebookItemsValidation) throws Exception;

// Signup methods
public JSONArray getSignupMeetingsForContext(String siteId);
public DateManagerValidation validateSignupMeetings(String siteId, JSONArray signupMeetings) throws Exception;
public void updateSignupMeetings(DateManagerValidation signupValidation) throws Exception;

// Resources methods
public JSONArray getResourcesForContext(String siteId);
public DateManagerValidation validateResources(String siteId, JSONArray resources) throws Exception;
public void updateResources(DateManagerValidation resourceValidation) throws Exception;

// Calendar methods
public JSONArray getCalendarEventsForContext(String siteId);
public DateManagerValidation validateCalendarEvents(String siteId, JSONArray calendarEvents) throws Exception;
public void updateCalendarEvents(DateManagerValidation calendarValidation) throws Exception;

// Forum methods
public JSONArray getForumsForContext(String siteId);
public DateManagerValidation validateForums(String siteId, JSONArray forums) throws Exception;
public void updateForums(DateManagerValidation forumValidation) throws Exception;

// Announcement methods
public JSONArray getAnnouncementsForContext(String siteId);
public DateManagerValidation validateAnnouncements(String siteId, JSONArray announcements) throws Exception;
public void updateAnnouncements(DateManagerValidation announcementValidation) throws Exception;

// Lessons methods
public JSONArray getLessonsForContext(String siteId);
public DateManagerValidation validateLessons(String siteId, JSONArray lessons) throws Exception;
public void updateLessons(DateManagerValidation lessonsValidation) throws Exception;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**********************************************************************************
Copyright (c) 2019 Apereo Foundation
Licensed under the Educational Community License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/ecl2
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**********************************************************************************/

package org.sakaiproject.datemanager.api.model;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class DateManagerError {
public String field;
public String msg;
public String toolId;
public String toolTitle;
public int idx;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**********************************************************************************
Copyright (c) 2019 Apereo Foundation
Licensed under the Educational Community License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/ecl2
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**********************************************************************************/

package org.sakaiproject.datemanager.api.model;

import java.time.Instant;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public class DateManagerUpdate {
public Object object;
public Instant openDate;
public Instant dueDate;
public Instant acceptUntilDate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**********************************************************************************
Copyright (c) 2019 Apereo Foundation
Licensed under the Educational Community License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/ecl2
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**********************************************************************************/

package org.sakaiproject.datemanager.api.model;

import java.util.List;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter @Setter
@NoArgsConstructor
public class DateManagerValidation {
private List<DateManagerError> errors;
private List<Object> updates;
}
Loading

0 comments on commit 1ada426

Please sign in to comment.