Unverified Commit 9c72a6c3 authored by Christopher Guindon's avatar Christopher Guindon Committed by GitHub
Browse files

Updates to the /working_groups resource #167 (#204)

* Updates to the /working_groups resource #167

Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* remove org doc id for science
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* Update the Working Group object structure in the API

* Fix imports, update openapi spec to reflect new WG structure

* Update documentation for Working Group service and related resources

* updated front end to work with new wg data

* Fix integrity of the list in the working group import object
Co-authored-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
Co-authored-by: Zhou Fang's avatarZhou Fang <zhou.fang@eclipse-foundation.org>
parent 4c493ace
...@@ -771,26 +771,66 @@ components: ...@@ -771,26 +771,66 @@ components:
WorkingGroup: WorkingGroup:
type: object type: object
properties: properties:
documentID: alias:
$ref: '#/components/schemas/ObjectID'
name:
type: string type: string
levels: description: internal alias for the working group
title:
type: string
description: Public-facing or official name of the working group
status:
type: string
description: Current status of the working group (e.g. incubating, active, archived)
logo:
type: string
description: image link for the working groups logo
description:
type: string
description: Short description of the working group
resources:
type: object type: object
description: The ID of the working group relationship to be formed
properties: properties:
document_id: charter:
$ref: '#/components/schemas/ObjectID' type: string
level: description: Link to the charter for the current working group
contact_form:
type: string
description: URL link to the contact form
members:
type: string
description: URL to the members list for the given working group
participation_agreements:
type: object
properties:
individual:
$ref: '#/components/schemas/WorkingGroupParticipationAgreement'
organization:
$ref: '#/components/schemas/WorkingGroupParticipationAgreement'
sponsorship:
type: string type: string
price: description: link to the sponsorship agreement document
website:
type: string type: string
revenue_top: description: the URL for the homepage of this working group
type: number levels:
revenue_bottom: type: array
type: number items:
company_size: type: object
type: number description: Definition of the participation level for the working group, including its relation code
properties:
relation:
type: string
description: code representing the relation, used internally when using common relation types
description:
type: string
description: the label for the participation level
WorkingGroupParticipationAgreement:
type: object
properties:
document_id:
$ref: '#/components/schemas/ObjectID'
pdf:
type: string
description: Link to the PDF version of the participation agreement
ConstraintViolations: ConstraintViolations:
type: array type: array
......
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
/** /**
* Copyright (c) 2021 Eclipse Foundation * Copyright (c) 2021 Eclipse Foundation
* *
...@@ -11,81 +22,136 @@ ...@@ -11,81 +22,136 @@
*/ */
package org.eclipsefoundation.react.model; package org.eclipsefoundation.react.model;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
/**
* Definition representing data about a working group, including the core information about the group, links to
* resources for the group, and available participation levels.
*
* @author Martin Lowe
*
*/
public class WorkingGroup { public class WorkingGroup {
private String alias;
private String documentID; private String title;
private String name; private String status;
private String logo;
private String description;
private WorkingGroupResources resources;
private List<WorkingGroupParticipationLevel> levels; private List<WorkingGroupParticipationLevel> levels;
public WorkingGroup(String documentID, String name, List<WorkingGroupParticipationLevel> levels) { /**
this.documentID = documentID; * @return the alias
this.name = name; */
this.levels = levels; public String getAlias() {
return alias;
} }
public WorkingGroup() { /**
* @param alias the alias to set
*/
public void setAlias(String alias) {
this.alias = alias;
} }
public WorkingGroup(String documentID, String name) { /**
this.documentID = documentID; * @return the title
this.name = name; */
public String getTitle() {
return title;
} }
public String getDocumentID() { /**
return this.documentID; * @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
} }
public void setDocumentID(String documentID) { /**
this.documentID = documentID; * @return the status
*/
public String getStatus() {
return status;
} }
public String getName() { /**
return this.name; * @param status the status to set
*/
public void setStatus(String status) {
this.status = status;
} }
public void setName(String name) { /**
this.name = name; * @return the logo
*/
public String getLogo() {
return logo;
} }
public List<WorkingGroupParticipationLevel> getLevels() { /**
return this.levels; * @param logo the logo to set
*/
public void setLogo(String logo) {
this.logo = logo;
} }
public void setLevels(List<WorkingGroupParticipationLevel> levels) { /**
this.levels = levels; * @return the description
*/
public String getDescription() {
return description;
} }
public WorkingGroup documentID(String documentID) { /**
setDocumentID(documentID); * @param description the description to set
return this; */
public void setDescription(String description) {
this.description = description;
} }
public WorkingGroup name(String name) { /**
setName(name); * @return the resources
return this; */
public WorkingGroupResources getResources() {
return resources;
} }
public WorkingGroup levels(List<WorkingGroupParticipationLevel> levels) { /**
setLevels(levels); * @param resources the resources to set
return this; */
public void setResources(WorkingGroupResources resources) {
this.resources = resources;
} }
@Override public List<WorkingGroupParticipationLevel> getLevels() {
public boolean equals(Object o) { return new ArrayList<>(this.levels);
if (o == this) }
return true;
if (!(o instanceof WorkingGroup)) { public void setLevels(List<WorkingGroupParticipationLevel> levels) {
return false; this.levels = new ArrayList<>(levels);
}
WorkingGroup workingGroup = (WorkingGroup) o;
return Objects.equals(documentID, workingGroup.documentID) && Objects.equals(name, workingGroup.name);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(documentID, name); return Objects.hash(alias, description, levels, logo, resources, status, title);
} }
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroup other = (WorkingGroup) obj;
return Objects.equals(alias, other.alias) && Objects.equals(description, other.description)
&& Objects.equals(levels, other.levels) && Objects.equals(logo, other.logo)
&& Objects.equals(resources, other.resources) && Objects.equals(status, other.status)
&& Objects.equals(title, other.title);
}
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
package org.eclipsefoundation.react.model; package org.eclipsefoundation.react.model;
import java.util.List; import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
...@@ -19,25 +19,25 @@ import java.util.Objects; ...@@ -19,25 +19,25 @@ import java.util.Objects;
* *
* @author Martin Lowe <martin.lowe@eclipse-foundation.org> * @author Martin Lowe <martin.lowe@eclipse-foundation.org>
*/ */
public class WorkingGroupList { public class WorkingGroupMap {
private List<WorkingGroup> workingGroups; private Map<String, WorkingGroup> workingGroups;
public WorkingGroupList() { public WorkingGroupMap() {
} }
public WorkingGroupList(List<WorkingGroup> workingGroups) { public WorkingGroupMap(Map<String, WorkingGroup> workingGroups) {
this.workingGroups = workingGroups; this.workingGroups = workingGroups;
} }
public List<WorkingGroup> getWorkingGroups() { public Map<String, WorkingGroup> getWorkingGroups() {
return this.workingGroups; return this.workingGroups;
} }
public void setWorkingGroups(List<WorkingGroup> workingGroups) { public void setWorkingGroups(Map<String, WorkingGroup> workingGroups) {
this.workingGroups = workingGroups; this.workingGroups = workingGroups;
} }
public WorkingGroupList workingGroups(List<WorkingGroup> workingGroups) { public WorkingGroupMap workingGroups(Map<String, WorkingGroup> workingGroups) {
setWorkingGroups(workingGroups); setWorkingGroups(workingGroups);
return this; return this;
} }
...@@ -46,10 +46,10 @@ public class WorkingGroupList { ...@@ -46,10 +46,10 @@ public class WorkingGroupList {
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == this) if (o == this)
return true; return true;
if (!(o instanceof WorkingGroupList)) { if (!(o instanceof WorkingGroupMap)) {
return false; return false;
} }
WorkingGroupList workingGroupList = (WorkingGroupList) o; WorkingGroupMap workingGroupList = (WorkingGroupMap) o;
return Objects.equals(workingGroups, workingGroupList.workingGroups); return Objects.equals(workingGroups, workingGroupList.workingGroups);
} }
......
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipsefoundation.react.model;
import java.util.Objects;
import javax.json.bind.annotation.JsonbProperty;
/**
* Defines a PDF version of a blank participation agreement, as well as the document ID for the document within the
* Eclipse databases.
*
* @author Martin Lowe
*
*/
public class WorkingGroupParticipationAgreement {
@JsonbProperty("document_id")
private String documentId;
private String pdf;
/**
* @return the documentId
*/
public String getDocumentId() {
return documentId;
}
/**
* @param documentId the documentId to set
*/
public void setDocumentId(String documentId) {
this.documentId = documentId;
}
/**
* @return the pdf
*/
public String getPdf() {
return pdf;
}
/**
* @param pdf the pdf to set
*/
public void setPdf(String pdf) {
this.pdf = pdf;
}
@Override
public int hashCode() {
return Objects.hash(documentId, pdf);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroupParticipationAgreement other = (WorkingGroupParticipationAgreement) obj;
return Objects.equals(documentId, other.documentId) && Objects.equals(pdf, other.pdf);
}
}
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipsefoundation.react.model;
import java.util.Objects;
/**
* Represents the available participation agreements for a working group
*
* @author Martin Lowe
*
*/
public class WorkingGroupParticipationAgreements {
private WorkingGroupParticipationAgreement individual;
private WorkingGroupParticipationAgreement organization;
/**
* @return the individual
*/
public WorkingGroupParticipationAgreement getIndividual() {
return individual;
}
/**
* @param individual the individual to set
*/
public void setIndividual(WorkingGroupParticipationAgreement individual) {
this.individual = individual;
}
/**
* @return the organization
*/
public WorkingGroupParticipationAgreement getOrganization() {
return organization;
}
/**
* @param organization the organization to set
*/
public void setOrganization(WorkingGroupParticipationAgreement organization) {
this.organization = organization;
}
@Override
public int hashCode() {
return Objects.hash(individual, organization);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroupParticipationAgreements other = (WorkingGroupParticipationAgreements) obj;
return Objects.equals(individual, other.individual) && Objects.equals(organization, other.organization);
}
}
...@@ -11,61 +11,55 @@ ...@@ -11,61 +11,55 @@
*/ */
package org.eclipsefoundation.react.model; package org.eclipsefoundation.react.model;
public class WorkingGroupParticipationLevel { import java.util.Objects;
private String documentID;
private String level;
private String price;
private int revenueTop;
private int revenueBottom;
private Integer companySize;
public String getDocumentID() {
return this.documentID;
}
public void setDocumentID(String documentID) {
this.documentID = documentID;
}
public String getLevel() {
return this.level;
}
public void setLevel(String level) {
this.level = level;
}
public String getPrice() {
return this.price;
}
public void setPrice(String price) {
this.price = price;
}
public class WorkingGroupParticipationLevel {
private String relation;
private String description;
public int getRevenueTop() { /**
return this.revenueTop; * @return the relation
*/
public String getRelation() {
return relation;
} }