mozilla / network-pulse

A stream of assets from peers across the Mozilla Network
https://mozillapulse.org
36 stars 41 forks source link

Add number of results for each issue tag #517

Closed kristinashu closed 7 years ago

kristinashu commented 7 years ago

@xmatthewx would you be up for adding something like this? This will be helpful feedback for users when one post appears at the top of several issues.

https://redpen.io/qf3e141d69fb01cf4c

issues results 2x

xmatthewx commented 7 years ago

Yep. Great idea. Useful for search as well.

Sudip7 commented 7 years ago

is this enhancement applicable for issues tab or for all the relevant tabs. Please clarify. @xmatthewx @kristinashu

kristinashu commented 7 years ago

Only in the Issues tab, thanks!

Note that search results already does this (example), please style it the same.

Sudip7 commented 7 years ago

Thanks @kristinashu . I added some code. Please, suggest should I add additional filters in order to restrict that to issue page or keep as it is.

image

image

image

image

@xmatthewx @mmmavis please suggest.

kristinashu commented 7 years ago

Yes, please hide on Featured and Latest pages. Thanks!

xmatthewx commented 7 years ago

👍 Yes. Please hide everywhere. Everywhere but individual issue pages. It could also show on individual tag views, for example: /tags/mozfest. But it shouldn't appear anywhere else.

Sudip7 commented 7 years ago

I have added following code:

reIssueCountResult() {
  if(this.props.latest) return null; 
  if(this.props.featured || this.props.search || this.state.loadingData) return null;
  let total = this.state.totalMatched,
      plural = (total === 0 || total > 1), // because "0 results"
      issueCountResult = `${total} result${plural ? `s` : ``} found`;
  return <p>{issueCountResult}</p>;
},

Even though I added filter for latest tab, not sure why the count is still there.

@xmatthewx @mmmavis please assist.

mmmavis commented 7 years ago

@Sudip7 which file(s) were you working on / adding the above code to?

mmmavis commented 7 years ago

@Sudip7 do you wanna start a PR so I can check out your code and modified files?

Sudip7 commented 7 years ago

@mmmavis , I have changed only one file, project-loader.jsx. M sending the PR

Sudip7 commented 7 years ago

@mmmavis any suggestions on fixing the problem??

mmmavis commented 7 years ago

Oops, this is done. Forgot to close this ticket.

mmmavis commented 7 years ago

https://www.mozillapulse.org/issues/online-privacy-and-security thanks @Sudip7