Skip to content

Conversation

GMishx
Copy link
Member

@GMishx GMishx commented Mar 28, 2019

Description

Currently, if an upload contains a folder with only one file in it, the License Browser does not show the license findings and decisions.

Changes

The UI currently changes the file name if such case occurs.

Now other parameters are also updated at the same time using new function updateTheFindingsAndDecisions (reusing the old code).

How to test

  1. Install current master branch.
  2. Upload a package with a folder containing single file.
  3. Check the parent folder using the License Browser.
    • The license findings and decisions will be missing.
  4. Install the fix and browse the same upload.
    1. It should show the findings.
    2. The flat view should not be effected.
    3. The other features links ([View][Info][Download][Tag][Edit]) on the right should not be effected.

@ghost ghost assigned GMishx Mar 28, 2019
@ghost ghost added the needs code review label Mar 28, 2019
@GMishx GMishx removed their assignment Mar 28, 2019
@mcjaeger mcjaeger self-assigned this Apr 22, 2019
@shaheemazmalmmd
Copy link
Member

@GMishx : i have tested this branch with classic zlib package. But was not successful with corrections you have made.

Find the screenshot below.

ScreenShotOfExample

@GMishx GMishx added the has merge conflicts PR to be rebased label Apr 23, 2019
@mcjaeger mcjaeger removed their assignment Apr 23, 2019
@GMishx
Copy link
Member Author

GMishx commented Apr 29, 2019

The code changes works if a folder contains a file. In such cases, the parent of the file is the actual folder in the uploadtree.

But if the parent of the file is a PDF (as in your test case), the parent of the file becomes artifact.dir (since PDFs are extracted by ununpack) and thus the code fails as there is no pfile entry for artifact.dir.

So, the parent of package.qpg is qnx folder which exists in the pfile and uploadtree table. But the parent of zlib.3 is artifact.dir which in turn has parent zlib.3.pdf and artifact.dir exists only in uploadtree and not in pfile table.

I will do some change to check if the parent is artifact.dir then get the next parent. It should fix the case.

Update the license findings and decisions if the folder contains
a single file.

Signed-off-by: Gaurav Mishra <[email protected]>
@GMishx GMishx force-pushed the fix/ui/single-file-folder branch from 9beb418 to 40defdb Compare April 29, 2019 05:47
@ghost ghost assigned GMishx Apr 29, 2019
@GMishx GMishx removed the has merge conflicts PR to be rebased label Apr 29, 2019
@GMishx GMishx removed their assignment Apr 29, 2019
@GMishx GMishx requested a review from shaheemazmalmmd April 29, 2019 05:48
Copy link
Member

@shaheemazmalmmd shaheemazmalmmd left a comment

Choose a reason for hiding this comment

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

Code looks good. works as expected.

@shaheemazmalmmd shaheemazmalmmd merged commit 2e109e8 into fossology:master Apr 30, 2019
@ghost ghost removed the ready label Apr 30, 2019
@GMishx GMishx deleted the fix/ui/single-file-folder branch April 30, 2019 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants