Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added folder "does not have" filter #767

Merged
merged 3 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"flatIconsDescription": "Show flat button style",
"flatIconsHint": "Flat icons",
"folderDescription": "Folders with each",
"folderExclusionDescription": "Folders without",
"folderHint": "Folder search",
"folderMoreInfo": "Filter for folders containing each of the search words",
"folderExclusionDescription": "Folder names without",
"folderExclusionHint": "Folder exclude filter",
"folderExclusionMoreInfo": "Filter to exclude any folders that contain the filter word",
"folderHint": "Folder search",
Expand Down Expand Up @@ -332,7 +334,7 @@
"file": "video name has",
"fileUnion": "video has any",
"folder": "folder name has",
"folderExclusion": "folder does not have",
"folderExclusion": "folders do not have",
"folderUnion": "folder has any",
"found": "found",
"fuzzy": "fuzzy search",
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Filters: FilterObject[] = [
placeholder: 'SIDEBAR.folderExclusion',
conjunction: 'SIDEBAR.or',
color: Colors.folderExclusion
},{
}, {
uniqueKey: 'fileUnion',
string: '',
array: [],
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/settings-buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export const SettingsButtons: SettingsButtonsType = {
toggled: false
},
'folderExclusion': {
description:'BUTTONS.folderExclusionDescription',
description: 'BUTTONS.folderExclusionDescription',
hidden: true,
iconName: 'icon-folder-x',
moreInfo: 'BUTTONS.folderExclusionMoreInfo',
Expand Down
24 changes: 15 additions & 9 deletions src/app/components/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1238,12 +1238,12 @@ export class HomeComponent implements OnInit, AfterViewInit {
if (!this.settingsButtons['tagExclusion'].toggled) {
this.settingsButtons['tagExclusion'].toggled = true;
}
this.onEnterKey(filter, 7); // 7th item is the `tagExclusion` filter in `FilterKeyNames`
this.onEnterKey(filter, 8); // 8th item is the `tagExclusion` filter in `FilterKeyNames`
} else {
if (!this.settingsButtons['tagIntersection'].toggled) {
this.settingsButtons['tagIntersection'].toggled = true;
}
this.onEnterKey(filter, 6); // 6th item is the `tagIntersection` filter in `FilterKeyNames`
this.onEnterKey(filter, 7); // 7th item is the `tagIntersection` filter in `FilterKeyNames`
}
}

Expand All @@ -1257,27 +1257,33 @@ export class HomeComponent implements OnInit, AfterViewInit {
if (!this.settingsButtons['exclude'].toggled) {
this.settingsButtons['exclude'].toggled = true;
}
this.onEnterKey(filter, 4); // 4th item is the `exclude` filter in `FilterKeyNames`
this.onEnterKey(filter, 5); // 5th item is the `exclude` filter in `FilterKeyNames`
} else {
if (!this.settingsButtons['fileIntersection'].toggled) {
this.settingsButtons['fileIntersection'].toggled = true;
}
this.onEnterKey(filter, 3); // 3rd item is the `fileIntersection` filter in `FilterKeyNames`
this.onEnterKey(filter, 4); // 4th item is the `fileIntersection` filter in `FilterKeyNames`
}
}

/**
* Add filter to FOLDER search when word in folder is clicked
* @param filter
*/
handleFolderWordClicked(filter: string): void {
handleFolderWordClicked(filter: string, event?): void {
this.showSidebar();
if (!this.settingsButtons['folderIntersection'].toggled) {
this.settingsButtons['folderIntersection'].toggled = true;
if (event && event.shiftKey) { // Shift click to exclude tag!
if (!this.settingsButtons['folderExclusion'].toggled) {
this.settingsButtons['folderExclusion'].toggled = true;
}
this.onEnterKey(filter, 2); // 2nd item is the `folderExclusion` filter in `FilterKeyNames`
} else {
if (!this.settingsButtons['folderIntersection'].toggled) {
this.settingsButtons['folderIntersection'].toggled = true;
}
this.onEnterKey(filter, 1); // 1st item is the `folder` filter
}
this.onEnterKey(filter, 1); // 1st item is the `folder` filter
}

/**
* Handle clicking on FOLDER in gallery, or the folder icon in breadcrumbs, or the `UP` folder
* @param filter
Expand Down