File tree 3 files changed +24
-5
lines changed
3 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ def is_project_session(self, session_uuid: str) -> bool:
36
36
def get_runs (self , folder_name : str = "Default" ) -> List ['run.Run' ]:
37
37
res = []
38
38
likely_deleted = []
39
- run_uuids = self .runs .keys ()
39
+ run_uuids = []
40
+ if folder_name == 'all' :
41
+ run_uuids = self .runs .keys ()
40
42
if folder_name in self .folders :
41
43
f = self .folders [folder_name ].load ()
42
44
if f :
@@ -52,7 +54,8 @@ def get_runs(self, folder_name: str = "Default") -> List['run.Run']:
52
54
logger .error ('error in creating run list, ' + run_uuid + ':' + str (e ))
53
55
54
56
for run_uuid in likely_deleted :
55
- self .runs .pop (run_uuid )
57
+ if run_uuid in self .runs :
58
+ self .runs .pop (run_uuid )
56
59
57
60
if self .is_run_added :
58
61
self .is_run_added = False
@@ -74,7 +77,6 @@ def get_sessions(self) -> List['session.Session']:
74
77
def delete_runs (self , run_uuids : List [str ], project_owner : str ) -> None :
75
78
for run_uuid in run_uuids :
76
79
if run_uuid in self .runs :
77
- self .runs .pop (run_uuid )
78
80
r = run .get (run_uuid )
79
81
if r and r .owner == project_owner :
80
82
try :
Original file line number Diff line number Diff line change @@ -299,6 +299,12 @@ export class RunCache extends CacheObject<Run> {
299
299
async updateRunData ( data : Record < string , any > ) : Promise < void > {
300
300
await NETWORK . updateRunData ( this . uuid , data )
301
301
}
302
+
303
+ localUpdateFolder ( folder : string ) {
304
+ if ( this . data != null ) {
305
+ this . data . folder = folder
306
+ }
307
+ }
302
308
}
303
309
304
310
export class SessionCache extends CacheObject < Session > {
@@ -734,6 +740,11 @@ class Cache {
734
740
archiveFolder . insertRuns ( runs )
735
741
defaultFolder . removeRuns ( runUUIDS )
736
742
743
+ for ( let uuid of runUUIDS ) {
744
+ let run = this . getRun ( uuid )
745
+ run . localUpdateFolder ( RunsFolder . ARCHIVE )
746
+ }
747
+
737
748
return response
738
749
}
739
750
@@ -749,6 +760,11 @@ class Cache {
749
760
defaultFolder . insertRuns ( runs )
750
761
archiveFolder . removeRuns ( runUUIDS )
751
762
763
+ for ( let uuid of runUUIDS ) {
764
+ let run = this . getRun ( uuid )
765
+ run . localUpdateFolder ( RunsFolder . DEFAULT )
766
+ }
767
+
752
768
return response
753
769
}
754
770
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class RunsListView extends ScreenView {
86
86
$ ( 'div' , $ => {
87
87
this . userMessages . render ( $ )
88
88
new HamburgerMenuView ( {
89
- title : 'Runs' ,
89
+ title : ( this . folder == RunsFolder . ARCHIVE ? 'Archived ' : '' ) + 'Runs' ,
90
90
setButtonContainer : container => this . buttonContainer = container
91
91
} ) . render ( $ )
92
92
@@ -136,7 +136,8 @@ class RunsListView extends ScreenView {
136
136
updateButtons ( ) {
137
137
let noRuns = this . currentRunsList . length == 0
138
138
139
- this . deleteButton . hide ( noRuns || ! this . isEditMode )
139
+ this . deleteButton . hide ( ( noRuns || ! this . isEditMode ) ||
140
+ ( this . folder != RunsFolder . DEFAULT && this . folder != RunsFolder . ARCHIVE ) )
140
141
this . cancelButton . hide ( noRuns || ! this . isEditMode )
141
142
this . editButton . hide ( noRuns || this . isEditMode )
142
143
this . archiveButton . hide ( ( noRuns || ! this . isEditMode ) ||
You can’t perform that action at this time.
0 commit comments