Skip to content

Commit ab52490

Browse files
authored
Merge pull request #103 from eveseat/5.0.x
5.0.x
2 parents 0b70be0 + 2d3883f commit ab52490

File tree

221 files changed

+9037
-3120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+9037
-3120
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ name: Tag a new seat-docker release
22
on:
33
release:
44
types: [released]
5+
# Allows you to run this workflow manually from the Actions tab
6+
workflow_dispatch:
57

68
jobs:
79
build:
810
name: Checkout and tag
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1214
with:
1315
repository: eveseat/seat-docker
1416
ssh-key: '${{ secrets.SEAT_DOCKER_REPO }}'

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/bootstrap/compiled.php
2+
.env.*.php
3+
.env.php
4+
.env
5+
.idea/
6+
7+
# testing
8+
vendor/
9+
composer.lock
10+
.phpunit.cache/test-results

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": ">=7.3",
20-
"fideloper/proxy": "^4.0",
21-
"laravel/framework": "^6.2",
19+
"php": "^8.2",
20+
"laravel/framework": "^10.0",
2221
"laravel/slack-notification-channel": "^2.0",
23-
"laravel/tinker": "^2.5",
24-
"eveseat/eveapi": "^4.0",
25-
"eveseat/services": "^4.1",
26-
"symfony/yaml": "^4.0",
27-
"yajra/laravel-datatables-oracle": "~9"
22+
"eveseat/eveapi": "^5.0",
23+
"eveseat/services": "^5.0",
24+
"eveseat/web": "^5.0",
25+
"symfony/yaml": "^6.2",
26+
"yajra/laravel-datatables-oracle": "^10.0"
2827
},
2928
"extra": {
3029
"laravel": {
3130
"providers": [
32-
"Seat\\Notifications\\NotificationsServiceProvider"
31+
"Seat\\Notifications\\NotificationsServiceProvider",
32+
"Seat\\Notifications\\Services\\Discord\\DiscordChannelServiceProvider"
3333
]
3434
}
3535
}

src/Config/Permissions/notifications.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of SeAT
55
*
6-
* Copyright (C) 2015 to 2022 Leon Jacobs
6+
* Copyright (C) 2015 to present Leon Jacobs
77
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
2222

2323
return [
2424
'setup' => [
25-
'label' => 'notifications::notifications.setup_label',
25+
'label' => 'notifications::notifications.setup_label',
2626
'description' => 'notifications::notifications.setup_description',
2727
],
2828
];

src/Config/notifications.alerts.php

Lines changed: 165 additions & 34 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of SeAT
5+
*
6+
* Copyright (C) 2015 to present Leon Jacobs
7+
*
8+
* This program is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation; either version 2 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License along
19+
* with this program; if not, write to the Free Software Foundation, Inc.,
20+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21+
*/
22+
23+
return [
24+
'discord' => [
25+
'route' => 'seatcore::notifications.integrations.new.discord',
26+
'icon' => 'fab fa-discord',
27+
'label' => 'notifications::notifications.new_discord',
28+
],
29+
'slack' => [
30+
'route' => 'seatcore::notifications.integrations.new.slack',
31+
'icon' => 'fab fa-slack',
32+
'label' => 'notifications::notifications.new_slack',
33+
],
34+
'mail' => [
35+
'route' => 'seatcore::notifications.integrations.new.email',
36+
'icon' => 'fas fa-envelope',
37+
'label' => 'notifications::notifications.new_email',
38+
],
39+
];
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/*
4+
* This file is part of SeAT
5+
*
6+
* Copyright (C) 2015 to present Leon Jacobs
7+
*
8+
* This program is free software; you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation; either version 2 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License along
19+
* with this program; if not, write to the Free Software Foundation, Inc.,
20+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21+
*/
22+
23+
return [
24+
'discord_everyone' => [
25+
'type' => 'discord',
26+
'label' => 'notifications::mentions.discord_everyone',
27+
'creation_controller_method' => 'Seat\Notifications\Http\Controllers\MentionsController@createDiscordAtEveryone',
28+
'message_adapter' => 'Seat\Notifications\Mentions\DiscordMentionsAdapter@populateAtEveryone',
29+
],
30+
'discord_here' => [
31+
'type' => 'discord',
32+
'label' => 'notifications::mentions.discord_here',
33+
'creation_controller_method' => 'Seat\Notifications\Http\Controllers\MentionsController@createDiscordAtHere',
34+
'message_adapter' => 'Seat\Notifications\Mentions\DiscordMentionsAdapter@populateAtHere',
35+
],
36+
'discord_role' => [
37+
'type' => 'discord',
38+
'label' => 'notifications::mentions.discord_role',
39+
'creation_controller_method' => 'Seat\Notifications\Http\Controllers\MentionsController@createDiscordAtRole',
40+
'message_adapter' => 'Seat\Notifications\Mentions\DiscordMentionsAdapter@populateAtRole',
41+
],
42+
'discord_user' => [
43+
'type' => 'discord',
44+
'label' => 'notifications::mentions.discord_user',
45+
'creation_controller_method' => 'Seat\Notifications\Http\Controllers\MentionsController@createDiscordAtUser',
46+
'message_adapter' => 'Seat\Notifications\Mentions\DiscordMentionsAdapter@populateAtUser',
47+
],
48+
];

src/Config/package.sidebar.php

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of SeAT
55
*
6-
* Copyright (C) 2015 to 2022 Leon Jacobs
6+
* Copyright (C) 2015 to present Leon Jacobs
77
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -23,30 +23,25 @@
2323
return [
2424

2525
'notifications' => [
26-
'name' => 'notifications',
27-
'label' => 'Notifications',
28-
'icon' => 'fas fa-bell',
26+
'name' => 'notifications',
27+
'label' => 'Notifications',
28+
'icon' => 'fas fa-bell',
2929
'route_segment' => 'notifications',
30-
'entries' => [
30+
'permission' => 'notifications.setup',
31+
'entries' => [
3132
[
32-
'name' => 'integrations',
33-
'label' => 'Integrations',
33+
'name' => 'integrations',
34+
'label' => 'Integrations',
3435
'permission' => 'notifications.setup',
35-
'icon' => 'fas fa-toggle-on',
36-
'route' => 'notifications.integrations.list',
36+
'icon' => 'fas fa-toggle-on',
37+
'route' => 'seatcore::notifications.integrations.list',
3738
],
3839
[
39-
'name' => 'notifications',
40-
'label' => 'My Notifications',
41-
'icon' => 'fas fa-envelope-square',
42-
'route' => 'notifications.list',
43-
],
44-
[
45-
'name' => 'notification.groups',
46-
'label' => 'Notifications Groups',
40+
'name' => 'notification.groups',
41+
'label' => 'Notifications Groups',
4742
'permission' => 'notifications.setup',
48-
'icon' => 'fas fa-object-group',
49-
'route' => 'notifications.groups.list',
43+
'icon' => 'fas fa-object-group',
44+
'route' => 'seatcore::notifications.groups.list',
5045
],
5146
],
5247
],

src/Exceptions/NullNotifierException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of SeAT
55
*
6-
* Copyright (C) 2015 to 2022 Leon Jacobs
6+
* Copyright (C) 2015 to present Leon Jacobs
77
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by

src/Http/Controllers/GroupsController.php

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of SeAT
55
*
6-
* Copyright (C) 2015 to 2022 Leon Jacobs
6+
* Copyright (C) 2015 to present Leon Jacobs
77
*
88
* This program is free software; you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -26,13 +26,15 @@
2626
use Seat\Eveapi\Models\Character\CharacterInfo;
2727
use Seat\Eveapi\Models\Corporation\CorporationInfo;
2828
use Seat\Notifications\Http\DataTables\NotificationGroupDataTable;
29+
use Seat\Notifications\Http\Validation\CreateGroupMention;
2930
use Seat\Notifications\Http\Validation\Group;
3031
use Seat\Notifications\Http\Validation\GroupAffiliation;
3132
use Seat\Notifications\Http\Validation\GroupAlert;
3233
use Seat\Notifications\Http\Validation\GroupAllAlert;
3334
use Seat\Notifications\Http\Validation\GroupIntegration;
3435
use Seat\Notifications\Models\GroupAffiliation as GroupAffiliationModel;
3536
use Seat\Notifications\Models\GroupAlert as GroupAlertModel;
37+
use Seat\Notifications\Models\GroupMention;
3638
use Seat\Notifications\Models\Integration;
3739
use Seat\Notifications\Models\NotificationGroup;
3840
use Seat\Web\Http\Controllers\Controller;
@@ -115,15 +117,6 @@ public function postAddIntegrations(GroupIntegration $request)
115117

116118
// Attach the integrations to the group.
117119
foreach ($request->integrations as $integration_id) {
118-
119-
$integration = Integration::find($integration_id);
120-
121-
// Make sure only one integration type is added.
122-
if ($group->integrations->contains('type', $integration->type))
123-
return redirect()->back()
124-
->with('warning', 'A ' . $integration->type .
125-
' integration already exists. Please choose another type.');
126-
127120
// Add the integration
128121
if (! $group->integrations->contains($integration_id))
129122
$group->integrations()
@@ -150,6 +143,20 @@ public function getDeleteIntegration(int $group_id, int $integration_id)
150143

151144
}
152145

146+
public function postAddGroupMention(CreateGroupMention $request) {
147+
$mention_type = config('notifications.mentions')[$request->mention_type];
148+
149+
// call the controller for creation. It can either show a page to enter more details or directly create the mention.
150+
return app()->call($mention_type['creation_controller_method']);
151+
}
152+
153+
public function postDeleteGroupMention($mention_id) {
154+
GroupMention::destroy($mention_id);
155+
156+
return redirect()->back()
157+
->with('success', 'Removed mention!');
158+
}
159+
153160
/**
154161
* @param \Illuminate\Http\Request $request
155162
* @return \Illuminate\Http\JsonResponse
@@ -159,6 +166,13 @@ public function getAjaxAlerts(Request $request)
159166
$keyword = strtolower($request->query('q', ''));
160167
$alerts = collect(config('notifications.alerts', []));
161168

169+
// remove all hidden groups
170+
$alerts = $alerts->filter(function ($alert) {
171+
$is_visible = $alert['visible'] ?? true;
172+
173+
return $is_visible;
174+
});
175+
162176
if (! empty($keyword)) {
163177
$alerts = $alerts->filter(function ($alert) use ($keyword) {
164178
return strpos(strtolower(trans($alert['label'])), $keyword) !== false;
@@ -242,7 +256,7 @@ public function postAddAffiliation(GroupAffiliation $request)
242256
foreach ($request->input('corporations') as $corp)
243257
if (! $group->affiliations->contains('affiliation_id', $corp))
244258
$group->affiliations()->save(new GroupAffiliationModel([
245-
'type' => 'corp',
259+
'type' => 'corp',
246260
'affiliation_id' => $corp,
247261
]));
248262

@@ -251,7 +265,7 @@ public function postAddAffiliation(GroupAffiliation $request)
251265
foreach ($request->input('characters') as $character)
252266
if (! $group->affiliations->contains('affiliation_id', $character))
253267
$group->affiliations()->save(new GroupAffiliationModel([
254-
'type' => 'char',
268+
'type' => 'char',
255269
'affiliation_id' => $character,
256270
]));
257271

0 commit comments

Comments
 (0)