fossology / FOSSologyUI

Repository to hold the new UI framework for FOSSology built with React
https://fossology.github.io/FOSSologyUI/
GNU General Public License v2.0
49 stars 88 forks source link

feat(reuse): add all reuse options and update corresponding api #128

Closed Aman-Codes closed 3 years ago

Aman-Codes commented 3 years ago

Description

Closes #89 Closes #130

Changes

Screenshots

image

How to test

Test upload from file page

github-actions[bot] commented 3 years ago

This pull request has conflicts, please rebase to resolve those before we can evaluate the pull request.

GMishx commented 3 years ago

During testing, I noticed that if I change group from "Select the reuse group", there is a call to /uploads and /folders which is good but when I change folder, there is call to /folders instead of /uploads because of which the upload list does not updates. So please fix that and please add recursive=false to /folders calls to limit uploads to that folder only and not it's child folders.

Also, in case there is no upload in a folder, I see "No Data" in the drop-down. Can it be changed to "No Uploads" instead?

Aman-Codes commented 3 years ago

@GMishx Updated it

GMishx commented 3 years ago

While testing, the UI works fine for /upload/file but for /jobs/scheduleAgents, I am unable to change upload from drop-down.

Following errors are the in console.

Warning: Failed prop type: The prop `reuse.reuseUpload` is marked as required in `CommonFields`, but its value is `undefined`.
CommonFields@http://localhost:3000/static/js/main.chunk.js:5261:22
ScheduleAgents@http://localhost:3000/static/js/main.chunk.js:13434:113
div
Route@http://localhost:3000/static/js/vendors~main.chunk.js:199331:29
PrivateLayout@http://localhost:3000/static/js/main.chunk.js:22099:23
C@http://localhost:3000/static/js/vendors~main.chunk.js:199588:31
Switch@http://localhost:3000/static/js/vendors~main.chunk.js:199533:29
Router@http://localhost:3000/static/js/vendors~main.chunk.js:198966:30
BrowserRouter@http://localhost:3000/static/js/vendors~main.chunk.js:198586:35
Routes
Ge@http://localhost:3000/static/js/vendors~main.chunk.js:219326:67
GlobalProvider@http://localhost:3000/static/js/main.chunk.js:7353:24
App@http://localhost:3000/static/js/main.chunk.js:155:63
r@http://localhost:3000/static/js/vendors~main.chunk.js:194956:19 index.js:1
Warning: Failed prop type: The prop `reuse.reuseUpload` is marked as required in `UploadReuse`, but its value is `undefined`.
UploadReuse@http://localhost:3000/static/js/main.chunk.js:4922:21
CommonFields@http://localhost:3000/static/js/main.chunk.js:5261:22
form
div
div
div
ScheduleAgents@http://localhost:3000/static/js/main.chunk.js:13434:113
div
Route@http://localhost:3000/static/js/vendors~main.chunk.js:199331:29
PrivateLayout@http://localhost:3000/static/js/main.chunk.js:22099:23
C@http://localhost:3000/static/js/vendors~main.chunk.js:199588:31
Switch@http://localhost:3000/static/js/vendors~main.chunk.js:199533:29
Router@http://localhost:3000/static/js/vendors~main.chunk.js:198966:30
BrowserRouter@http://localhost:3000/static/js/vendors~main.chunk.js:198586:35
Routes
Ge@http://localhost:3000/static/js/vendors~main.chunk.js:219326:67
GlobalProvider@http://localhost:3000/static/js/main.chunk.js:7353:24
App@http://localhost:3000/static/js/main.chunk.js:155:63
r@http://localhost:3000/static/js/vendors~main.chunk.js:194956:19 index.js:1
Warning: Received NaN for the `value` attribute. If this is expected, cast the value to a string.
select
div
InputContainer@http://localhost:3000/static/js/main.chunk.js:6017:24
div
UploadReuse@http://localhost:3000/static/js/main.chunk.js:4922:21
CommonFields@http://localhost:3000/static/js/main.chunk.js:5261:22
form
div
div
div
ScheduleAgents@http://localhost:3000/static/js/main.chunk.js:13434:113
div
Route@http://localhost:3000/static/js/vendors~main.chunk.js:199331:29
PrivateLayout@http://localhost:3000/static/js/main.chunk.js:22099:23
C@http://localhost:3000/static/js/vendors~main.chunk.js:199588:31
Switch@http://localhost:3000/static/js/vendors~main.chunk.js:199533:29
Router@http://localhost:3000/static/js/vendors~main.chunk.js:198966:30
BrowserRouter@http://localhost:3000/static/js/vendors~main.chunk.js:198586:35
Routes
Ge@http://localhost:3000/static/js/vendors~main.chunk.js:219326:67
GlobalProvider@http://localhost:3000/static/js/main.chunk.js:7353:24
App@http://localhost:3000/static/js/main.chunk.js:155:63
r@http://localhost:3000/static/js/vendors~main.chunk.js:194956:19 index.js:1
Aman-Codes commented 3 years ago

e.target.value always returns string, even for numeric values. Updated the handleChange function for it now