Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Commit 3c8ac4e

Browse files
authored
Merge pull request #163 from jpmorganchase/TourFixes
Removes broken tour steps, fixes issue where clicking next on the las…
2 parents 80c0321 + d96895f commit 3c8ac4e

File tree

2 files changed

+29
-38
lines changed

2 files changed

+29
-38
lines changed

cakeshop-api/src/main/webapp/js/sandbox/tour.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,16 @@
131131
},
132132
onShow: function() {
133133
$('.sidenav .settingsView').css({'z-index': '10000'});
134-
}
135-
}
134+
},
135+
onNext: function() {
136+
// for some reason clicking the disabled next button closes but doesn't end the tour.
137+
// End it, reset z-indexes, and go to first tab
138+
$('#tx-icon a').click();
139+
$('.sidenav .settingsView').css({'z-index': '100'});
140+
$('.sidenav li').css({'z-index': '100'});
141+
Sandbox.tour.end()
142+
},
143+
},
136144
]
137145
});
138146

cakeshop-api/src/main/webapp/js/tour.js

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import 'jif-dashboard/dashboard-template'
1212
container: "body",
1313
backdropContainer: "body",
1414
backdropOptions: {
15-
highlightOpacity: 0.8,
15+
highlightOpacity: 0.0, // hightlight animation calulations are off, not needed anyway
1616
highlightColor: '#FFF',
1717
backdropSibling: false,
1818
},
@@ -139,32 +139,11 @@ import 'jif-dashboard/dashboard-template'
139139
},
140140
{
141141
element: ".widget-shell.contract-list",
142-
content: "Here we have a list of contracts deployed on the chain (via the Cakeshop APIs)",
142+
content: "Here we have the contract registry, which tracks the contracts deployed on the chain",
143143
placement: "top",
144144
onShow: showMenuStep("#contracts"),
145145
onHide: hideMenuStep,
146146
},
147-
{
148-
element: ".widget-shell.contract-detail",
149-
content: "Metadata for the selected contract, such as the ABI and the original source code",
150-
placement: "top",
151-
onShow: loadWidget("#contracts", "contract-detail", ".widget-shell.contract-list tbody tr:first button.deets"),
152-
onHide: hideMenuStep,
153-
},
154-
{
155-
element: ".widget-shell.contract-paper-tape",
156-
content: "The paper tape shows the transaction history for the selected contract",
157-
placement: "top",
158-
onShow: loadWidget("#contracts", "contract-paper-tape", ".widget-shell.contract-list tbody tr:first button.tape"),
159-
onHide: hideMenuStep,
160-
},
161-
{
162-
element: ".widget-shell.contract-current-state",
163-
content: "Here we can see the current state of the contract, as read from any exposed public variables (methods marked 'constant' in solidity)",
164-
placement: "top",
165-
onShow: loadWidget("#contracts", "contract-current-state", ".widget-shell.contract-list tbody tr:first button.state"),
166-
onHide: hideMenuStep,
167-
},
168147
])
169148
.concat([
170149
//------------------------------------------------------------------------
@@ -247,19 +226,23 @@ import 'jif-dashboard/dashboard-template'
247226
onHide: hideMenuStep,
248227
},
249228
])
250-
// .concat([
251-
//------------------------------------------------------------------------
252-
// API DOCS
253-
// {
254-
// element: "#api",
255-
// title: "API Documentation",
256-
// content: "This dashboard and all related tools are built using a set of RESTful APIs. These APIs provide a friendly interface for interacting with the blockchain and abstract away some of the complexity",
257-
// backdropContainer: ".tower-sidebar",
258-
// onShow: showMenuStep("#api"),
259-
// onHide: hideMenuStep,
260-
// },
261-
// ])
262-
229+
.concat([
230+
// ------------------------------------------------------------------------
231+
// Version info
232+
{
233+
element: ".tower-sidebar .version-info:first-of-type",
234+
title: "Thanks for using Cakeshop!",
235+
content: "Here you can see the current version of Cakeshop along with the build hash that matches the git commit the produced this build. Please reach out to us with any feedback or support requests.",
236+
backdrop: false,
237+
backdropContainer: ".tower-sidebar",
238+
onShow: () => {
239+
},
240+
onHide: () => {
241+
// for some reason clicking the disabled next button ends the tour but doesn't set the flag. Set it
242+
window.localStorage.setItem('tour_end', true);
243+
},
244+
},
245+
])
263246
});
264247

265248
function loadWidget(tab, widget, click_sel) {

0 commit comments

Comments
 (0)