File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,15 @@ class SchemaPage extends Component {
125
125
}
126
126
127
127
selectedFileContent ( ) {
128
+ const file = this . selectedFile ( ) ;
129
+ return file && file . content ;
130
+ }
131
+
132
+ selectedFile ( ) {
128
133
const {
129
134
files, selectedFile
130
135
} = this . state ;
131
- const file = files . find ( f => f . fileName === selectedFile ) ;
132
- return file && file . content ;
136
+ return files . find ( f => f . fileName === selectedFile ) ;
133
137
}
134
138
135
139
renderFilesMenu ( ) {
@@ -228,6 +232,20 @@ class SchemaPage extends Component {
228
232
</ Tabs >
229
233
</ Sider >
230
234
< Content style = { { minHeight : 280 } } >
235
+ {
236
+ selectedFile && (
237
+ < Alert
238
+ message = { (
239
+ < span >
240
+ This file is available for edit at
241
+ < b > { this . selectedFile ( ) . absPath } </ b >
242
+ </ span >
243
+ ) }
244
+ type = "info"
245
+ style = { { paddingTop : 10 , paddingBottom : 11 } }
246
+ />
247
+ )
248
+ }
231
249
{ selectedFile
232
250
? < PrismCode code = { this . selectedFileContent ( ) } style = { { padding : 12 } } />
233
251
: < h2 style = { { padding : 24 , textAlign : 'center' } } > Select tables to generate Cube.js schema</ h2 >
Original file line number Diff line number Diff line change @@ -69,7 +69,12 @@ class DevServer {
69
69
app . get ( '/playground/files' , catchErrors ( async ( req , res ) => {
70
70
this . cubejsServer . event ( 'Dev Server Files Load' ) ;
71
71
const files = await this . cubejsServer . repository . dataSchemaFiles ( ) ;
72
- res . json ( { files } ) ;
72
+ res . json ( {
73
+ files : files . map ( f => ( {
74
+ ...f ,
75
+ absPath : path . resolve ( path . join ( this . cubejsServer . repository . localPath ( ) , f . fileName ) )
76
+ } ) )
77
+ } ) ;
73
78
} ) ) ;
74
79
75
80
app . post ( '/playground/generate-schema' , catchErrors ( async ( req , res ) => {
You can’t perform that action at this time.
0 commit comments