Skip to content

Commit cdb7653

Browse files
committed
scafold with user name, this prompts for login which helps illustrate how local testing works
1 parent ecf5278 commit cdb7653

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

generators/app/templates/app/addin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<body>
3232

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

3737
</body>

generators/app/templates/app/scripts/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ geotab.addin.<%= root %> = function () {
4040
freshState.setState({
4141
hello: 'world'
4242
});
43+
44+
// getting the current user to display in the UI
45+
freshApi.getSession(session => {
46+
document.querySelector('#<%= root %>-user').textContent = `${session.userName}'s`;
47+
});
48+
4349
// show main content
4450
elAddin.className = '';
4551
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-addin",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "MyGeotab/Geotab Drive add-in generator",
55
"homepage": "https://github.com/geotab/generator-addin",
66
"author": {

0 commit comments

Comments
 (0)