Repository navigation
[#610][2] Add Anchor IDs and The First Step of Tutorial - #660
Conversation
|
|
||
| constructor(public tourService: TourService) { | ||
| this.tourService.end$.subscribe(() => { | ||
| location.reload(); |
There was a problem hiding this comment.
Why do we refresh the page after the tour finishes?
There was a problem hiding this comment.
After the whole tutorial steps, the workflow that we formed as the example will remain on screen if we do not refresh the page after the tour finished.
There was a problem hiding this comment.
It's open for discussion but I think we shouldn't refresh the page automatically. The user might want to play with the workflow around for some more time. Let's remove the refresh for now and discuss it again after everything's finished.
| export class ProductTourComponent implements OnInit { | ||
|
|
||
| constructor(public tourService: TourService) { } | ||
| public loaded = false; |
There was a problem hiding this comment.
this variable is not use (at least in this PR)
| location.reload(); | ||
| }); | ||
|
|
||
| this.tourService.initialize([{ |
There was a problem hiding this comment.
Should we initialize the tourService inside the constructor or in other Angular life cycle callbacks, such as onInit? What's the recommended way by the library?
There was a problem hiding this comment.
In the library's demo project code, the author initialize tourService inside the constructor
| <ng-template let-step="step"> | ||
| <p class="tour-step-content" [innerHTML] = 'tourService.currentStep.content'></p> | ||
| <div class="tour-step-navigation"> | ||
| <button *ngIf="tourService.hasPrev(step)" class="btn btn-sm btn-light" (click)="tourService.prev()">« Prev</button> |
There was a problem hiding this comment.
I can't see the Prev/Next buttons in my browser, the CSS seems also broken, please fix that.
There was a problem hiding this comment.
Prev/Next buttons will appear only if we have multiple steps
| <texera-property-editor class="texera-property-editor-grid-container grid-container"></texera-property-editor> | ||
| <texera-workflow-editor class="texera-workflow-editor-grid-container grid-container"></texera-workflow-editor> | ||
| <texera-result-panel class="texera-result-panel-grid-container grid-container"></texera-result-panel> | ||
| <texera-navigation class="texera-navigation-grid-container grid-container" tourAnchor="texera-navigation-grid-container"></texera-navigation> |
There was a problem hiding this comment.
Are these anchor points used in this PR or following PRs?
There was a problem hiding this comment.
those anchor ids will used in the following PRs
|
Left a few comments on the PR. The CSS seems broken for me. The test cases fail, and I've fixed them for you. The test cases fail in 2 places:
|
|
@bobbyfine Looks good to merge. Although the CSS is broken now, I assume they'll be fixed in subsequent PRs. Look forward to review the next PR. |
The goal of this PR is to create all necessary Anchor IDs and the first step of the tutorial.
The library we use to achieve this goal is ngx-tour
Define anchor points for the tour steps by adding the tourAnchor directive throughout app.
"div tourAnchor="some.anchor.id"
Define tour steps using tourService.initialize(steps)
this.tourService.initialize([{
anchorId: 'some.anchor.id',
content: 'Some content',
title: 'First',
}, {
anchorId: 'another.anchor.id',
content: 'Other content',
title: 'Second',
}]);
The final goal of PR [#610] is to implement a tutorial into new GUI.