Skip to content

Commit adccb31

Browse files
committed
fix: update some events for gitlab
1 parent 1abbdbd commit adccb31

File tree

15 files changed

+67
-42
lines changed

15 files changed

+67
-42
lines changed

lang/en/events/gitlab/note.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
return [
4+
'title' => [
5+
'commit' => '💬 <b>New Comment on Commit</b> - 🦊:repo by :user',
6+
'issue' => '💬 <b>New Comment on Issue</b> - 🦊:repo by :user',
7+
'merge_request' => '💬 <b>New Comment on Merge Request</b> - 🦊:repo by :user',
8+
'snippet' => '💬 <b>New Comment on Snippet</b> - 🦊:repo by :user',
9+
],
10+
'view_comment' => '🔗 View Comment: :link',
11+
'snippet_comment' => 'View Comment on Snippet',
12+
];

resources/views/events/gitlab/issue/close.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
?>
88
{!! __('tg-notifier::events/gitlab/issues.closed.title', [
9-
'issue' => "<a href='$payload->object_attributes->url'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
9+
'issue' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
1010
'user' => "<b>{$payload->user->name}</b>"
1111
]
1212
) !!}

resources/views/events/gitlab/issue/open.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
?>
88
{!! __('tg-notifier::events/gitlab/issues.opened.title', [
9-
'issue' => "<a href='$payload->object_attributes->url'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
9+
'issue' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
1010
'user' => "<b>{$payload->user->name}</b>"
1111
]
1212
) !!}

resources/views/events/gitlab/issue/reopen.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
?>
88
{!! __('tg-notifier::events/gitlab/issues.reopened.title', [
9-
'issue' => "<a href='$payload->object_attributes->url'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
9+
'issue' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a>",
1010
'user' => "<b>{$payload->user->name}</b>"
1111
]
1212
) !!}
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "💬 <b>New Comment on Commit</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}</a> by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('tg-notifier::events/gitlab/note.title.commit', [
9+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}</a>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

8-
$message .= "⚙️ <b>{$payload->commit->message}</b> \n\n";
14+
⚙️ <b>{{ $payload->commit->message }}</b>
915

10-
$message .= "🔗 View Comment: <a href=\"{$payload->object_attributes->url}\">{$payload->commit->id}</a> \n\n";
16+
{!! __('tg-notifier::events/gitlab/note.view_comment', [
17+
'link' => "<a href='{$payload->object_attributes->url}'>{$payload->commit->id}</a>"
18+
]
19+
) !!}
1120

12-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
13-
14-
echo $message;
21+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))

resources/views/events/gitlab/note/issue.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
* @var $payload object
44
*/
55
6-
$message = "💬 <b>New Comment on Issue</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->issue->iid}</a> by <b>{$payload->user->name}</b>\n\n";
6+
?>
77

8-
$message .= "📢 <b>{$payload->issue->title}</b> \n\n";
8+
{!! __('tg-notifier::events/gitlab/note.title.issue', [
9+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->issue->iid}</a>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
913

10-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
14+
📢 <b>{{ $payload->issue->title }}</b>
1115

12-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "💬 <b>New Comment on Merge Request</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->merge_request->iid}</a> by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('tg-notifier::events/gitlab/note.title.merge_request', [
9+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->merge_request->iid}</a>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

8-
$message .= "🛠 <b>{$payload->merge_request->title}</b> \n";
14+
🛠 <b>{{ $payload->merge_request->title }}</b>
15+
🌳 {{ $payload->merge_request->source_branch }} -> {{ $payload->merge_request->target_branch }} 🎯
916

10-
$message .= "🌳 {$payload->merge_request->source_branch} -> {$payload->merge_request->target_branch} 🎯 \n";
11-
12-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
13-
14-
echo $message;
17+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "💬 <b>New Comment on Snippet</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}</a> by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('tg-notifier::events/gitlab/note.title.snippet', [
9+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}</a>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

8-
$message .= "📝 <b>{$payload->snippet->title}</b> \n\n";
14+
📝 <b>{{ $payload->snippet->title }}</b>
915

10-
$message .= "🔗 <a href=\"{$payload->object_attributes->url}\">View Comment</a> \n\n";
16+
🔗 <a href="{{ $payload->object_attributes->url }}">{{ __('tg-notifier::events/gitlab/note.snippet_comment') }}</a>
1117

12-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
13-
14-
echo $message;
18+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))

resources/views/events/gitlab/push/default.blade.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
'noun' => $noun,
1616
'repo' => $payload->project->path_with_namespace,
1717
'branch' => $branch,
18-
]
19-
) !!}
18+
]) !!}
2019

2120
@foreach($payload->commits as $commit)
2221
@php
@@ -26,8 +25,7 @@
2625
'commit' => "<a href='$commit->url'>$commitId</a>",
2726
'commit_message' => $commit->message,
2827
'commit_by' => $commit->author->name,
29-
]
30-
) !!}
28+
]) !!}
3129
@endforeach
3230

3331
{!! __('tg-notifier::events/gitlab/push.default.pusher', ['name' => $payload->user_name]) !!}

resources/views/events/gitlab/release/create.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
{!! __('tg-notifier::events/gitlab/release.title.create', [
1010
'repo' => "<a href='$payload->url'>{$payload->project->path_with_namespace}#{$payload->tag}</a>",
11-
'user' => "<b>{$payload->commit->author->name}</b>"
12-
]
13-
) !!}
11+
'user' => "<b>{$payload->commit->author->name}</b>"
12+
]) !!}
1413

1514
🔖 <b>{{ $payload->tag }}</b>
1615
🗞 <b>{{ $payload->name }}</b>

0 commit comments

Comments
 (0)