-
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #93 from tanhongit/main
Gitlab notification
- Loading branch information
Showing
52 changed files
with
398 additions
and
118 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
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
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
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
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
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
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,22 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
if ($payload->object_attributes->active) { | ||
$active = "Enabled"; | ||
$icon = "🚩"; | ||
} else { | ||
$active = "Disabled"; | ||
$icon = "🏴"; | ||
} | ||
|
||
$flagUrl = $payload->project->web_url . "/-/feature_flags/" . $payload->object_attributes->id; | ||
|
||
$message = "{$icon} <b>Feature Flag {$active}</b> - 🦊<a href=\"{$flagUrl}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->name}</a> by <a href=\"{$payload->user_url}\">{$payload->user->name}</a>\n\n"; | ||
|
||
$message .= "{$icon} Name: <b>{$payload->object_attributes->name}</b> \n\n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "✅ <b>Merge Request Approved</b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->object_attributes->title}</b> \n\n"; | ||
|
||
$message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
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,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "❌ <b>Close Merge Request</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->object_attributes->title}</b> \n\n"; | ||
|
||
$message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
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,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "✅🎉 <b>Merge Request Merged</b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->object_attributes->title}</b> \n\n"; | ||
|
||
$message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
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,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "👷♂️🛠️ <b>Merge Request Opened</b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->object_attributes->title}</b> \n\n"; | ||
|
||
$message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
16 changes: 16 additions & 0 deletions
16
resources/events/gitlab/merge_request/partials/_reviewers.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 | ||
*/ | ||
|
||
$textReviewers = ''; | ||
if (isset($payload->reviewers) && count($payload->reviewers) > 0) { | ||
$reviewers = []; | ||
foreach ($payload->reviewers as $reviewer) { | ||
$reviewers[] = "<b>{$reviewer->name}</b>"; | ||
} | ||
|
||
$textReviewers .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n"; | ||
} | ||
|
||
return $textReviewers; |
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,18 @@ | ||
<?php | ||
/** | ||
* @var $payload mixed | ||
*/ | ||
|
||
$message = "👷♂️🛠️ <b>Merge Request Reopened</b> to 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; | ||
|
||
$message .= "🛠 <b>{$payload->object_attributes->title}</b> \n\n"; | ||
|
||
$message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; | ||
|
||
$message .= require __DIR__ . '/partials/_reviewers.php'; | ||
|
||
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; | ||
|
||
echo $message; |
Oops, something went wrong.