Skip to content

Commit

Permalink
Merge pull request #12049 from aembler/marketplace-migration-9.2.x
Browse files Browse the repository at this point in the history
9.2: Marketplace Update Notification
  • Loading branch information
aembler committed May 7, 2024
2 parents b176973 + 96af1e6 commit 9b5ba15
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 52 deletions.
10 changes: 0 additions & 10 deletions concrete/blocks/desktop_featured_addon/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,5 @@ public function getBlockTypeName()
*/
public function view()
{
$mri = new MarketplaceRemoteItemList();
$mri->sortBy('recommended');
$mri->setItemsPerPage(1);
$mri->filterByCompatibility(1);
$mri->setType('addons');
$mri->execute();
$items = $mri->getPage();
if (isset($items[0]) && is_object($items[0])) {
$this->set('remoteItem', $items[0]);
}
}
}
10 changes: 4 additions & 6 deletions concrete/blocks/desktop_featured_addon/view.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php defined('C5_EXECUTE') or die('Access Denied.'); ?>
<?php if (isset($remoteItem) && is_object($remoteItem)) { ?>

<div class="ccm-block-desktop-featured-addon">
<div class="ccm-block-desktop-featured-addon-inner">

<h6><?=t('Featured Add-On')?></h6/>

<img src="<?=$remoteItem->getRemoteIconURL()?>" width="80" height="80" />
<h3><?=$remoteItem->getName()?></h3>
<p><?=$remoteItem->getDescription()?></p>
<a href="<?=$remoteItem->getRemoteURL()?>" class="btn btn-primary"><?=t('Learn More')?></a>
<img src="<?=ASSETS_URL_IMAGES?>/marketplace_upgrade_addon.png" width="80" height="80" />
<h3><?=t('Connect to the new marketplace!')?></h3>
<p><?=t("This version of Concrete can't connect to the latest marketplace. You should update to version 9.3 to enjoy one-click marketplace integration.")?></p>
<a target="_blank" href="https://www.concretecms.com/about/new-marketplace" class="btn btn-secondary btn-lg"><?=t('Learn More')?></a>

</div>
</div>

<?php } ?>
11 changes: 1 addition & 10 deletions concrete/blocks/desktop_featured_theme/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ public function getBlockTypeName()
*/
public function view()
{
$mri = new MarketplaceRemoteItemList();
$mri->sortBy('recommended');
$mri->filterByCompatibility(1);
$mri->setItemsPerPage(1);
$mri->setType('themes');
$mri->execute();
$items = $mri->getPage();
if (isset($items[0]) && is_object($items[0])) {
$this->set('remoteItem', $items[0]);
}

}
}
28 changes: 11 additions & 17 deletions concrete/blocks/desktop_featured_theme/view.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<?php defined('C5_EXECUTE') or die('Access Denied.'); ?>
<?php if (isset($remoteItem) && is_object($remoteItem)) { ?>

<div class="ccm-block-desktop-featured-theme">
<div class="ccm-block-desktop-featured-theme-inner">
<div class="ccm-block-desktop-featured-theme">
<div class="ccm-block-desktop-featured-theme-inner" style="display: flex">

<img src="<?=$remoteItem->getLargeThumbnail()->src?>" style="height: 250px" />
<img src="<?=ASSETS_URL_IMAGES?>/marketplace_upgrade_theme.png" style="height: 250px; border-right: 0"/>

<div class="ccm-block-desktop-featured-theme-description">
<div class="ccm-block-desktop-featured-theme-description">
<h6><?=t('Featured Theme')?></h6/>

<h6><?=t('Featured Theme')?></h6/>
<h3><?=t('Connect to the new marketplace!')?></h3>
<p><?=t("This version of Concrete can't connect to the latest marketplace. You should update to version 9.3 to enjoy one-click marketplace integration.")?></p>
<a target="_blank" href="https://www.concretecms.com/about/new-marketplace" class="btn btn-info"><?=t('Learn More')?></a>
</div>

<h3><?=$remoteItem->getName()?></h3>
<p><?=$remoteItem->getDescription()?></p>
<div class="btn-group">
<a href="<?=$remoteItem->getRemoteURL()?>" class="btn btn-primary active"><?=$remoteItem->getDisplayPrice()?></a>
<a href="<?=$remoteItem->getRemoteURL()?>" class="btn btn-primary"><?=t('Learn More')?></a>
</div>
</div>
</div>
</div>

</div>
</div>

<?php } ?>
6 changes: 3 additions & 3 deletions concrete/config/concrete.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*
* @var string
*/
'version' => '9.2.8',
'version_installed' => '9.2.8',
'version_db' => '20240122172319', // the key of the latest database migration
'version' => '9.2.9',
'version_installed' => '9.2.9',
'version_db' => '20240506191622', // the key of the latest database migration

/*
* Installation status
Expand Down
8 changes: 4 additions & 4 deletions concrete/elements/dashboard/marketplace_connect_failed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Marketplace\Marketplace;

$mi = Marketplace::getInstance();
if ($mi->hasConnectionError() && $mi->getConnectionError() == Marketplace::E_MARKETPLACE_SUPPORT_MANUALLY_DISABLED) {
?>
Expand All @@ -12,7 +13,7 @@
?>

<?php
if ($mi->hasConnectionError()) {
if ($mi->hasConnectionError() && $mi->getConnectionError() !== Marketplace::E_GENERAL_CONNECTION_ERROR) {
?>

<br>
Expand All @@ -39,11 +40,10 @@
?>
</div>

<?php echo $h->button(t('Troubleshoot Connection'), View::url('/dashboard/extend/connect'), '', 'btn-primary')?>
<?php

}
?>

<?php echo $h->button(t('Troubleshoot Connection'), View::url('/dashboard/extend/connect'), '', 'btn-primary')?>

<?php
} ?>
11 changes: 11 additions & 0 deletions concrete/elements/dashboard/marketplace_upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>

<div style="text-align: left">
<div><?=t("This version of Concrete can't connect to the latest marketplace. You should update to version 9.3 to enjoy one-click marketplace integration.")?></div>
<div style="margin-top: 2rem; text-align: center">
<a href="https://www.concretecms.com/about/new-marketplace" target="_blank" class="btn btn-primary"><?=t('Learn More')?></a>
</div>
</div>

Binary file added concrete/images/marketplace_upgrade_addon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added concrete/images/marketplace_upgrade_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions concrete/single_pages/dashboard/extend/connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


<?php
if ($marketplace->hasConnectionError()) { ?>
if ($marketplace->hasConnectionError() && $marketplace->getConnectionError() !== Marketplace::E_GENERAL_CONNECTION_ERROR) { ?>

<h4><?=t('Marketplace Error')?></h4>

Expand Down Expand Up @@ -89,7 +89,9 @@

<?php }

} ?>
}

if ($marketplace->getConnectionError() !== Marketplace::E_GENERAL_CONNECTION_ERROR) { ?>


<fieldset class="mb-3">
Expand Down Expand Up @@ -120,6 +122,14 @@
</div>
</div>

<?php } else {


View::element('dashboard/marketplace_upgrade');


} ?>

</form>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
namespace Concrete\Core\Announcement\Controller\Update;

use Concrete\Core\Announcement\Action\LearnMoreAction;
use Concrete\Core\Announcement\Action\VideoAction;
use Concrete\Core\Announcement\Button\LearnMoreButton;
use Concrete\Core\Announcement\Controller\AbstractController;
use Concrete\Core\Announcement\Icon\SvgIcon;
use Concrete\Core\Announcement\Item\StandardItem;
use Concrete\Core\Announcement\Slide\FeatureSlide;
use Concrete\Core\User\User;

class Version929Controller extends AbstractController
{

public function getSlides(User $user): array
{
return [
new FeatureSlide(
t('Coming Soon'), [
new StandardItem(
t('Get ready for the new Marketplace'),
t('The next minor version of Concrete will connect to a new marketplace experience providing high-quality themes, add-ons, and SaaS integrations.'),
),
new StandardItem(
t('Update your existing Add-ons & Themes Now'),
t('Take a quick look to apply any unapplied updates to your current extensions before May 15th.'),
[
new LearnMoreAction(DIR_REL . '/dashboard/extend/update')
],
),
new StandardItem(
t('9.2.9 Release Notes'),
t('Take a look at the changes that have been applied in the current version of Concrete.'),
[
new LearnMoreAction('https://documentation.concretecms.org/9-x/developers/introduction/version-history/929-release-notes')
],
),
],
new LearnMoreButton('https://documentation.concretecms.org/9-x/developers/introduction/version-history/929-release-notes', t('View Release Notes'))
)
];
}


}
6 changes: 6 additions & 0 deletions concrete/src/Announcement/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Concrete\Core\Announcement\Controller\CollectSiteInformationController;
use Concrete\Core\Announcement\Controller\Update\Version920Controller;
use Concrete\Core\Announcement\Controller\Update\Version929Controller;
use Concrete\Core\Application\Application;
use Concrete\Core\Announcement\Controller\WelcomeController;
use Concrete\Core\Support\Manager as CoreManager;
Expand All @@ -26,6 +27,11 @@ public function createConcreteVersion920Driver()
return $this->app->make(Version920Controller::class);
}

public function createConcreteVersion929Driver()
{
return $this->app->make(Version929Controller::class);
}

public function __construct(Application $application)
{
parent::__construct($application);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Concrete\Core\Updater\Migrations\Migrations;

use Concrete\Core\Announcement\AnnouncementService;
use Concrete\Core\Updater\Migrations\RepeatableMigrationInterface;
use Doctrine\DBAL\Schema\Schema;
use Concrete\Core\Updater\Migrations\AbstractMigration;

final class Version20240506191622 extends AbstractMigration implements RepeatableMigrationInterface
{

public function upgradeDatabase()
{
$service = $this->app->make(AnnouncementService::class);
$service->createAnnouncementIfNotExists('concrete_version_929');

}
}

0 comments on commit 9b5ba15

Please sign in to comment.