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

Ramenhog/version url param #16

Merged
merged 4 commits into from
Apr 17, 2018
Merged

Ramenhog/version url param #16

merged 4 commits into from
Apr 17, 2018

Conversation

ramenhog
Copy link
Contributor

Closes #13

The main changes to use.js are in the showVersion() function on line #271. The file was also reformatted with JSPrettier.

screen shot 2018-04-17 at 2 32 29 pm

@ghost ghost assigned ramenhog Apr 17, 2018
@aaronkw
Copy link

aaronkw commented Apr 17, 2018

This is perfect for my needs!!

@ramenhog ramenhog assigned dongbohu, cgreene and ramenhog and unassigned ramenhog Apr 17, 2018
Copy link
Contributor

@dongbohu dongbohu left a comment

Choose a reason for hiding this comment

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

A minor comment in the first file. Not sure whether I need to review use.js.

$scope.chosenVersion = Versions.get(verParams);
$location.search({ version: chosenVersionHash });
};
$scope.geneset.$promise.then(function(data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to add a blank line between 280 and 281 to make it more readable.

var versionParam = $location.search().version;

if (versionParam) {
var matchingVersions = $scope.geneset.versions.filter(function(
Copy link
Contributor

Choose a reason for hiding this comment

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

The search of versionParam doesn't have to scan the whole $scope.geneset.versions. It will be done when one match is found. So it can be written like this:

if (versionParam) {
  var found = $scope.geneset.versions.find(function(version) {
    return version.ver_hash === versionParam;
  });
  if (found) {
    initialVersion = versionParam;
  }
}
...

Of course, if $scope.geneset.versions includes only a few elements, then no big deal.

@@ -12,354 +12,409 @@
* The dependencies block here is also where component dependencies should be
* specified, as shown below.
*/
angular.module( 'tribe.genesets.use', [
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you change anything else except the coding style in this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

Never mind, I meant the other parts except showVersion().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, that's it 👍

@ramenhog
Copy link
Contributor Author

ramenhog commented Apr 17, 2018

Thanks, just addressed the concerns. Back to you :) @dongbohu

Copy link
Contributor

@dongbohu dongbohu left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@ramenhog ramenhog merged commit 94c0c90 into master Apr 17, 2018
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.

4 participants