From 04867cd8cbb54837ff7c87eb2e3faaf4bf6c33e9 Mon Sep 17 00:00:00 2001 From: pxthinh Date: Mon, 27 Nov 2023 00:44:06 +0700 Subject: [PATCH 1/2] feat: add view and lang for branch protection rule and deploy key --- .../events/github/branch_protection_rule.php | 22 +++++++++++++++++ lang/de/events/github/deploy_key.php | 12 ++++++++++ .../events/github/branch_protection_rule.php | 22 +++++++++++++++++ lang/en/events/github/deploy_key.php | 12 ++++++++++ .../events/github/branch_protection_rule.php | 22 +++++++++++++++++ lang/ja/events/github/deploy_key.php | 12 ++++++++++ .../events/github/branch_protection_rule.php | 22 +++++++++++++++++ lang/vi/events/github/deploy_key.php | 12 ++++++++++ .../branch_protection_rule/created.blade.php | 19 +++++++++++++++ .../branch_protection_rule/deleted.blade.php | 14 +++++++++++ .../branch_protection_rule/edited.blade.php | 24 +++++++++++++++++++ .../github/deploy_key/created.blade.php | 14 +++++++++++ .../github/deploy_key/deleted.blade.php | 14 +++++++++++ 13 files changed, 221 insertions(+) create mode 100644 lang/de/events/github/branch_protection_rule.php create mode 100644 lang/de/events/github/deploy_key.php create mode 100644 lang/en/events/github/branch_protection_rule.php create mode 100644 lang/en/events/github/deploy_key.php create mode 100644 lang/ja/events/github/branch_protection_rule.php create mode 100644 lang/ja/events/github/deploy_key.php create mode 100644 lang/vi/events/github/branch_protection_rule.php create mode 100644 lang/vi/events/github/deploy_key.php create mode 100644 resources/views/events/github/branch_protection_rule/created.blade.php create mode 100644 resources/views/events/github/branch_protection_rule/deleted.blade.php create mode 100644 resources/views/events/github/branch_protection_rule/edited.blade.php create mode 100644 resources/views/events/github/deploy_key/created.blade.php create mode 100644 resources/views/events/github/deploy_key/deleted.blade.php diff --git a/lang/de/events/github/branch_protection_rule.php b/lang/de/events/github/branch_protection_rule.php new file mode 100644 index 0000000..891c4d7 --- /dev/null +++ b/lang/de/events/github/branch_protection_rule.php @@ -0,0 +1,22 @@ + [ + 'title' => '⚠️ New Branch Protection Rules form 🦑:user', + 'link' => '🔗 Link: :link', + ], + 'edited' => [ + 'title' => '📝 Branch Protection Rules Have Been Edited form 🦑:user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + ], + 'link' => '🔗 Link: :link', + ], + 'deleted' => [ + 'title' => '🗑 Branch Protection Rules Deleted form 🦑:user', + ], +]; diff --git a/lang/de/events/github/deploy_key.php b/lang/de/events/github/deploy_key.php new file mode 100644 index 0000000..b1985fb --- /dev/null +++ b/lang/de/events/github/deploy_key.php @@ -0,0 +1,12 @@ + [ + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], + 'deleted' => [ + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], +]; diff --git a/lang/en/events/github/branch_protection_rule.php b/lang/en/events/github/branch_protection_rule.php new file mode 100644 index 0000000..891c4d7 --- /dev/null +++ b/lang/en/events/github/branch_protection_rule.php @@ -0,0 +1,22 @@ + [ + 'title' => '⚠️ New Branch Protection Rules form 🦑:user', + 'link' => '🔗 Link: :link', + ], + 'edited' => [ + 'title' => '📝 Branch Protection Rules Have Been Edited form 🦑:user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + ], + 'link' => '🔗 Link: :link', + ], + 'deleted' => [ + 'title' => '🗑 Branch Protection Rules Deleted form 🦑:user', + ], +]; diff --git a/lang/en/events/github/deploy_key.php b/lang/en/events/github/deploy_key.php new file mode 100644 index 0000000..b1985fb --- /dev/null +++ b/lang/en/events/github/deploy_key.php @@ -0,0 +1,12 @@ + [ + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], + 'deleted' => [ + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], +]; diff --git a/lang/ja/events/github/branch_protection_rule.php b/lang/ja/events/github/branch_protection_rule.php new file mode 100644 index 0000000..891c4d7 --- /dev/null +++ b/lang/ja/events/github/branch_protection_rule.php @@ -0,0 +1,22 @@ + [ + 'title' => '⚠️ New Branch Protection Rules form 🦑:user', + 'link' => '🔗 Link: :link', + ], + 'edited' => [ + 'title' => '📝 Branch Protection Rules Have Been Edited form 🦑:user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + ], + 'link' => '🔗 Link: :link', + ], + 'deleted' => [ + 'title' => '🗑 Branch Protection Rules Deleted form 🦑:user', + ], +]; diff --git a/lang/ja/events/github/deploy_key.php b/lang/ja/events/github/deploy_key.php new file mode 100644 index 0000000..b1985fb --- /dev/null +++ b/lang/ja/events/github/deploy_key.php @@ -0,0 +1,12 @@ + [ + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], + 'deleted' => [ + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], +]; diff --git a/lang/vi/events/github/branch_protection_rule.php b/lang/vi/events/github/branch_protection_rule.php new file mode 100644 index 0000000..891c4d7 --- /dev/null +++ b/lang/vi/events/github/branch_protection_rule.php @@ -0,0 +1,22 @@ + [ + 'title' => '⚠️ New Branch Protection Rules form 🦑:user', + 'link' => '🔗 Link: :link', + ], + 'edited' => [ + 'title' => '📝 Branch Protection Rules Have Been Edited form 🦑:user', + 'changes' => [ + 'title' => [ + 'name' => '📖 Title has been changed', + 'from' => '📝 From: :title_from', + 'to' => '🏷 To: :title_to', + ], + ], + 'link' => '🔗 Link: :link', + ], + 'deleted' => [ + 'title' => '🗑 Branch Protection Rules Deleted form 🦑:user', + ], +]; diff --git a/lang/vi/events/github/deploy_key.php b/lang/vi/events/github/deploy_key.php new file mode 100644 index 0000000..b1985fb --- /dev/null +++ b/lang/vi/events/github/deploy_key.php @@ -0,0 +1,12 @@ + [ + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], + 'deleted' => [ + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'message' => 'Please go to the setting deploy key to manage.', + ], +]; diff --git a/resources/views/events/github/branch_protection_rule/created.blade.php b/resources/views/events/github/branch_protection_rule/created.blade.php new file mode 100644 index 0000000..200cdc2 --- /dev/null +++ b/resources/views/events/github/branch_protection_rule/created.blade.php @@ -0,0 +1,19 @@ +repository; +?> + +{!! __('tg-notifier::events/github/branch_protection_rule.deleted.title', [ + 'user' => "$repository->full_name" + ] + ) !!} + +📢 {{ $payload->rule->name }} + +{!! __('tg-notifier::events/github/branch_protection_rule.created.link', [ + 'link' => "{$repository->html_url}/settings/branch_protection_rules/{$payload->rule->id}" + ] + ) !!} diff --git a/resources/views/events/github/branch_protection_rule/deleted.blade.php b/resources/views/events/github/branch_protection_rule/deleted.blade.php new file mode 100644 index 0000000..932e8ee --- /dev/null +++ b/resources/views/events/github/branch_protection_rule/deleted.blade.php @@ -0,0 +1,14 @@ +repository; +?> + +{!! __('tg-notifier::events/github/branch_protection_rule.deleted.title', [ + 'user' => "$repository->full_name" + ] + ) !!} + +📢 {{ $payload->rule->name }} diff --git a/resources/views/events/github/branch_protection_rule/edited.blade.php b/resources/views/events/github/branch_protection_rule/edited.blade.php new file mode 100644 index 0000000..2fdfbd6 --- /dev/null +++ b/resources/views/events/github/branch_protection_rule/edited.blade.php @@ -0,0 +1,24 @@ +repository; +?> + +{!! __('tg-notifier::events/github/branch_protection_rule.edited.title', [ + 'user' => "$repository->full_name" + ] + ) !!} + +@if(isset($payload->changes->name->from)) +{!! __('tg-notifier::events/github/issues.edited.changes.title.from', ['title_from' => $payload->changes->name->from]) !!} +{!! __('tg-notifier::events/github/issues.edited.changes.title.to', ['title_to' => $payload->rule->name]) !!} +@else +📢 {{ $payload->rule->name }} +@endif + +{!! __('tg-notifier::events/github/branch_protection_rule.edited.link', [ + 'link' => "{$repository->html_url}/settings/branch_protection_rules/{$payload->rule->id}" + ] + ) !!} diff --git a/resources/views/events/github/deploy_key/created.blade.php b/resources/views/events/github/deploy_key/created.blade.php new file mode 100644 index 0000000..dafbe19 --- /dev/null +++ b/resources/views/events/github/deploy_key/created.blade.php @@ -0,0 +1,14 @@ + + +{!! __('tg-notifier::events/github/deploy_key.created.title', [ + 'issue' => "{$payload->repository->full_name}", + 'user' => "{$payload->key->added_by}", + ] + ) !!} + +📢 {{ $payload->key->title }} +{!! __('tg-notifier::events/github/deploy_key.created.message') !!} diff --git a/resources/views/events/github/deploy_key/deleted.blade.php b/resources/views/events/github/deploy_key/deleted.blade.php new file mode 100644 index 0000000..487a82e --- /dev/null +++ b/resources/views/events/github/deploy_key/deleted.blade.php @@ -0,0 +1,14 @@ + + +{!! __('tg-notifier::events/github/deploy_key.deleted.title', [ + 'issue' => "repository->html_url}'>{$payload->repository->full_name}", + 'user' => "{$payload->key->added_by}", + ] + ) !!} + +📢 {{ $payload->key->title }} +{!! __('tg-notifier::events/github/deploy_key.deleted.message') !!} From 5ef6783d50f2930bc4324c15ab9533a31c8e617b Mon Sep 17 00:00:00 2001 From: pxthinh Date: Mon, 27 Nov 2023 11:16:34 +0700 Subject: [PATCH 2/2] fix: update variable for pull request review and deploy key --- lang/de/events/github/deploy_key.php | 4 ++-- lang/de/events/github/pull_request_review.php | 4 ++-- lang/en/events/github/deploy_key.php | 4 ++-- lang/en/events/github/pull_request_review.php | 4 ++-- lang/ja/events/github/deploy_key.php | 4 ++-- lang/ja/events/github/pull_request_review.php | 4 ++-- lang/vi/events/github/deploy_key.php | 4 ++-- lang/vi/events/github/pull_request_review.php | 4 ++-- resources/views/events/github/deploy_key/created.blade.php | 2 +- resources/views/events/github/deploy_key/deleted.blade.php | 2 +- .../events/github/pull_request_review/dismissed.blade.php | 2 +- .../events/github/pull_request_review/submitted.blade.php | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lang/de/events/github/deploy_key.php b/lang/de/events/github/deploy_key.php index b1985fb..a14fa34 100644 --- a/lang/de/events/github/deploy_key.php +++ b/lang/de/events/github/deploy_key.php @@ -2,11 +2,11 @@ return [ 'created' => [ - 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], 'deleted' => [ - 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], ]; diff --git a/lang/de/events/github/pull_request_review.php b/lang/de/events/github/pull_request_review.php index da3b25c..7d4ad6f 100644 --- a/lang/de/events/github/pull_request_review.php +++ b/lang/de/events/github/pull_request_review.php @@ -2,10 +2,10 @@ return [ 'dismissed' => [ - 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'submitted' => [ - 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'link' => '🔗 Link: :review', ]; diff --git a/lang/en/events/github/deploy_key.php b/lang/en/events/github/deploy_key.php index b1985fb..a14fa34 100644 --- a/lang/en/events/github/deploy_key.php +++ b/lang/en/events/github/deploy_key.php @@ -2,11 +2,11 @@ return [ 'created' => [ - 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], 'deleted' => [ - 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], ]; diff --git a/lang/en/events/github/pull_request_review.php b/lang/en/events/github/pull_request_review.php index da3b25c..7d4ad6f 100644 --- a/lang/en/events/github/pull_request_review.php +++ b/lang/en/events/github/pull_request_review.php @@ -2,10 +2,10 @@ return [ 'dismissed' => [ - 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'submitted' => [ - 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'link' => '🔗 Link: :review', ]; diff --git a/lang/ja/events/github/deploy_key.php b/lang/ja/events/github/deploy_key.php index b1985fb..a14fa34 100644 --- a/lang/ja/events/github/deploy_key.php +++ b/lang/ja/events/github/deploy_key.php @@ -2,11 +2,11 @@ return [ 'created' => [ - 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], 'deleted' => [ - 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], ]; diff --git a/lang/ja/events/github/pull_request_review.php b/lang/ja/events/github/pull_request_review.php index da3b25c..7d4ad6f 100644 --- a/lang/ja/events/github/pull_request_review.php +++ b/lang/ja/events/github/pull_request_review.php @@ -2,10 +2,10 @@ return [ 'dismissed' => [ - 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'submitted' => [ - 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'link' => '🔗 Link: :review', ]; diff --git a/lang/vi/events/github/deploy_key.php b/lang/vi/events/github/deploy_key.php index b1985fb..a14fa34 100644 --- a/lang/vi/events/github/deploy_key.php +++ b/lang/vi/events/github/deploy_key.php @@ -2,11 +2,11 @@ return [ 'created' => [ - 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :issue by :user', + 'title' => '💬 Added Deploy Key ⚠️ from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], 'deleted' => [ - 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :issue by :user', + 'title' => '🗑 Deploy Key Deleted 💬 from 🦑 :repo by :user', 'message' => 'Please go to the setting deploy key to manage.', ], ]; diff --git a/lang/vi/events/github/pull_request_review.php b/lang/vi/events/github/pull_request_review.php index da3b25c..7d4ad6f 100644 --- a/lang/vi/events/github/pull_request_review.php +++ b/lang/vi/events/github/pull_request_review.php @@ -2,10 +2,10 @@ return [ 'dismissed' => [ - 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️🛠️ Dismissed Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'submitted' => [ - 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:issue by :user', + 'title' => '👷‍♂️‍🛠️ New Pull Request Review Comment 💬 - 🦑:repo by :user', ], 'link' => '🔗 Link: :review', ]; diff --git a/resources/views/events/github/deploy_key/created.blade.php b/resources/views/events/github/deploy_key/created.blade.php index dafbe19..2dfd2ce 100644 --- a/resources/views/events/github/deploy_key/created.blade.php +++ b/resources/views/events/github/deploy_key/created.blade.php @@ -5,7 +5,7 @@ ?> {!! __('tg-notifier::events/github/deploy_key.created.title', [ - 'issue' => "{$payload->repository->full_name}", + 'repo' => "{$payload->repository->full_name}", 'user' => "{$payload->key->added_by}", ] ) !!} diff --git a/resources/views/events/github/deploy_key/deleted.blade.php b/resources/views/events/github/deploy_key/deleted.blade.php index 487a82e..ca2bbdf 100644 --- a/resources/views/events/github/deploy_key/deleted.blade.php +++ b/resources/views/events/github/deploy_key/deleted.blade.php @@ -5,7 +5,7 @@ ?> {!! __('tg-notifier::events/github/deploy_key.deleted.title', [ - 'issue' => "repository->html_url}'>{$payload->repository->full_name}", + 'repo' => "repository->html_url}'>{$payload->repository->full_name}", 'user' => "{$payload->key->added_by}", ] ) !!} diff --git a/resources/views/events/github/pull_request_review/dismissed.blade.php b/resources/views/events/github/pull_request_review/dismissed.blade.php index 5f2015b..0ded6f9 100644 --- a/resources/views/events/github/pull_request_review/dismissed.blade.php +++ b/resources/views/events/github/pull_request_review/dismissed.blade.php @@ -7,7 +7,7 @@ ?> {!! __('tg-notifier::events/github/pull_request_review.dismissed.title', [ - 'issue' => "{$payload->repository->full_name}#$pull_request->number", + 'repo' => "{$payload->repository->full_name}#$pull_request->number", 'user' => "@{$pull_request->user->login}" ] ) !!} diff --git a/resources/views/events/github/pull_request_review/submitted.blade.php b/resources/views/events/github/pull_request_review/submitted.blade.php index bd04fb6..5222679 100644 --- a/resources/views/events/github/pull_request_review/submitted.blade.php +++ b/resources/views/events/github/pull_request_review/submitted.blade.php @@ -7,7 +7,7 @@ ?> {!! __('tg-notifier::events/github/pull_request_review.submitted.title', [ - 'issue' => "{$payload->repository->full_name}#$pull_request->number", + 'repo' => "{$payload->repository->full_name}#$pull_request->number", 'user' => "@{$pull_request->user->login}" ] ) !!}