Skip to content

Conversation

@cloverhearts
Copy link
Member

What is this PR for?

When you type in the search box and start the search,
The result is not exposed.
Previously, it was working well.

What type of PR is it?

Hot Fix

Todos

  • - fixed bug on navbar.html and controller

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-866

How should this be tested?

try to search action on navbar.

Screenshots (if appropriate)

before

test02

#### after

test01

### Questions: - Does the licenses files need update? no - Is there breaking changes for older versions? no - Does this needs documentation? no

$scope.search = function() {
$location.url(/search/ + $scope.searchTerm);
$scope.search = function(searchTerm) {
console.log('search term ', searchTerm);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove console.log from here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@prabhjyotsingh oh, Thank you!

@prabhjyotsingh
Copy link
Contributor

If we use $scope.search = function(searchTerm) then we can this function becomes redundant. Can you remove this as well.

$rootScope.$on('$locationChangeSuccess', function () {
 var path = $location.path();
 // hacky solution to clear search bar
 // TODO(felizbear): figure out how to make ng-click work in navbar
 if (path === '/') {
   $scope.searchTerm = '';
 }
});

@cloverhearts
Copy link
Member Author

@prabhjyotsingh
I think that code would clean up the search box.
It should not be deleted.

@prabhjyotsingh
Copy link
Contributor

Or that is also broken for $locationChangeSuccess, its not cleaning up. Can you fix this as well ?

@cloverhearts
Copy link
Member Author

@prabhjyotsingh Okay, i will look to this issue.

@cloverhearts
Copy link
Member Author

cloverhearts commented May 23, 2016

@prabhjyotsingh
you're alright.
this is code is bug and dead code. If active to code, the search becomes impossible.
So I have deleted that code.

@cloverhearts
Copy link
Member Author

@prabhjyotsingh
fix done.
Please, Can you feedback for this pr for me?

@bzz
Copy link
Member

bzz commented May 24, 2016

Thanks for hotfix, but do we know why it stopped working in the first place?
Let me take a look.

\cc @felizbear for review as well

@astroshim
Copy link
Contributor

I tesed and working well. but it seems need a "initial statement".

<form role="search"
style="width: 300px; display: inline-block; margin: 0 10px"
ng-submit="search()">
ng-submit="search(searchTerm)">
Copy link
Contributor

Choose a reason for hiding this comment

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

i definitely like passing the argument to search instead of taking it from the $scope 👍

@cloverhearts
Copy link
Member Author

cloverhearts commented May 24, 2016

@astroshim Thank you for feed back.
are you meant 'initial statement' for 'clean up on search box'?

@AhyoungRyu
Copy link
Contributor

AhyoungRyu commented May 24, 2016

@cloverhearts I agree with @astroshim. I think he was saying that when the result is nothing, Zeppelin needs to show some statement like "We couldn’t find any notebook matching 'something_you_typed' "

@astroshim
Copy link
Contributor

Thanks for the detail explanation AhyoungRyu.

@cloverhearts
Copy link
Member Author

Thank you for explaining, @astroshim @AhyoungRyu
I agree too.
But, This is must exist only for bug fixes at this PR.
I will make it in the next PR.

@AhyoungRyu
Copy link
Contributor

@cloverhearts Yeah you're right. LGTM 👍

@prabhjyotsingh
Copy link
Contributor

I think this sounds good, have created a jira for the same https://issues.apache.org/jira/browse/ZEPPELIN-869. LGTM.
I'll Merge this if no more discussion.

@bzz
Copy link
Member

bzz commented May 24, 2016

Let me take a look.

@prabhjyotsingh could you please wait, as there was an issue raised, but not addressed yet?

Thanks for hotfix, but do we know why it stopped working in the first place?

It would be really cool, if we could know the answer, as I think it might help us avoiding such bugs further down the road. @cloverhearts could you please share, if you have already done some investigation before?

@prabhjyotsingh
Copy link
Contributor

Surething.

@cloverhearts
Copy link
Member Author

@bzz
can not access to '$ scope.searchTerm variable at navbar.html' in navbar.controller
Code and nav are not currently operating normally.
I did not find the PR of the problem, which seems to be a problem at some point.
This can cause a lot of problems in the current navbar.
For example
#912

I think we need to recover the ability to hotfix first.
And it should retouching the navbar.

@bzz
Copy link
Member

bzz commented May 25, 2016

@cloverhearts fix looks great to me. Pity that we can not identify the source of the bug though.

Let's merge as a hotfix!

@prabhjyotsingh
Copy link
Contributor

Sure, I'll merge this.

@asfgit asfgit closed this in 3b40c3a May 26, 2016
shijinkui pushed a commit to shijinkui/incubator-zeppelin that referenced this pull request May 26, 2016
### What is this PR for?
When you type in the search box and start the search,
The result is not exposed.
Previously, it was working well.

### What type of PR is it?
Hot Fix

### Todos
* [x] - fixed bug on navbar.html and controller

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-866
### How should this be tested?
try to search action on navbar.

### Screenshots (if appropriate)
#### before
<img width="1280" alt="test02" src="https://cloud.githubusercontent.com/assets/10525473/15469402/10713c64-2125-11e6-909d-cb375e7c31a4.png">

#### after
<img width="1280" alt="test01" src="https://cloud.githubusercontent.com/assets/10525473/15469411/1a6e0b0c-2125-11e6-9ade-e4147e7143d8.png">

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes apache#911 from cloverhearts/fixed/searchbar and squashes the following commits:

bca027b [CloverHearts] remove whitespace
c592422 [CloverHearts] add space in navbar.controller.js
433139a [CloverHearts] removed event locationChangeSuccess on pr ( does not working search bar)
bac1254 [CloverHearts] removed console.log (pr does not working search box)
4d06560 [CloverHearts] Hotfix -  dose not working search box on navbar.
@cloverhearts cloverhearts deleted the fixed/searchbar branch June 16, 2016 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants