Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.

Commit de87189

Browse files
committed
Update to the latest version of KB
1 parent 53b4fe4 commit de87189

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Plugin.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ class Plugin extends Base
99
{
1010
public function initialize()
1111
{
12-
$this->on('app.bootstrap', function($container) {
13-
Translator::load($container['config']->getCurrentLanguage(), __DIR__.'/Locale');
14-
15-
$container['eventManager']->register(WebhookHandler::EVENT_COMMIT, t('Github commit received'));
16-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Github issue opened'));
17-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Github issue closed'));
18-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Github issue reopened'));
19-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE, t('Github issue assignee change'));
20-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_LABEL_CHANGE, t('Github issue label change'));
21-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Github issue comment created'));
22-
});
23-
2412
$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_ISSUE_COMMENT);
2513
$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_COMMIT);
2614
$this->actionManager->getAction('\Kanboard\Action\TaskAssignCategoryLabel')->addEvent(WebhookHandler::EVENT_ISSUE_LABEL_CHANGE);
@@ -35,6 +23,19 @@ public function initialize()
3523
$this->route->addRoute('/webhook/github/:project_id/:token', 'webhook', 'handler', 'GithubWebhook');
3624
}
3725

26+
public function onStartup()
27+
{
28+
Translator::load($this->language->getCurrentLanguage(), __DIR__.'/Locale');
29+
30+
$this->eventManager->register(WebhookHandler::EVENT_COMMIT, t('Github commit received'));
31+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Github issue opened'));
32+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Github issue closed'));
33+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Github issue reopened'));
34+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE, t('Github issue assignee change'));
35+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_LABEL_CHANGE, t('Github issue label change'));
36+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Github issue comment created'));
37+
}
38+
3839
public function getPluginName()
3940
{
4041
return 'Github Webhook';
@@ -52,7 +53,7 @@ public function getPluginAuthor()
5253

5354
public function getPluginVersion()
5455
{
55-
return '1.0.1';
56+
return '1.0.2';
5657
}
5758

5859
public function getPluginHomepage()

Template/project/integrations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h3><i class="fa fa-github fa-fw"></i>&nbsp;<?= t('Github webhooks') ?></h3>
22
<div class="listing">
33
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'handler', array('plugin' => 'GithubWebhook', 'token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/>
4-
<p class="form-help"><a href="http://kanboard.net/plugins/github-webhook" target="_blank"><?= t('Help on Github webhooks') ?></a></p>
5-
</div>
4+
<p class="form-help"><a href="https://kanboard.net/plugin/github-webhook" target="_blank"><?= t('Help on Github webhooks') ?></a></p>
5+
</div>

Test/PluginTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public function testPlugin()
1010
{
1111
$plugin = new Plugin($this->container);
1212
$this->assertSame(null, $plugin->initialize());
13+
$this->assertSame(null, $plugin->onStartup());
1314
$this->assertNotEmpty($plugin->getPluginName());
1415
$this->assertNotEmpty($plugin->getPluginDescription());
1516
$this->assertNotEmpty($plugin->getPluginAuthor());

0 commit comments

Comments
 (0)