-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from tanhongit/develop
Develop
- Loading branch information
Showing
10 changed files
with
87 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
'by' => 'by', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
return [ | ||
'issue_title' => '📢', | ||
'closed' => [ | ||
'title' => '🚫 <b>Issue Closed </b> to 🦑 :issue by :user', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
return [ | ||
'_body' => [ | ||
'title' => '📖 <b>Content:</b>', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
parameters: | ||
excludePaths: | ||
- src/Http/Actions/WebhookAction.php | ||
ignoreErrors: | ||
- message: '#Parameter \#2 \$namespace of method Illuminate\\Support\\ServiceProvider\:\:loadViewsFrom\(\) expects string, mixed given\.#' | ||
path: src/Providers/TelegramGitNotifierServiceProvider.php | ||
|
||
|
||
- message: '#Parameter \#1 \$token of method CSlant\\TelegramGitNotifier\\Webhook\:\:setToken\(\) expects string, mixed given\.#' | ||
path: src/Http/Actions/WebhookAction.php | ||
|
||
- message: '#Parameter \#1 \$url of method CSlant\\TelegramGitNotifier\\Webhook\:\:setUrl\(\) expects string, mixed given\.#' | ||
path: src/Http/Actions/WebhookAction.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
* @var $event string | ||
*/ | ||
$issue = $payload->issue; | ||
?> | ||
|
||
{!! __('tg-notifier::events/github/issues.closed.title', [ | ||
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", | ||
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" | ||
] | ||
) !!} | ||
|
||
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b> | ||
|
||
@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) | ||
|
||
@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) |
16 changes: 16 additions & 0 deletions
16
resources/views/events/shared/partials/github/_assignees.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
* @var $event string | ||
*/ | ||
if (isset($event) && isset($payload) && !empty($payload->{$event}->assignees)) { | ||
$assigneeText = "🙋 Assignee: "; | ||
$assigneeArray = []; | ||
foreach ($payload->{$event}->assignees as $assignee) { | ||
$assigneeArray[] = "<a href=\"{$assignee->html_url}\">@{$assignee->login}</a> "; | ||
} | ||
$assigneeText .= implode(', ', $assigneeArray)."\n"; | ||
} | ||
?> | ||
{!! $assigneeText ?? '' !!} |
16 changes: 16 additions & 0 deletions
16
resources/views/events/shared/partials/github/_body.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
* @var $event string | ||
*/ | ||
if (isset($event) && isset($payload) && !empty($payload->{$event}->body)) { | ||
$body = $payload->{$event}->body; | ||
if (strlen($body) > 50) { | ||
$body = substr($body, 0, 50).'...'; | ||
} | ||
$html = __('tg-notifier::events/shared/github._body.title', ['body' => $body])."\n{$body}"; | ||
} | ||
?> | ||
{!! $html ?? '' !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters