Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
feat(projects,components): add new field owner country to data model
Browse files Browse the repository at this point in the history
  • Loading branch information
maierthomas committed Dec 19, 2017
1 parent a7c97b1 commit 716b6f1
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 7 deletions.
Expand Up @@ -101,10 +101,13 @@
</tr>
<tr>
<td width="33%">
<sw360:DisplayUserEdit emails="${component.moderators}" id="<%=Component._Fields.MODERATORS.toString()%>"
description="Moderators" multiUsers="true" readonly="false"/>
<label class="textlabel stackedLabel" for="ownerCountry">Owner Country</label>
<input class="toplabelledInput" id="ownerCountry" name="<portlet:namespace/><%=Component._Fields.OWNER_COUNTRY%>" type="text"
placeholder="Enter Owner Country" value="<sw360:out value="${component.ownerCountry}"/>"/>
</td>
<td width="33%">
<sw360:DisplayUserEdit emails="${component.moderators}" id="<%=Component._Fields.MODERATORS.toString()%>"
description="Moderators" multiUsers="true" readonly="false"/>
</td>
<td width="33%">
</td>
Expand Down
Expand Up @@ -101,7 +101,10 @@
<td>Owner billing group:</td>
<td><sw360:out value="${component.ownerGroup}"/></td>
</tr>

<tr>
<td>Owner country:</td>
<td><sw360:out value="${component.ownerCountry}"/></td>
</tr>
<tr>
<td>Moderators:</td>
<td><sw360:DisplayUserEmailCollection value="${component.moderators}"/></td>
Expand Down
Expand Up @@ -164,6 +164,7 @@
$stepElement.append(wizard.createSingleMergeLine('Component owner', data.componentTarget.componentOwner, data.componentSource.componentOwner));
$stepElement.append(wizard.createSingleMergeLine('Owner accounting unit', data.componentTarget.ownerAccountingUnit, data.componentSource.ownerAccountingUnit));
$stepElement.append(wizard.createSingleMergeLine('Owner billing group', data.componentTarget.ownerGroup, data.componentSource.ownerGroup));
$stepElement.append(wizard.createSingleMergeLine('Owner country', data.componentTarget.ownerCountry, data.componentSource.ownerCountry));
$stepElement.append(wizard.createMultiMergeLine('Moderators', data.componentTarget.moderators, data.componentSource.moderators));
$stepElement.append(wizard.createMultiMergeLine('Subscribers', data.componentTarget.subscribers, data.componentSource.subscribers));
$stepElement.append(wizard.createMultiMapMergeLine('Additional Roles', data.componentTarget.roles, data.componentSource.roles));
Expand Down Expand Up @@ -208,6 +209,7 @@
componentSelection.componentOwner = wizard.getFinalSingleValue('Component owner');
componentSelection.ownerAccountingUnit = wizard.getFinalSingleValue('Owner accounting unit');
componentSelection.ownerGroup = wizard.getFinalSingleValue('Owner billing group');
componentSelection.ownerCountry = wizard.getFinalSingleValue('Owner country');
componentSelection.moderators = wizard.getFinalMultiValue('Moderators');
componentSelection.subscribers = wizard.getFinalMultiValue('Subscribers');
componentSelection.roles = wizard.getFinalMultiMapValue('Additional Roles');
Expand Down Expand Up @@ -261,6 +263,7 @@
$stepElement.append(wizard.createSingleDisplayLine('Component owner', data.componentSelection.componentOwner));
$stepElement.append(wizard.createSingleDisplayLine('Owner accounting unit', data.componentSelection.ownerAccountingUnit));
$stepElement.append(wizard.createSingleDisplayLine('Owner billing group', data.componentSelection.ownerGroup));
$stepElement.append(wizard.createSingleDisplayLine('Owner country', data.componentSelection.ownerCountry));
$stepElement.append(wizard.createMultiDisplayLine('Moderators', data.componentSelection.moderators));
$stepElement.append(wizard.createMultiDisplayLine('Subscribers', data.componentSelection.subscribers));
$stepElement.append(wizard.createMultiMapDisplayLine('Additional Roles', data.componentSelection.roles));
Expand Down
Expand Up @@ -149,11 +149,17 @@
value="<sw360:out value="${project.ownerGroup}"/>" placeholder="Enter owner's billing group"/>
</td>
<td width="33%">
<sw360:DisplayUserEdit email="${project.leadArchitect}" id="<%=Project._Fields.LEAD_ARCHITECT.toString()%>"
description="Lead architect" multiUsers="false"/>
<label class="textlabel stackedLabel" for="proj_owner_country">Owner country</label>
<input class="toplabelledInput" id="proj_owner_country" name="<portlet:namespace/><%=Project._Fields.OWNER_COUNTRY%>"
type="text"
value="<sw360:out value="${project.ownerCountry}"/>" placeholder="Enter owner's country"/>
</td>
</tr>
<tr>
<td width="33%">
<sw360:DisplayUserEdit email="${project.leadArchitect}" id="<%=Project._Fields.LEAD_ARCHITECT.toString()%>"
description="Lead architect" multiUsers="false"/>
</td>
<td width="33%">
<sw360:DisplayUserEdit emails="${project.moderators}" id="<%=Project._Fields.MODERATORS.toString()%>"
description="Moderators" multiUsers="true"/>
Expand All @@ -162,12 +168,17 @@
<sw360:DisplayUserEdit emails="${project.contributors}" id="<%=Project._Fields.CONTRIBUTORS.toString()%>"
description="Contributors" multiUsers="true"/>
</td>
</tr>
<tr>
<td width="33%">
<sw360:DisplayUserEdit emails="${project.securityResponsibles}" id="<%=Project._Fields.SECURITY_RESPONSIBLES.toString()%>"
description="Security Responsibles" multiUsers="true"/>
</td>
<td width="33%">
</td>
<td width="33%">
</td>
</tr>

</table>


Expand Down
Expand Up @@ -84,6 +84,10 @@
<td>Owner billing group:</td>
<td><sw360:out value="${project.ownerGroup}"/></td>
</tr>
<tr>
<td>Owner country:</td>
<td><sw360:out value="${project.ownerCountry}"/></td>
</tr>
<tr>
<td>Lead architect:</td>
<td><sw360:DisplayUserEmail email="${project.leadArchitect}"/></td>
Expand Down
Expand Up @@ -42,6 +42,7 @@ public class ComponentExporter extends ExcelExporter<Component, ComponentHelper>
nameToDisplayName.put(Component._Fields.COMPONENT_OWNER.getFieldName(), "component owner");
nameToDisplayName.put(Component._Fields.OWNER_ACCOUNTING_UNIT.getFieldName(), "owner accounting unit");
nameToDisplayName.put(Component._Fields.OWNER_GROUP.getFieldName(), "owner group");
nameToDisplayName.put(Component._Fields.OWNER_COUNTRY.getFieldName(), "owner country");
}

private static final List<Component._Fields> COMPONENT_IGNORED_FIELDS = ImmutableList.<Component._Fields>builder()
Expand Down
Expand Up @@ -59,6 +59,7 @@ public class ProjectExporter extends ExcelExporter<Project, ProjectHelper> {
nameToDisplayName.put(Project._Fields.PROJECT_OWNER.getFieldName(), "project owner");
nameToDisplayName.put(Project._Fields.OWNER_ACCOUNTING_UNIT.getFieldName(), "owner accounting unit");
nameToDisplayName.put(Project._Fields.OWNER_GROUP.getFieldName(), "owner group");
nameToDisplayName.put(Project._Fields.OWNER_COUNTRY.getFieldName(), "owner country");
}

private static final List<Project._Fields> PROJECT_IGNORED_FIELDS = ImmutableList.<Project._Fields>builder()
Expand Down
3 changes: 2 additions & 1 deletion libraries/lib-datahandler/src/main/thrift/components.thrift
Expand Up @@ -251,7 +251,8 @@ struct Component {
26: optional string componentOwner,
27: optional string ownerAccountingUnit,
28: optional string ownerGroup,
29: optional map<string,set<string>> roles, //customized roles with set of mail addresses
29: optional string ownerCountry,
30: optional map<string,set<string>> roles, //customized roles with set of mail addresses

// Linked objects
32: optional list<Release> releases,
Expand Down
1 change: 1 addition & 0 deletions libraries/lib-datahandler/src/main/thrift/projects.thrift
Expand Up @@ -97,6 +97,7 @@ struct Project {
130: optional string projectOwner,
131: optional string ownerAccountingUnit,
132: optional string ownerGroup,
133: optional string ownerCountry,

// Linked objects
30: optional map<string, ProjectRelationship> linkedProjects,
Expand Down
Expand Up @@ -125,6 +125,7 @@ public Sw360Module() {
"securityResponsiblesIterator",
"setSecurityResponsibles",
"setOwnerGroup",
"setOwnerCountry",
"rolesSize",
"setRoles",
"setOwnerAccountingUnit",
Expand Down Expand Up @@ -245,6 +246,7 @@ static abstract class UserMixin extends User {
"setComponentOwner",
"setOwnerAccountingUnit",
"setOwnerGroup",
"setOwnerCountry",
"rolesSize",
"setRoles"
})
Expand Down

0 comments on commit 716b6f1

Please sign in to comment.