-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Added Tutorial Plugin * added react-joyride library to control the steps of tutorial * added tutorial plugin | auto-start or start from burger menu tutorial button * 3 preset configuration: map, home, mapMobile
- Loading branch information
1 parent
bf08831
commit c15d518
Showing
22 changed files
with
1,853 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Copyright 2017, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
var expect = require('expect'); | ||
|
||
var { | ||
START_TUTORIAL, | ||
SETUP_TUTORIAL, | ||
UPDATE_TUTORIAL, | ||
DISABLE_TUTORIAL, | ||
RESET_TUTORIAL, | ||
startTutorial, | ||
setupTutorial, | ||
updateTutorial, | ||
disableTutorial, | ||
resetTutorial | ||
} = require('../tutorial'); | ||
|
||
describe('Test the tutorial actions', () => { | ||
|
||
it('startTutorial', () => { | ||
const retval = startTutorial(); | ||
expect(retval).toExist(); | ||
expect(retval.type).toBe(START_TUTORIAL); | ||
}); | ||
|
||
it('setupTutorial', () => { | ||
const steps = 'steps'; | ||
const style = 'style'; | ||
const checkbox = 'checkbox'; | ||
const defaultStep = 'defaultStep'; | ||
const retval = setupTutorial(steps, style, checkbox, defaultStep); | ||
expect(retval).toExist(); | ||
expect(retval.type).toBe(SETUP_TUTORIAL); | ||
expect(retval.steps).toBe(steps); | ||
expect(retval.style).toBe(style); | ||
expect(retval.checkbox).toBe(checkbox); | ||
expect(retval.defaultStep).toBe(defaultStep); | ||
}); | ||
|
||
it('updateTutorial', () => { | ||
const tour = 'tour'; | ||
const steps = 'steps'; | ||
const error = 'error'; | ||
const retval = updateTutorial(tour, steps, error); | ||
expect(retval).toExist(); | ||
expect(retval.type).toBe(UPDATE_TUTORIAL); | ||
expect(retval.tour).toBe(tour); | ||
expect(retval.steps).toBe(steps); | ||
expect(retval.error).toBe(error); | ||
}); | ||
|
||
it('disableTutorial', () => { | ||
const retval = disableTutorial(); | ||
expect(retval).toExist(); | ||
expect(retval.type).toBe(DISABLE_TUTORIAL); | ||
}); | ||
|
||
it('resetTutorial', () => { | ||
const retval = resetTutorial(); | ||
expect(retval).toExist(); | ||
expect(retval.type).toBe(RESET_TUTORIAL); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Copyright 2017, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
const START_TUTORIAL = 'START_TUTORIAL'; | ||
const SETUP_TUTORIAL = 'SETUP_TUTORIAL'; | ||
const UPDATE_TUTORIAL = 'UPDATE_TUTORIAL'; | ||
const DISABLE_TUTORIAL = 'DISABLE_TUTORIAL'; | ||
const RESET_TUTORIAL = 'RESET_TUTORIAL'; | ||
|
||
|
||
function startTutorial() { | ||
return { | ||
type: START_TUTORIAL | ||
}; | ||
} | ||
|
||
function setupTutorial(steps, style, checkbox, defaultStep) { | ||
return { | ||
type: SETUP_TUTORIAL, | ||
steps, | ||
style, | ||
checkbox, | ||
defaultStep | ||
}; | ||
} | ||
|
||
function updateTutorial(tour, steps, error) { | ||
return { | ||
type: UPDATE_TUTORIAL, | ||
tour, | ||
steps, | ||
error | ||
}; | ||
} | ||
|
||
function disableTutorial() { | ||
return { | ||
type: DISABLE_TUTORIAL | ||
}; | ||
} | ||
|
||
|
||
function resetTutorial() { | ||
return { | ||
type: RESET_TUTORIAL | ||
}; | ||
} | ||
|
||
module.exports = { | ||
START_TUTORIAL, | ||
SETUP_TUTORIAL, | ||
UPDATE_TUTORIAL, | ||
DISABLE_TUTORIAL, | ||
RESET_TUTORIAL, | ||
startTutorial, | ||
setupTutorial, | ||
updateTutorial, | ||
disableTutorial, | ||
resetTutorial | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.