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
Add new feature to find file(recreate) #9889
Conversation
|
Great work! I assume since this depends on this gitlab_git MR, this PR has to wait until a new version is release? Can you add tests for this? |
| include ExtractsPath | ||
| include ActionView::Helpers::SanitizeHelper | ||
| include TreeHelper | ||
| before_action :assign_ref_vars |
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.
Do we also need to add:
before_action :require_non_empty_project
before_action :authorize_download_code!|
Does this PR also need an upgrade of gitlab_git to 7.2.22? |
|
Also, this feature could use a spinach test to test the JavaScript functionality. |
|
@stanhu Yes. This PR needs an upgrade of gitlab_git to 7.2.22. and okay I will check to use a spinach test. If you need to additional works. please comment. Thank you. have a nice day. |
| @@ -14,6 +14,7 @@ class @ShortcutsNavigation extends Shortcuts | |||
| Mousetrap.bind('g m', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-merge_requests')) | |||
| Mousetrap.bind('g w', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-wiki')) | |||
| Mousetrap.bind('g s', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-snippets')) | |||
| Mousetrap.bind('t', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-find-file')) | |||
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.
Shouldn't this only be active to on the tree page? Can you also update https://github.com/gitlabhq/gitlabhq/blob/master/app/views/help/_shortcuts.html.haml and the screenshot in https://github.com/gitlabhq/gitlabhq/blob/master/doc/workflow/shortcuts.md
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.
Okay, @Razer6 Thank you for your suggestions.
I updated _shortcuts.html.haml and screenshot.
and I added shortcuts using up and down array key in find file view to select file more conveniently.
The reason that add t shortcut in app/assets/javascripts/shortcuts_navigation.coffee is to use find file view on other page(eg. merge request/commit/branch page) If necessary.
but If not necessary, I just define it on the tree view.
what do you think about that?
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.
I think it doesn't make sense on the issues page, but it does on any file pages (tree, blob, blame) as well as the project root.
|
@stanhu please check and review sources thank you. |
|
|
| @@ -0,0 +1,1158 @@ | |||
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |||
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.
Please move this file to /vendor/assets/javascripts
|
Please provide a screenshots for this feature |
|
|
||
| # make tbody row html | ||
| makeHtml: (filePath, blobItemUrl) -> | ||
| return @row.replace("%blobItemUrl", blobItemUrl).replace("%filePath", filePath) |
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.
What happens if the file path has the text %blobItemUrl? Can we just construct the entire text without a replace?
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.
As mentioned above, please generate the row DOM using jQuery.
| $(".tree-table > tbody").empty() | ||
|
|
||
| for filePath, i in filePaths | ||
| break if i > 19 |
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.
So if i == 20? :) That may be a little clearer.
|
@koreamic I may seem very critical (and I am), but I tried it out locally and it works really, really well. Great job. I can't wait to have this in the next release :) I'm sure we can get it ready. |
|
@DouweM |
Using the fuzzy filter, develop "file finder" feature. - feedback(http://feedback.gitlab.com/forums/176466-general/suggestions/4987909-add-file-finder-fuzzy-input-in-files-tab-to-ju ) - fuzzy filter(https://github.com/jeancroy/fuzzaldrin-plus) - shortcuts(when "t" was hitted at tree view, go to 'file find' page and 'esc' is to go back) - depends on gitlab_git 7.2.22
|
@koreamic You're amazing. I've got nothing, I'm merging this. |
|
This is awesome. Thanks @koreamic |
|
@koreamic I notice you're not credited in the changelog! I added |
|
|
|
Great work, @koreamic! |
|
@koreamic and thank you for getting this feature done! |
|
wow @stanhu already updated CHANGELOG |
|
@koreamic Curious, why did you use fuzzaldrin-plus instead of fuzzaldrin? And which version was it? |
|
@tsigo That was at my suggestion actually. I had much better results in Atom's fuzzy finder with the "Use Alternate Scoring" option enabled, which switches from fuzzaldrin to fuzzaldrin-plus. It's now the default in Atom's fuzzy finder as well: atom/fuzzy-finder@c004c7e |
|
Ok. Do we know which version it was? I'm trying to replace the minified vendor JS with non-minified versions (specifically so we know version info, among other things). |
|
@tsigo Ah, good call. It doesn't really matter, the API hasn't changed, so you can just get the latest one. |
Added function ls_files in Gitlab::Git::Repository Using native git command(git ls-tree) ls_files function ls to return only each file's full paths of a repository This function is called by Repository within GitLab as @DouweM 's suggestion. (ref : gitlabhq/gitlabhq#9889 & https://github.com/gitlabhq/gitlabhq#9855) See merge request !60
Using the fuzzy lib, develop "file finder" feature.
(http://feedback.gitlab.com/forums/176466-general/suggestions/4987909-add-file-finder-fuzzy-input-in-files-tab-to-ju)
Issue(#9854)
PR(#9855)
(ps. cause by my mistake, recreate PR(#9855), sorry!!)