[go: nahoru, domu]

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

Issue/2718 site search selection #2815

Merged
merged 12 commits into from
Jun 12, 2015
Merged

Conversation

kwonye
Copy link
Contributor
@kwonye kwonye commented Jun 10, 2015

Two things:

  1. Just clean up that @aforcier mentioned that didn't make it into the previous merge. Mostly removing unused parameters
  2. Addresses issue Searching and selecting non-visible site does not allow you to 'Visit Site' #2817. getCurrentBlog() currently checks for blog visibility. With the site picker search, the user can select a non-visible blog. Clicking 'View Site' does not work for non-visible blogs. So there are two options:
    1. Make any blog selected visible.
    2. getCurrentBlog() doesn't care about visibility.

My vote would be 2. Visibility seems to be a purely UI-driven concept, and auditing the calls to it doesn't yield any concerns. However, @maxme suggested 1. Thoughts?

@roundhill @nbradbury @tonyr59h @aforcier

@kwonye kwonye changed the title Feature/2718 site search Issue/2718 site search selection Jun 10, 2015
@kwonye kwonye added this to the 4.2 milestone Jun 10, 2015
@daniloercoli daniloercoli self-assigned this Jun 11, 2015
@daniloercoli
Copy link
Contributor

Make any blog selected visible.
getCurrentBlog() doesn't care about visibility.
My vote would be 2. Visibility seems to be a purely UI-driven concept, and auditing the calls to it doesn't yield any concerns. However, @maxme suggested 1. Thoughts?

My personal experience with the site picker seems to suggest the option 1. When I searched for a site would have been nice to have it available in the list right after.

@daniloercoli
Copy link
Contributor

The code looks OK, and can be merged if we go with the option 2.

@nbradbury
Copy link
Contributor

I think either option works, but my vote is for #1 since it seems more user-friendly. Either way, I think the search results should show hidden sites using the same "muted" styling I added here.

@kwonye
Copy link
Contributor Author
kwonye commented Jun 11, 2015

Ready for review. Now when a hidden site is selected, it becomes visible.

@@ -446,6 +438,15 @@ public static Blog setCurrentBlog(int id) {
return currentBlog;
}

public static Blog setCurrentBlogAndSetVisible(int id) {
Blog blog = getBlog(id);
Copy link
Contributor

Choose a reason for hiding this comment

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

In the current version of the code setCurrentBlogAndSetVisible and setCurrentBlog despite doing almost the same thing they have different code.
I also noticed that setCurrentBlog is very similar to getBlog.

My .2$: It's probably better to have setCurrentBlogAndSetVisible calling setCurrentBlog, and in order, change setCurrentBlog that should call getBlog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also noticed that setCurrentBlog is very similar to getBlog.

Good catch! Didn't notice that. In fact, setBlog() returning a value didn't make sense so I looked at its usages and no one used the return value so I removed it.

It's probably better to have setCurrentBlogAndSetVisible calling setCurrentBlog and in order, change setCurrentBlog that should call getBlog.

So it was calling it before, but as the return value. Now, it calls it first and then sets the blog as visible. I believe that's what you meant.

@daniloercoli (adding your name just in case it doesn't ping you)

@daniloercoli
Copy link
Contributor

:shipit:

daniloercoli added a commit that referenced this pull request Jun 12, 2015
@daniloercoli daniloercoli merged commit 36987be into develop Jun 12, 2015
@daniloercoli daniloercoli deleted the feature/2718-site-search branch June 12, 2015 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants