Skip to content

Commit

Permalink
scafold with user name, this prompts for login which helps illustrate…
Browse files Browse the repository at this point in the history
… how local testing works
  • Loading branch information
beefo committed Oct 15, 2016
1 parent ecf5278 commit cdb7653
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generators/app/templates/app/addin.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<body>

<div id="<%= root %>" class="hidden">
<h1>Welcome to my add-in</h1>
<h1>Welcome to <span id="<%= root %>-user">my</span> add-in</h1>
</div>

</body>
Expand Down
6 changes: 6 additions & 0 deletions generators/app/templates/app/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ geotab.addin.<%= root %> = function () {
freshState.setState({
hello: 'world'
});

// getting the current user to display in the UI
freshApi.getSession(session => {
document.querySelector('#<%= root %>-user').textContent = `${session.userName}'s`;
});

// show main content
elAddin.className = '';
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-addin",
"version": "0.1.7",
"version": "0.1.8",
"description": "MyGeotab/Geotab Drive add-in generator",
"homepage": "https://github.com/geotab/generator-addin",
"author": {
Expand Down

0 comments on commit cdb7653

Please sign in to comment.