N°7157 - Allow users to unsubscribe from notification channels (#611)

* N°7157 - Allow users to unsubscribe from notification channels

* Fix type hinting

* Add missing dict entries

* Allows to subscribe/unsubscribe from notifications individually

* Refactor NotificationsService to singleton pattern

* Refactor NotificationsRepository to singleton pattern and rename methods to a more functional naming

* Add PHPDoc and type hints

* Dump autoloaders

* Replace modals with toasts

* Add dict entry

---------

Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
This commit is contained in:
Stephen Abello
2024-02-19 09:25:47 +01:00
committed by GitHub
parent efe5f004a1
commit ceba1ad1e9
28 changed files with 1305 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
<div class="option ibo-input-select--autocomplete-item" role="option" >
{# Image #}
<span class="ibo-input-select--autocomplete-item-image" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
<span class="ibo-input-select--autocomplete-item-image" data-template-add-class="class" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
{# Desc #}
<span class="ibo-input-select--autocomplete-item-txt">

View File

@@ -0,0 +1,21 @@
<div class="item ibo-input-select--notification-item" role="item" >
{# Image #}
<span class="ibo-input-select--autocomplete-item-image" data-template-add-class="class" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
{# Desc #}
<span class="ibo-input-select--autocomplete-item-txt">
{# Friendly name #}
<span data-template-text="friendlyname"></span>
{# Additional content #}
{% block additional_content %}
{% endblock %}
<span class="ibo-input-select--notification-item--mixed-value" data-template-condition="mixed">
<span data-template-text="mixed_value"></span>
</span>
</span>
</div>

View File

@@ -7,6 +7,9 @@
name="{{ oUIBlock.GetName() }}"
multiple
style="display: none;"
{% if oUIBlock.IsDisabled() == true %}
disabled
{% endif %}
>
</select>

View File

@@ -49,6 +49,14 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
{% if oUIBlock.HasRemoveItemButton() %}
'remove_button' : {},
{% endif %}
{# PLUGIN min items #}
{% if oUIBlock.GetMinItems() is not empty %}
'combodo_min_items' : {
minItems: {{ oUIBlock.GetMinItems() }},
errorMessage: '{{ 'UI:Component:Input:Set:MinimumItems'|dict_format(oUIBlock.GetMinItems()) }}'
},
{% endif %}
},
{# Max items you can select #}
@@ -197,6 +205,31 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
'data-tooltip-html-enabled': true
});
CombodoTooltip.InitTooltipFromMarkup($item);
{% if oUIBlock.GetOnItemAddJs() is not null %}
{{ oUIBlock.GetOnItemAddJs()|raw }}
{% endif %}
},
{# On item remove #}
onItemRemove: function(value, $item){
{% if oUIBlock.GetOnItemRemoveJs() is not null %}
{{ oUIBlock.GetOnItemRemoveJs()|raw }}
{% endif %}
},
{# On option remove #}
onOptionRemove: function(value, $item){
{% if oUIBlock.GetOnOptionRemoveJs() is not null %}
{{ oUIBlock.GetOnOptionRemoveJs()|raw }}
{% endif %}
},
{# On option add #}
onOptionAdd: function(value, $item){
{% if oUIBlock.GetOnOptionAddJs() is not null %}
{{ oUIBlock.GetOnOptionAddJs()|raw }}
{% endif %}
},
{# plugin combodo_add_button #}

View File

@@ -0,0 +1,17 @@
{# @copyright Copyright (C) 2010-2023 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
<div class="option simple-option-renderer" role="option">
<div class="simple-option-renderer--container" data-template-add-class="class">
<img class="simple-option-renderer--container--icon" src="" data-template-attr-src="img">
<span class="simple-option-renderer--container--label" data-template-text="label">
</span>
<span class="simple-option-renderer--container--complementary" data-template-text="complementary-text">
</span>
</div>
</div>