Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #7

Merged
merged 48 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b419867
chore: Bump eslint from 7.21.0 to 7.22.0 (#4956)
dependabot[bot] Mar 15, 2021
20409ec
chore: Bump snyk from 1.474.0 to 1.487.0 (#4955)
dependabot[bot] Mar 15, 2021
b1e4ae3
chore: Bump laravel/framework from 8.31.0 to 8.32.1 (#4958)
dependabot[bot] Mar 15, 2021
c26b57c
chore: Bump symfony/translation from 5.2.4 to 5.2.5 (#4960)
dependabot[bot] Mar 15, 2021
19117ed
chore: Bump laravel/cashier from 12.9.2 to 12.9.3 (#4962)
dependabot[bot] Mar 15, 2021
ed2b3b7
fix: fix the adorable url migration (#4963)
asbiin Mar 15, 2021
5894065
fix: fix the adorable url migration (again) (#4964)
asbiin Mar 15, 2021
e2a0932
chore: Bump sentry/sentry-laravel from 2.4.0 to 2.4.1 (#4961)
dependabot[bot] Mar 15, 2021
db0d014
chore: Bump vimeo/psalm from 4.6.2 to 4.6.3 (#4959)
dependabot[bot] Mar 15, 2021
207bf37
chore(deps): update deps (#4965)
asbiin Mar 15, 2021
99c353e
chore: Bump mocha from 8.3.1 to 8.3.2 (#4954)
dependabot[bot] Mar 15, 2021
ca21705
fix: fix subscriptions list display (#4967)
asbiin Mar 16, 2021
500ecc8
fix: fix broken stay in touch frequency input (#4969)
SimonVanacco Mar 16, 2021
0a732b2
refactor: fix audit logs display (#4971)
asbiin Mar 17, 2021
68c3bf5
chore: remove unused message (#4973)
asbiin Mar 17, 2021
de2042d
chore(i18n): update translations (#4974)
asbiin Mar 17, 2021
6952f41
ci: fix release workflow (#4980)
asbiin Mar 18, 2021
fd700d3
ci: fix release creation (#4982)
asbiin Mar 19, 2021
225e68e
fix: fix udpate maintenance mode message (#4983)
asbiin Mar 19, 2021
8d1f815
chore(release): update release 2.20.0 (#4981)
asbiin Mar 19, 2021
de37e87
style: Minor fix to style and spacing of headers on Dashboard. (#4976)
mgrhm Mar 20, 2021
025392c
style: Minor style and typo fixes to settings.php. (#4907)
mgrhm Mar 21, 2021
da17b8d
feat: add ability to attach dates to gifts (#4909)
sktlmarat Mar 21, 2021
bd6c276
style: minor fix for spacing on subheadings between emoji and text (#…
mgrhm Mar 21, 2021
f058050
style: Minor rewording, style changes to app.php. (#4978)
mgrhm Mar 21, 2021
105b74f
fix: sort and group relationships by relationship type (#4985)
dragosh635 Mar 21, 2021
1ca2a7d
style: standardised megabytes unit to MB preceded by space (#4988)
mgrhm Mar 22, 2021
b5b584a
chore: Bump snyk from 1.493.0 to 1.503.0 (#4993)
dependabot[bot] Mar 22, 2021
10946d3
chore: Bump web-token/jwt-signature-algorithm-eddsa from 2.2.8 to 2.2…
dependabot[bot] Mar 22, 2021
18d4759
chore: Bump web-token/jwt-signature-algorithm-ecdsa from 2.2.8 to 2.2…
dependabot[bot] Mar 22, 2021
cc5468d
chore: Bump web-token/jwt-key-mgmt from 2.2.8 to 2.2.9 (#4997)
dependabot[bot] Mar 22, 2021
5728c6e
chore: Bump web-token/jwt-signature-algorithm-rsa from 2.2.8 to 2.2.9…
dependabot[bot] Mar 22, 2021
be85cad
feat: add date of creation in journal (#4949)
sktlmarat Mar 27, 2021
442fb64
style: gave warning boxes background colours, fixed pale red shade (#…
mgrhm Mar 27, 2021
f513bfe
chore: Bump eslint-plugin-vue from 7.7.0 to 7.8.0 (#4991)
dependabot[bot] Mar 27, 2021
3c633a6
chore: Bump faker from 5.4.0 to 5.5.1 (#5002)
dependabot[bot] Mar 29, 2021
539c9c9
chore: Bump symfony/translation from 5.2.5 to 5.2.6 (#5005)
dependabot[bot] Mar 29, 2021
ac9560b
chore: Bump sentry/sentry-laravel from 2.4.1 to 2.4.2 (#5008)
dependabot[bot] Mar 29, 2021
7835e2c
chore: Bump facade/ignition from 2.5.14 to 2.6.0 (#5010)
dependabot[bot] Mar 29, 2021
016dd07
chore: Bump guzzlehttp/guzzle from 7.2.0 to 7.3.0 (#5013)
dependabot[bot] Mar 29, 2021
14d441b
chore: Bump vimeo/psalm from 4.6.4 to 4.7.0 (#5016)
dependabot[bot] Mar 29, 2021
7a46f92
chore: Bump web-token/jwt-signature-algorithm-ecdsa from 2.2.9 to 2.2…
dependabot[bot] Mar 29, 2021
4d536c8
chore: Bump web-token/jwt-signature-algorithm-rsa from 2.2.9 to 2.2.1…
dependabot[bot] Mar 29, 2021
37da019
chore: Bump web-token/jwt-signature-algorithm-eddsa from 2.2.9 to 2.2…
dependabot[bot] Mar 29, 2021
b834477
chore: Bump laravel/dusk from 6.13.0 to 6.14.0 (#5019)
dependabot[bot] Mar 29, 2021
e1e559b
chore: Bump eslint from 7.22.0 to 7.23.0 (#5006)
dependabot[bot] Mar 29, 2021
f612332
chore: Bump laravolt/avatar from 4.1.1 to 4.1.3 (#5011)
dependabot[bot] Mar 29, 2021
ad1cee8
chore: Bump snyk from 1.503.0 to 1.511.0 (#5012)
dependabot[bot] Mar 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
path: CHANGELOG.md

package:
needs: semantic-release
needs: semantic
runs-on: ubuntu-latest
name: Package release
if: needs.semantic.outputs.new_release_published == 'true'
Expand Down
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
[
"semantic-release-github-pullrequest",
{
"baseRef": "master",
"assets": ["CHANGELOG.md"],
"labels": [
"semantic-release",
Expand Down
Binary file added .rnd
Binary file not shown.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# [2.20.0](https://github.com/monicahq/monica/compare/v2.19.1...v2.20.0) (2021-03-18)


### Bug Fixes

* catch fatal error during install hooks ([#4642](https://github.com/monicahq/monica/issues/4642)) ([1c63ea0](https://github.com/monicahq/monica/commit/1c63ea0b3088e7701c4326bce365a8f09491d6f3))
* fix add gender type ([#4548](https://github.com/monicahq/monica/issues/4548)) ([c0561ce](https://github.com/monicahq/monica/commit/c0561cef7b6c296d41ee42405dec46dae8bb34af))
* fix broken stay in touch frequency input ([#4969](https://github.com/monicahq/monica/issues/4969)) ([500ecc8](https://github.com/monicahq/monica/commit/500ecc830282c79170121c2666a71025aaa65721))
* fix checkbox UI issue in invite user page ([#4546](https://github.com/monicahq/monica/issues/4546)) ([827154e](https://github.com/monicahq/monica/commit/827154e9bebb3a545c71eb73ef204feeaf59ed07))
* fix contact list description display & UI column names ([#4891](https://github.com/monicahq/monica/issues/4891)) ([aa090f8](https://github.com/monicahq/monica/commit/aa090f89846cc5323005636ca77b294953f2c5de))
* fix date missing on journal api ([#4905](https://github.com/monicahq/monica/issues/4905)) ([8de23ba](https://github.com/monicahq/monica/commit/8de23ba01b5b796cc7c9fbe4d22b4f8b8d2d8cd9))
* fix date you met update UX ([#4511](https://github.com/monicahq/monica/issues/4511)) ([288e3d0](https://github.com/monicahq/monica/commit/288e3d0af5bcd331ac83836f25d5b347194f11c9))
* fix docker build ([#4733](https://github.com/monicahq/monica/issues/4733)) ([4fa4561](https://github.com/monicahq/monica/commit/4fa4561c2c4b34d3f39c5266d1581fa2cd9ee75a))
* fix oauth login bad credentials ([#4688](https://github.com/monicahq/monica/issues/4688)) ([28d4cc9](https://github.com/monicahq/monica/commit/28d4cc94bb339e4345ae1a0d9c1a4f45716707ff))
* fix passport setup migration ([#4606](https://github.com/monicahq/monica/issues/4606)) ([e17b89b](https://github.com/monicahq/monica/commit/e17b89b656ea6d002f8347af75aebb631c4d0e4f))
* fix subscriptions list display ([#4967](https://github.com/monicahq/monica/issues/4967)) ([ca21705](https://github.com/monicahq/monica/commit/ca217056bb375d38b4673f6fcfb4db758b775298))
* fix the adorable url migration ([#4963](https://github.com/monicahq/monica/issues/4963)) ([ed2b3b7](https://github.com/monicahq/monica/commit/ed2b3b7667b8ea2c65bd151b4fe0c75364418eb8))
* fix the adorable url migration (again) ([#4964](https://github.com/monicahq/monica/issues/4964)) ([5894065](https://github.com/monicahq/monica/commit/5894065059e5877ba4486c64bc746378ac655fdb))
* update activity with emotions ([#4459](https://github.com/monicahq/monica/issues/4459)) ([d4adb4f](https://github.com/monicahq/monica/commit/d4adb4f206c7637ae5bd21f39009568e0ca639c3))
* update adorable api to api.hello-avatar.com ([#4778](https://github.com/monicahq/monica/issues/4778)) ([527131e](https://github.com/monicahq/monica/commit/527131e4e72f7a0deea5d4a9d8025a6d1a9d15fa))


### Features

* add a confirmation to delete a journal entry [#4308](https://github.com/monicahq/monica/issues/4308) ([#4514](https://github.com/monicahq/monica/issues/4514)) ([18fadb7](https://github.com/monicahq/monica/commit/18fadb77ce7fb4b46fd71ae8205127b9e8c9581d))
* add Android icon for use when bookmarking ([#4798](https://github.com/monicahq/monica/issues/4798)) ([dcee3a9](https://github.com/monicahq/monica/commit/dcee3a943212476f2e96e5c54165daae244c47fc))
* add Apple icons for use when bookmarking. ([#4743](https://github.com/monicahq/monica/issues/4743)) ([a28adcd](https://github.com/monicahq/monica/commit/a28adcdd7d13330271d198c470b6985eee39df11))
* add artisan command to create new account ([#4745](https://github.com/monicahq/monica/issues/4745)) ([b9ee793](https://github.com/monicahq/monica/commit/b9ee793669562c8bf44bd57322e9f5126b2af998))
* add notion of addressbooks ([#3749](https://github.com/monicahq/monica/issues/3749)) ([a18962e](https://github.com/monicahq/monica/commit/a18962ecbf09cb222ac943f8be19362985a7235a))
* add Swedish language ([#4652](https://github.com/monicahq/monica/issues/4652)) ([e1edcad](https://github.com/monicahq/monica/commit/e1edcad04b5cdee0c61883db0d64cf2ca9e9369c))
* allow customization of life event types ([#4243](https://github.com/monicahq/monica/issues/4243)) ([657d824](https://github.com/monicahq/monica/commit/657d824273e8eedc01ed099576571d47d0e26017))
* default gender to unknown ([#4753](https://github.com/monicahq/monica/issues/4753)) ([ebf7c08](https://github.com/monicahq/monica/commit/ebf7c085dd786b174055be389ba5fef35fae861a))
* set and clear personal description now appears in change log ([#4893](https://github.com/monicahq/monica/issues/4893)) ([686a0a1](https://github.com/monicahq/monica/commit/686a0a1f0b2dbbee91fef41eca318a3b9fbd48ff))

# UNRELEASED CHANGES:

### New features:
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function handle(): void
if ($this->confirmToProceed()) {
try {
$this->artisan('✓ Maintenance mode: on', 'down', [
'--message' => 'Upgrading Monica v'.config('monica.app_version'),
'--retry' => '10',
]);

Expand Down
20 changes: 10 additions & 10 deletions app/Helpers/AuditLogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ class AuditLogHelper
*
* @return Collection
*/
public static function getCollectionOfAuditForSettings($logs): Collection
public static function getCollectionOfAudits($logs): Collection
{
$logsCollection = collect();

foreach ($logs as $key => $log) {
$object = null;
$link = null;

// the log is about a contact
if (isset($log->object->{'contact_id'})) {
try {
// check if the contact that the log is about still exists
// in that case, we will display a link to point to this contact
$contact = Contact::findOrFail($log->object->{'contact_id'});
$description = trans(
'logs.settings_log_'.$log->action.'_with_name_with_link',
[
'link' => '/people/'.$contact->hashId(),
'name' => $contact->name,
]
);
$object = $contact->name;
$link = route('people.show', ['contact' => $contact]);
} catch (ModelNotFoundException $e) {
// the contact doesn't exist anymore, we don't need a link, we'll only display a name
$description = trans('logs.settings_log_'.$log->action.'_with_name', ['name' => $log->object->{'contact_name'}]);
$object = $log->object->{'contact_name'};
}
$description = trans('logs.settings_log_'.$log->action.'_with_name', ['name' => $object]);
} else {
$description = trans('logs.settings_log_'.$log->action, ['name' => $log->object->{'name'}]);
}

$logsCollection->push([
'author_name' => ($log->author) ? $log->author->name : $log->author_name,
'description' => $description,
'audited_at' => DateHelper::getShortDateWithTime($log->audited_at),
'link' => $link,
'object' => $object,
'audited_at' => $log->audited_at,
]);
}

Expand Down
15 changes: 15 additions & 0 deletions app/Helpers/CollectionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,19 @@ private static function valueRetriever($value)
return data_get($item, $value);
};
}

/**
* Group collection based on a specific property from its items.
*
* @param \Illuminate\Support\Collection $collection
* @param string $property
*
* @return mixed
*/
public static function groupByItemsProperty($collection, $property)
{
return $collection->mapToGroups(function ($item) use ($property) {
return [data_get($item, $property) => $item];
});
}
}
2 changes: 2 additions & 0 deletions app/Helpers/InstanceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static function getNumberOfPaidSubscribers()
*/
public static function getPlanInformationFromConfig(string $timePeriod): ?array
{
$timePeriod = strtolower($timePeriod);

if ($timePeriod != 'monthly' && $timePeriod != 'annual') {
return null;
}
Expand Down
16 changes: 2 additions & 14 deletions app/Http/Controllers/Contacts/ContactAuditLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers\Contacts;

use App\Helpers\DateHelper;
use App\Helpers\AuditLogHelper;
use App\Models\Contact\Contact;
use App\Http\Controllers\Controller;

Expand All @@ -18,21 +18,9 @@ public function index(Contact $contact)
->orderBy('created_at', 'desc')
->paginate(15);

$logsCollection = collect();

foreach ($logs as $log) {
$description = trans('logs.contact_log_'.$log->action);

$logsCollection->push([
'author_name' => ($log->author) ? $log->author->name : $log->author_name,
'description' => $description,
'audited_at' => DateHelper::getShortDateWithTime($log->audited_at),
]);
}

return view('people.auditlogs.index')
->withContact($contact)
->withLogs($logsCollection)
->withLogsCollection(AuditLogHelper::getCollectionOfAudits($logs))
->withLogsPagination($logs);
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,20 +259,36 @@ public function show(Contact $contact)
$relationships = $contact->relationships;
// get love relationship type
$loveRelationships = $relationships->filter(function ($item) {
$item->relationshipTypeLocalized = $item->relationshipType->getLocalizedName(null, false, $item->ofContact->gender->type ?? null);

return $item->relationshipType->relationshipTypeGroup->name == 'love';
});
$loveRelationships->sortByCollator('relationshipTypeLocalized');

// get family relationship type
$familyRelationships = $relationships->filter(function ($item) {
$item->relationshipTypeLocalized = $item->relationshipType->getLocalizedName(null, false, $item->ofContact->gender->type ?? null);

return $item->relationshipType->relationshipTypeGroup->name == 'family';
});
$familyRelationships->sortByCollator('relationshipTypeLocalized');

// get friend relationship type
$friendRelationships = $relationships->filter(function ($item) {
$item->relationshipTypeLocalized = $item->relationshipType->getLocalizedName(null, false, $item->ofContact->gender->type ?? null);

return $item->relationshipType->relationshipTypeGroup->name == 'friend';
});
$friendRelationships->sortByCollator('relationshipTypeLocalized');

// get work relationship type
$workRelationships = $relationships->filter(function ($item) {
$item->relationshipTypeLocalized = $item->relationshipType->getLocalizedName(null, false, $item->ofContact->gender->type ?? null);

return $item->relationshipType->relationshipTypeGroup->name == 'work';
});
$workRelationships->sortByCollator('relationshipTypeLocalized');

// reminders
$reminders = $contact->activeReminders;
$relevantRemindersFromRelatedContacts = $contact->getBirthdayRemindersAboutRelatedContacts();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/AuditLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function index()
$accountHasLimitations = AccountHelper::hasLimitations(auth()->user()->account);

return view('settings.auditlog.index')
->withLogsCollection(AuditLogHelper::getCollectionOfAuditForSettings($logs))
->withLogsCollection(AuditLogHelper::getCollectionOfAudits($logs))
->withAccountHasLimitations($accountHasLimitations)
->withLogsPagination($logs);
}
Expand Down
13 changes: 4 additions & 9 deletions app/Http/Controllers/Settings/StorageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ class StorageController extends Controller
*/
public function index()
{
$documents = Document::where('account_id', auth()->user()->account_id)
->orderBy('created_at', 'desc')
->get();

$photos = Photo::where('account_id', auth()->user()->account_id)
->orderBy('created_at', 'desc')
->get();
$documents = Document::where('account_id', auth()->user()->account_id)->get();
$photos = Photo::where('account_id', auth()->user()->account_id)->get();
$elements = $documents->concat($photos)->sortByDesc('created_at');

// size is in bytes in the database
$currentAccountSize = StorageHelper::getAccountStorageSize(auth()->user()->account);
Expand All @@ -37,8 +33,7 @@ public function index()

return view('settings.storage.index')
->withAccountHasLimitations($accountHasLimitations)
->withDocuments($documents)
->withPhotos($photos)
->withElements($elements)
->withCurrentAccountSize($currentAccountSize)
->withAccountLimit(config('monica.max_storage_size'))
->withPercentUsage($percentUsage);
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Settings/SubscriptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function index()
]);
}

$planId = $account->getSubscribedPlanId();
try {
$nextBillingDate = $account->getNextBillingDate();
} catch (StripeException $e) {
Expand All @@ -55,7 +54,7 @@ public function index()
}

return view('settings.subscriptions.account', [
'planInformation' => InstanceHelper::getPlanInformationFromConfig($planId),
'planInformation' => InstanceHelper::getPlanInformationFromConfig($subscription->name),
'nextBillingDate' => $nextBillingDate,
'subscription' => $subscription,
'hasInvoices' => $hasInvoices,
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Account/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function contacts()
*/
public function contact()
{
return $this->contacts()->first();
return $this->contacts->first();
}

/**
Expand Down
32 changes: 32 additions & 0 deletions app/Models/Contact/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,38 @@ public function getAvatarDefaultURL()
}
}

/**
* Get the adorable avatar URL.
*
* @param string|null $value
* @return string|null
*/
public function getAvatarAdorableUrlAttribute(?string $value): ?string
{
if (isset($value) && $value !== '') {
return Str::of($value)
->after('https://api.adorable.io/avatars/')
->ltrim('/')
->start(Str::finish(config('monica.adorable_api'), '/'));
}

return null;
}

/**
* Set the adorable avatar URL.
*
* @param string|null $value
* @return void
*/
public function setAvatarAdorableUrlAttribute(?string $value)
{
if (isset($value) && $value !== '') {
$value = Str::of($value)->replace(Str::finish(config('monica.adorable_api'), '/'), '');
}
$this->attributes['avatar_adorable_url'] = $value;
}

/**
* Returns the URL of the avatar, properly sized.
* The avatar can come from 4 sources:
Expand Down
1 change: 1 addition & 0 deletions app/Models/Journal/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function getInfoForJournalEntry()
'month_name' => mb_convert_case(DateHelper::getShortMonth($this->date), MB_CASE_UPPER, 'UTF-8'),
'year' => $this->date->year,
'date' => $this->date,
'created_at' => DateHelper::getShortDateWithTime($this->created_at),
];
}
}
9 changes: 9 additions & 0 deletions app/Providers/MacroServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@ public function boot()
return CollectionHelper::sortByCollator($collect, $callback, $options, $descending);
});
}

if (! Collection::hasMacro('groupByItemsProperty')) {
Collection::macro('groupByItemsProperty', function ($property) {
/** @var Collection */
$collect = $this;

return CollectionHelper::groupByItemsProperty($collect, $property);
});
}
}
}
Loading