-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(web): search by filename #7624
Merged
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
94ead4a
Toggle to search by filename
alextran1502 369c29a
wild card search and pr feedback
alextran1502 a21aaed
Pr feedback
alextran1502 9e3c9c1
naming
alextran1502 f232f37
placeholder
alextran1502 9530a32
Create index
alextran1502 5dde7a3
pr feedback
alextran1502 436ea37
pr feedback
alextran1502 56a97a0
Update web/src/lib/components/shared-components/search-bar/search-tex…
alextran1502 eddcc18
Merge branch 'main' of github.com:immich-app/immich into web/filename…
alextran1502 41f4b67
pr feedback
alextran1502 75c19e4
pr feedback
alextran1502 7e418d7
pr feedback
alextran1502 63ae135
pr feedback
alextran1502 a84dac1
Merge branch 'main' of github.com:immich-app/immich into web/filename…
alextran1502 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script lang="ts"> | ||
export let fileName: string | undefined; | ||
alextran1502 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export let context: string | undefined; | ||
|
||
enum TextSearchOptions { | ||
Context = 'context', | ||
FileName = 'file-name', | ||
alextran1502 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
alextran1502 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
let selectedOption = fileName ? TextSearchOptions.FileName : TextSearchOptions.Context; | ||
|
||
$: { | ||
if (selectedOption === TextSearchOptions.Context) { | ||
fileName = undefined; | ||
} else { | ||
context = undefined; | ||
} | ||
} | ||
</script> | ||
|
||
<div class="flex gap-5"> | ||
<label class="immich-form-label" for="context"> | ||
<input type="radio" name="context" id="context" bind:group={selectedOption} value={TextSearchOptions.Context} /> | ||
<span>CONTEXT</span> | ||
</label> | ||
|
||
<label class="immich-form-label" for="file-name"> | ||
<input | ||
type="radio" | ||
name="file-name" | ||
id="file-name" | ||
bind:group={selectedOption} | ||
value={TextSearchOptions.FileName} | ||
/> | ||
<span>FILE NAME</span> | ||
</label> | ||
</div> | ||
|
||
{#if selectedOption === TextSearchOptions.Context} | ||
<input | ||
class="immich-form-input hover:cursor-text w-full !mt-1" | ||
type="text" | ||
id="context" | ||
name="context" | ||
placeholder="Sunrise on the beach" | ||
bind:value={context} | ||
/> | ||
{:else} | ||
<input | ||
class="immich-form-input hover:cursor-text w-full !mt-1" | ||
type="text" | ||
id="file-name" | ||
name="file-name" | ||
placeholder={'File name or extension i.e. IMG_1234.JPG or PNG'} | ||
alextran1502 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bind:value={fileName} | ||
/> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should rename this since we search on the file path