From a99689006b866e34ed00c24b053e16d6fed69812 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Thu, 29 Jun 2023 22:51:46 +0100 Subject: [PATCH 1/8] refactor(l10n): remove untranslated components in home page Signed-off-by: miguel456 --- resources/views/home.blade.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 189a6f0..02e903f 100755 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -61,8 +61,8 @@
-

Confira os cargos disponíveis

-

Quer colaborar com a equipe da {{ config('app.name') }} Estamos recrutando! Confira um dos nossos cargos abertos. Uma boa equipe é um pilar de uma comunidade bem-sucedida.

+

{{ __('Check out our available roles') }}

+ {!! __("

Are you looking to work with the :appName team? We're actively recruiting! Check out one of our open roles. A good team is an important aaspect of a successful community.

", ['appName' => config('app.name')]) !!}
@@ -138,7 +138,7 @@
-

{{__('Applications Closed')}}

+

{{__('There are no open roles')}}

@@ -148,9 +148,8 @@

{{__('Hello There!')}}

- {{__('We are currently not hiring any new staff members at the moment. If you\'d like to apply, check out our Discord\'s - announcement channel for news when a new position opens. - Our application cycle usually lasts two weeks, so if you\'re seeing this, it\'s because it finished, and new one will begin soon.')}} + {{__('We are currently not recruiting any new staff members at the moment. If you\'d like to apply, check out our community\'s + announcement channel for news when a new role opens.')}}

@@ -169,9 +168,8 @@
-

{{ __('A gestão da :appName responde a todas candidaturas dentro de 48 horas.', ['appName' => config('app.name')]) }}

-

{!! __('Se você tiver algum dúvida sobre a sua conta de recrutamento, candidatura, ou qualquer outra questão, visite o nosso site de atendimento, ou envie-nos um email.', ['supportURL' => config('app.support_url'), 'supportEmail' => config('app.support_email')]) !!}

- + {!! __("

The :appName management team usually responds to applications within :timeTakenAppl hours.", ['appName' => config('app.name'), 'timeTakenAppl' => '48']) !!} +

{!! __('If you have any questions about your web portal account, application or literally anything else, please visit our support site, or send us an email.', ['supportURL' => config('app.support_url'), 'supportEmail' => config('app.support_email')]) !!}

From 498534e9c0917dbc7f0ea8ebf321a63c66280b36 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sat, 1 Jul 2023 22:36:58 +0100 Subject: [PATCH 2/8] chore(refactor): refactor events --- app/Events/ApplicationApprovedEvent.php | 2 +- app/Events/ApplicationDeniedEvent.php | 2 +- app/Events/UserBannedEvent.php | 4 ++-- composer.lock | 16 ++++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Events/ApplicationApprovedEvent.php b/app/Events/ApplicationApprovedEvent.php index c72d2db..c604174 100755 --- a/app/Events/ApplicationApprovedEvent.php +++ b/app/Events/ApplicationApprovedEvent.php @@ -30,7 +30,7 @@ class ApplicationApprovedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $application; + public Application $application; /** * Create a new event instance. diff --git a/app/Events/ApplicationDeniedEvent.php b/app/Events/ApplicationDeniedEvent.php index 48951a3..3a45a0f 100755 --- a/app/Events/ApplicationDeniedEvent.php +++ b/app/Events/ApplicationDeniedEvent.php @@ -30,7 +30,7 @@ class ApplicationDeniedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $application; + public Application $application; /** * Create a new event instance. diff --git a/app/Events/UserBannedEvent.php b/app/Events/UserBannedEvent.php index 05902ad..af024b0 100755 --- a/app/Events/UserBannedEvent.php +++ b/app/Events/UserBannedEvent.php @@ -31,9 +31,9 @@ class UserBannedEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public $user; + public User $user; - public $ban; + public Ban $ban; /** * Create a new event instance. diff --git a/composer.lock b/composer.lock index 8b967a5..d745548 100755 --- a/composer.lock +++ b/composer.lock @@ -9088,22 +9088,22 @@ }, { "name": "composer/class-map-generator", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513" + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513", - "reference": "1e1cb2b791facb2dfe32932a7718cf2571187513", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", "shasum": "" }, "require": { - "composer/pcre": "^2 || ^3", + "composer/pcre": "^2.1 || ^3.1", "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6" + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { "phpstan/phpstan": "^1.6", @@ -9141,7 +9141,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.0.0" + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" }, "funding": [ { @@ -9157,7 +9157,7 @@ "type": "tidelift" } ], - "time": "2022-06-19T11:31:27+00:00" + "time": "2023-06-30T13:58:57+00:00" }, { "name": "composer/pcre", From 2cfdabeb627b14384edfa70ae2978dbdfdc994b0 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 2 Jul 2023 00:01:22 +0100 Subject: [PATCH 3/8] chore(deps): update sentry version, sentry handler --- app/Exceptions/Handler.php | 19 +++++-------------- composer.json | 2 +- composer.lock | 23 ++++++++++------------- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 37c0edb..ebe7e96 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -22,6 +22,7 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Sentry\Laravel\Integration; use Throwable; class Handler extends ExceptionHandler @@ -45,21 +46,11 @@ class Handler extends ExceptionHandler 'password_confirmation', ]; - /** - * Report or log an exception. - * - * @param \Throwable $exception - * @return void - * - * @throws \Exception - */ - public function report(Throwable $exception) + public function register(): void { - if (app()->bound('sentry') && $this->shouldReport($exception)) { - app('sentry')->captureException($exception); - } - - parent::report($exception); + $this->reportable(function (Throwable $e) { + Integration::captureUnhandledException($e); + }); } /** diff --git a/composer.json b/composer.json index a372b89..27b61ab 100755 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "mpociot/teamwork": "^8.0", "opcodesio/log-viewer": "^1.2", "pragmarx/google2fa-laravel": "^1.3", - "sentry/sentry-laravel": "3.2.*", + "sentry/sentry-laravel": "3.6.*", "socialiteproviders/discord": "^4.1", "spatie/laravel-permission": "^5.5", "ultrono/markdown": "*" diff --git a/composer.lock b/composer.lock index d745548..f26cbae 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b69f99d4cab0bf1ae806c2c8e9fd8205", + "content-hash": "366b9feca7fa3c75b96dd22ce137d9f4", "packages": [ { "name": "almasaeed2010/adminlte", @@ -5592,29 +5592,26 @@ }, { "name": "sentry/sentry-laravel", - "version": "3.2.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "55ad9bd47766cec2d8978b8487c40e81a5a87d76" + "reference": "6aacef4d12c22046f68ab617ee1496b9655b8eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/55ad9bd47766cec2d8978b8487c40e81a5a87d76", - "reference": "55ad9bd47766cec2d8978b8487c40e81a5a87d76", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/6aacef4d12c22046f68ab617ee1496b9655b8eb9", + "reference": "6aacef4d12c22046f68ab617ee1496b9655b8eb9", "shasum": "" }, "require": { "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.3", - "sentry/sentry": "^3.12", + "sentry/sdk": "^3.4", + "sentry/sentry": "^3.20", "symfony/psr-http-message-bridge": "^1.0 | ^2.0" }, - "conflict": { - "laravel/lumen-framework": "*" - }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", @@ -5647,7 +5644,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { @@ -5669,7 +5666,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.2.0" + "source": "https://github.com/getsentry/sentry-laravel/tree/3.6.0" }, "funding": [ { @@ -5681,7 +5678,7 @@ "type": "custom" } ], - "time": "2023-02-01T10:56:52+00:00" + "time": "2023-06-29T10:31:13+00:00" }, { "name": "socialiteproviders/discord", From 3e4f8084aef1b59577eb1e776fb57c082c2069e8 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Sun, 2 Jul 2023 00:03:35 +0100 Subject: [PATCH 4/8] fix(suspensions): fix missing datetime cast A missing datetime cast caused issues in the suspension service, where it tried calling Carbon methods on a string (which should have been a Carbon instance). --- app/Ban.php | 2 +- app/Exceptions/Handler.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Ban.php b/app/Ban.php index c88278b..b9124ff 100755 --- a/app/Ban.php +++ b/app/Ban.php @@ -36,7 +36,7 @@ class Ban extends Model ]; public $casts = [ - 'bannedUntil', + 'bannedUntil' => 'datetime', ]; public function user() diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index ebe7e96..51c0c2e 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -57,13 +57,13 @@ class Handler extends ExceptionHandler * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Throwable $exception + * @param \Throwable $e * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable */ - public function render($request, Throwable $exception) + public function render($request, Throwable $e) { - return parent::render($request, $exception); + return parent::render($request, $e); } } From 31b2c151e11f8efdbc0e7c313c46bb44f6332129 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sun, 2 Jul 2023 14:33:14 +0100 Subject: [PATCH 5/8] feat(settings): add analytics settings, customization settings Signed-off-by: miguel456 --- .env.example | 15 +++++++++++++++ config/analytics.php | 11 +++++++++++ config/app.php | 39 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 config/analytics.php diff --git a/.env.example b/.env.example index 15a10a6..ed3c5f9 100755 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ APP_NAME=Laravel +APP_DESCRIPTION="AthenaHR - Your one-stop-shop for your community recruitment needs" APP_ENV=local APP_KEY= APP_DEBUG=true @@ -11,9 +12,16 @@ APP_LOGO="path/to/large/logo.png" APP_LOGO_SM="path/to/small/logo.png" APP_AUTH_BANNER="" APP_SITEHOMEPAGE="" + +# Add your status page here. It'll appear in error pages as a button. +# If you don't have one, leave it empty and the button won't show up. +APP_STATUSPAGE="https://status.athenahr.io" + + API_PREFIX="api" + # FEATURE OVERRIDES # Feature overrides allow you to force-enable/disable features regardless of application settings and feature flags # Turning on the override will disable its feature @@ -56,11 +64,18 @@ DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD= +## SERVICES + RECAPTCHA_SITE_KEY= RECAPTCHA_PRIVATE_KEY= RECAPTCHA_VERIFY_URL="https://www.google.com/recaptcha/api/siteverify" # WARNING: Your contact form will be useless if you change this value. Only change this URL if Google updates it. +# AthenaHR's defaut GTM ID is pre-configured unless you supply one - if you leave this on, we'll use analytics data to improve the app. +# Off by default +GTM_ENABLED=false +GTM_ID="GTM-T47K5CG" + MOJANG_STATUS_URL="https://status.mojang.com/check" MOJANG_API_URL="https://api.mojang.com" diff --git a/config/analytics.php b/config/analytics.php new file mode 100644 index 0000000..b21faa2 --- /dev/null +++ b/config/analytics.php @@ -0,0 +1,11 @@ + [ + 'gtm-enabled' => env('GTM_ENABLED', false), + 'gtm-id' => env('GTM_ID', 'GTM-T47K5CG') + ] + +]; diff --git a/config/app.php b/config/app.php index 12b310d..dade03c 100755 --- a/config/app.php +++ b/config/app.php @@ -34,6 +34,25 @@ return [ 'name' => env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application description + |-------------------------------------------------------------------------- + | + | This value is a short description of the application. The default value uses + | AthenaHR's tagline, but you can set your own value to match your branding. + | + | This value is used in the description meta-tags, so it shows up in search + | results and in embeds, such as Discord link previews. As such, this is a + | highly visible value, so make it count! + | + */ + + + 'description' => env('APP_DESCRIPTION', 'AthenaHR - Your one-stop-shop for your community recruitment needs'), + + /* |-------------------------------------------------------------------------- | Application Homepage @@ -69,7 +88,7 @@ return [ | It forces Laravel to load all assets via HTTPS, even when the environment is | set to "local". This setting is useless in production because it's already enforced. | If you don't enable this when using SSL locally, the pages won't load properly. - | If you're a regular user, don't touch this setting. + | If you're a regular user, you don't need to don't touch this setting. | */ 'force_secure' => env('NONPROD_FORCE_SECURE', false), @@ -79,7 +98,7 @@ return [ | IP address anonymity |-------------------------------------------------------------------------- | - | RB Recruiter collects IP addresses and stores them in the database in order to + | AthenaHR collects IP addresses and stores them in the database in order to | display them to site admins. | | This feature allows you to disable the display and collection of IP addresses, @@ -102,7 +121,7 @@ return [ | - Terms of Service, where you outline acceptable usage of your services; | - Community Guidelines, where you outline acceptable behavior for users on your platforms. | - | RBRecruiter will display these URLs at appropriate locations and force users to accept them, + | AthenaHR will display these URLs at appropriate locations and force users to accept them, | if legally necessary, such as in the registration & application form pages. | | Additionally, you can also specify a support email and URL where your users/customers can send inquiries if necessary. @@ -119,6 +138,20 @@ return [ 'support_email' => env('SUPPORT_EMAIL', 'support@example.com'), 'source_repo' => env('SOURCE_REPO', 'https://code.webvokestudio.pt/miguel456/rbrecruiter'), + + /* + |-------------------------------------------------------------------------- + | Status Page + |-------------------------------------------------------------------------- + | + | AthenaHR can display a helpful status page in error pages. If you want a button + | leading to your status page, fill in this value. Otherwise, leave it blank. + | + */ + + 'statuspage' => env('app_statuspage', ""), + + /* |-------------------------------------------------------------------------- | Application Environment From 7100a4d1b409211164654e99763326f5c7ee7357 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sun, 2 Jul 2023 14:34:05 +0100 Subject: [PATCH 6/8] refactor(deorgify): deorgify homepage header Signed-off-by: miguel456 --- composer.lock | 12 ++++---- resources/views/breadcrumbs/header.blade.php | 32 +++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/composer.lock b/composer.lock index f26cbae..b86c7c3 100755 --- a/composer.lock +++ b/composer.lock @@ -10133,16 +10133,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.0", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", - "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", "shasum": "" }, "require": { @@ -10174,9 +10174,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" }, - "time": "2023-06-01T12:35:21+00:00" + "time": "2023-06-29T20:46:06+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/resources/views/breadcrumbs/header.blade.php b/resources/views/breadcrumbs/header.blade.php index 13d0765..b6c604f 100755 --- a/resources/views/breadcrumbs/header.blade.php +++ b/resources/views/breadcrumbs/header.blade.php @@ -4,18 +4,20 @@ - - - + @if(config('analytics.google.gtm-enabled')) + + + + @endif - + - + @@ -25,8 +27,8 @@ {{config('app.name')}} | {{ __('Home') }} - - + + @@ -110,9 +112,9 @@

{{config('app.name')}}

-
{{ __('Welcome to the :appName Recruitment Portal!', ['appName' => config('app.name')]) }}
+
{{ __('Welcome to the :appName recruitment portal!', ['appName' => config('app.name')]) }}

-

{{ __('We process applications for our Discord server\'s management team here. If you have any questions, don\'t hesistate to contact our support team! Take a look at the open jobs below.') }}

+

{{ __('Please feel free to take a look at any open roles below. If you see something you like, applying is easy!') }}

{!! __('If you\'d like to learn more about our community, make sure to visit our main website!', ['mainWebsiteUrlConfigValue' => config('app.sitehomepage')]) !!}

@@ -167,8 +169,10 @@ @endswitch {{ __('Back to safety') }} - {{ __('System status') }} + @if(!empty(config('app.statuspage'))) + {{ __('System status') }} + @endif From 0d9477aea284b8d5c7ec715edb5729c87824e0a9 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sun, 2 Jul 2023 14:48:44 +0100 Subject: [PATCH 7/8] refactor(deorgify): update copyright footer Signed-off-by: miguel456 --- resources/views/breadcrumbs/footer.blade.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/breadcrumbs/footer.blade.php b/resources/views/breadcrumbs/footer.blade.php index d1e47c0..0c0fe08 100755 --- a/resources/views/breadcrumbs/footer.blade.php +++ b/resources/views/breadcrumbs/footer.blade.php @@ -3,16 +3,18 @@ - + From 1f5df4cc5ab8607982a9a12fcae40e9499fd9c18 Mon Sep 17 00:00:00 2001 From: miguel456 Date: Sun, 2 Jul 2023 14:58:59 +0100 Subject: [PATCH 8/8] refactor(deorgify): misc updates, remove unnecessary stuff Signed-off-by: miguel456 --- resources/views/breadcrumbs/app.blade.php | 10 ++++++---- resources/views/components/card.blade.php | 1 - resources/views/components/global-errors.blade.php | 2 -- resources/views/components/modal.blade.php | 2 -- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/resources/views/breadcrumbs/app.blade.php b/resources/views/breadcrumbs/app.blade.php index 87108cb..0ab09ac 100755 --- a/resources/views/breadcrumbs/app.blade.php +++ b/resources/views/breadcrumbs/app.blade.php @@ -1,10 +1,12 @@ @include('breadcrumbs.header') - - - + @if(config('analytics.google.gtm-enabled')) + + + + @endif @if (session()->has('error')) diff --git a/resources/views/components/card.blade.php b/resources/views/components/card.blade.php index 858a1bc..25ff661 100755 --- a/resources/views/components/card.blade.php +++ b/resources/views/components/card.blade.php @@ -1,5 +1,4 @@
-
diff --git a/resources/views/components/global-errors.blade.php b/resources/views/components/global-errors.blade.php index e6d4f87..d8e3f6b 100755 --- a/resources/views/components/global-errors.blade.php +++ b/resources/views/components/global-errors.blade.php @@ -1,5 +1,3 @@ - - @if (session()->has('success'))