Skip to content

[OMP] [stable-3_4_0] Port the CSV importexport tool for OMP 3.4 #1828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: stable-3_4_0
Choose a base branch
from

Conversation

Godoy0722
Copy link
Contributor

Describe the feature

This PR is intended to port the native CSV Importexport tool for submissions on OMP 3.4.

@Godoy0722
Copy link
Contributor Author

Hello @asmecher . Just a heads-up that I made the porting for this tool and it's ready to be reviewed!

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is sample data that should be excluded from the pull request

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is sample data that should be excluded from the pull request


class CachedEntities
{

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@kaitlinnewson
Copy link
Member

Hi @Godoy0722, I've added a few initial comments above. I also noticed that tabs are being used to indent in many files, but should be converted to spaces, and there are a few files with added blank lines at the end to remove.

I was wondering about the decision to break the code down into many small classes with a single function (e.g. all of the processors here). To me it makes the code more difficult to read and maintain, but interested to know your take on it.

@Godoy0722
Copy link
Contributor Author

Hello, @kaitlinnewson. I just updated the code to match your requests. I was trying to refactor the code in a way we could see the separated processings or at a later moment, reuse this code in different ways. But if you think it won't be necessary I can undo this refactoring and put it all inside the base code again and maybe keep only the validations in a different code. What do you think about it?

@Godoy0722
Copy link
Contributor Author

Hello @kaitlinnewson , just want to know if is there anything else you like to add or something else you'd like for me to do, or if is everything ok with this PR.

/**
* @copydoc Plugin::getDisplayName()
*/
function getDisplayName() {
Copy link
Member

Choose a reason for hiding this comment

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

Missing visibility (public) for function (and in more functions below).

$bookCoverImageSaved = $this->fileManager->copyFile($srcFilePath, $destFilePath);

if (!$bookCoverImageSaved) {
$reason = __('plugin.importexport.csv.erroWhileSavingBookCoverImage');
Copy link
Member

@kaitlinnewson kaitlinnewson Mar 27, 2025

Choose a reason for hiding this comment

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

Suggested change
$reason = __('plugin.importexport.csv.erroWhileSavingBookCoverImage');
$reason = __('plugin.importexport.csv.errorWhileSavingBookCoverImage');

msgid "pugin.importexport.csv.missingHeadersOnCsv"
msgstr "The following headers are missing in your CSV file: \"{$missingHeaders}\". Please update it as shown in the sample.csv file."

msgid "plugin.importexport.csv.erroWhileSavingBookCoverImage"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
msgid "plugin.importexport.csv.erroWhileSavingBookCoverImage"
msgid "plugin.importexport.csv.errorWhileSavingBookCoverImage"

Copy link
Member

Choose a reason for hiding this comment

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

A small formatting issue in this file - should be indented with tabs rather than spaces

@kaitlinnewson
Copy link
Member

Hi @Godoy0722, sorry for the delay in replying. I find that having many classes/functions (and a lot that are only used in one place) makes it a bit harder to understand the code, but I think a second review on this would be helpful from someone with more experience with these kinds of code design questions.

@kaitlinnewson
Copy link
Member

Hi @jonasraoni, would you have time to do a second review on this?

Godoy0722 and others added 2 commits April 28, 2025 11:55
Suggested by Kaitlin, commited by Guilherme

Co-authored-by: Kaitlin Newson <[email protected]>
Suggested by Kaitlin, commited by Guilherme

Co-authored-by: Kaitlin Newson <[email protected]>
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.

2 participants