@@ -25,6 +25,7 @@ import MappingInfoView from "oxalis/view/right-menu/mapping_info_view";
25
25
import MeshesView from "oxalis/view/right-menu/meshes_view" ;
26
26
import NmlUploadZoneContainer from "oxalis/view/nml_upload_zone_container" ;
27
27
import OxalisController from "oxalis/controller" ;
28
+ import type { ControllerStatus } from "oxalis/controller" ;
28
29
import RecordingSwitch from "oxalis/view/recording_switch" ;
29
30
import SettingsView from "oxalis/view/settings/settings_view" ;
30
31
import MergerModeController from "oxalis/controller/merger_mode_controller" ;
@@ -68,6 +69,7 @@ type State = {
68
69
isSettingsCollapsed : boolean ,
69
70
activeLayout : string ,
70
71
hasError : boolean ,
72
+ status : ControllerStatus ,
71
73
} ;
72
74
73
75
const canvasAndLayoutContainerID = "canvasAndLayoutContainer" ;
@@ -108,6 +110,7 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> {
108
110
isSettingsCollapsed : true ,
109
111
activeLayout : lastActiveLayout ,
110
112
hasError : false ,
113
+ status : "loading" ,
111
114
} ;
112
115
}
113
116
@@ -190,57 +193,61 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> {
190
193
< OxalisController
191
194
initialAnnotationType = { this . props . initialAnnotationType }
192
195
initialCommandType = { this . props . initialCommandType }
196
+ controllerStatus = { this . state . status }
197
+ setControllerStatus = { ( status : ControllerStatus ) => this . setState ( { status } ) }
193
198
/>
194
199
< CrossOriginApi / >
195
200
< Layout className = "tracing-layout" >
196
201
< RenderToPortal portalId = "navbarTracingSlot" >
197
- < div style = { { flex : "0 1 auto" , zIndex : 210 , display : "flex" } } >
198
- < ButtonComponent
199
- className = { this . state . isSettingsCollapsed ? "" : "highlight-togglable-button" }
200
- onClick = { this . handleSettingsCollapse }
201
- shape = "circle"
202
- >
203
- < Icon
204
- type = "setting"
205
- className = "withoutMargin"
206
- style = { { display : "flex" , alignItems : "center" , justifyContent : "center" } }
207
- />
208
- </ ButtonComponent >
209
- < ActionBarView
210
- layoutProps = { {
211
- storedLayoutNamesForView : currentLayoutNames ,
212
- activeLayout : this . state . activeLayout ,
213
- layoutKey : layoutType ,
214
- setCurrentLayout : layoutName => {
215
- this . setState ( { activeLayout : layoutName } ) ;
216
- setActiveLayout ( layoutType , layoutName ) ;
217
- } ,
218
- saveCurrentLayout : this . saveCurrentLayout ,
219
- setAutoSaveLayouts : this . props . setAutoSaveLayouts ,
220
- autoSaveLayouts : this . props . autoSaveLayouts ,
221
- } }
222
- />
223
- { isDatasetOnScratchVolume ? (
224
- < Tooltip title = { messages [ "dataset.is_scratch" ] } >
225
- < Alert
226
- className = "hide-on-small-screen"
227
- style = { {
228
- height : 30 ,
229
- paddingTop : 4 ,
230
- backgroundColor : "#f17a27" ,
231
- color : "white" ,
232
- } }
233
- message = {
234
- < span >
235
- Dataset is on tmpscratch!{ " " }
236
- < Icon type = "warning" theme = "filled" style = { { margin : "0 0 0 6px" } } />
237
- </ span >
238
- }
239
- type = "error"
202
+ { this . state . status === "loaded" ? (
203
+ < div style = { { flex : "0 1 auto" , zIndex : 210 , display : "flex" } } >
204
+ < ButtonComponent
205
+ className = { this . state . isSettingsCollapsed ? "" : "highlight-togglable-button" }
206
+ onClick = { this . handleSettingsCollapse }
207
+ shape = "circle"
208
+ >
209
+ < Icon
210
+ type = "setting"
211
+ className = "withoutMargin"
212
+ style = { { display : "flex" , alignItems : "center" , justifyContent : "center" } }
240
213
/>
241
- </ Tooltip >
242
- ) : null }
243
- </ div >
214
+ </ ButtonComponent >
215
+ < ActionBarView
216
+ layoutProps = { {
217
+ storedLayoutNamesForView : currentLayoutNames ,
218
+ activeLayout : this . state . activeLayout ,
219
+ layoutKey : layoutType ,
220
+ setCurrentLayout : layoutName => {
221
+ this . setState ( { activeLayout : layoutName } ) ;
222
+ setActiveLayout ( layoutType , layoutName ) ;
223
+ } ,
224
+ saveCurrentLayout : this . saveCurrentLayout ,
225
+ setAutoSaveLayouts : this . props . setAutoSaveLayouts ,
226
+ autoSaveLayouts : this . props . autoSaveLayouts ,
227
+ } }
228
+ />
229
+ { isDatasetOnScratchVolume ? (
230
+ < Tooltip title = { messages [ "dataset.is_scratch" ] } >
231
+ < Alert
232
+ className = "hide-on-small-screen"
233
+ style = { {
234
+ height : 30 ,
235
+ paddingTop : 4 ,
236
+ backgroundColor : "#f17a27" ,
237
+ color : "white" ,
238
+ } }
239
+ message = {
240
+ < span >
241
+ Dataset is on tmpscratch!{ " " }
242
+ < Icon type = "warning" theme = "filled" style = { { margin : "0 0 0 6px" } } />
243
+ </ span >
244
+ }
245
+ type = "error"
246
+ />
247
+ </ Tooltip >
248
+ ) : null }
249
+ </ div >
250
+ ) : null }
244
251
</ RenderToPortal >
245
252
< Layout style = { { display : "flex" } } >
246
253
< Sider
0 commit comments