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

dev(components): hide inaccessible projects in component summary #808

Merged
merged 1 commit into from
Apr 6, 2018

Conversation

maierthomas
Copy link
Contributor

@maierthomas maierthomas commented Apr 4, 2018

  • hide inaccessible projects in the "is used by the following" section for a component
  • add usage count of linked projects (allUsingProjectsCount)

closes #805

Copy link
Member

@maxhbr maxhbr left a 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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections::singleton

Copy link
Contributor Author

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;
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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.

@maierthomas maierthomas force-pushed the dev/805-using-projects-summary branch from ee58880 to 25bd3c9 Compare April 4, 2018 14:47
@maierthomas maierthomas force-pushed the dev/805-using-projects-summary branch 2 times, most recently from ee49114 to 0f02cf4 Compare April 5, 2018 07:09
@mcjaeger
Copy link
Contributor

mcjaeger commented Apr 5, 2018

tested-by:michael.c.jaeger@siemens.com

@maierthomas maierthomas force-pushed the dev/805-using-projects-summary branch 5 times, most recently from 26f0a50 to 0454cbd Compare April 5, 2018 13:46
@maierthomas
Copy link
Contributor Author

maierthomas commented Apr 5, 2018

@mcjaeger updated branch again,
can you please redeploy on stage for test purpose?

  • added same behavior for project detailView - usingProjects for projects

@maierthomas maierthomas force-pushed the dev/805-using-projects-summary branch 3 times, most recently from bdc2a3c to 61963d9 Compare April 6, 2018 16:33
- hide inaccessible projects in the "is used by the following" section
- add usage count of linked projects
@maierthomas maierthomas force-pushed the dev/805-using-projects-summary branch from 61963d9 to 4fc3300 Compare April 6, 2018 16:41
@maierthomas
Copy link
Contributor Author

maierthomas commented Apr 6, 2018

tested successfully on local and siemens test instance

@maierthomas maierthomas merged commit a183488 into master Apr 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding usage count of releases in addition to searchByReleaseId in Projects.thrift
3 participants