Skip to content

Conversation

@erickoledadevrel
Copy link
Contributor

Adapted the code in the sample add-on, but adjusted for a web app deployment. Moved the library's .clasp.json file to the src/ directory so that clasp could be used to deploy the web app.

@erickoledadevrel erickoledadevrel requested a review from grant July 31, 2018 16:47
Copy link
Contributor

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

  • Update license header
  • Coding nits
  • I'd upgrade to Angular 2 if you can.

<script>
var email = '<?= email ?>';
var isSignedIn = '<?= isSignedIn ?>' == 'true';
Copy link
Contributor

Choose a reason for hiding this comment

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

Always use ===.
sed -i -e 's/==/===/g' **/*.*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,50 @@
<!--
* Copyright 2016 Google Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

This line has changed since 2016; Google is a LLC. See go/releasing or look here:

Copyright 2018 Google LLC 
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

/**
* Gets the user's GitHub repos.
*/
function getGitHubRepos() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Combine getGitHubRepos and getGitHubProfile.
These method are too similar. I only see 1 difference (url).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kept them as separate methods, but combined the common bits.

* Create a wrapped version of google.script.run that
* is adapted for Angular promises.
*/
var ScriptService = function($q) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is $q? Please document.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a standard Angular module. Added an @see annotation with a link.

return $q(function(resolve, reject) {
google.script.run
.withSuccessHandler(resolve)
.withFailureHandler(reject)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing ;?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the next line is part of the same statement.

};

/**
* The controller for the sample.
Copy link
Contributor

Choose a reason for hiding this comment

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

Document params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They aren't really parameters, but Angular dependencies. $scope is always just one thing, as with $window. script and intercom are services defined below. There really isn't anything to say about them individually.

1. Run the following commands:
```sh
clasp version "Initial version"
clasp deploy 1 "Web App"
Copy link
Contributor

Choose a reason for hiding this comment

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

You could just clasp deploy unless you really want the version description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice!


## AngularJS

This web app uses the [AngularJS 1 framework](https://angularjs.org/) to make it
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Why don't we upgrade to Angular 2?
  • Can we say Angular instead of AngularJS?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned in the PR description, I took the existing Add-on sample and converted it into a web app. I don't think it's worth the effort to upgrade to the latest Angular version, as I believe it's not a straightforward upgrade process.

.gitignore Outdated
@@ -1,2 +1,4 @@
node_modules/
*.log
samples/**/Secrets.gs
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 mention where we create this Secrets.gs file in the README or in a comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

This sample web application connects to your GitHub account using the Apps
Script OAuth2 library and displays some information about the repositories you
own. It demonstrates some best practices for using this library in a web app.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please include a picture here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@erickoledadevrel erickoledadevrel merged commit 30cfe6d into master Aug 1, 2018
@erickoledadevrel erickoledadevrel deleted the webapp branch August 1, 2018 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants