Skip to content

Commit 01a1aea

Browse files
authored
Merge pull request #5 from fcollonval/start-tour-toast
Start tour toast
2 parents cdbeb47 + 7c9ca01 commit 01a1aea

File tree

4 files changed

+104
-3
lines changed

4 files changed

+104
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@jupyterlab/notebook": "^2.0.0",
4141
"@jupyterlab/statedb": "^2.0.0",
4242
"jupyterlab-tutorial": "^1.0.5",
43+
"jupyterlab_toastify": "^4.1.2",
4344
"react": "~16.9.0",
4445
"react-dom": "~16.9.0",
4546
"react-joyride": "^2.2.1"

src/tutorialManager.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MainMenu } from '@jupyterlab/mainmenu';
22
import { IStateDB } from '@jupyterlab/statedb';
33
import { ISignal, Signal } from '@lumino/signaling';
4+
import { INotification } from 'jupyterlab_toastify';
45
import {
56
ITutorial,
67
ITutorialManager,
@@ -135,7 +136,31 @@ export class TutorialManager implements ITutorialManager {
135136
);
136137
}
137138

138-
this._tutorialLaunched.emit(tutorialList);
139+
if (tutorialList.length > 0) {
140+
if (force) {
141+
this._tutorialLaunched.emit(tutorialList);
142+
} else {
143+
INotification.info(`Try the ${tutorialList[0].label}.`, {
144+
autoClose: 10000,
145+
buttons: [
146+
{
147+
label: 'Start now',
148+
callback: (): void => {
149+
this._tutorialLaunched.emit(tutorialList);
150+
}
151+
},
152+
{
153+
label: "Don't show me again",
154+
callback: (): void => {
155+
tutorialList.forEach(tour =>
156+
this._rememberDoneTutorial(tour.id)
157+
);
158+
}
159+
}
160+
]
161+
});
162+
}
163+
}
139164

140165
return Promise.resolve();
141166
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// generated by genversion
2-
export const version = '2.0.0';
2+
export const version = '2.1.0';

yarn.lock

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,13 @@
832832
dependencies:
833833
regenerator-runtime "^0.13.4"
834834

835+
"@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7":
836+
version "7.11.2"
837+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736"
838+
integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==
839+
dependencies:
840+
regenerator-runtime "^0.13.4"
841+
835842
"@babel/runtime@^7.8.4":
836843
version "7.11.0"
837844
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.0.tgz#f10245877042a815e07f7e693faff0ae9d3a2aac"
@@ -919,11 +926,37 @@
919926
exec-sh "^0.3.2"
920927
minimist "^1.2.0"
921928

929+
"@fortawesome/fontawesome-common-types@^0.2.30":
930+
version "0.2.30"
931+
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.30.tgz#2f1cc5b46bd76723be41d0013a8450c9ba92b777"
932+
integrity sha512-TsRwpTuKwFNiPhk1UfKgw7zNPeV5RhNp2Uw3pws+9gDAkPGKrtjR1y2lI3SYn7+YzyfuNknflpBA1LRKjt7hMg==
933+
922934
"@fortawesome/fontawesome-free@^5.12.0":
923935
version "5.13.1"
924936
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.1.tgz#c53b4066edae16cd1fd669f687baf031b45fb9d6"
925937
integrity sha512-D819f34FLHeBN/4xvw0HR0u7U2G7RqjPSggXqf7LktsxWQ48VAfGwvMrhcVuaZV2fF069c/619RdgCCms0DHhw==
926938

939+
"@fortawesome/fontawesome-svg-core@^1.2.30":
940+
version "1.2.30"
941+
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.30.tgz#f56dc6791861fe5d1af04fb8abddb94658c576db"
942+
integrity sha512-E3sAXATKCSVnT17HYmZjjbcmwihrNOCkoU7dVMlasrcwiJAHxSKeZ+4WN5O+ElgO/FaYgJmASl8p9N7/B/RttA==
943+
dependencies:
944+
"@fortawesome/fontawesome-common-types" "^0.2.30"
945+
946+
"@fortawesome/free-solid-svg-icons@^5.14.0":
947+
version "5.14.0"
948+
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.14.0.tgz#970453f5e8c4915ad57856c3a0252ac63f6fec18"
949+
integrity sha512-M933RDM8cecaKMWDSk3FRYdnzWGW7kBBlGNGfvqLVwcwhUPNj9gcw+xZMrqBdRqxnSXdl3zWzTCNNGEtFUq67Q==
950+
dependencies:
951+
"@fortawesome/fontawesome-common-types" "^0.2.30"
952+
953+
"@fortawesome/react-fontawesome@^0.1.11":
954+
version "0.1.11"
955+
resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.11.tgz#c1a95a2bdb6a18fa97b355a563832e248bf6ef4a"
956+
integrity sha512-sClfojasRifQKI0OPqTy8Ln8iIhnxR/Pv/hukBhWnBz9kQRmqi6JSH3nghlhAY7SUeIIM7B5/D2G8WjX0iepVg==
957+
dependencies:
958+
prop-types "^15.7.2"
959+
927960
"@istanbuljs/load-nyc-config@^1.0.0":
928961
version "1.1.0"
929962
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
@@ -2670,7 +2703,7 @@ class-utils@^0.3.5:
26702703
isobject "^3.0.0"
26712704
static-extend "^0.1.1"
26722705

2673-
classnames@^2.2:
2706+
classnames@^2.2, classnames@^2.2.6:
26742707
version "2.2.6"
26752708
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
26762709
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
@@ -2867,6 +2900,11 @@ csstype@^2.2.0, csstype@~2.6.9:
28672900
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.10.tgz#e63af50e66d7c266edb6b32909cfd0aabe03928b"
28682901
integrity sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==
28692902

2903+
csstype@^3.0.2:
2904+
version "3.0.2"
2905+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.2.tgz#ee5ff8f208c8cd613b389f7b222c9801ca62b3f7"
2906+
integrity sha512-ofovWglpqoqbfLNOTBNZLSbMuGrblAf1efvvArGKOZMBrIoJeu5UsAipQolkijtyQx5MtAzT/J9IHj/CEY1mJw==
2907+
28702908
dashdash@^1.12.0:
28712909
version "1.14.1"
28722910
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -2999,6 +3037,14 @@ dom-helpers@^3.4.0:
29993037
dependencies:
30003038
"@babel/runtime" "^7.1.2"
30013039

3040+
dom-helpers@^5.0.1:
3041+
version "5.2.0"
3042+
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.0.tgz#57fd054c5f8f34c52a3eeffdb7e7e93cd357d95b"
3043+
integrity sha512-Ru5o9+V8CpunKnz5LGgWXkmrH/20cGKwcHwS4m73zIvs54CN9epEmT/HLqFJW3kXpakAFkEdzgy1hzlJe3E4OQ==
3044+
dependencies:
3045+
"@babel/runtime" "^7.8.7"
3046+
csstype "^3.0.2"
3047+
30023048
dom-serializer@0:
30033049
version "0.2.2"
30043050
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
@@ -4736,6 +4782,16 @@ jupyterlab-tutorial@^1.0.5:
47364782
react-dom "~16.9.0"
47374783
react-joyride "^2.2.1"
47384784

4785+
jupyterlab_toastify@^4.1.2:
4786+
version "4.1.2"
4787+
resolved "https://registry.yarnpkg.com/jupyterlab_toastify/-/jupyterlab_toastify-4.1.2.tgz#b794be24f787dcf1de0fd61d5b932f3826c829dc"
4788+
integrity sha512-t6qtSmooENGyi9FBtvJp7tezIKpUMtaKGTMGAQm1wrDKJJ3yDh/o+CYBPSGamzfIn1j4KSPh50yQs2CpoKDZSw==
4789+
dependencies:
4790+
"@fortawesome/fontawesome-svg-core" "^1.2.30"
4791+
"@fortawesome/free-solid-svg-icons" "^5.14.0"
4792+
"@fortawesome/react-fontawesome" "^0.1.11"
4793+
react-toastify "^6.0.5"
4794+
47394795
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
47404796
version "3.2.2"
47414797
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
@@ -5599,6 +5655,15 @@ react-proptype-conditional-require@^1.0.4:
55995655
resolved "https://registry.yarnpkg.com/react-proptype-conditional-require/-/react-proptype-conditional-require-1.0.4.tgz#69c2d5741e6df5e08f230f36bbc2944ee1222555"
56005656
integrity sha1-acLVdB5t9eCPIw82u8KUTuEiJVU=
56015657

5658+
react-toastify@^6.0.5:
5659+
version "6.0.8"
5660+
resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-6.0.8.tgz#84625d81d0fd01902a7f4c6f317eb074cb3bba67"
5661+
integrity sha512-NSqCNwv+C4IfR+c92PFZiNyeBwOJvigrP2bcRi2f6Hg3WqcHhEHOknbSQOs9QDFuqUjmK3SOrdvScQ3z63ifXg==
5662+
dependencies:
5663+
classnames "^2.2.6"
5664+
prop-types "^15.7.2"
5665+
react-transition-group "^4.4.1"
5666+
56025667
react-transition-group@^2.9.0:
56035668
version "2.9.0"
56045669
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d"
@@ -5609,6 +5674,16 @@ react-transition-group@^2.9.0:
56095674
prop-types "^15.6.2"
56105675
react-lifecycles-compat "^3.0.4"
56115676

5677+
react-transition-group@^4.4.1:
5678+
version "4.4.1"
5679+
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.1.tgz#63868f9325a38ea5ee9535d828327f85773345c9"
5680+
integrity sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==
5681+
dependencies:
5682+
"@babel/runtime" "^7.5.5"
5683+
dom-helpers "^5.0.1"
5684+
loose-envify "^1.4.0"
5685+
prop-types "^15.6.2"
5686+
56125687
react@~16.9.0:
56135688
version "16.9.0"
56145689
resolved "https://registry.yarnpkg.com/react/-/react-16.9.0.tgz#40ba2f9af13bc1a38d75dbf2f4359a5185c4f7aa"

0 commit comments

Comments
 (0)