Skip to content

Commit

Permalink
Merge 5d063da into e69139f
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 14, 2018
2 parents e69139f + 5d063da commit 2585d00
Show file tree
Hide file tree
Showing 18 changed files with 308 additions and 233 deletions.
202 changes: 47 additions & 155 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,21 @@ $ mvn clean package -DskipTests -Dproduction
```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
"status": ApiStatus,
"action": ApiAction,
"message": String,
"id": String
},
"payload": {
"ArrayList<Project>": [
{
"id": 1,
"name": "Legacy DSpace",
"scopeId": "1934",
"id": Long,
"name": String,
"scopeId": String,
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 2,
"name": "Code Management - Maps",
"scopeId": "3781",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 3,
"name": "CORAL - Electronic Resource Management",
"scopeId": "3783",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
}
},
{
"id": 4,
"name": "Piper - Automated Ingest",
"scopeId": "3786",
"remoteProjectManager": {
"id": 1,
"name": "VersionOne",
"type": "VERSION_ONE"
"id": Long,
"name": String,
"type": String
}
}
]
Expand All @@ -84,104 +54,44 @@ $ mvn clean package -DskipTests -Dproduction

<hr />

| **Title** | **Active Sprints** |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description** | Returns a list of all active sprints based on associated remote project manager projects. |
| **URL** | ```/sprints/active``` |
| **Method** | **GET** |
| **URL Parameters** | |
| **Success Response** | **Code:** 200 OK<br/>**Content Type:** application/json<br/>**Schema:** |
| **Sample Request** | ```/sprints/active``` |
| **Notes** | Currently, only remote project manager implemented is VersionOne. VersionOne sprints are based on a timebox which is a spring schedule in the UI. Projects can share the same sprint schedule and will appear to be the same sprint in this response. |
| **Title** | **Active Sprints** |
| :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description** | Returns a list of all active sprints based on associated remote project manager projects. |
| **URL** | ```/sprints/active``` |
| **Method** | **GET** |
| **URL Parameters** | |
| **Success Response** | **Code:** 200 OK<br/>**Content Type:** application/json<br/>**Schema:** |
| **Sample Request** | ```/sprints/active``` |
| **Notes** | Currently, VersionOne is the only remote project manager implemented. VersionOne sprints are based on a timebox which is a sprint schedule in the UI. Projects can share the same sprint schedule and will appear to be the same sprint in this response. |

```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
"status": ApiStatus,
"action": ApiAction,
"message": String,
"id": String
},
"payload": {
"ArrayList<Sprint>": [
{
"id": "8416",
"name": "Sprint 14",
"project": "CORAL - Electronic Resource Management",
"cards": [
{
"id": "8234",
"number": "B-03467",
"type": "Feature",
"status": "Accepted",
"name": "Update new feedback and purchase forms to incorporate all fields from the existing feedback form",
"description": "<p>Needs to have the new styling and needs to pass WAVE ADA check.</p>\n<p> </p>\n<p>All the key/value information will go right into the Notes field.</p>\n<p> </p>\n<p>We will be finishing out and fully styling the feedback form, the request a purchase form, and ideally the https://coral.library.tamu.edu/resourcelink.php?resource=1440 link resolver while we're at it.</p>",
"assignees": [
{
"id": "20",
"name": "Jeremy Huff",
"avatar": "1706"
},
{
"id": "3483",
"name": "Jason Savell",
"avatar": "no_avatar.png"
},
{
"id": "7888",
"name": "Kevin Day",
"avatar": "no_avatar.png"
}
]
},
{
"id": "8417",
"number": "B-03578",
"type": "Feature",
"status": "Done",
"name": "Sort by title by default when viewing resource list with trial/purchase requests hidden",
"assignees": [
{
"id": "3483",
"name": "Jason Savell",
"avatar": "no_avatar.png"
}
]
}
]
},
{
"id": "8435",
"name": "Weaver Upgrades/Auth2 Retirement",
"project": "DI Internal",
"id": String,
"name": String,
"project": String,
"cards": [
{
"id": "8436",
"number": "B-03587",
"type": "Feature",
"status": "Done",
"name": "Upgrade My Library UI to weaver-ui 2",
"estimate": 3,
"assignees": [
{
"id": "6616",
"name": "Ryan Laddusaw",
"avatar": "no_avatar.png"
}
]
},
{
"id": "8437",
"number": "B-03588",
"type": "Feature",
"status": "Done",
"name": "Update My Library Service to Weaver 2",
"estimate": 2,
"id": String,
"number": String,
"type": String,
"status": String,
"name": String,
"description": String,
"estimate": Float,
"assignees": [
{
"id": "6616",
"name": "Ryan Laddusaw",
"avatar": "no_avatar.png"
"id": String,
"name": String,
"avatar": String
}
]
}
Expand All @@ -207,39 +117,21 @@ $ mvn clean package -DskipTests -Dproduction
```json
{
"meta": {
"status": "SUCCESS",
"action": null,
"message": "Your request was successful",
"id": null
"status": ApiStatus,
"action": ApiAction,
"message": String,
"id": String
},
"payload": {
"ArrayList<ProjectStats>": [
{
"id": "1",
"name": "Legacy DSpace",
"requestCount": 22,
"issueCount": 41,
"featureCount": 32,
"defectCount": 0,
"backlogItemCount": 32
},
{
"id": "2",
"name": "Code Management - Maps",
"requestCount": 0,
"issueCount": 0,
"featureCount": 5,
"defectCount": 0,
"backlogItemCount": 5
},
{
"id": "3",
"name": "CORAL - Electronic Resource Management",
"requestCount": 2,
"issueCount": 0,
"featureCount": 12,
"defectCount": 8,
"backlogItemCount": 20
"id": String,
"name": String,
"requestCount": Interger,
"issueCount": Interger,
"featureCount": Interger,
"defectCount": Interger,
"backlogItemCount": Interger
}
]
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/edu/tamu/app/ProjectApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class ProjectApplication extends SpringBootServletInitializer {
*
* @param args
* String[]
*
*/
public static void main(String[] args) {
SpringApplication.run(ProjectApplication.class, args);
Expand All @@ -31,9 +30,7 @@ public static void main(String[] args) {
*
* @param application
* SpringApplicationBuilder
*
* @return SpringApplicationBuilder
*
*/
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/edu/tamu/app/ProjectInitialization.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
package edu.tamu.app;

import java.util.Arrays;
import java.util.HashSet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import edu.tamu.app.model.CardType;
import edu.tamu.app.model.repo.CardTypeRepo;
import edu.tamu.app.model.repo.RemoteProjectManagerRepo;
import edu.tamu.app.service.registry.ManagementBeanRegistry;

@Component
@Profile("!test")
public class ProjectInitialization implements CommandLineRunner {

@Autowired
Expand All @@ -16,11 +23,17 @@ public class ProjectInitialization implements CommandLineRunner {
@Autowired
private RemoteProjectManagerRepo remoteProjectManagerRepo;

@Autowired
private CardTypeRepo cardTypeRepo;

@Override
public void run(String... args) throws Exception {
remoteProjectManagerRepo.findAll().forEach(versionManagementSoftware -> {
managementBeanRegistry.register(versionManagementSoftware);
});
if (cardTypeRepo.findByIdentifier("Feature") == null) {
cardTypeRepo.create(new CardType("Feature", new HashSet<String>(Arrays.asList(new String[] { "Story" }))));
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ public void addProject(Project project) {
}

public void updateProject(Project project) {
List<ProjectStats> projectsStats = get().stream().filter(p -> !p.getId().equals(project.getId())).collect(Collectors.toList());
List<ProjectStats> projectsStats = get().stream().filter(p -> !p.getId().equals(project.getId().toString())).collect(Collectors.toList());
projectsStats.add(getProjectStats(project));
set(projectsStats);
broadcast();
}

public void removeProject(Project project) {
List<ProjectStats> projectsStats = get().stream().filter(p -> !p.getId().equals(project.getId())).collect(Collectors.toList());
List<ProjectStats> projectsStats = get().stream().filter(p -> !p.getId().equals(project.getId().toString())).collect(Collectors.toList());
set(projectsStats);
broadcast();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import edu.tamu.app.model.RemoteProjectManager;
Expand All @@ -30,19 +33,19 @@ public class RemoteProjectManagerController {

private Logger logger = LoggerFactory.getLogger(this.getClass());

@RequestMapping(method = RequestMethod.GET)
@GetMapping
@PreAuthorize("hasRole('USER')")
public ApiResponse getAll() {
return new ApiResponse(SUCCESS, remoteProjectManagerRepo.findAll());
}

@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@GetMapping("/{id}")
@PreAuthorize("hasRole('USER')")
public ApiResponse getOne(@PathVariable Long id) {
return new ApiResponse(SUCCESS, remoteProjectManagerRepo.findOne(id));
}

@RequestMapping(method = RequestMethod.POST)
@PostMapping
@PreAuthorize("hasRole('USER')")
@WeaverValidation(business = { @WeaverValidation.Business(value = CREATE) })
public ApiResponse createRemoteProjectManager(@WeaverValidatedModel RemoteProjectManager remoteProjectManager) {
Expand All @@ -51,15 +54,15 @@ public ApiResponse createRemoteProjectManager(@WeaverValidatedModel RemoteProjec
return new ApiResponse(SUCCESS, remoteProjectManagerRepo.create(remoteProjectManager));
}

@RequestMapping(method = RequestMethod.PUT)
@PutMapping
@PreAuthorize("hasRole('USER')")
@WeaverValidation(business = { @WeaverValidation.Business(value = UPDATE) })
public ApiResponse updateRemoteProjectManager(@WeaverValidatedModel RemoteProjectManager remoteProjectManager) {
logger.info("Updating Remote Project Manager: " + remoteProjectManager.getName());
return new ApiResponse(SUCCESS, remoteProjectManagerRepo.update(remoteProjectManager));
}

@RequestMapping(method = RequestMethod.DELETE)
@DeleteMapping
@PreAuthorize("hasRole('USER')")
@WeaverValidation(business = { @WeaverValidation.Business(value = DELETE) })
public ApiResponse deleteRemoteProjectManager(@WeaverValidatedModel RemoteProjectManager remoteProjectManager) {
Expand All @@ -68,13 +71,13 @@ public ApiResponse deleteRemoteProjectManager(@WeaverValidatedModel RemoteProjec
return new ApiResponse(SUCCESS);
}

@RequestMapping(value = "/types", method = RequestMethod.GET)
@GetMapping("/types")
@PreAuthorize("hasRole('USER')")
public ApiResponse getTypes() {
return new ApiResponse(SUCCESS, ServiceType.map());
}

@RequestMapping(value = "/scaffolding/{type}", method = RequestMethod.GET)
@GetMapping("/scaffolding/{type}")
@PreAuthorize("hasRole('USER')")
public ApiResponse getTypeScaffolding(@PathVariable String type) {
ServiceType serviceType = ServiceType.valueOf(type);
Expand Down

0 comments on commit 2585d00

Please sign in to comment.