Skip to content

Commit 62b7eff

Browse files
committed
fix: update view actions for issue gitlab event
1 parent 439f6a9 commit 62b7eff

File tree

5 files changed

+59
-22
lines changed

5 files changed

+59
-22
lines changed

lang/en/events/github/workflow_run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
'title' => ' <b>Workflow Requested</b> form 🦑:user',
2424
'body' => 'Running workflow: 💥 <b>:name</b> ⏳',
2525
],
26-
'link' => '🔗 Link: :link',
26+
'link' => '🔗 Workflow run link: :link',
2727
];

lang/en/events/gitlab/issues.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
return [
4+
'issue_title' => '📢',
5+
'closed' => [
6+
'title' => '🚫 <b>Issue Closed </b> to 🦊 :issue by :user',
7+
],
8+
'edited' => [
9+
'title' => '⚠️ <b>Issue has been edited</b> to 🦊 :issue by :user',
10+
'changes' => [
11+
'title' => [
12+
'name' => '📖 <b>Title</b> has been changed',
13+
'from' => '📝 <b>From:</b> :title_from',
14+
'to' => '🏷 <b>To:</b> :title_to',
15+
],
16+
'body' => [
17+
'title' => '📖 <b>Body</b> has been changed',
18+
'message' => 'Please check the issue for more details',
19+
],
20+
],
21+
],
22+
'opened' => [
23+
'title' => '⚠️ <b>New Issue</b> to 🦊 :issue by :user',
24+
],
25+
'reopened' => [
26+
'title' => '⚠️ <b>Issue has been reopened</b> ⚠️ to 🦊 :issue by :user',
27+
],
28+
];
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>Issue Closed </b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('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>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

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

10-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php';
11-
12-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
13-
14-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._assignees', compact('payload', 'event'))
17+
@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 Issue</b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> created by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('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>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

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

10-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php';
11-
12-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
13-
14-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._assignees', compact('payload', 'event'))
17+
@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>Issue has been reopened</b> ⚠️ to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> by <b>{$payload->user->name}</b>\n\n";
7+
?>
8+
{!! __('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>",
10+
'user' => "<b>{$payload->user->name}</b>"
11+
]
12+
) !!}
713

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

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

0 commit comments

Comments
 (0)