Revert "add disabled pro plugin multiple global config"

This reverts commit cdff0df465.
This commit is contained in:
Jordan Blasenhauer 2024-05-10 17:22:33 +02:00
parent 5814f64cca
commit 4b24d0a38e
2 changed files with 1 additions and 23 deletions

View file

@ -215,8 +215,6 @@ class Multiple {
.closest("button")
.hasAttribute(`data-${this.prefix}-multiple-add`)
) {
if (this.isAvoidAction(e.target)) return;
//get plugin from btn
const btn = e.target.closest("button");
const attName = btn.getAttribute(
@ -284,8 +282,6 @@ class Multiple {
.closest("button")
.hasAttribute(`data-${this.prefix}-multiple-delete`)
) {
if (this.isAvoidAction(e.target)) return;
// We are not removing it really, just hiding it and update values to default
// By setting default value, group will be send to server and delete (because a setting with default value is useless to keep)
const multContainer = e.target.closest(
@ -345,17 +341,6 @@ class Multiple {
});
}
isAvoidAction(target) {
// check that not disabled pro plugin
const proDisabled = target
.closest("[data-plugin-item]")
.hasAttribute("data-pro-disabled")
? true
: false;
return proDisabled;
}
sortMultipleByContainerAndSuffixe(obj) {
const sortMultiples = {};
for (const [name, value] of Object.entries(obj)) {
@ -711,13 +696,6 @@ class Multiple {
//for already existing global config multiples
//global is check
setDisabledMultServ(inp, method, global) {
// Check if pro
const proDisabled = inp
.closest("[data-plugin-item]")
.hasAttribute("data-pro-disabled")
? true
: false;
if (proDisabled) return inp.setAttribute("disabled", "");
if (global) return inp.removeAttribute("disabled");
if (method === "ui" || method === "default") {

View file

@ -1,7 +1,7 @@
{% set current_endpoint = current_endpoint or url_for(request.endpoint)[1:].split("/")[-1].strip().replace('_', '-') %}
<!-- plugin item -->
{% for plugin in plugins %}
<div data-advanced data-plugin-item="{{ plugin['id'] }}" {% if plugin['type'] == 'pro' and not is_pro_version %} data-pro-disabled {% endif %}
<div data-advanced data-plugin-item="{{ plugin['id'] }}" {% if plugin['type'] == 'pro' and not is_pro_version %} data-pro-disabled {% endif %}"
id="{{ plugin['id'] }}"
class="{% if loop.index != 1 %}hidden{% endif %} w-full px-1">
<!-- title and desc -->