From 7ce5806db4fe3b35d240a83c2ee6a1424e352e6b Mon Sep 17 00:00:00 2001 From: pxthinh Date: Tue, 28 Nov 2023 17:37:57 +0700 Subject: [PATCH 1/8] feat: update view template for assigned, locked and labeled --- lang/en/events/github/pull_request.php | 20 +++++++++++++++++++ .../github/pull_request/assigned.blade.php | 20 +++++++++++++++++++ .../github/pull_request/labeled.blade.php | 17 ++++++++++++++++ .../github/pull_request/locked.blade.php | 15 ++++++++++++++ .../github/pull_request/unassigned.blade.php | 19 ++++++++++++++++++ .../github/pull_request/unlabeled.blade.php | 17 ++++++++++++++++ .../github/pull_request/unlocked.blade.php | 15 ++++++++++++++ 7 files changed, 123 insertions(+) create mode 100644 resources/views/events/github/pull_request/assigned.blade.php create mode 100644 resources/views/events/github/pull_request/labeled.blade.php create mode 100644 resources/views/events/github/pull_request/locked.blade.php create mode 100644 resources/views/events/github/pull_request/unassigned.blade.php create mode 100644 resources/views/events/github/pull_request/unlabeled.blade.php create mode 100644 resources/views/events/github/pull_request/unlocked.blade.php diff --git a/lang/en/events/github/pull_request.php b/lang/en/events/github/pull_request.php index 088ccb7..5c49522 100644 --- a/lang/en/events/github/pull_request.php +++ b/lang/en/events/github/pull_request.php @@ -2,15 +2,35 @@ return [ 'review' => '👥 Reviewers: ', + 'assigned' => [ + 'title' => '‍👷‍♂️🛠️ Assigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been assigned in the pull request :pullRequest', + ], 'closed' => [ 'title' => ':title - 🦑:repo by :user', 'title_merged' => '✅ Pull Request Merged', 'title_closed' => '🚫 Pull Request Closed', ], + 'labeled' => [ + 'title' => '‍👷‍♂️🛠️ Labeled Pull Request - 🦑:repo by :user', + ], + 'locked' => [ + 'title' => '‍👷‍♂️🛠️ Locked Pull Request - 🦑:repo by :user', + ], 'opened' => [ 'title' => '👷‍♂️🛠️ New Pull Request - 🦑:repo by :user', ], 'reopened' => [ 'title' => '👷‍♂️🛠️ Reopened Pull Request - 🦑:repo by :user', ], + 'unassigned' => [ + 'title' => '‍👷‍♂️🛠️ Unassigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been unassigned in the pull request :pullRequest', + ], + 'unlabeled' => [ + 'title' => '‍👷‍♂️🛠️ Unlabeled Pull Request - 🦑:repo by :user', + ], + 'unlocked' => [ + 'title' => '‍👷‍♂️🛠️ Unlocked Pull Request - 🦑:repo by :user', + ], ]; diff --git a/resources/views/events/github/pull_request/assigned.blade.php b/resources/views/events/github/pull_request/assigned.blade.php new file mode 100644 index 0000000..b953dbd --- /dev/null +++ b/resources/views/events/github/pull_request/assigned.blade.php @@ -0,0 +1,20 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.assigned.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}", + ] + ) !!} + +{!! __('tg-notifier::events/github/pull_request.assigned.body', [ + 'name' => "@{$payload->assignee->login}", + 'pullRequest' => "$pull_request->title", + ] + ) !!} diff --git a/resources/views/events/github/pull_request/labeled.blade.php b/resources/views/events/github/pull_request/labeled.blade.php new file mode 100644 index 0000000..87837a7 --- /dev/null +++ b/resources/views/events/github/pull_request/labeled.blade.php @@ -0,0 +1,17 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.labeled.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}", + ] + ) !!} + +📢 {{ $payload->label->name }} +{{ substr($payload->label->description, 0, 50).'...' }} diff --git a/resources/views/events/github/pull_request/locked.blade.php b/resources/views/events/github/pull_request/locked.blade.php new file mode 100644 index 0000000..d884d7d --- /dev/null +++ b/resources/views/events/github/pull_request/locked.blade.php @@ -0,0 +1,15 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.locked.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}" + ] + ) !!} + +📢 {{ $pull_request->title }} diff --git a/resources/views/events/github/pull_request/unassigned.blade.php b/resources/views/events/github/pull_request/unassigned.blade.php new file mode 100644 index 0000000..70ae3a8 --- /dev/null +++ b/resources/views/events/github/pull_request/unassigned.blade.php @@ -0,0 +1,19 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.unassigned.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}" + ] + ) !!} + +{!! __('tg-notifier::events/github/pull_request.unassigned.body', [ + 'name' => "@{$payload->assignee->login}", + 'pullRequest' => "$pull_request->title", + ] + ) !!} diff --git a/resources/views/events/github/pull_request/unlabeled.blade.php b/resources/views/events/github/pull_request/unlabeled.blade.php new file mode 100644 index 0000000..cf29f38 --- /dev/null +++ b/resources/views/events/github/pull_request/unlabeled.blade.php @@ -0,0 +1,17 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.unlabeled.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}", + ] + ) !!} + +📢 {{ $payload->label->name }} +{{ substr($payload->label->description, 0, 50).'...' }} diff --git a/resources/views/events/github/pull_request/unlocked.blade.php b/resources/views/events/github/pull_request/unlocked.blade.php new file mode 100644 index 0000000..2f90ce9 --- /dev/null +++ b/resources/views/events/github/pull_request/unlocked.blade.php @@ -0,0 +1,15 @@ +pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.unlocked.title', [ + 'repo' => "{$payload->repository->full_name}#$pull_request->number", + 'user' => "@{$pull_request->user->login}" + ] + ) !!} + +📢 {{ $pull_request->title }} From c57e670dcf9a6a309ed5c15a85fe259b263d428b Mon Sep 17 00:00:00 2001 From: pxthinh Date: Wed, 29 Nov 2023 16:56:03 +0700 Subject: [PATCH 2/8] feat: update view template for label and format code for pull request --- lang/en/events/github/label.php | 25 +++++++++++++++ .../events/github/label/created.blade.php | 17 ++++++++++ .../events/github/label/deleted.blade.php | 13 ++++++++ .../events/github/label/edited.blade.php | 31 +++++++++++++++++++ .../github/pull_request/assigned.blade.php | 1 - .../github/pull_request/labeled.blade.php | 4 +-- .../github/pull_request/unlabeled.blade.php | 1 - .../events/github/team/created.blade.php | 1 + .../events/github/team/deleted.blade.php | 1 + 9 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 lang/en/events/github/label.php create mode 100644 resources/views/events/github/label/created.blade.php create mode 100644 resources/views/events/github/label/deleted.blade.php create mode 100644 resources/views/events/github/label/edited.blade.php create mode 100644 resources/views/events/github/team/created.blade.php create mode 100644 resources/views/events/github/team/deleted.blade.php diff --git a/lang/en/events/github/label.php b/lang/en/events/github/label.php new file mode 100644 index 0000000..4ebc4ed --- /dev/null +++ b/lang/en/events/github/label.php @@ -0,0 +1,25 @@ + [ + 'title' => '💬 New Label ⚠️ - 🦑:repo by :user', + ], + 'deleted' => [ + 'title' => '🗑 Label Deleted - 🦑:repo by :user', + ], + 'edited' => [ + 'title' => '👷‍♂️🛠️ Label has been edited - 🦑:repo by :user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + 'description' => [ + 'name' => '📖 Description has been changed', + 'from' => '📝 From: :description_from', + 'to' => '🏷 To: :description_to', + ], + ], + ], +]; diff --git a/resources/views/events/github/label/created.blade.php b/resources/views/events/github/label/created.blade.php new file mode 100644 index 0000000..efbf76f --- /dev/null +++ b/resources/views/events/github/label/created.blade.php @@ -0,0 +1,17 @@ +label; +$description = strlen($label->description) > 50 ? $label->description : substr($label->description, 0, 50).'...'; +?> + +{!! __('tg-notifier::events/github/label.created.title', [ + 'repo' => "{$payload->repository->full_name}", + 'user' => "@{$payload->sender->login}", + ] + ) !!} + +📢 {{ $payload->label->name }} +{{ $description }} diff --git a/resources/views/events/github/label/deleted.blade.php b/resources/views/events/github/label/deleted.blade.php new file mode 100644 index 0000000..8f40028 --- /dev/null +++ b/resources/views/events/github/label/deleted.blade.php @@ -0,0 +1,13 @@ + + +{!! __('tg-notifier::events/github/label.deleted.title', [ + 'repo' => "{$payload->repository->full_name}", + 'user' => "@{$payload->sender->login}", + ] + ) !!} + +📢 {{ $payload->label->name }} diff --git a/resources/views/events/github/label/edited.blade.php b/resources/views/events/github/label/edited.blade.php new file mode 100644 index 0000000..41589cd --- /dev/null +++ b/resources/views/events/github/label/edited.blade.php @@ -0,0 +1,31 @@ +changes; +$label = $payload->label; +$description = strlen($label->description) > 50 ? $label->description : substr($label->description, 0, 50).'...'; +$description_changes = strlen($changes->name->description) > 50 ? $changes->name->description : substr($changes->name->description, 0, 50).'...'; +?> + +{!! __('tg-notifier::events/github/label.edited.title', [ + 'repo' => "{$payload->repository->full_name}", + 'user' => "@{$payload->sender->login}", + ] + ) !!} + + +@if(isset($changes->name->from)) +{!! __('tg-notifier::events/github/label.edited.changes.title.from', ['title_from' => $payload->changes->name->from]) !!} +{!! __('tg-notifier::events/github/label.edited.changes.title.to', ['title_to' => $payload->label->name]) !!} +@else +📢 {{ $label->name }} +@endif + +@if(isset($changes->name->description)) + {!! __('tg-notifier::events/github/label.edited.changes.description.from', ['description_from' => $description_changes]) !!} + {!! __('tg-notifier::events/github/label.edited.changes.description.to', ['description_to' =>$description]) !!} +@else +{{ $description }} +@endif diff --git a/resources/views/events/github/pull_request/assigned.blade.php b/resources/views/events/github/pull_request/assigned.blade.php index b953dbd..2fbe51d 100644 --- a/resources/views/events/github/pull_request/assigned.blade.php +++ b/resources/views/events/github/pull_request/assigned.blade.php @@ -1,7 +1,6 @@ pull_request; diff --git a/resources/views/events/github/pull_request/labeled.blade.php b/resources/views/events/github/pull_request/labeled.blade.php index 87837a7..c30116e 100644 --- a/resources/views/events/github/pull_request/labeled.blade.php +++ b/resources/views/events/github/pull_request/labeled.blade.php @@ -1,10 +1,10 @@ pull_request; +$description = strlen($payload->label->description) > 50 ? $payload->label->description : substr($payload->label->description, 0, 50).'...'; ?> {!! __('tg-notifier::events/github/pull_request.labeled.title', [ @@ -14,4 +14,4 @@ ) !!} 📢 {{ $payload->label->name }} -{{ substr($payload->label->description, 0, 50).'...' }} +{{ $description }} diff --git a/resources/views/events/github/pull_request/unlabeled.blade.php b/resources/views/events/github/pull_request/unlabeled.blade.php index cf29f38..a2e185b 100644 --- a/resources/views/events/github/pull_request/unlabeled.blade.php +++ b/resources/views/events/github/pull_request/unlabeled.blade.php @@ -1,7 +1,6 @@ pull_request; diff --git a/resources/views/events/github/team/created.blade.php b/resources/views/events/github/team/created.blade.php new file mode 100644 index 0000000..a7b8ef8 --- /dev/null +++ b/resources/views/events/github/team/created.blade.php @@ -0,0 +1 @@ +{!! 'hihi' !!} diff --git a/resources/views/events/github/team/deleted.blade.php b/resources/views/events/github/team/deleted.blade.php new file mode 100644 index 0000000..a7b8ef8 --- /dev/null +++ b/resources/views/events/github/team/deleted.blade.php @@ -0,0 +1 @@ +{!! 'hihi' !!} From e508f28c3efaac4540c54d79111441091c2620c1 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Wed, 29 Nov 2023 16:56:51 +0700 Subject: [PATCH 3/8] feat: update multiple lang --- lang/de/events/github/pull_request.php | 20 ++++++++++++++++++++ lang/ja/events/github/pull_request.php | 20 ++++++++++++++++++++ lang/vi/events/github/pull_request.php | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/lang/de/events/github/pull_request.php b/lang/de/events/github/pull_request.php index 088ccb7..5c49522 100644 --- a/lang/de/events/github/pull_request.php +++ b/lang/de/events/github/pull_request.php @@ -2,15 +2,35 @@ return [ 'review' => '👥 Reviewers: ', + 'assigned' => [ + 'title' => '‍👷‍♂️🛠️ Assigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been assigned in the pull request :pullRequest', + ], 'closed' => [ 'title' => ':title - 🦑:repo by :user', 'title_merged' => '✅ Pull Request Merged', 'title_closed' => '🚫 Pull Request Closed', ], + 'labeled' => [ + 'title' => '‍👷‍♂️🛠️ Labeled Pull Request - 🦑:repo by :user', + ], + 'locked' => [ + 'title' => '‍👷‍♂️🛠️ Locked Pull Request - 🦑:repo by :user', + ], 'opened' => [ 'title' => '👷‍♂️🛠️ New Pull Request - 🦑:repo by :user', ], 'reopened' => [ 'title' => '👷‍♂️🛠️ Reopened Pull Request - 🦑:repo by :user', ], + 'unassigned' => [ + 'title' => '‍👷‍♂️🛠️ Unassigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been unassigned in the pull request :pullRequest', + ], + 'unlabeled' => [ + 'title' => '‍👷‍♂️🛠️ Unlabeled Pull Request - 🦑:repo by :user', + ], + 'unlocked' => [ + 'title' => '‍👷‍♂️🛠️ Unlocked Pull Request - 🦑:repo by :user', + ], ]; diff --git a/lang/ja/events/github/pull_request.php b/lang/ja/events/github/pull_request.php index 088ccb7..5c49522 100644 --- a/lang/ja/events/github/pull_request.php +++ b/lang/ja/events/github/pull_request.php @@ -2,15 +2,35 @@ return [ 'review' => '👥 Reviewers: ', + 'assigned' => [ + 'title' => '‍👷‍♂️🛠️ Assigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been assigned in the pull request :pullRequest', + ], 'closed' => [ 'title' => ':title - 🦑:repo by :user', 'title_merged' => '✅ Pull Request Merged', 'title_closed' => '🚫 Pull Request Closed', ], + 'labeled' => [ + 'title' => '‍👷‍♂️🛠️ Labeled Pull Request - 🦑:repo by :user', + ], + 'locked' => [ + 'title' => '‍👷‍♂️🛠️ Locked Pull Request - 🦑:repo by :user', + ], 'opened' => [ 'title' => '👷‍♂️🛠️ New Pull Request - 🦑:repo by :user', ], 'reopened' => [ 'title' => '👷‍♂️🛠️ Reopened Pull Request - 🦑:repo by :user', ], + 'unassigned' => [ + 'title' => '‍👷‍♂️🛠️ Unassigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been unassigned in the pull request :pullRequest', + ], + 'unlabeled' => [ + 'title' => '‍👷‍♂️🛠️ Unlabeled Pull Request - 🦑:repo by :user', + ], + 'unlocked' => [ + 'title' => '‍👷‍♂️🛠️ Unlocked Pull Request - 🦑:repo by :user', + ], ]; diff --git a/lang/vi/events/github/pull_request.php b/lang/vi/events/github/pull_request.php index 088ccb7..5c49522 100644 --- a/lang/vi/events/github/pull_request.php +++ b/lang/vi/events/github/pull_request.php @@ -2,15 +2,35 @@ return [ 'review' => '👥 Reviewers: ', + 'assigned' => [ + 'title' => '‍👷‍♂️🛠️ Assigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been assigned in the pull request :pullRequest', + ], 'closed' => [ 'title' => ':title - 🦑:repo by :user', 'title_merged' => '✅ Pull Request Merged', 'title_closed' => '🚫 Pull Request Closed', ], + 'labeled' => [ + 'title' => '‍👷‍♂️🛠️ Labeled Pull Request - 🦑:repo by :user', + ], + 'locked' => [ + 'title' => '‍👷‍♂️🛠️ Locked Pull Request - 🦑:repo by :user', + ], 'opened' => [ 'title' => '👷‍♂️🛠️ New Pull Request - 🦑:repo by :user', ], 'reopened' => [ 'title' => '👷‍♂️🛠️ Reopened Pull Request - 🦑:repo by :user', ], + 'unassigned' => [ + 'title' => '‍👷‍♂️🛠️ Unassigned Pull Request - 🦑:repo by :user', + 'body' => ':name has been unassigned in the pull request :pullRequest', + ], + 'unlabeled' => [ + 'title' => '‍👷‍♂️🛠️ Unlabeled Pull Request - 🦑:repo by :user', + ], + 'unlocked' => [ + 'title' => '‍👷‍♂️🛠️ Unlocked Pull Request - 🦑:repo by :user', + ], ]; From 190024ed1ed8c99ac782ed90be187a9d5ca12ac3 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Wed, 29 Nov 2023 17:00:29 +0700 Subject: [PATCH 4/8] fix: update IGNORE_MESSAGE for issue comment --- .../events/github/issue_comment/created.blade.php | 12 ++++++++---- .../events/github/issue_comment/deleted.blade.php | 4 ++++ .../events/github/issue_comment/edited.blade.php | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/resources/views/events/github/issue_comment/created.blade.php b/resources/views/events/github/issue_comment/created.blade.php index f030b37..4c6ce02 100644 --- a/resources/views/events/github/issue_comment/created.blade.php +++ b/resources/views/events/github/issue_comment/created.blade.php @@ -7,13 +7,17 @@ $issue = $payload->issue; ?> +@if(empty($issue->pull_request)) {!! __('tg-notifier::events/github/issue_comment.created.title', [ - 'issue' => "{$payload->repository->full_name}#$issue->number", - 'user' => "@{$issue->user->login}" - ] - ) !!} + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] +) !!} 📢 {{ $issue->title }} @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) +@else +IGNORE_MESSAGE +@endif diff --git a/resources/views/events/github/issue_comment/deleted.blade.php b/resources/views/events/github/issue_comment/deleted.blade.php index 2b7610b..e52062f 100644 --- a/resources/views/events/github/issue_comment/deleted.blade.php +++ b/resources/views/events/github/issue_comment/deleted.blade.php @@ -7,6 +7,7 @@ $issue = $payload->issue; ?> +@if(empty($issue->pull_request)) {!! __('tg-notifier::events/github/issue_comment.deleted.title', [ 'issue' => "{$payload->repository->full_name}#$issue->number", 'user' => "@{$issue->user->login}" @@ -17,3 +18,6 @@ @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) +@else +IGNORE_MESSAGE +@endif diff --git a/resources/views/events/github/issue_comment/edited.blade.php b/resources/views/events/github/issue_comment/edited.blade.php index bde55e1..344afab 100644 --- a/resources/views/events/github/issue_comment/edited.blade.php +++ b/resources/views/events/github/issue_comment/edited.blade.php @@ -7,6 +7,7 @@ $issue = $payload->issue; ?> +@if(empty($issue->pull_request)) {!! __('tg-notifier::events/github/issue_comment.edited.title', [ 'issue' => "{$payload->repository->full_name}#$issue->number", 'user' => "@{$issue->user->login}" @@ -17,3 +18,6 @@ @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) +@else +IGNORE_MESSAGE +@endif From 1db4db544505c103c4957974971794bb6f1dde9e Mon Sep 17 00:00:00 2001 From: pxthinh Date: Sat, 2 Dec 2023 22:27:52 +0700 Subject: [PATCH 5/8] fix: update view edited for label --- .../views/events/github/label/edited.blade.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/views/events/github/label/edited.blade.php b/resources/views/events/github/label/edited.blade.php index 41589cd..74cabce 100644 --- a/resources/views/events/github/label/edited.blade.php +++ b/resources/views/events/github/label/edited.blade.php @@ -5,8 +5,10 @@ $changes = $payload->changes; $label = $payload->label; -$description = strlen($label->description) > 50 ? $label->description : substr($label->description, 0, 50).'...'; -$description_changes = strlen($changes->name->description) > 50 ? $changes->name->description : substr($changes->name->description, 0, 50).'...'; +$description = strlen($label->description) < 50 ? $label->description : substr($label->description, 0, 50).'...'; +if (isset($changes->description->from)) { + $description_changes = strlen($changes->description->from) < 50 ? $changes->description->from : substr($changes->description->from, 0, 50).'...'; +} ?> {!! __('tg-notifier::events/github/label.edited.title', [ @@ -15,17 +17,18 @@ ] ) !!} - @if(isset($changes->name->from)) +{!! __('tg-notifier::events/github/label.edited.changes.title.name') !!} {!! __('tg-notifier::events/github/label.edited.changes.title.from', ['title_from' => $payload->changes->name->from]) !!} {!! __('tg-notifier::events/github/label.edited.changes.title.to', ['title_to' => $payload->label->name]) !!} @else 📢 {{ $label->name }} @endif -@if(isset($changes->name->description)) - {!! __('tg-notifier::events/github/label.edited.changes.description.from', ['description_from' => $description_changes]) !!} - {!! __('tg-notifier::events/github/label.edited.changes.description.to', ['description_to' =>$description]) !!} +@if(isset($changes->description->from)) +{!! __('tg-notifier::events/github/label.edited.changes.description.name') !!} +{!! __('tg-notifier::events/github/label.edited.changes.description.from', ['description_from' => $description_changes]) !!} +{!! __('tg-notifier::events/github/label.edited.changes.description.to', ['description_to' => $description]) !!} @else {{ $description }} @endif From 4edbd9427e6fe2adfc2a7c954ac253a4ecd7dbc7 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Sat, 2 Dec 2023 23:39:11 +0700 Subject: [PATCH 6/8] feat: add the ignore message config variable --- config/telegram-git-notifier.php | 2 ++ resources/views/events/github/issue_comment/created.blade.php | 2 +- resources/views/events/github/issue_comment/deleted.blade.php | 2 +- resources/views/events/github/issue_comment/edited.blade.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/telegram-git-notifier.php b/config/telegram-git-notifier.php index 2621b01..a47cb58 100644 --- a/config/telegram-git-notifier.php +++ b/config/telegram-git-notifier.php @@ -78,6 +78,8 @@ /** Set the path to the view file */ 'view' => [ + 'ignore-message' => env('IGNORE_MESSAGE', 'ignore-message'), + 'namespace' => env('TGN_VIEW_NAMESPACE', 'tg-notifier'), 'default' => env( diff --git a/resources/views/events/github/issue_comment/created.blade.php b/resources/views/events/github/issue_comment/created.blade.php index 4c6ce02..e811b92 100644 --- a/resources/views/events/github/issue_comment/created.blade.php +++ b/resources/views/events/github/issue_comment/created.blade.php @@ -19,5 +19,5 @@ @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) @else -IGNORE_MESSAGE +{{ config('telegram-git-notifier.view.ignore-message') }} @endif diff --git a/resources/views/events/github/issue_comment/deleted.blade.php b/resources/views/events/github/issue_comment/deleted.blade.php index e52062f..4534c34 100644 --- a/resources/views/events/github/issue_comment/deleted.blade.php +++ b/resources/views/events/github/issue_comment/deleted.blade.php @@ -19,5 +19,5 @@ @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) @else -IGNORE_MESSAGE +{{ config('telegram-git-notifier.view.ignore-message') }} @endif diff --git a/resources/views/events/github/issue_comment/edited.blade.php b/resources/views/events/github/issue_comment/edited.blade.php index 344afab..8a7018a 100644 --- a/resources/views/events/github/issue_comment/edited.blade.php +++ b/resources/views/events/github/issue_comment/edited.blade.php @@ -19,5 +19,5 @@ @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) @include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) @else -IGNORE_MESSAGE +{{ config('telegram-git-notifier.view.ignore-message') }} @endif From eb2bc5afdd730d56bcb6032a76faaf1f6a5ce7e1 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Sun, 3 Dec 2023 14:28:42 +0700 Subject: [PATCH 7/8] fix: remove code debug --- resources/views/events/github/team/created.blade.php | 1 - resources/views/events/github/team/deleted.blade.php | 1 - 2 files changed, 2 deletions(-) diff --git a/resources/views/events/github/team/created.blade.php b/resources/views/events/github/team/created.blade.php index a7b8ef8..e69de29 100644 --- a/resources/views/events/github/team/created.blade.php +++ b/resources/views/events/github/team/created.blade.php @@ -1 +0,0 @@ -{!! 'hihi' !!} diff --git a/resources/views/events/github/team/deleted.blade.php b/resources/views/events/github/team/deleted.blade.php index a7b8ef8..e69de29 100644 --- a/resources/views/events/github/team/deleted.blade.php +++ b/resources/views/events/github/team/deleted.blade.php @@ -1 +0,0 @@ -{!! 'hihi' !!} From d18bbca95bb4bf3db4830bea9eb1ade63b9be920 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Sun, 3 Dec 2023 14:43:58 +0700 Subject: [PATCH 8/8] lang: add multiple lang for label --- lang/de/events/github/label.php | 25 +++++++++++++++++++++++++ lang/ja/events/github/label.php | 25 +++++++++++++++++++++++++ lang/vi/events/github/label.php | 25 +++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 lang/de/events/github/label.php create mode 100644 lang/ja/events/github/label.php create mode 100644 lang/vi/events/github/label.php diff --git a/lang/de/events/github/label.php b/lang/de/events/github/label.php new file mode 100644 index 0000000..4ebc4ed --- /dev/null +++ b/lang/de/events/github/label.php @@ -0,0 +1,25 @@ + [ + 'title' => '💬 New Label ⚠️ - 🦑:repo by :user', + ], + 'deleted' => [ + 'title' => '🗑 Label Deleted - 🦑:repo by :user', + ], + 'edited' => [ + 'title' => '👷‍♂️🛠️ Label has been edited - 🦑:repo by :user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + 'description' => [ + 'name' => '📖 Description has been changed', + 'from' => '📝 From: :description_from', + 'to' => '🏷 To: :description_to', + ], + ], + ], +]; diff --git a/lang/ja/events/github/label.php b/lang/ja/events/github/label.php new file mode 100644 index 0000000..4ebc4ed --- /dev/null +++ b/lang/ja/events/github/label.php @@ -0,0 +1,25 @@ + [ + 'title' => '💬 New Label ⚠️ - 🦑:repo by :user', + ], + 'deleted' => [ + 'title' => '🗑 Label Deleted - 🦑:repo by :user', + ], + 'edited' => [ + 'title' => '👷‍♂️🛠️ Label has been edited - 🦑:repo by :user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + 'description' => [ + 'name' => '📖 Description has been changed', + 'from' => '📝 From: :description_from', + 'to' => '🏷 To: :description_to', + ], + ], + ], +]; diff --git a/lang/vi/events/github/label.php b/lang/vi/events/github/label.php new file mode 100644 index 0000000..4ebc4ed --- /dev/null +++ b/lang/vi/events/github/label.php @@ -0,0 +1,25 @@ + [ + 'title' => '💬 New Label ⚠️ - 🦑:repo by :user', + ], + 'deleted' => [ + 'title' => '🗑 Label Deleted - 🦑:repo by :user', + ], + 'edited' => [ + 'title' => '👷‍♂️🛠️ Label has been edited - 🦑:repo by :user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + 'description' => [ + 'name' => '📖 Description has been changed', + 'from' => '📝 From: :description_from', + 'to' => '🏷 To: :description_to', + ], + ], + ], +];