fix + show one mult group

*change jinja logic
*handle format value error
*show one mult group if none exist (when create new one for example)
This commit is contained in:
BlasenhauerJ 2023-02-14 13:53:08 +01:00
parent 7828c0225a
commit 39b0f3f195
3 changed files with 21 additions and 3 deletions

View File

@ -75,12 +75,25 @@ class ServiceModal {
this.updateModalData(obj);
}
//open modal when all done
if(action === 'new') this.addOneMultGroup()
this.openModal();
}
} catch (err) {}
});
}
addOneMultGroup() {
const settings = document.querySelector('[services-modal-form]')
const multAddBtns = settings.querySelectorAll('[services-multiple-add]');
multAddBtns.forEach(btn => {
//check if already one (SCHEMA exclude so length >= 2)
const plugin = btn.closest('[plugin-item]');
if(plugin.querySelectorAll('[services-settings-multiple]').length >= 2) return;
btn.click()
})
}
isLastServAndAct(target) {
const serviceName = target.closest("button").getAttribute("services-name");
const serviceAction = target

View File

@ -155,8 +155,13 @@ class FormatValue {
init() {
this.inputs.forEach((inp) => {
inp.setAttribute("value", inp.getAttribute("value").trim());
inp.value = inp.value.trim();
try {
inp.setAttribute("value", inp.getAttribute("value").trim());
inp.value = inp.value.trim();
}catch(err) {
}
});
}
}

View File

@ -299,7 +299,7 @@ url_for(request.endpoint)[1:].split("/")[-1].strip().replace('_', '-') %}
type="button"
value="download"
{{current_endpoint}}-download="{{child['name'].split('/')[0]}}"
{{current_endpoint}}-file="{{child['name'].split('/')[1] or child['name'].split('/')[0]}}"
{{current_endpoint}}-file="{{child['name'].split('/')[1]}}"
{{current_endpoint}}-setting-select-dropdown-btn="{{child['name'].split('/')[0]}}"
class="duration-300 border-gray-300 hover:brightness-90 bg-white text-white my-0 relative px-6 py-2 text-center align-middle transition-all rounded-none cursor-pointer leading-normal text-sm ease-in tracking-tight-rem dark:border-slate-600 dark:bg-slate-700 dark:text-gray-300 w-full border-b border-l border-r hover:bg-gray-100"
>