1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-02 14:31:33 +02:00
gitea/web_src/js/features
wxiaoguang 768e16dad1
Use weighted algorithm for string matching when finding files in repo (#21370)
This PR is for:
* https://github.com/go-gitea/gitea/issues/20231

Now, when a user searches `word`, they always see `/{word}.txt` before
`/{w}e-g{o}t-{r}esult.{d}at`

Demo:

When searching "a", "a.ext" comes first. 

Then when searching "at", the longer matched "template" comes first.

<details>


![image](https://user-images.githubusercontent.com/2114189/194588738-3644d891-956f-40e4-b79b-b97d34265456.png)


![image](https://user-images.githubusercontent.com/2114189/194588797-9b124670-4e1e-4510-a170-780295ed89b8.png)

</details>

This PR also makes the frontend tests could import feature JS files by
introducing `jestSetup.js`

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
2022-10-08 12:22:44 +01:00
..
comp
admin-common.js
admin-emails.js
admin-users.js
aria.js
aria.md
clipboard.js
codeeditor.js
colorpicker.js
common-global.js
common-issue.js
common-organization.js
contextpopup.js
dropzone.js
emoji.js
eventsource.sharedworker.js
file-fold.js
formatting.js
heatmap.js
imagediff.js
install.js
mcaptcha.js
notification.js
org-team.js
pull-view-file.js
repo-branch.js
repo-code.js
repo-commit.js
repo-common.js
repo-diff-filetree.js
repo-diff.js
repo-editor.js
repo-findfile.js
repo-findfile.test.js
repo-graph.js
repo-home.js
repo-issue-content.js
repo-issue-pr-form.js
repo-issue.js
repo-legacy.js
repo-migrate.js
repo-migration.js
repo-projects.js
repo-release.js
repo-settings.js
repo-template.js
repo-unicode-escape.js
repo-wiki.js
serviceworker.js
sshkey-helper.js
stopwatch.js
tablesort.js
tribute.js
user-auth-webauthn.js
user-auth.js
user-settings.js