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

Add new feature to find file(recreate) #9889

Merged
merged 1 commit into from Jan 7, 2016
Merged

Add new feature to find file(recreate) #9889

merged 1 commit into from Jan 7, 2016

Conversation

Copy link
Contributor

@koreamic koreamic commented Dec 5, 2015

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!!)

@stanhu
Copy link

@stanhu stanhu commented Dec 9, 2015

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
Copy link
Member

@stanhu stanhu Dec 12, 2015

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!

@stanhu
Copy link

@stanhu stanhu commented Dec 12, 2015

Does this PR also need an upgrade of gitlab_git to 7.2.22?

@stanhu
Copy link

@stanhu stanhu commented Dec 12, 2015

Also, this feature could use a spinach test to test the JavaScript functionality.

@koreamic
Copy link
Author

@koreamic koreamic commented Dec 12, 2015

@stanhu
Thank you for your concern and help.

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'))
Copy link
Member

@Razer6 Razer6 Dec 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@koreamic koreamic Dec 15, 2015

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?

Copy link
Contributor

@DouweM DouweM Dec 22, 2015

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.

@koreamic
Copy link
Author

@koreamic koreamic commented Dec 15, 2015

@stanhu
I added spinach test case and shortcuts that up down arrow to select item easly.
and modified some bugs(main menu bar out focusing)

please check and review sources

thank you.

@yms9654
Copy link

@yms9654 yms9654 commented Dec 17, 2015

👍 This is a great feature!
I think many users like this.

@@ -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){
Copy link
Member

@dzaporozhets dzaporozhets Dec 18, 2015

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

@dzaporozhets
Copy link

@dzaporozhets dzaporozhets commented Dec 18, 2015

Please provide a screenshots for this feature


# make tbody row html
makeHtml: (filePath, blobItemUrl) ->
return @row.replace("%blobItemUrl", blobItemUrl).replace("%filePath", filePath)
Copy link
Member

@stanhu stanhu Dec 19, 2015

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?

Copy link
Contributor

@DouweM DouweM Dec 22, 2015

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
Copy link
Contributor

@DouweM DouweM Jan 5, 2016

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.

@DouweM
Copy link

@DouweM DouweM commented Jan 5, 2016

@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.

@koreamic
Copy link
Author

@koreamic koreamic commented Jan 7, 2016

@DouweM
I have to thank you for your review and concern all the time.
I have learned many things.
I modified sources and commited as your review.
but If there are things to be modified, leave comments.

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
@DouweM
Copy link

@DouweM DouweM commented Jan 7, 2016

@koreamic You're amazing. I've got nothing, I'm merging this.

DouweM added a commit that referenced this issue Jan 7, 2016
Add new feature to find file(recreate)
@DouweM DouweM merged commit 5c7de85 into gitlabhq:master Jan 7, 2016
1 check passed
@JobV
Copy link

@JobV JobV commented Jan 7, 2016

This is awesome. Thanks @koreamic

@DouweM
Copy link

@DouweM DouweM commented Jan 7, 2016

@koreamic I notice you're not credited in the changelog! I added (koreamic) in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2327, let me know if you want that to have your full name instead.

@Razer6
Copy link

@Razer6 Razer6 commented Jan 7, 2016

❤️

@stanhu
Copy link

@stanhu stanhu commented Jan 7, 2016

Great work, @koreamic!

@koreamic
Copy link
Author

@koreamic koreamic commented Jan 7, 2016

@DouweM @stanhu @Razer6 @randx @JobV @yms9654 @noveler17
Thanks a lot for your help & patience.
@DouweM koreamic is enough. thanks

@dzaporozhets
Copy link

@dzaporozhets dzaporozhets commented Jan 7, 2016

@koreamic can you please provide us with your full name? We prefer not to use usernames since it can be different between websites and can produce unnecessary confusion. cc @DouweM

@dzaporozhets
Copy link

@dzaporozhets dzaporozhets commented Jan 7, 2016

@koreamic and thank you for getting this feature done! 👍

@koreamic
Copy link
Author

@koreamic koreamic commented Jan 8, 2016

@randx @DouweM
Okay. My full name is Kyungchul Shin
Thank you.

@dzaporozhets
Copy link

@dzaporozhets dzaporozhets commented Jan 8, 2016

@koreamic thank you!

@DouweM I will update CHANGELOG

@dzaporozhets
Copy link

@dzaporozhets dzaporozhets commented Jan 8, 2016

wow @stanhu already updated CHANGELOG 😄 🚀

@rspeicher
Copy link

@rspeicher rspeicher commented Jan 17, 2016

@koreamic Curious, why did you use fuzzaldrin-plus instead of fuzzaldrin? And which version was it?

@DouweM
Copy link

@DouweM DouweM commented Jan 17, 2016

@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

@rspeicher
Copy link

@rspeicher rspeicher commented Jan 17, 2016

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).

@DouweM
Copy link

@DouweM DouweM commented Jan 17, 2016

@tsigo Ah, good call. It doesn't really matter, the API hasn't changed, so you can just get the latest one.

stanhu pushed a commit to gitlabhq/gitlab_git that referenced this issue Feb 9, 2016
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
@gitlabhq gitlabhq deleted a comment Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants