File tree Expand file tree Collapse file tree 5 files changed +5419
-13
lines changed Top Open diff view settings
containers/SelectTutorial Expand file tree Collapse file tree 5 files changed +5419
-13
lines changed Top Open diff view settings Original file line number Diff line number Diff line change 4747 "eslint" : " ^6.8.0" ,
4848 "eslint-config-prettier" : " ^6.10.1" ,
4949 "eslint-plugin-prettier" : " ^3.1.3" ,
50+ "git-url-parse" : " ^11.1.2" ,
5051 "jest" : " ^25.3.0" ,
5152 "jsdom" : " ^16.2.2" ,
5253 "prettier" : " ^2.0.4" ,
Original file line number Diff line number Diff line change @@ -16,18 +16,6 @@ class Editor {
1616 } )
1717
1818 // 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 => {
3119 const commands = createCommands ( {
3220 extensionPath : this . vscodeExt . extensionPath ,
3321 // NOTE: local storage must be bound to the vscodeExt.workspaceState
@@ -40,6 +28,12 @@ class Editor {
4028 this . vscodeExt . subscriptions . push ( command )
4129 }
4230 }
31+ public deactivate = ( ) : void => {
32+ // cleanup subscriptions/tasks
33+ for ( const disposable of this . vscodeExt . subscriptions ) {
34+ disposable . dispose ( )
35+ }
36+ }
4337}
4438
4539export default Editor
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as React from 'react'
33import SelectTutorialForm from './SelectTutorialForm'
44import TutorialOverview from '../../components/TutorialOverview'
55import LoadTutorialSummary from './LoadTutorialSummary'
6+ import processTutorial from '../../services/tutorial'
67
78const styles = {
89 page : {
@@ -39,7 +40,7 @@ const SelectTutorialPage = (props: Props) => {
3940 setPage ( 'loading' )
4041 }
4142 const onLoadSummary = ( d : TT . Tutorial ) => {
42- setData ( d )
43+ setData ( processTutorial ( d ) )
4344 setPage ( 'summary' )
4445 }
4546 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