Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/02/18 15:51:17 (6 years ago)
Author:
jzenisek
Message:

#2839: applied several fixes:

  • show full project-path in project/resource selector
  • handle lost of project-ownership by not withdrawing permissions
  • update automatically after hand-down save
  • lock jobs for which statistics/deletion is pending
  • lock the disabled checkbox in ProjectResourcesView...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r15922 r15978  
    8787    }
    8888
     89    private Dictionary<Guid, string> projectNames;
     90    public Dictionary<Guid, string> ProjectNames {
     91      get { return projectNames; }
     92    }
     93
     94    private HashSet<Project> disabledParentProjects;
     95    public HashSet<Project> DisabledParentProjects {
     96      get { return disabledParentProjects; }
     97    }
    8998
    9099    private List<Plugin> onlinePlugins;
     
    127136        resources = new ItemList<Resource>();
    128137        jobs = new HiveItemCollection<RefreshableJob>();
     138        projectNames = new Dictionary<Guid, string>();
    129139
    130140        projectAncestors = new Dictionary<Guid, HashSet<Guid>>();
     
    138148          service.GetSlaves().ForEach(s => resources.Add(s));
    139149          service.GetJobs().ForEach(p => jobs.Add(new RefreshableJob(p)));
     150          projectNames = service.GetProjectNames();
    140151        });
    141152
    142153        UpdateResourceGenealogy();
    143154        UpdateProjectGenealogy();
     155        UpdateDisabledParentProjects();
    144156      }
    145157      catch {
     
    159171      try {
    160172        projects = new ItemList<Project>();
     173        projectNames = new Dictionary<Guid, string>();
    161174        resources = new ItemList<Resource>();
    162175
     
    170183          service.GetSlaveGroups().ForEach(g => resources.Add(g));
    171184          service.GetSlaves().ForEach(s => resources.Add(s));
     185          projectNames = service.GetProjectNames();
    172186        });
    173187
    174188        UpdateResourceGenealogy();
    175189        UpdateProjectGenealogy();
     190        UpdateDisabledParentProjects();
    176191      } catch {
    177192        projects = null;
     
    236251          projectDescendants[ancestor].Add(pa.Key);
    237252        }
     253      }
     254    }
     255
     256    private void UpdateDisabledParentProjects() {
     257      disabledParentProjects = new HashSet<Project>();
     258
     259      foreach (var pid in projects
     260        .Where(x => x.ParentProjectId.HasValue)
     261        .SelectMany(x => projectAncestors[x.Id]).Distinct()
     262        .Where(x => !projects.Select(y => y.Id).Contains(x))) {
     263        var p = new Project();
     264        p.Id = pid;
     265        p.ParentProjectId = projectAncestors[pid].FirstOrDefault();
     266        p.Name = projectNames[pid];
     267        disabledParentProjects.Add(p);
    238268      }
    239269    }
Note: See TracChangeset for help on using the changeset viewer.