Skip to content
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

Moved the function display_my_block() to Web.pm #5435

Merged
merged 4 commits into from
Aug 10, 2021

Conversation

roshnaeem
Copy link
Contributor

Description:

"Re-architecturing the Open Food Facts Perl modules and functions, possibly making some of them more generic and publishing them on CPAN."
Specifically, Display.pm is way too big, and it's very difficult to understand what all the functions do. Trying to move the functions from Display.pm to new files like Web.pm, Api.pm, etc

Moved the function display_my_block() from Dispaly.pm to Web.pm.

Related to : #5205


=head2 display_my_block ( $request_ref )

The sidebar of home page consists of blocks. This function is used to to display one block.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The sidebar of home page consists of blocks. This function is used to to display one block.
The sidebar of home page consists of blocks. This function is used to to display one block with information and links related to the logged in user.

@@ -41,14 +41,37 @@ use utf8;
use Exporter qw(import);

use ProductOpener::Display qw/:all/;
use ProductOpener::Store qw(:all);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need all those modules?

One thing that would be very nice to do is to remove the circular dependencies that we currently have (module A that use module B, and module B that uses module A). So we should only use the minimum set of modules that are actually used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added them because we are gonna need them for the next functions we are gonna move to Web.pm. Also, I was not sure where $server_options is present.

Copy link
Contributor

Choose a reason for hiding this comment

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

$server_options is imported from Config.pm

@sonarcloud
Copy link

sonarcloud bot commented Aug 9, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Thanks!

@stephanegigandet stephanegigandet merged commit a4d8ede into openfoodfacts:main Aug 10, 2021
@roshnaeem roshnaeem deleted the web.pm-2 branch August 10, 2021 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants