mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-04 16:45:34 +00:00
Merge pull request #16611 from Godmartinz/MS_teams_deprecation_update
Reworked MS Teams deprecation warnings and notifications visibility
This commit is contained in:
@ -722,8 +722,8 @@ class Helper
|
|||||||
// The check and message that the user is still using the deprecated version
|
// The check and message that the user is still using the deprecated version
|
||||||
$deprecations = [
|
$deprecations = [
|
||||||
'ms_teams_deprecated' => array(
|
'ms_teams_deprecated' => array(
|
||||||
'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'),
|
'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows') && (Setting::getSettings()->webhook_selected === 'microsoft'),
|
||||||
'message' => 'The Microsoft Teams webhook URL being used will be deprecated Jan 31st, 2025. <a class="btn btn-primary" href="' . route('settings.slack.index') . '">Change webhook endpoint</a>'),
|
'message' => 'The Microsoft Teams webhook URL being used will be deprecated Dec 31st, 2025. <a class="btn btn-primary" href="' . route('settings.slack.index') . '">Change webhook endpoint</a>'),
|
||||||
];
|
];
|
||||||
|
|
||||||
// if item of concern is being used and its being used with the deprecated values return the notification array.
|
// if item of concern is being used and its being used with the deprecated values return the notification array.
|
||||||
|
|||||||
@ -71,12 +71,12 @@ class SlackSettingsForm extends Component
|
|||||||
|
|
||||||
$this->setting = Setting::getSettings();
|
$this->setting = Setting::getSettings();
|
||||||
$this->save_button = trans('general.save');
|
$this->save_button = trans('general.save');
|
||||||
$this->webhook_selected = $this->setting->webhook_selected;
|
$this->webhook_selected = $this->setting->webhook_selected ?? 'slack';
|
||||||
$this->webhook_name = $this->webhook_text[$this->setting->webhook_selected]["name"];
|
$this->webhook_name = $this->webhook_text[$this->setting->webhook_selected]["name"] ?? $this->webhook_text['slack']["name"];
|
||||||
$this->webhook_icon = $this->webhook_text[$this->setting->webhook_selected]["icon"];
|
$this->webhook_icon = $this->webhook_text[$this->setting->webhook_selected]["icon"] ?? $this->webhook_text['slack']["icon"];
|
||||||
$this->webhook_placeholder = $this->webhook_text[$this->setting->webhook_selected]["placeholder"];
|
$this->webhook_placeholder = $this->webhook_text[$this->setting->webhook_selected]["placeholder"] ?? $this->webhook_text['slack']["placeholder"];
|
||||||
$this->webhook_link = $this->webhook_text[$this->setting->webhook_selected]["link"];
|
$this->webhook_link = $this->webhook_text[$this->setting->webhook_selected]["link"] ?? $this->webhook_text['slack']["link"];
|
||||||
$this->webhook_test = $this->webhook_text[$this->setting->webhook_selected]["test"];
|
$this->webhook_test = $this->webhook_text[$this->setting->webhook_selected]["test"] ?? $this->webhook_text['slack']["test"];
|
||||||
$this->webhook_endpoint = $this->setting->webhook_endpoint;
|
$this->webhook_endpoint = $this->setting->webhook_endpoint;
|
||||||
$this->webhook_channel = $this->setting->webhook_channel;
|
$this->webhook_channel = $this->setting->webhook_channel;
|
||||||
$this->webhook_botname = $this->setting->webhook_botname;
|
$this->webhook_botname = $this->setting->webhook_botname;
|
||||||
@ -90,7 +90,7 @@ class SlackSettingsForm extends Component
|
|||||||
$this->isDisabled= '';
|
$this->isDisabled= '';
|
||||||
}
|
}
|
||||||
if($this->webhook_selected === 'microsoft' && $this->teams_webhook_deprecated) {
|
if($this->webhook_selected === 'microsoft' && $this->teams_webhook_deprecated) {
|
||||||
session()->flash('warning', 'The selected Microsoft Teams webhook URL will be deprecated Jan 31st, 2025. Please use a workflow URL. Microsofts Documentation on creating a workflow can be found <a href="https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498" target="_blank"> here.</a>');
|
session()->flash('warning', trans('admin/settings/message.webhook.ms_teams_deprecation'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function updated($field) {
|
public function updated($field) {
|
||||||
@ -191,6 +191,7 @@ class SlackSettingsForm extends Component
|
|||||||
$this->setting->webhook_endpoint = '';
|
$this->setting->webhook_endpoint = '';
|
||||||
$this->setting->webhook_channel = '';
|
$this->setting->webhook_channel = '';
|
||||||
$this->setting->webhook_botname = '';
|
$this->setting->webhook_botname = '';
|
||||||
|
$this->setting->webhook_selected = '';
|
||||||
|
|
||||||
$this->setting->save();
|
$this->setting->save();
|
||||||
|
|
||||||
|
|||||||
@ -49,12 +49,11 @@ return [
|
|||||||
'error_redirect' => 'ERROR: 301/302 :endpoint returns a redirect. For security reasons, we don’t follow redirects. Please use the actual endpoint.',
|
'error_redirect' => 'ERROR: 301/302 :endpoint returns a redirect. For security reasons, we don’t follow redirects. Please use the actual endpoint.',
|
||||||
'error_misc' => 'Something went wrong. :( ',
|
'error_misc' => 'Something went wrong. :( ',
|
||||||
'webhook_fail' => ' webhook notification failed: Check to make sure the URL is still valid.',
|
'webhook_fail' => ' webhook notification failed: Check to make sure the URL is still valid.',
|
||||||
'webhook_channel_not_found' => ' webhook channel not found.'
|
'webhook_channel_not_found' => ' webhook channel not found.',
|
||||||
|
'ms_teams_deprecation' => 'The selected Microsoft Teams webhook URL will be deprecated Dec 31st, 2025. Please use a workflow URL. Microsoft\'s documentation on creating a workflow can be found <a href="https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498" target="_blank"> here.</a>',
|
||||||
],
|
],
|
||||||
|
|
||||||
'location_scoping' => [
|
'location_scoping' => [
|
||||||
'not_saved' => 'Your settings were not saved.',
|
'not_saved' => 'Your settings were not saved.',
|
||||||
'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping.|There are :count items in the database that need your attention before you can enable location scoping.',
|
'mismatch' => 'There is 1 item in the database that need your attention before you can enable location scoping.|There are :count items in the database that need your attention before you can enable location scoping.',
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@ -266,19 +266,21 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
|||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
@can('admin')
|
@can('admin')
|
||||||
@if ($snipeSettings->show_alerts_in_menu=='1')
|
<!-- Tasks: style can be found in dropdown.less -->
|
||||||
<!-- Tasks: style can be found in dropdown.less -->
|
<?php $alert_items = ($snipeSettings->show_alerts_in_menu=='1') ? Helper::checkLowInventory() : [];
|
||||||
<?php $alert_items = Helper::checkLowInventory(); $deprecations = Helper::deprecationCheck()?>
|
$deprecations = Helper::deprecationCheck()
|
||||||
|
?>
|
||||||
|
|
||||||
<li class="dropdown tasks-menu">
|
<li class="dropdown tasks-menu">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
<x-icon type="alerts" />
|
<x-icon type="alerts" />
|
||||||
<span class="sr-only">{{ trans('general.alerts') }}</span>
|
<span class="sr-only">{{ trans('general.alerts') }}</span>
|
||||||
@if (count($alert_items) || count($deprecations))
|
@if(count($alert_items) + count($deprecations))
|
||||||
<span class="label label-danger">{{ count($alert_items) + count($deprecations) }}</span>
|
<span class="label label-danger">{{ count($alert_items) + count($deprecations)}}</span>
|
||||||
@endif
|
@endif
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
|
@can('superadmin')
|
||||||
@if($deprecations)
|
@if($deprecations)
|
||||||
@foreach ($deprecations as $key => $deprecation)
|
@foreach ($deprecations as $key => $deprecation)
|
||||||
@if ($deprecation['check'])
|
@if ($deprecation['check'])
|
||||||
@ -286,11 +288,12 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
<li class="header">{{ trans_choice('general.quantity_minimum', count($alert_items)) }}</li>
|
@endcan
|
||||||
|
@if($alert_items)
|
||||||
|
<li class="header">{{ trans_choice('general.quantity_minimum', count($alert_items)) }}</li>
|
||||||
<li>
|
<li>
|
||||||
<!-- inner menu: contains the actual data -->
|
<!-- inner menu: contains the actual data -->
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
|
|
||||||
@for($i = 0; count($alert_items) > $i; $i++)
|
@for($i = 0; count($alert_items) > $i; $i++)
|
||||||
|
|
||||||
<li><!-- Task item -->
|
<li><!-- Task item -->
|
||||||
@ -315,13 +318,13 @@ dir="{{ Helper::determineLanguageDirection() }}">
|
|||||||
@endfor
|
@endfor
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{{-- <li class="footer">
|
@endif
|
||||||
<a href="#">{{ trans('general.tasks_view_all') }}</a>
|
{{-- <li class="footer">
|
||||||
</li> --}}
|
<a href="#">{{ trans('general.tasks_view_all') }}</a>
|
||||||
</ul>
|
</li> --}}
|
||||||
</li>
|
</ul>
|
||||||
@endcan
|
</li>
|
||||||
@endif
|
@endcan
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user