Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/18 23:06:00 (6 years ago)
Author:
jzenisek
Message:

#2839: fixed couple of minor issues

  • changed tags in resource selector
  • added project information in job list and adapted sortation
  • fixed hand-down save by withdrawing additional offset-rights (permissions, resources),...
File:
1 edited

Legend:

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

    r15978 r15992  
    151151        });
    152152
    153         UpdateResourceGenealogy();
    154         UpdateProjectGenealogy();
    155         UpdateDisabledParentProjects();
     153        RefreshResourceGenealogy();
     154        RefreshProjectGenealogy();
     155        RefreshDisabledParentProjects();
    156156      }
    157157      catch {
     
    186186        });
    187187
    188         UpdateResourceGenealogy();
    189         UpdateProjectGenealogy();
    190         UpdateDisabledParentProjects();
     188        RefreshResourceGenealogy();
     189        RefreshProjectGenealogy();
     190        RefreshDisabledParentProjects();
    191191      } catch {
    192192        projects = null;
     
    214214    }
    215215
    216     private void UpdateResourceGenealogy() {
     216    private void RefreshResourceGenealogy() {
    217217      resourceAncestors.Clear();
    218218      resourceDescendants.Clear();
     
    234234    }
    235235
    236     private void UpdateProjectGenealogy() {
     236    private void RefreshProjectGenealogy() {
    237237      projectAncestors.Clear();
    238238      projectDescendants.Clear();
     
    254254    }
    255255
    256     private void UpdateDisabledParentProjects() {
     256    private void RefreshDisabledParentProjects() {
    257257      disabledParentProjects = new HashSet<Project>();
    258258
     
    414414
    415415    public static void UpdateJob(Action<Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken) {
    416       HiveServiceLocator.Instance.CallHiveService(service => {
    417         HiveClient.StoreAsync(
    418           new Action<Exception>((Exception ex) => {
    419             //refreshableJob.ExecutionState = ExecutionState.Prepared;
    420             exceptionCallback(ex);
    421           }), refreshableJob.Job, cancellationToken);
    422       });
    423     }
     416      refreshableJob.IsProgressing = true;
     417      refreshableJob.Progress.Status = "Saving Job...";
     418      HiveClient.StoreAsync(
     419        new Action<Exception>((Exception ex) => {
     420          exceptionCallback(ex);
     421        }), refreshableJob.Job, cancellationToken);
     422      refreshableJob.IsProgressing = false;
     423      refreshableJob.Progress.Finish();
     424    }
     425
     426    public static void UpdateJob(RefreshableJob refreshableJob) {
     427      refreshableJob.IsProgressing = true;
     428
     429      try {
     430        refreshableJob.Progress.Start("Saving Job...");
     431        HiveClient.StoreAsync(new Action<Exception>((Exception ex) => {
     432          throw new Exception("Update failed.", ex);
     433        }), refreshableJob.Job, new CancellationToken());
     434      } finally {
     435        refreshableJob.IsProgressing = false;
     436        refreshableJob.Progress.Finish();
     437      }
     438    }
     439
     440
    424441
    425442    #region Upload Job
     
    687704      });
    688705    }
     706
     707    public string GetProjectAncestry(Guid projectId) {
     708      if (projectId == null || projectId == Guid.Empty) return "";
     709      var projects = projectAncestors[projectId].Reverse().ToList();
     710      projects.Add(projectId);
     711      return string.Join(" » ", projects.Select(x => ProjectNames[x]).ToArray());
     712    }
    689713  }
    690714}
Note: See TracChangeset for help on using the changeset viewer.