Skip to content

Commit 94727fd

Browse files
Prepares plugin to be sent to PKP plugin gallery
Issue: documentacao-e-tarefas/scielo#135 Signed-off-by: Iudi <iudi@lepidus.com.br> Signed-off-by: Jhon <jhon@lepidus.com.br>
1 parent 191f796 commit 94727fd

7 files changed

Lines changed: 20 additions & 21 deletions

File tree

.github/workflows/generate-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
mkdir $PLUGIN_NAME
2020
ls -la
2121
shopt -s extglob
22-
cp -r !($PLUGIN_NAME|.git*|.|..) $PLUGIN_NAME
22+
cp -r !($PLUGIN_NAME|.git*|tests|.|..) $PLUGIN_NAME
2323
ls -la
2424
tar -zcvf $PLUGIN_NAME.tar.gz $PLUGIN_NAME
2525
ls -la

PluginUpdateNotificationPlugin.inc.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* @file plugins/reports/scieloSubmissions/PluginUpdateNotificationPlugin.inc.php
4+
* @file plugins/reports/pluginUpdateNotification/PluginUpdateNotificationPlugin.inc.php
55
*
66
* Copyright (c) 2021 Lepidus Tecnologia
77
* Copyright (c) 2021 SciELO
@@ -16,7 +16,7 @@
1616
import('lib.pkp.classes.plugins.GenericPlugin');
1717
import('plugins.generic.pluginUpdateNotification.classes.NotificationTranslator');
1818
import('plugins.generic.pluginUpdateNotification.classes.NotificationTranslatorPKP');
19-
import('plugins.generic.pluginUpdateNotification.classes.UpdateNotificationPlugin');
19+
import('plugins.generic.pluginUpdateNotification.classes.PluginUpdateNotification');
2020

2121
class PluginUpdateNotificationPlugin extends GenericPlugin {
2222
public function register($category, $path, $mainContextId = NULL) {
@@ -31,8 +31,8 @@ public function register($category, $path, $mainContextId = NULL) {
3131

3232
return $success;
3333
}
34-
35-
public function getDisplayName() {
34+
35+
public function getDisplayName() {
3636
return __('plugins.generic.pluginUpdateNotification.displayName');
3737
}
3838

@@ -49,7 +49,7 @@ public function checkUpdatesPlugins($hookName, $params) {
4949

5050
if(!empty($updatePluginsNames)) {
5151
$tradutor = new NotificationTranslatorPKP();
52-
$notification = new UpdateNotificationPlugin($updatePluginsNames, $tradutor);
52+
$notification = new PluginUpdateNotification($updatePluginsNames, $tradutor);
5353
$smarty->assign([
5454
'notificationText' => $notification->getNotificationText($locale)
5555
]);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
class UpdateNotificationPlugin {
4-
private $updatePlugins;
3+
class PluginUpdateNotification {
4+
private $upgradeablePlugins;
55
private $translator;
66

77
public function __construct($listPlugins, $translator) {
8-
$this->updatePlugins = $listPlugins;
8+
$this->upgradeablePlugins = $listPlugins;
99
$this->translator = $translator;
1010
}
1111

1212
public function getNotificationText($locale) {
13-
$stringPlugins = implode(", ", $this->updatePlugins);
13+
$stringPlugins = implode(", ", $this->upgradeablePlugins);
1414
$notificationText = $this->translator->translate('plugins.generic.pluginUpdateNotification.messageNotification', $locale, ['stringPlugins' => $stringPlugins]);
1515

1616
return $notificationText;

classes/autoload.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function($class) {
77
static $classes = null;
88
if ($classes === null) {
99
$classes = array(
10-
'updatenotificationplugin' => '/UpdateNotificationPlugin.inc.php',
10+
'pluginupdatenotification' => '/PluginUpdateNotification.inc.php',
1111
'notificationtranslator' => '/NotificationTranslator.inc.php',
1212
'notificationtranslatortests' => '/NotificationTranslatorTests.inc.php',
1313
'notificationtranslatorpkp' => '/NotificationTranslatorPKP.inc.php',

index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

33
/**
4-
* @defgroup plugins_generic_PluginUpdateNotification Plugin Update Notification Plugin
4+
* @defgroup plugins_generic_pluginUpdateNotification Plugin Update Notification Plugin
55
*/
6-
6+
77
/**
8-
* @file plugins/reports/scieloSubmissions/index.php
8+
* @file plugins/reports/pluginUpdateNotification/index.php
99
*
1010
* Copyright (c) 2021 Lepidus Tecnologia
1111
* Copyright (c) 2021 SciELO

tests/NotificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ class NotificationTest extends TestCase {
99

1010
public function testOneNotificationUpdate(): void {
1111
$translatorTests = new NotificationTranslatorTests();
12-
$notification = new UpdateNotificationPlugin($this->oneUpdatePlugins, $translatorTests);
12+
$notification = new PluginUpdateNotification($this->oneUpdatePlugins, $translatorTests);
1313
$expectedText = "Os seguintes plugins possuem atualizações disponíveis: ORCID Profile";
1414
$this->assertEquals($expectedText, $notification->getNotificationText('pt_BR'));
1515
}
1616

1717
public function testManyNotificationUpdates(): void {
1818
$translatorTests = new NotificationTranslatorTests();
19-
$notification = new UpdateNotificationPlugin($this->manyUpdatePlugins, $translatorTests);
19+
$notification = new PluginUpdateNotification($this->manyUpdatePlugins, $translatorTests);
2020
$expectedText = "Os seguintes plugins possuem atualizações disponíveis: ORCID Profile, Backup, Default Translation";
2121
$this->assertEquals($expectedText, $notification->getNotificationText('pt_BR'));
2222
}
2323

2424
public function testOneNotificationUpdateTranslated(): void {
2525
$translatorTests = new NotificationTranslatorTests();
26-
$notification = new UpdateNotificationPlugin($this->oneUpdatePlugins, $translatorTests);
26+
$notification = new PluginUpdateNotification($this->oneUpdatePlugins, $translatorTests);
2727
$expectedText = "The following plugins have updates available: ORCID Profile";
2828
$this->assertEquals($expectedText, $notification->getNotificationText('en_US'));
2929
}
3030

3131
public function testManyUpdateNotificationTranslated(): void {
3232
$translatorTests = new NotificationTranslatorTests();
33-
$notification = new UpdateNotificationPlugin($this->manyUpdatePlugins, $translatorTests);
33+
$notification = new PluginUpdateNotification($this->manyUpdatePlugins, $translatorTests);
3434
$expectedText = "The following plugins have updates available: ORCID Profile, Backup, Default Translation";
3535
$this->assertEquals($expectedText, $notification->getNotificationText('en_US'));
3636
}

version.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
<application>pluginUpdateNotification</application>
1414
<type>plugins.generic</type>
1515
<lazy-load>0</lazy-load>
16-
<release>1.1.0.0</release>
17-
<date>2021-02-25</date>
16+
<release>1.2.0.0</release>
17+
<date>2021-05-19</date>
1818
<class>PluginUpdateNotificationPlugin</class>
1919
</version>
20-

0 commit comments

Comments
 (0)