Skip to content

Commit

Permalink
Merge branch 'master' into migrate_settings_vue
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcage committed Aug 1, 2023
2 parents 544e4ca + dd47ec9 commit 51b7e99
Show file tree
Hide file tree
Showing 98 changed files with 4,923 additions and 7,231 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

GITHASH_LOG_CONTEXT_ENABLED=true
GITHASH_CACHE_ENABLED=false

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
# DB_HOST=mysql
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
PHP_VERSION: "8.1"
NODE_VERSION: "16.x"
NODE_VERSION: "16"

jobs:
laravel-tests:
Expand All @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Static code analysis
run: php ./vendor/bin/phpstan analyse --no-progress
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install NPM packages
Expand All @@ -57,14 +57,3 @@ jobs:
# SESSION_DRIVER: array
# QUEUE_DRIVER: sync
# run: vendor/bin/phpunit

php-security-checker:
name: Local PHP Security Checker
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Local PHP Security Checker
uses: docker://pplotka/local-php-security-checker-github-actions
19 changes: 19 additions & 0 deletions .github/workflows/maintenance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Workflow maintenance

on:
workflow_dispatch:
schedule:
- cron: "0 1 1 * *"

jobs:
cleanup:
name: Delete old workflow runs
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 6
10 changes: 3 additions & 7 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,27 @@ on:

env:
PHP_VERSION: "8.1"
NODE_VERSION: "16.x"
NODE_VERSION: "16"

jobs:
pre-release:
name: "Pre Release"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run build
- name: Store Git hash
shell: bash
run: |
echo "$(git rev-parse HEAD)" >> storage/githash.cache
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ on:

env:
PHP_VERSION: "8.1"
NODE_VERSION: "16.x"
NODE_VERSION: "16"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run build
- name: Store Git hash
- name: Store release version
shell: bash
run: |
echo "$(git rev-parse HEAD)" >> storage/githash.cache
echo "${{ github.ref_name }}" >> RELEASE
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
PHP_BIN: php81
PHP_VERSION: '8.1'
NODE_VERSION: "16.x"
NODE_VERSION: "16"

jobs:
check-secret:
Expand All @@ -38,11 +38,7 @@ jobs:
if: (github.repository == 'OHFLesvos/ohf-community' && needs.check-secret.outputs.remote-data == 'true')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Store Git hash
shell: bash
run: |
echo "$(git rev-parse HEAD)" >> storage/githash.cache
uses: actions/checkout@v3
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
Expand All @@ -51,11 +47,15 @@ jobs:
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run build
- name: Store release version
shell: bash
run: |
echo "${{ github.ref_name }}" >> RELEASE
- name: Enable maintenance mode on remote
uses: appleboy/ssh-action@master
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ _ide_helper.php
.phpstorm.meta.php
.php-cs-fixer.cache
storage/githash.cache
.DS_Store
app/RELEASE
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"amiralizadeh9480.laravel-extra-intellisense",
"codingyu.laravel-goto-view",
"open-southeners.laravel-pint",
"stef-k.laravel-goto-controller",
"damianbal.vs-phpclassgen",
"bmewburn.vscode-intelephense-client",
"octref.vetur"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"webling",
"xampp"
],
"git.pullTags": false
"git.pullTags": false,
"editor.formatOnSave": false
}
25 changes: 24 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Changelog

## NEXT
## 4.2.0

* Add parent-child relations to visitors

## 4.1.0

* Add full-text search to visitor name, improving search usability (searching for LASTNAME SURNAME works the same as SURNAME LASTNAME)

## 4.0.0

* Require PHP 8.1
* Extended visitor report
* Removed knowledge base
* Added support for specifying email domain for Google OAuth login
* Store avatar images locally
* Update icon library (Font Awesome 6)
Expand All @@ -16,6 +27,18 @@
* Add a liability form signed field to visitor records
* Add remarks field to visitor records

## 3.7.3

* Added visitor data to export file

## 3.7.2

* Make visitor date of birth non-mandatory

## 3.7.1

* Make ID number not required anymore for visitor registration

## 3.7.0

* Allow editing of transaction metadata (with specific user permission) for controlled transactions
Expand Down
1 change: 0 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
2 changes: 0 additions & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function register()
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
Expand All @@ -82,7 +81,6 @@ public function render($request, Throwable $exception)
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response|JsonResponse|RedirectResponse
*/
protected function unauthenticated($request, AuthenticationException $exception)
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Fundraising/DonationsExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(private ?Donor $donor = null)
{
}

private function getDonationsQuery(?int $year = null)
private function getDonationsQuery(int $year = null)
{
return $this->donor != null
? $this->donor->donations()
Expand Down
3 changes: 0 additions & 3 deletions app/Exports/Fundraising/DonorsExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ public function map($donor): array
return $map;
}

/**
* @return array
*/
public function columnFormats(): array
{
$formats = [];
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Accounting/API/CategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function index(Request $request): JsonResource
private function filterQuery(Builder $query, string $filter): Builder
{
return $query->where(fn (Builder $wq) => $wq
->where('name', 'LIKE', '%'.$filter.'%')
->orWhere('description', 'LIKE', '%'.$filter.'%')
->where('name', 'LIKE', '%'.$filter.'%')
->orWhere('description', 'LIKE', '%'.$filter.'%')
);
}

Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Accounting/API/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function index(Request $request)

private function filterQuery(Builder $query, string $filter): Builder
{
return $query->where(fn (Builder $wq) => $wq
return $query->where(
fn (Builder $wq) => $wq
->where('name', 'LIKE', '%'.$filter.'%')
->orWhere('description', 'LIKE', '%'.$filter.'%')
);
Expand Down
14 changes: 7 additions & 7 deletions app/Http/Controllers/Accounting/API/SuppliersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public function index(Request $request)
private function filterQuery(Builder $query, string $filter): Builder
{
return $query->where(fn (Builder $wq) => $wq
->where('name', 'LIKE', '%'.$filter.'%')
->orWhere('category', 'LIKE', '%'.$filter.'%')
->orWhere('remarks', 'LIKE', '%'.$filter.'%')
->orWhere('tax_number', $filter)
->orWhere(DB::raw('REPLACE(phone, \' \', \'\')'), str_replace(' ', '', $filter))
->orWhere(DB::raw('REPLACE(mobile, \' \', \'\')'), str_replace(' ', '', $filter))
->orWhere(DB::raw('REPLACE(iban, \' \', \'\')'), str_replace(' ', '', $filter))
->where('name', 'LIKE', '%'.$filter.'%')
->orWhere('category', 'LIKE', '%'.$filter.'%')
->orWhere('remarks', 'LIKE', '%'.$filter.'%')
->orWhere('tax_number', $filter)
->orWhere(DB::raw('REPLACE(phone, \' \', \'\')'), str_replace(' ', '', $filter))
->orWhere(DB::raw('REPLACE(mobile, \' \', \'\')'), str_replace(' ', '', $filter))
->orWhere(DB::raw('REPLACE(iban, \' \', \'\')'), str_replace(' ', '', $filter))
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Accounting/WeblingApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public function store(Wallet $wallet, Request $request): RedirectResponse
$bookedTransactions[] = $transaction->id;
} catch (Exception $e) {
return redirect()->back()
->withInput()
->with('error', $e->getMessage());
->withInput()
->with('error', $e->getMessage());
}
}

Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function showLoginForm()
/**
* Handle a login request to the application.
*
* @param \Illuminate\Http\Request $request
* @return RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Symfony\Component\HttpFoundation\Response|View
*
* @throws \Illuminate\Validation\ValidationException
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
Expand Down Expand Up @@ -97,7 +96,6 @@ protected function validator(array $data)
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
protected function create(array $data)
Expand Down
10 changes: 6 additions & 4 deletions app/Http/Controllers/CommunityVolunteers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ protected function getFields(): array
'assign' => function ($cmtyvol, $value) {
if (collect([__('Female'), 'f', 'w', 'Frau', 'Fräulein', 'Fr.', 'Fr', 'Frl.', 'Frl', 'Missus', 'Missis', 'Miss', 'Mrs.', 'Mrs', 'Ms.', 'Ms'])
->map(fn ($t) => strtolower($t))
->contains(strtolower($value))) {
->contains(strtolower($value))
) {
$cmtyvol->gender = 'f';
} elseif (collect([__('Male'), 'm', 'Herr', 'Hr.', 'Hr', 'Mister', 'Mr.', 'Mr'])
->map(fn ($t) => strtolower($t))
->contains(strtolower($value))) {
->contains(strtolower($value))
) {
$cmtyvol->gender = 'm';
} else {
$cmtyvol->gender = null;
Expand Down Expand Up @@ -205,8 +207,8 @@ protected function getFields(): array
[
'label' => __('Languages'),
'icon' => 'language',
'value' => fn (CommunityVolunteer $cmtyvol) => $cmtyvol->languages != null ? (is_array($cmtyvol->languages) ? implode(', ', $cmtyvol->languages) : $cmtyvol->languages) : null,
'value_html' => fn (CommunityVolunteer $cmtyvol) => $cmtyvol->languages != null ? (is_array($cmtyvol->languages) ? implode('<br>', $cmtyvol->languages) : $cmtyvol->languages) : null,
'value' => fn (CommunityVolunteer $cmtyvol) => $cmtyvol->languages != null ? implode(', ', $cmtyvol->languages) : null,
'value_html' => fn (CommunityVolunteer $cmtyvol) => $cmtyvol->languages != null ? implode('<br>', $cmtyvol->languages) : null,
'overview' => false,
'section' => 'general',
'assign' => function ($cmtyvol, $value) {
Expand Down
Loading

0 comments on commit 51b7e99

Please sign in to comment.