Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-03-21 22:18:53 -07:00
commit 6c2c36469a
3 changed files with 45 additions and 4 deletions

View file

@ -1163,7 +1163,7 @@ class Helper
* }
* @todo - use this everywhere else in the app where we have very long if/else config('app.lock_passwords') stuff
*/
public function isDemoMode() {
public static function isDemoMode() {
if (config('app.lock_passwords') === true) {
return true;
\Log::debug('app locked!');
@ -1177,7 +1177,7 @@ class Helper
* I know it's gauche to return a shitty HTML string, but this is just a helper and since it will be the same every single time,
* it seemed pretty safe to do here. Don't you judge me.
*/
public function showDemoModeFieldWarning() {
public static function showDemoModeFieldWarning() {
if (Helper::isDemoMode()) {
return "<p class=\"text-warning\"><i class=\"fas fa-lock\"></i>" . trans('general.feature_disabled') . "</p>";
}

View file

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\Setting;
class UpdateSlackSetting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/*
* This is a dumb migration that would only affect a few people that would have been caught in the back-in-time
* migration change to change Slack to slack
*/
$settings = Setting::where('webhook_selected', '=', 'Slack')->get();
foreach($settings as $setting){
$setting->webhook_selected = 'slack';
$setting->save();
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View file

@ -60,8 +60,11 @@
</div>
<div class="col-md-9 required" wire:ignore>
{{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:90%')) }}
@if (Helper::isDemoMode())
{{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:90%', 'disabled')) }}
@else
{{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:90%')) }}
@endif
</div>
</div>