Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 2020-05-23-feat-2163
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Aug 25, 2020
2 parents d9a1632 + 69617a6 commit e42e941
Show file tree
Hide file tree
Showing 52 changed files with 3,892 additions and 2,866 deletions.
26 changes: 13 additions & 13 deletions .azure/azure.sig
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEuNgCced4O/05ANeg4OezJU6ORAcFAl7mE5wACgkQ4OezJU6O
RAf1OA//a4tBOjn1oJYwNp3QuakpQR8WjhI0y7YbHtAsAqjlizQf9EHgphhon10g
Cllejxr7sa5Kre2qVqWb3FpnpeW6XdTGEJxXnjffNj/11b08pCD0745h7LJXW9Ny
PldsQELZS1Oz+vOmxvaVowq6ynM4BuLm2uT1matbR+/Nk92RTv0EtK+8ptRnzVUb
M/Qzzv4J8pN2z06LyUjuNzD622NU/peoIhHP6iekUhagcRu5HxEdcLMiGx8nKHJ2
du8zGDw8IXIwfi+U2SVq8JkhIN5kBkki0SxgFNNPVunh4dopsYYChqBgoP40om//
aq1nldvUp9teLC1S8mVXbuzmsEedZ7jFanBSVy+HQQXA6ok81JK9Q+FWNOAf/hlF
Brs0LG9KUpC4IW7ndBcv3Or1j4kLCrn9iG9ux+g84Jn69rn78VTmzdPSUY5BNMQM
cvPXuCA/tVLiBESGlZG1eisSvrhGsZu1cTwEiR/xQO9YrDXCEAUnQRcfn76qd4p0
x8fn2wzZU3XiTbcInAcQs9pwJXJ3ICR7JWbL4JBQg9N8HvLFgidsI+paZMxCC/KW
GYHql21Sd9Sxw+ONTTfFIp0qC85p2XwGewHPgfc4cR5GHPlNb8DwLtelND17Gf9t
vOm6jhzoLya1XSOeeaw2WaQWVhbQM49+ChxZZHYReHHEMHjq65U=
=gZB5
iQIzBAABCgAdFiEEuNgCced4O/05ANeg4OezJU6ORAcFAl9EuPkACgkQ4OezJU6O
RAcSSA/+OfGKqZSrpg/kF+aXB5qLqrgKtIxxxPKWf7OjXBIVfmrAs8gtiu7pyoLg
LC3GpAmVlh9BY4NkuAJgq1su9LHY+7bRowupfCNOUXo0AAD7t7yxTHtt/w7A8uAH
3gmeWQqo+AGuAepcT8eRJ8DxtMvT++MAGibeSE4ZrQ/Se19m22dTxrj5byKZceyW
vzPfIt+AozRbEDBubQvSPMl3ZTdWrlRbt+Gk1aLzUu5vFqrbF7eaGoYkdOpRbOvg
mljSy8DaFeFCf8mwGk4IHRxlcqNN7y/2ns4CSGzYtFAMSzSO4C0ktycrEYhCx6fG
JMs51q7QhoIw+USUgTw8v1oDxm9EsgY3W1YV8vC4I8HOlqcQmRIBzA9mNtP29hcT
dKBJT2ypuYN7qDQRBUscGHXCg4TnfLZMJfDYt+HbciVJtB49iwcWW56XJlriRFsk
tl7k1JwYUzqYoDkFxX1OOKg84cZ/37ifxm8yGWGbyWEJqunUdUBmDQYm5gLVhcHF
ueyQx4thmhQfwjk9NGeb2k1T/CWrVH2f9DGptNJpxN0L7R88GwE4Rf1FsG3gRXJo
9hBZ2rDgvz8yUpZuMQ15Tdt23ZDa8Bl625VLTPTWu5r7VHzGNmq9f0Jg0A/djcAc
Gv9lHzAjzPDi+WmKzAqepiPXCmfznaKE5zz3Hov207c/uYPqkxI=
=GLcU
-----END PGP SIGNATURE-----
1 change: 1 addition & 0 deletions .azure/step-prepare-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ steps:
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
sudo apt-get install php$(phpVersion)-intl
sudo apt-get install php-imagick
php -version
displayName: Set php version $(phpVersion)

Expand Down
5 changes: 5 additions & 0 deletions .azure/step-runsonar.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
steps:
- script: |
echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)"
displayName: Use Java 11

- template: step-cache-sonar.yml

- bash: |
Expand Down
9 changes: 3 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,9 @@ MFA_ENABLED=true
# Enable DAV support
DAV_ENABLED=true

# CLIENT ID and SECRET used for the official mobile application
# This is to make sure that only the mobile application that you approve can
# access the route to let your users sign in with their credentials
# Note: the official mobile application is not currently available on the stores.
MOBILE_CLIENT_ID=
MOBILE_CLIENT_SECRET=
# CLIENT ID and SECRET used for OAuth authentication
PASSPORT_PERSONAL_ACCESS_CLIENT_ID=
PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET=

# Allow to access general statistics about your instance through a public API
# call
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 7 * * 0'

jobs:
CodeQL-Build:

# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
3 changes: 2 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
uses: actions/checkout@v2

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: imagick
coverage: none
- name: Check PHP Version
run: php -v
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@

### Enhancements:

*
* Update tag management on the contact profile
* Add next and previous arrows when viewing photos
* Add dependency to php imagick module
* Renamed MOBILE_CLIENT_ID and MOBILE_CLIENT_SECRET variables to PASSPORT_PERSONAL_ACCESS_CLIENT_ID and PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET

### Fixes:

*
* Fix exception when registering in certain cases
* Fix vue-select usage


# RELEASED VERSIONS:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ Ivan Kruchkoff @ivankruchkoff <ivan@kruchkoff.com>
Joaquim Monserrat @jeremies
Jack Kuo @JackKuo-tw <jackkuo@jackkuo.org>
Russell Ault @RussellAult
Martijn van der Ven @Zegnat <martijn@vanderven.se>
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ ENTRYPOINT ["scripts/docker/entrypoint.sh"]
# Apache2
COPY scripts/docker/apache2-foreground /usr/local/sbin/
COPY scripts/docker/000-default.conf /etc/apache2/conf.d/
RUN echo 'LoadModule rewrite_module modules/mod_rewrite.so' > /etc/apache2/conf.d/rewrite.conf

EXPOSE 80
CMD ["apache2-foreground"]
2 changes: 1 addition & 1 deletion app/Helpers/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function parseDate($date, $timezone = null): ?Carbon
$date->setTimezone($appTimezone);
}

return $date;
return $date === false ? null : $date;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/Auth/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ private function proxy(array $data = []): array
/** @var \Illuminate\Http\Response */
$response = app(Kernel::class)->handle(Request::create($url, 'POST', [
'grant_type' => $data['grantType'],
'client_id' => config('monica.mobile_client_id'),
'client_secret' => config('monica.mobile_client_secret'),
'client_id' => config('passport.personal_access_client.id'),
'client_secret' => config('passport.personal_access_client.secret'),
'username' => $data['username'],
'password' => $data['password'],
'scope' => '',
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ protected function create(array $data): ?User

return $user;
} catch (\Exception $e) {
Log::warning($e);
Log::error($e);

return null;
abort(500, trans('auth.signup_error'));
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/Models/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ public function getNameAttribute(): string
if ($this->name_order == 'firstname_lastname' || $this->name_order == 'firstname_lastname_nickname') {
$completeName = $this->first_name;

if (! is_null($this->last_name)) {
if ($this->last_name !== '') {
$completeName = $completeName.' '.$this->last_name;
}
} else {
if (! is_null($this->last_name)) {
if ($this->last_name !== '') {
$completeName = $this->last_name;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Account/Photo/UploadPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function execute(array $data): ?Photo
return null;
}

return tap(Photo::create($array), function ($photo) use ($contact) {
return tap(Photo::create($array), function ($photo) use ($contact): void {
$contact->photos()->syncWithoutDetaching([$photo->id]);
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Contact/Gift/UpdateGift.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function execute(array $data): Gift
$this->validate($data);

$gift = Gift::where('account_id', $data['account_id'])
->findOrFail($data['gift_id']);
->findOrFail((int) $data['gift_id']);

Contact::where('account_id', $data['account_id'])
->findOrFail($data['contact_id']);
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"ext-bcmath": "*",
"ext-gd": "*",
"ext-gmp": "*",
"ext-imagick": "*",
"ext-intl": "*",
"ext-redis": "*",
"asbiin/laravel-webauthn": "^0.8",
"bacon/bacon-qr-code": "^1.0",
"bacon/bacon-qr-code": "^2.0",
"creativeorange/gravatar": "~1.0",
"doctrine/dbal": "2.9.3",
"erusev/parsedown": "^1.7",
Expand All @@ -23,7 +24,7 @@
"intervention/image": "^2.3",
"laravel/cashier": "~10.0",
"laravel/framework": "^7.0",
"laravel/passport": "^8.0",
"laravel/passport": "^9.0",
"laravel/socialite": "^4.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
Expand Down Expand Up @@ -63,13 +64,13 @@
"matthiasnoback/live-code-coverage": "^1.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^4.1",
"nunomaduro/larastan": "^0.5",
"nunomaduro/larastan": "^0.6",
"phpunit/phpcov": "^7.0",
"phpunit/phpunit": "^9.0",
"psalm/plugin-laravel": "^1.0",
"psalm/plugin-laravel": "1.1.1",
"roave/security-advisories": "dev-master",
"thecodingmachine/phpstan-safe-rule": "^1.0",
"vimeo/psalm": "^3.10"
"vimeo/psalm": "3.11.2"
},
"suggest": {
"ext-apcu": "*"
Expand Down
Loading

0 comments on commit e42e941

Please sign in to comment.