File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ async function openInEditor (input, context) {
10
10
if ( input . gitPath ) {
11
11
query = await git . resolveFile ( input . file , context )
12
12
} else {
13
- path . resolve ( cwd . get ( ) , input . file )
13
+ query = path . resolve ( cwd . get ( ) , input . file )
14
14
}
15
15
if ( input . line ) {
16
16
query += `:${ input . line } `
Original file line number Diff line number Diff line change 93
93
"project-select-list-item" : {
94
94
"tooltips" : {
95
95
"favorite" : " Toggle favorite" ,
96
- "delete" : " Remove from list"
96
+ "delete" : " Remove from list" ,
97
+ "open-in-editor" : " Open in editor"
97
98
}
98
99
},
99
100
"project-plugin-item" : {
Original file line number Diff line number Diff line change 10
10
@click.stop =" $emit('favorite')"
11
11
/>
12
12
</div >
13
+
13
14
<div class =" info" >
14
15
<ListItemInfo
15
16
:description =" project.path"
24
25
</div >
25
26
</ListItemInfo >
26
27
</div >
28
+
27
29
<div class =" actions" >
28
30
<VueButton
29
31
v-if =" project.homepage"
34
36
v-tooltip =" project.homepage"
35
37
@click.stop
36
38
/>
39
+
40
+ <VueButton
41
+ class =" icon-button"
42
+ icon-left =" open_in_browser"
43
+ v-tooltip =" $t('org.vue.components.project-select-list-item.tooltips.open-in-editor')"
44
+ @click.stop =" openInEditor()"
45
+ />
46
+
37
47
<VueButton
38
48
class =" icon-button"
39
49
icon-left =" close"
47
57
</template >
48
58
49
59
<script >
60
+ import OPEN_IN_EDITOR from ' ../graphql/fileOpenInEditor.gql'
61
+
50
62
export default {
51
63
props: {
52
64
project: {
53
65
type: Object ,
54
66
required: true
55
67
}
68
+ },
69
+
70
+ methods: {
71
+ async openInEditor () {
72
+ await this .$apollo .mutate ({
73
+ mutation: OPEN_IN_EDITOR ,
74
+ variables: {
75
+ input: {
76
+ file: this .project .path
77
+ }
78
+ }
79
+ })
80
+ }
56
81
}
57
82
}
58
83
</script >
Original file line number Diff line number Diff line change 17
17
{{ $t('org.vue.components.project-select-list-item.tooltips.favorite') }}
18
18
</VueSwitch >
19
19
20
+ <VueDropdownButton
21
+ :label =" $t('org.vue.components.project-select-list-item.tooltips.open-in-editor')"
22
+ icon-left =" open_in_browser"
23
+ @click =" openInEditor(projectCurrent)"
24
+ />
25
+
20
26
<VueDropdownButton
21
27
v-if =" projectCurrent.homepage"
22
28
:href =" projectCurrent.homepage"
@@ -72,6 +78,7 @@ import PROJECT_CURRENT from '../graphql/projectCurrent.gql'
72
78
import PROJECTS from ' ../graphql/projects.gql'
73
79
import PROJECT_OPEN from ' ../graphql/projectOpen.gql'
74
80
import PROJECT_SET_FAVORITE from ' ../graphql/projectSetFavorite.gql'
81
+ import OPEN_IN_EDITOR from ' ../graphql/fileOpenInEditor.gql'
75
82
76
83
export default {
77
84
apollo: {
@@ -112,6 +119,17 @@ export default {
112
119
}
113
120
})
114
121
}
122
+ },
123
+
124
+ async openInEditor (project ) {
125
+ await this .$apollo .mutate ({
126
+ mutation: OPEN_IN_EDITOR ,
127
+ variables: {
128
+ input: {
129
+ file: project .path
130
+ }
131
+ }
132
+ })
115
133
}
116
134
}
117
135
}
You can’t perform that action at this time.
0 commit comments