File tree Expand file tree Collapse file tree 5 files changed +5419
-13
lines changed
containers/SelectTutorial Expand file tree Collapse file tree 5 files changed +5419
-13
lines changed Original file line number Diff line number Diff line change 47
47
"eslint" : " ^6.8.0" ,
48
48
"eslint-config-prettier" : " ^6.10.1" ,
49
49
"eslint-plugin-prettier" : " ^3.1.3" ,
50
+ "git-url-parse" : " ^11.1.2" ,
50
51
"jest" : " ^25.3.0" ,
51
52
"jsdom" : " ^16.2.2" ,
52
53
"prettier" : " ^2.0.4" ,
Original file line number Diff line number Diff line change @@ -16,18 +16,6 @@ class Editor {
16
16
} )
17
17
18
18
// commands
19
- this . activateCommands ( )
20
-
21
- // setup tasks or views here
22
- }
23
- public deactivate = ( ) : void => {
24
- // cleanup subscriptions/tasks
25
- for ( const disposable of this . vscodeExt . subscriptions ) {
26
- disposable . dispose ( )
27
- }
28
- }
29
-
30
- private activateCommands = ( ) : void => {
31
19
const commands = createCommands ( {
32
20
extensionPath : this . vscodeExt . extensionPath ,
33
21
// NOTE: local storage must be bound to the vscodeExt.workspaceState
@@ -40,6 +28,12 @@ class Editor {
40
28
this . vscodeExt . subscriptions . push ( command )
41
29
}
42
30
}
31
+ public deactivate = ( ) : void => {
32
+ // cleanup subscriptions/tasks
33
+ for ( const disposable of this . vscodeExt . subscriptions ) {
34
+ disposable . dispose ( )
35
+ }
36
+ }
43
37
}
44
38
45
39
export default Editor
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as React from 'react'
3
3
import SelectTutorialForm from './SelectTutorialForm'
4
4
import TutorialOverview from '../../components/TutorialOverview'
5
5
import LoadTutorialSummary from './LoadTutorialSummary'
6
+ import processTutorial from '../../services/tutorial'
6
7
7
8
const styles = {
8
9
page : {
@@ -39,7 +40,7 @@ const SelectTutorialPage = (props: Props) => {
39
40
setPage ( 'loading' )
40
41
}
41
42
const onLoadSummary = ( d : TT . Tutorial ) => {
42
- setData ( d )
43
+ setData ( processTutorial ( d ) )
43
44
setPage ( 'summary' )
44
45
}
45
46
const onClear = ( ) => {
Original file line number Diff line number Diff line change
1
+ import * as TT from 'typings/tutorial'
2
+ // @ts -ignore
3
+ import gitUrlParser from 'git-url-parse'
4
+
5
+ const processTutorial = ( tutorial : TT . Tutorial ) : TT . Tutorial => {
6
+ // define tutorial id as the "owner/repo-name"
7
+ // see docs at https://github.com/IonicaBizau/git-url-parse
8
+ const { repo } = tutorial . config
9
+ const { full_name } = gitUrlParser ( repo . uri )
10
+ tutorial . id = `${ full_name } :${ repo . branch } `
11
+
12
+ return tutorial
13
+ }
14
+
15
+ export default processTutorial
You can’t perform that action at this time.
0 commit comments