-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Conversation
lib/ProductOpener/Web.pm
Outdated
|
||
=head2 display_my_block ( $request_ref ) | ||
|
||
The sidebar of home page consists of blocks. This function is used to to display one block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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 fromDisplay.pm
to new files likeWeb.pm
,Api.pm
, etcMoved the function display_my_block() from
Dispaly.pm
toWeb.pm
.Related to : #5205