File tree Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 127
127
</div >
128
128
129
129
<div ref =" folders" class =" folders" >
130
- <template v-if =" folderCurrent .children " >
130
+ <VueLoadingIndicator
131
+ v-if =" loading"
132
+ class =" overlay"
133
+ />
134
+ <template v-else-if =" folderCurrent .children " >
131
135
<FolderExplorerItem
132
136
v-for =" folder of folderCurrent.children"
133
137
v-if =" showHidden || !folder.hidden"
@@ -153,6 +157,7 @@ const SHOW_HIDDEN = 'vue-ui.show-hidden-folders'
153
157
export default {
154
158
data () {
155
159
return {
160
+ loading: 0 ,
156
161
error: false ,
157
162
editingPath: false ,
158
163
editedPath: ' ' ,
@@ -166,6 +171,7 @@ export default {
166
171
folderCurrent: {
167
172
query: FOLDER_CURRENT ,
168
173
fetchPolicy: ' network-only' ,
174
+ loadingKey: ' loading' ,
169
175
async result () {
170
176
await this .$nextTick ()
171
177
this .$refs .folders .scrollTop = 0
@@ -374,4 +380,5 @@ export default {
374
380
flex 100% 1 1
375
381
overflow-x hidden
376
382
overflow-y auto
383
+ position relative
377
384
</style >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const path = require('path')
5
5
let cwd = process . cwd ( )
6
6
7
7
function normalize ( value ) {
8
+ if ( value . length === 1 ) return value
8
9
const lastChar = value . charAt ( value . length - 1 )
9
10
if ( lastChar === path . sep ) {
10
11
value = value . substr ( 0 , value . length - 1 )
Original file line number Diff line number Diff line change
1
+ export function isValidName ( name ) {
2
+ return ! name . match ( / [ / @ \s + % : ] / ) && encodeURIComponent ( name ) === name
3
+ }
Original file line number Diff line number Diff line change 418
418
419
419
<script >
420
420
import Prompts from ' ../mixins/Prompts'
421
+ import { isValidName } from ' ../util/folders'
421
422
422
423
import CWD from ' ../graphql/cwd.gql'
423
424
import PROJECT_CREATION from ' ../graphql/projectCreation.gql'
@@ -486,8 +487,7 @@ export default {
486
487
487
488
computed: {
488
489
folderNameValid () {
489
- const name = this .formData .folder
490
- return ! name .match (/ [/@\s +%:] / ) && encodeURIComponent (name) === name
490
+ return isValidName (this .formData .folder )
491
491
},
492
492
493
493
detailsValid () {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe('Vue project manager', () => {
19
19
cy . get ( '.change-folder' ) . click ( )
20
20
cy . get ( '.create' ) . within ( ( ) => {
21
21
cy . get ( '.folder-explorer' ) . should ( 'be.visible' )
22
- cy . get ( '.current -path' ) . click ( )
22
+ cy . get ( '.edit -path-button ' ) . click ( )
23
23
cy . get ( '.path-input input' ) . clear ( ) . type ( Cypress . env ( 'cwd' ) + '{enter}' )
24
24
cy . get ( '.create-project' ) . click ( )
25
25
} )
@@ -71,7 +71,7 @@ describe('Vue project manager', () => {
71
71
cy . get ( '.tab-button' ) . eq ( 2 ) . click ( )
72
72
cy . get ( '.import' ) . within ( ( ) => {
73
73
cy . get ( '.folder-explorer' ) . should ( 'be.visible' )
74
- cy . get ( '.current -path' ) . click ( )
74
+ cy . get ( '.edit -path-button ' ) . click ( )
75
75
cy . get ( '.path-input input' ) . clear ( ) . type ( Cypress . env ( 'cwd' ) + '{enter}' )
76
76
cy . get ( `.folder-explorer-item:contains('cli-ui-test')` ) . click ( )
77
77
cy . get ( '.import-project' ) . should ( 'not.have.class' , 'disabled' ) . click ( )
You can’t perform that action at this time.
0 commit comments