-
Notifications
You must be signed in to change notification settings - Fork 20
dev(components): hide inaccessible projects in component summary #808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with minor comments
Set<String> searchIds = queryForIdsAsValue("byreleaseid", id); | ||
|
||
return new HashSet<>((makeSummaryFromFullDocs(SummaryType.SHORT, filterAccessibleProjectsByIds(user, searchIds)))); | ||
Set<String> ids = new HashSet<>(Arrays.asList(id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collections::singleton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
@@ -760,19 +761,21 @@ private void prepareDetailView(RenderRequest request, RenderResponse response) { | |||
private void setUsingDocs(RenderRequest request, User user, ComponentService.Iface client, Set<String> releaseIds) { | |||
Set<Project> usingProjects = null; | |||
Set<Component> usingComponentsForComponent = null; | |||
int allUsingProjectsCount = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is -1
the fallback, instead of 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using -1
as fallback one could only fill it after line 769, i.e. if the call was successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, now I see https://github.com/sw360/sw360portal/pull/808/files#diff-e8bd4c4dc1849fc1be46b0781739dcd5R13. I think that this is not the nicest way of handling exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usingProjectTable
evalutes the value of allUsingProjectsCount
.
You are right, its not the best way of handling exceptions.
setUsingDocs
should throw the exception instead of only logging it.
But I dont want to refactor this method here.
ee58880
to
25bd3c9
Compare
ee49114
to
0f02cf4
Compare
tested-by:michael.c.jaeger@siemens.com |
26f0a50
to
0454cbd
Compare
@mcjaeger updated branch again,
|
bdc2a3c
to
61963d9
Compare
- hide inaccessible projects in the "is used by the following" section - add usage count of linked projects
61963d9
to
4fc3300
Compare
tested successfully on local and siemens test instance |
allUsingProjectsCount
)closes #805