Skip to content

Conversation

Charishma0249
Copy link
Contributor

@Charishma0249 Charishma0249 commented Oct 8, 2021

Files

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

(you can copy the ticket if it hasn't changed)

Right now, if a user has uploaded a file to Citesphere, they can download the originally uploaded file. However, all the files that Giles creates (extracted text, OCR, individual pages) can't be downloaded. Basically, the user should be able to do that. Maybe a new modal opens or a new page if the user clicks on a file and it shows all the files that belong to the upload. The user can then choose a file to download.

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

@jdamerow
Copy link
Member

jdamerow commented Jan 5, 2022

Make it so, Jenkins.

@diging-jenkins
Copy link

Jenkins successfully deployed Citesphere to be reviewed!

@jdamerow
Copy link
Member

jdamerow commented Jan 5, 2022

  • clicking on the extracted text throws a not found error (pdf works)
  • and also, all the extracted pages are missing, e.g. for the pdf I've uploaded:
    image

@jdamerow jdamerow closed this Jan 5, 2022
@Charishma0249
Copy link
Contributor Author

Addressed review comments

@Charishma0249 Charishma0249 reopened this Mar 3, 2022
@diging-jenkins
Copy link

Jenkins successfully deployed Citesphere to be reviewed!


ICitation citation = citationManager.getCitation(itemId);
Optional<IGilesUpload> uploadOptional = citation.getGilesUploads().stream().filter(u -> u.getUploadedFile() != null).filter(g -> g.getUploadedFile().getId().equals(fileId)).findFirst();
Optional<IGilesUpload> uploadOptional = citation.getGilesUploads().stream().filter(u -> u.getUploadedFile() != null).filter(g -> g.getUploadedFile().getId().equals(fileId) || g.getExtractedText().getId().equals(fileId) || g.getPages().stream().filter(p -> p!=null).anyMatch(a -> a.getImage().getId().equals(fileId) || a.getText().getId().equals(fileId) || a.getOcr().getId().equals(fileId) || a.getAdditionalFiles().stream().filter(f -> f!=null).anyMatch(f -> f.getId().equals(fileId)))).findFirst();
Copy link
Member

Choose a reason for hiding this comment

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

at the minimum this line needs to be reformatted (it's way too long). Even better would be to rewrite it so it's clearer what it does.

@jdamerow
Copy link
Member

Make it so, Jenkins.

@diging-jenkins
Copy link

Jenkins successfully deployed Citesphere to be reviewed!

@jdamerow
Copy link
Member

On the front end, the module should have the structure:

  • Uploaded file: filename
  • Extracted text: filename
  • Page 1
    • Image: filename
    • Extracted text: filename
    • OCR: filename
  • Page 2
    • ...

etc.

@jdamerow jdamerow closed this Mar 17, 2022
@diya17 diya17 reopened this Oct 10, 2023
@diging-jenkins
Copy link

Jenkins successfully deployed Citesphere to be reviewed!

}


private static Stream<IGilesFile> generateStream(List<IGilesUpload> uploadOptionalList) {
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 this method static?

$("#viewUploadBody modal-body page-title").empty();
$("#viewUploadBody modal-body page-list").empty();
}); */
Copy link
Member

Choose a reason for hiding this comment

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

delete if not needed

/* $(uploadItem).children().each(function() {
// Clear content of each child element
$('#page-list').empty();
}); */
Copy link
Member

Choose a reason for hiding this comment

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

delete if not needed

function showFiles(modalName, item) {

var uploadItem = $(item);
var modalNameLCase = modalName.toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

indentation

</div>
</div>
</div>

Copy link
Member

Choose a reason for hiding this comment

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

I think all of these can be simplified by just creating a model for each upload and then show/hide those modals when the user clicks on an upload in the list. There is not javascript really needed (beyond opening/closing the modal).

@jdamerow jdamerow closed this Apr 2, 2024
@diging-jenkins
Copy link

Jenkins successfully deployed Citesphere to be reviewed!

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.

6 participants