Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #68 from herpaderpaldent/1.6.4
Browse files Browse the repository at this point in the history
1.6.4 Include new seat plugin service pattern.
  • Loading branch information
herpaderpaldent authored Jan 13, 2019
2 parents 57871fe + b0d7ced commit 825a487
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 49 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#Version 1.6.3
# Version 1.6.4
* Include new seat plugin service pattern.
* Use proper form-id to subscribe to notifications

# Version 1.6.3
This version attempts to resolve major outages in using seat-groups >1.6.0 if not used with seat-notifications installed.

* Refactored GroupSync job to use events for missing refreshtoken, successful attaches/detached role updates and failed syncs
Expand Down
70 changes: 68 additions & 2 deletions src/GroupsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use Herpaderpaldent\Seat\SeatGroups\Listeners\MissingRefreshTokenNotification;
use Herpaderpaldent\Seat\SeatGroups\Observers\RefreshTokenObserver;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
use Seat\Eveapi\Models\RefreshToken;
use Seat\Services\AbstractSeatPlugin;

class GroupsServiceProvider extends ServiceProvider
class GroupsServiceProvider extends AbstractSeatPlugin
{
/**
* Bootstrap the application services.
Expand Down Expand Up @@ -139,4 +139,70 @@ protected function mergeConfigs(array $original, array $merging)

return $array;
}

/**
* Return an URI to a CHANGELOG.md file or an API path which will be providing changelog history.
*
* @return string|null
*/
public function getChangelogUri(): ?string
{

return 'https://raw.githubusercontent.com/herpaderpaldent/seat-groups/master/CHANGELOG.md';
}

/**
* Return the plugin public name as it should be displayed into settings.
*
* @return string
*/
public function getName(): string
{

return 'seat-groups';
}

/**
* Return the plugin repository address.
*
* @return string
*/
public function getPackageRepositoryUrl(): string
{

return 'https://github.com/herpaderpaldent/seat-groups';
}

/**
* Return the plugin technical name as published on package manager.
*
* @return string
*/
public function getPackagistPackageName(): string
{

return 'seat-groups';
}

/**
* Return the plugin vendor tag as published on package manager.
*
* @return string
*/
public function getPackagistVendorName(): string
{

return 'herpaderpaldent';
}

/**
* Return the plugin installed version.
*
* @return string
*/
public function getVersion(): string
{

return config('seatgroups.config.version');
}
}
2 changes: 1 addition & 1 deletion src/config/seatgroups.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 10:24.
*/
return [
'version' => '1.6.3',
'version' => '1.6.4',
];

//TODO: Update Version
92 changes: 47 additions & 45 deletions src/resources/views/notification/channel.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@inject('SeatGroupNotificationController', 'Herpaderpaldent\Seat\SeatGroups\Http\Controllers\SeatGroupNotificationController')

@if( $SeatGroupNotificationController->isDisabledButton('discord') )
<a href="" type="button" class="btn btn-app disabled">
<i class="fa fa-bullhorn"></i>Discord
</a>
<a href="" type="button" class="btn btn-app disabled">
<i class="fa fa-bullhorn"></i>Discord
</a>
@elseif(! $SeatGroupNotificationController->isSubscribed('discord') )
<a href="" type="button" class="btn btn-app" data-toggle="modal" data-target="#discord-channel-modal">
<i class="fa fa-bullhorn"></i>Discord
Expand Down Expand Up @@ -31,46 +31,47 @@
@endif


<div class="modal fade" id="discord-channel-modal">
<div class="modal fade" id="discord-channel-modal" style="text-align: left">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">Discord channel selection</h4>
<h4 class="modal-title">SeAt groups update notification (Discord)</h4>
</div>
<div class="modal-body">

<form id="subscribeDiscordChannelForm" role="form"
<form id="subscribeDiscordChannelSeatGroups" role="form"
action="{{ route('seatgroups.subscribe') }}" method="post">
{{ csrf_field() }}

<input type="hidden" name="via" value="discord">

<div class="row">
<div class="form-group">
<label for="available_channels">Select delivery channel:</label>
<select name="channel_id" id="available_channels" class="form-control" style="width: 100%">
<option></option>
@foreach($available_channels as $channel)
@if(!array_key_exists('discord', $channel))
@continue
@endif

@foreach($channel['discord'] as $channel_id => $channel_name)
<option value="{{ $channel_id }}">{{ $channel_name }}</option>
@endforeach
<div class="form-group">
<label for="available_channels">Select delivery channel:</label>
<select name="channel_id" id="available_channels" class="form-control" style="width: 100%"
form="subscribeDiscordChannelSeatGroups">
<option></option>
@foreach($available_channels as $channel)
@if(!array_key_exists('discord', $channel))
@continue
@endif

@foreach($channel['discord'] as $channel_id => $channel_name)
<option value="{{ $channel_id }}">{{ $channel_name }}</option>
@endforeach
</select>
</div>

@endforeach
</select>
</div>

<span class="help-block">Although you might chose the right channel here you need to make sure that the bot has the appropriate channel permission to post a message.</span>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<button type="submit" form="subscribeDiscordChannelForm" class="btn btn-primary">Save changes</button>
<button type="submit" form="subscribeDiscordChannelSeatGroups" class="btn btn-primary">Save changes</button>
</div>

</div>
Expand All @@ -79,51 +80,52 @@
<!-- /.modal-dialog -->
</div>

<div class="modal fade" id="slack-channel-modal">
<div class="modal fade" id="slack-channel-modal" style="text-align: left">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">Slack channel selection</h4>
<h4 class="modal-title">SeAt groups update notification (Slack)</h4>
</div>
<div class="modal-body">

<form id="subscribeSlackChannelForm" role="form"
<form id="subscribeSlackChannelSeatGroups" role="form"
action="{{ route('seatgroups.subscribe') }}" method="post">
{{ csrf_field() }}

<input type="hidden" name="via" value="slack">

<div class="row">
<div class="form-group">
<label for="available_channels">Select delivery channel:</label>
<select name="channel_id" id="available_channels" class="form-control" style="width: 100%">
<option></option>
@foreach($available_channels as $channel)
@if(!array_key_exists('slack', $channel))
@continue
@endif

@foreach($channel['slack'] as $channel)
<option value="{{ $channel['id'] }}">
{{ $channel['name'] }}
@if($channel['private_channel'])
<i>(private channel)</i>
@endif
</option>
@endforeach

<div class="form-group">
<label for="available_channels">Select delivery channel:</label>
<select name="channel_id" id="available_channels" class="form-control" style="width: 100%"
form="subscribeSlackChannelSeatGroups">
<option></option>
@foreach($available_channels as $channel)
@if(!array_key_exists('slack', $channel))
@continue
@endif

@foreach($channel['slack'] as $channel)
<option value="{{ $channel['id'] }}">
{{ $channel['name'] }}
@if($channel['private_channel'])
<i>(private channel)</i>
@endif
</option>
@endforeach
</select>
</div>

@endforeach
</select>

</div>
<span class="help-block">If do not see the wished channel, invite the bot to it and try again later.</span>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<button type="submit" form="subscribeSlackChannelForm" class="btn btn-primary">Save changes</button>
<button type="submit" form="subscribeSlackChannelSeatGroups" class="btn btn-primary">Save changes</button>
</div>

</div>
Expand Down

0 comments on commit 825a487

Please sign in to comment.