Some bugfixes for #1673

This commit is contained in:
the-djmaze 2024-08-05 17:20:41 +02:00
parent 85fb2ff44d
commit 3a8af7de29
2 changed files with 28 additions and 5 deletions

View file

@ -1,8 +1,30 @@
((rl) => {
const EmptyOption = { id: -1, name: '' };
const Folders = ko.computed(() => {
return [EmptyOption, ...rl.app.folderList().map((f) => ({ name: f.name }))];
const
aResult = [{
id: -1,
name: ''
}],
sDeepPrefix = '\u00A0\u00A0\u00A0',
showUnsubscribed = true/*!SettingsUserStore.hideUnsubscribed()*/,
foldersWalk = folders => {
folders.forEach(oItem => {
if (showUnsubscribed || oItem.hasSubscriptions() || !oItem.exists) {
aResult.push({
id: oItem.fullName,
name: sDeepPrefix.repeat(oItem.deep) + oItem.detailedName()
});
}
if (oItem.subFolders.length) {
foldersWalk(oItem.subFolders());
}
});
};
foldersWalk(rl.app.folderList());
return aResult;
});
const Priorities = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const searchQ = ko.observable(''),
priority = ko.observable(1),
@ -92,6 +114,7 @@
const advS = event.detail;
if (advS.viewModelTemplateID == 'PopupsAdvancedSearch') {
const button = document.createElement('button');
button.setAttribute('class', 'btn');
button.setAttribute('data-i18n', 'SFILTERS/CREATE_FILTER');
button.addEventListener('click', function () {
searchQ(advS.buildSearchString());
@ -149,7 +172,7 @@
}
}
rl.addSettingsViewModel(SearchFiltersSettingsTab, 'STabSearchFilters', 'Filters', 'filters');
rl.addSettingsViewModel(SearchFiltersSettingsTab, 'STabSearchFilters', 'Search Filters', 'searchfilters');
class SearchFiltersPopupView extends rl.pluginPopupView {
constructor() {

View file

@ -17,7 +17,7 @@
options: folders,
value: fFolder,
optionsText: 'name',
optionsValue: 'name',
optionsValue: 'id',
enable: usefFolder
"></select>
</div>
@ -51,4 +51,4 @@
<footer>
<button form="search-filters-form" class="btn buttonSearchFilters" data-icon="✔"
data-i18n="SFILTERS/CREATE_FILTER"></button>
</footer>
</footer>