Skip to content

Commit 45f9c4e

Browse files
author
Volodymyr Tymtsiv
committed
Remove sub-tabs in the Tutorials tab.
1 parent 6a09fe7 commit 45f9c4e

6 files changed

Lines changed: 107 additions & 30 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
### Adding a new tutorial
2+
3+
To add a new tutorial you need to do the following:
4+
5+
1) Add a file with a scenario to tour_scenario folder which you want to implement
6+
2) Create a method in tutorial.controller.js which will start the tour.
7+
3) Create a button in main-tutorial.html.
8+
4) Add ng-click directive to the button with a method which will start the tour.
9+
10+
11+
Now let's look closer to these steps.
12+
13+
### Adding scenario
14+
15+
You need to create a file and declare all steps related to the tour.
16+
17+
Each step has a type. For each step, the element of the step will be highlighted.
18+
19+
There are four step types:
20+
21+
- click - To get the next step it is necessary to click on the element;
22+
- input - To get the next step it is necessary to type in the input what is described in the step and click 'next' button;
23+
- notice - Just highlight the element. To get the next step it is necessary to click 'next' button;
24+
- select - Just highlight the element
25+
26+
Each step could have a custom logic relate to step (some action which needs to do before or after the step is shown)
27+
They should be declared in `eventHandlers` array.
28+
29+
Also, each step could have buttons.
30+
31+
There are four type of buttons:
32+
33+
- next
34+
- back
35+
- skip
36+
- done
37+
38+
To declare a default behavior you just need to declare the button type.
39+
If necessary to add some custom behavior to the button you could declare `action` field in button which is a function. It will rewrite the default behavior of the button.
40+
41+
For instance:
42+
43+
```
44+
{
45+
type: 'back',
46+
action: function () {
47+
$("#info-tab").trigger("click");
48+
}
49+
}
50+
```
51+
52+
53+
### Creating a method in tutorial.controller.js
54+
55+
Example:
56+
```javascript
57+
$scope.startServiceTutorial = function () {
58+
TourBuilder.buildTour(createServiceScenario);
59+
};
60+
61+
```
62+
63+
Where `createServiceScenario` is the name of the variable in the scenario file.
64+
65+
66+
### Adding button and use the method from the controller
67+
68+
69+
Example:
70+
71+
```html
72+
<button class="btn btn-primary" type="button" ng-click="startServiceTutorial()">
73+
Let's create a Service
74+
</button>
75+
```
76+
77+
Where `startServiceTutorial` the method name of the new tour.
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+

app/admin_components/adf-tutorial/tutorial.controller.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ angular.module('dfTutorial')
66

77
$scope.$parent.title = 'Tutorials';
88

9-
$scope.links = [
10-
{
11-
name: 'services',
12-
label: 'Services',
13-
path: 'service-tutorial'
14-
}
15-
];
16-
17-
$scope.start = function () {
9+
$scope.startServiceTutorial = function () {
1810
TourBuilder.buildTour(createServiceScenario);
1911
};
2012

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
<div>
2-
<div class="col-md-2 df-sidebar-nav">
3-
<df-sidebar-nav></df-sidebar-nav>
4-
</div>
5-
<div class="col-md-10 df-section"
6-
data-ng-class="activeView.path === 'service-tutorial' ? 'df-section-3-round' : 'df-section-all-round'"
7-
df-fs-height>
8-
9-
<div data-ng-if="activeView.path === 'service-tutorial'">
10-
<df-section-header data-title="'Services tutorial'"></df-section-header>
11-
<br>
12-
<p class="hero-example">Services are where you set up REST API connections to databases, file storage,
13-
email, remote web services, and more.
14-
</p>
15-
<button class="btn btn-primary"
16-
type="button"
17-
ng-click="start()">Let's create a Service
18-
</button>
19-
</div>
2+
<div class="col-md-12 df-section" df-fs-height>
3+
<df-section-header data-title="'Tutorials'"></df-section-header>
4+
<br>
5+
<p class="hero-example">Services are where you set up REST API connections to databases, file storage,
6+
email, remote web services, and more.
7+
</p>
8+
<button class="btn btn-primary" type="button" ng-click="startServiceTutorial()">
9+
Let's create a Service
10+
</button>
2011
</div>
2112
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div> <div class="col-md-2 df-sidebar-nav"> <df-sidebar-nav></df-sidebar-nav> </div> <div class="col-md-10 df-section" data-ng-class="activeView.path === 'service-tutorial' ? 'df-section-3-round' : 'df-section-all-round'" df-fs-height> <div data-ng-if="activeView.path === 'service-tutorial'"> <df-section-header data-title="'Services tutorial'"></df-section-header> <br> <p class="hero-example">Services are where you set up REST API connections to databases, file storage, email, remote web services, and more. </p> <button class="btn btn-primary" type="button" ng-click="start()">Let's create a Service </button> </div> </div> </div>
1+
<div> <div class="col-md-12 df-section" df-fs-height> <df-section-header data-title="'Tutorials'"></df-section-header> <br> <p class="hero-example">Services are where you set up REST API connections to databases, file storage, email, remote web services, and more. </p> <button class="btn btn-primary" type="button" ng-click="start()">Let's create a Service </button> </div> </div>

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
33
<![endif]--> <!-- Add your site or application content here --> <div id="dreamfactoryApp" data-ng-controller="MainCtrl" df-popup-login> <div id="popup-login-container"></div> <!-- Top level Nav --> <df-top-level-nav-std data-options="topLevelNavOptions"></df-top-level-nav-std> <div data-ng-if="showAdminComponentNav" style="margin: 10px auto;"> <!-- Component nav and title --> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <df-component-title></df-component-title> <df-component-nav data-options="componentNavOptions"></df-component-nav> </div> </div> </div> </div> <!-- Rendering Context --> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <div class="row"> <div data-ng-view=""></div> </div> </div> </div> </div> <!--<df-main-loading></df-main-loading>--> <div id="mask"></div> </div> <!--[if lt IE 9]>
44
<script src="scripts/oldieshim.d41d8cd9.js"></script>
5-
<![endif]--> <script src="scripts/vendor.ef0c91cf.js"></script> <script src="admin_components/adf-tutorial/popper.min.js"></script> <script src="admin_components/adf-tutorial/shepherd.min.js"></script> <script src="scripts/app.b8c94ade.js"></script> <!-- other deps --> <script src="vendor/ace/ace.js"></script> <script src="vendor/ace/mode-javascript.js"></script> <script src="vendor/ace/mode-json.js"></script> <script src="vendor/ace/mode-yaml.js"></script> <!--Begin Comm100 Live Chat Code--> <div id="comm100-button-219"></div> <script type="text/javascript"> var Comm100API=Comm100API||{};
5+
<![endif]--> <script src="scripts/vendor.ef0c91cf.js"></script> <script src="admin_components/adf-tutorial/popper.min.js"></script> <script src="admin_components/adf-tutorial/shepherd.min.js"></script> <script src="scripts/app.c208f5a2.js"></script> <!-- other deps --> <script src="vendor/ace/ace.js"></script> <script src="vendor/ace/mode-javascript.js"></script> <script src="vendor/ace/mode-json.js"></script> <script src="vendor/ace/mode-yaml.js"></script> <!--Begin Comm100 Live Chat Code--> <div id="comm100-button-219"></div> <script type="text/javascript"> var Comm100API=Comm100API||{};
66
Comm100API.status = "init";
77
Comm100API.showChat = function (bool) {
88
var sel = $("#comm100-button-219");
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)