-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from krishna9304/ui/reportImport
feat(ui): Added logical components to the report import page and Integrated the API Reviewed-by: [email protected] Tested-by: [email protected]
- Loading branch information
Showing
9 changed files
with
228 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright (C) 2022 Soham Banerjee([email protected]) | ||
Copyright (C) 2022 Soham Banerjee([email protected]), Krishna Mahato ([email protected]) | ||
SPDX-License-Identifier: GPL-2.0 | ||
|
@@ -80,6 +80,11 @@ export const actionsOptions = [ | |
name: "Export Unified Report", | ||
reportFormat: "unifiedreport", | ||
}, | ||
{ | ||
id: 6, | ||
name: "Import Report", | ||
reportFormat: "importReport", | ||
}, | ||
]; | ||
export const initialMessage = { | ||
type: "success", | ||
|
@@ -139,16 +144,16 @@ export const initialFolderListFile = [ | |
]; | ||
// constants for upload/ImportReport | ||
export const initialStateImportReport = { | ||
folder: "", | ||
editUpload: "", | ||
reportUpload: "", | ||
newLicense: "licenseCanditate", | ||
licenseInfoInFile: true, | ||
licenseConcluded: false, | ||
licenseDecision: true, | ||
existingDecisions: true, | ||
importDiscussed: true, | ||
copyright: false, | ||
folder: 1, | ||
upload: "", | ||
report: null, | ||
addNewLicensesAs: "candidate", | ||
addConcludedAsDecisions: true, | ||
addLicenseInfoFromInfoInFile: true, | ||
addLicenseInfoFromConcluded: false, | ||
addConcludedAsDecisionsOverwrite: true, | ||
addConcludedAsDecisionsTBD: true, | ||
addCopyrights: false, | ||
}; | ||
|
||
// constants for upload/UploadFromServer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright (C) 2021 Aman Dwivedi ([email protected]), Shruti Agarwal ([email protected]) | ||
Copyright (C) 2022 Krishna Mahato <[email protected]> | ||
SPDX-License-Identifier: GPL-2.0 | ||
|
@@ -27,7 +28,7 @@ const routes = { | |
server: "/upload/server", | ||
url: "/upload/url", | ||
vcs: "/upload/vcs", | ||
report: "/upload/report", | ||
importReport: "/upload/reportImport", | ||
instructions: "/upload/instructions", | ||
oneShotAnalysis: "/upload/oneShotAnalysis", | ||
oneShotCopyright: "/upload/oneShotCopyright", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
Copyright (C) 2021 Shruti Agarwal ([email protected]), Aman Dwivedi ([email protected]), | ||
Copyright (C) 2022 Soham Banerjee ([email protected]) | ||
Copyright (C) 2022 Soham Banerjee ([email protected]), Krishna Mahato ([email protected]) | ||
SPDX-License-Identifier: GPL-2.0 | ||
|
@@ -19,7 +19,7 @@ | |
|
||
import React, { useState, useEffect } from "react"; | ||
import routes from "constants/routes"; | ||
import { Link } from "react-router-dom"; | ||
import { Link, useHistory } from "react-router-dom"; | ||
import arrayToTree from "array-to-tree"; | ||
import messages from "constants/messages"; | ||
|
||
|
@@ -79,6 +79,8 @@ const Browse = () => { | |
const [query, setQuery] = useState(""); | ||
const [pages, setPages] = useState(); | ||
|
||
const history = useHistory(); | ||
|
||
useEffect(() => { | ||
setMessage({ | ||
type: "success", | ||
|
@@ -146,6 +148,12 @@ const Browse = () => { | |
}; | ||
|
||
const handleActionChange = (e, uploadId) => { | ||
if (e.target.value === "importReport") { | ||
history.push( | ||
`/upload/reportImport?folder=${browseData.folderId}&upload=${uploadId}` | ||
); | ||
return; | ||
} | ||
scheduleReport(uploadId, e.target.value) | ||
.then((res) => { | ||
return res?.message; | ||
|
Oops, something went wrong.