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

Show install all plugins button on Manage Plugins and License key section #22615

Open
wants to merge 2 commits into
base: 5.x-dev
Choose a base branch
from

Conversation

AltamashShaikh
Copy link
Contributor

Description:

Add code to show install all plugins button on Manage Plugins and License key section
Fixes: #PG-3698

Review

@@ -227,6 +229,32 @@ public function removePluginTrialRequest(string $pluginName): void
}
}

public function isInstallAllPaidPluginsVisible(): bool
{
$consumer = StaticContainer::get('Piwik\Plugins\Marketplace\Consumer');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To test add below code

Suggested change
$consumer = StaticContainer::get('Piwik\Plugins\Marketplace\Consumer');
return true;
$consumer = StaticContainer::get('Piwik\Plugins\Marketplace\Consumer');


public function getPaidPluginsToInstallAtOnce(): array
{
$plugins = StaticContainer::get('Piwik\Plugins\Marketplace\Plugins');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To test also add this here

Suggested change
$plugins = StaticContainer::get('Piwik\Plugins\Marketplace\Plugins');
return ['ActivityLog'];
$plugins = StaticContainer::get('Piwik\Plugins\Marketplace\Plugins');

@sgiehl sgiehl changed the title Add code to show install all plugins button on Manage Plugins and License key section, #PG-3698 Show install all plugins button on Manage Plugins and License key section Sep 25, 2024
Copy link
Contributor

If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Oct 10, 2024
@AltamashShaikh AltamashShaikh requested review from sgiehl and michalkleiner and removed request for sgiehl October 29, 2024 01:54
@AltamashShaikh AltamashShaikh added the Needs Review PRs that need a code review label Oct 29, 2024
@AltamashShaikh AltamashShaikh marked this pull request as ready for review October 30, 2024 02:06
@AltamashShaikh AltamashShaikh removed the Stale The label used by the Close Stale Issues action label Oct 30, 2024
@AltamashShaikh
Copy link
Contributor Author

@matomo-org/core-reviewers Can anyone check this ?

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

Left some comments. Otherwise aren't there any UI tests we can adjust or add to have that covered somehow?

@@ -38,15 +44,23 @@ import {
translate,
MatomoUrl,
} from 'CoreHome';
import InstallAllPaidPluginsButton from '../../../../Marketplace/vue/src/InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue';
Copy link
Member

Choose a reason for hiding this comment

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

We should only reference that relative, if it is within the same plugin. Here simply importing it from Marketplace should also work.

Comment on lines +256 to +258
$view->isInstallAllPaidPluginsVisible = $marketplace->isInstallAllPaidPluginsVisible();
$view->paidPluginsToInstallAtOnce = $marketplace->getPaidPluginsToInstallAtOnce();
$view->installAllPluginsNonce = Nonce::getNonce(\Piwik\Plugins\Marketplace\Controller::INSTALL_NONCE);
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if it might be smarter to change the InstallButton component to fetch all required information through a ajax request to a controller action (NOT api, due to the required token) instead of passing that through all controllers, views and vue components. Would be an additional request, but imho a lot simpler to reuse everywhere.

Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review Stale The label used by the Close Stale Issues action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants