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 127127 </div >
128128
129129 <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 " >
131135 <FolderExplorerItem
132136 v-for =" folder of folderCurrent.children"
133137 v-if =" showHidden || !folder.hidden"
@@ -153,6 +157,7 @@ const SHOW_HIDDEN = 'vue-ui.show-hidden-folders'
153157export default {
154158 data () {
155159 return {
160+ loading: 0 ,
156161 error: false ,
157162 editingPath: false ,
158163 editedPath: ' ' ,
@@ -166,6 +171,7 @@ export default {
166171 folderCurrent: {
167172 query: FOLDER_CURRENT ,
168173 fetchPolicy: ' network-only' ,
174+ loadingKey: ' loading' ,
169175 async result () {
170176 await this .$nextTick ()
171177 this .$refs .folders .scrollTop = 0
@@ -374,4 +380,5 @@ export default {
374380 flex 100% 1 1
375381 overflow-x hidden
376382 overflow-y auto
383+ position relative
377384 </style >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const path = require('path')
55let cwd = process . cwd ( )
66
77function normalize ( value ) {
8+ if ( value . length === 1 ) return value
89 const lastChar = value . charAt ( value . length - 1 )
910 if ( lastChar === path . sep ) {
1011 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 418418
419419<script >
420420import Prompts from ' ../mixins/Prompts'
421+ import { isValidName } from ' ../util/folders'
421422
422423import CWD from ' ../graphql/cwd.gql'
423424import PROJECT_CREATION from ' ../graphql/projectCreation.gql'
@@ -486,8 +487,7 @@ export default {
486487
487488 computed: {
488489 folderNameValid () {
489- const name = this .formData .folder
490- return ! name .match (/ [/@\s +%:] / ) && encodeURIComponent (name) === name
490+ return isValidName (this .formData .folder )
491491 },
492492
493493 detailsValid () {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe('Vue project manager', () => {
1919 cy . get ( '.change-folder' ) . click ( )
2020 cy . get ( '.create' ) . within ( ( ) => {
2121 cy . get ( '.folder-explorer' ) . should ( 'be.visible' )
22- cy . get ( '.current -path' ) . click ( )
22+ cy . get ( '.edit -path-button ' ) . click ( )
2323 cy . get ( '.path-input input' ) . clear ( ) . type ( Cypress . env ( 'cwd' ) + '{enter}' )
2424 cy . get ( '.create-project' ) . click ( )
2525 } )
@@ -71,7 +71,7 @@ describe('Vue project manager', () => {
7171 cy . get ( '.tab-button' ) . eq ( 2 ) . click ( )
7272 cy . get ( '.import' ) . within ( ( ) => {
7373 cy . get ( '.folder-explorer' ) . should ( 'be.visible' )
74- cy . get ( '.current -path' ) . click ( )
74+ cy . get ( '.edit -path-button ' ) . click ( )
7575 cy . get ( '.path-input input' ) . clear ( ) . type ( Cypress . env ( 'cwd' ) + '{enter}' )
7676 cy . get ( `.folder-explorer-item:contains('cli-ui-test')` ) . click ( )
7777 cy . get ( '.import-project' ) . should ( 'not.have.class' , 'disabled' ) . click ( )
You can’t perform that action at this time.
0 commit comments