From ef9e74ac7f6c24894d30c1ad921f27adcdc996da Mon Sep 17 00:00:00 2001 From: pxthinh Date: Mon, 27 Nov 2023 00:44:06 +0700 Subject: [PATCH] feat: add view and lang for branch protection rule and deploy key --- .../events/github/branch_protection_rule.php | 22 +++++++++++++++++ lang/en/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 | 16 +++++++++++++ .../github/deploy_key/deleted.blade.php | 16 +++++++++++++ 7 files changed, 123 insertions(+) create mode 100644 lang/en/events/github/branch_protection_rule.php create mode 100644 lang/en/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/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/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..421103f --- /dev/null +++ b/resources/views/events/github/deploy_key/created.blade.php @@ -0,0 +1,16 @@ +repository; +?> + +{!! __('tg-notifier::events/github/deploy_key.created.title', [ + 'issue' => "$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..997286b --- /dev/null +++ b/resources/views/events/github/deploy_key/deleted.blade.php @@ -0,0 +1,16 @@ +repository; +?> + +{!! __('tg-notifier::events/github/deploy_key.deleted.title', [ + 'issue' => "$repository->full_name", + 'user' => "{$payload->key->added_by}", + ] + ) !!} + +📢 {{ $payload->key->title }} +{!! __('tg-notifier::events/github/deploy_key.deleted.message') !!}