Skip to content

Commit 9356842

Browse files
authored
Merge pull request #2309 from HicServices/task/RDMP-358-folders-in-project-cohorts
Task/rdmp 358 folders in project cohorts
2 parents 74ec31f + 2d220da commit 9356842

File tree

6 files changed

+21
-79
lines changed

6 files changed

+21
-79
lines changed

Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,6 @@
514514
<data name="ProjectSavedCohortsNode" type="System.Resources.ResXFileRef, System.Windows.Forms">
515515
<value>..\ProjectSavedCohortsNode.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
516516
</data>
517-
<data name="CommittedCohortIdentificationNode" type="System.Resources.ResXFileRef, System.Windows.Forms">
518-
<value>..\CommittedCohortIdentificationNode.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
519-
</data>
520517
<data name="collapseAllNodes" type="System.Resources.ResXFileRef, System.Windows.Forms">
521518
<value>..\collapseAllNodes.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
522519
</data>

Rdmp.Core/Icons/IconProvision/RDMPConcept.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ public enum RDMPConcept
208208
LoadMetadataCatalogueLinkage,
209209
Setting,
210210
TicketingSystemReleaseStatus,
211-
CommittedCohortIdentificationNode,
212211
AllDatasetsNode,
213212
RegexRedaction,
214213
RegexRedactionConfiguration,

Rdmp.Core/Providers/DataExportChildProvider.cs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Rdmp.Core.Caching.Pipeline;
1414
using Rdmp.Core.CohortCommitting.Pipeline;
1515
using Rdmp.Core.Curation.Data;
16+
using Rdmp.Core.Curation.Data.Cohort;
1617
using Rdmp.Core.Curation.Data.Pipelines;
1718
using Rdmp.Core.DataExport.Data;
1819
using Rdmp.Core.DataExport.DataExtraction.Pipeline;
@@ -238,6 +239,22 @@ private void AddChildren(FolderNode<Project> folder, DescendancyList descendancy
238239
);
239240
}
240241

242+
private void AddChildren(FolderNode<CohortIdentificationConfiguration> folder, DescendancyList descendancy)
243+
{
244+
foreach (var child in folder.ChildFolders)
245+
//add subfolder children
246+
AddChildren(child, descendancy.Add(child));
247+
248+
//add catalogues in folder
249+
foreach (var cic in folder.ChildObjects) AddToDictionaries(new HashSet<object>() { cic }, descendancy.SetBetterRouteExists());
250+
251+
// Children are the folders + objects
252+
AddToDictionaries(new HashSet<object>(
253+
folder.ChildFolders.Cast<object>()
254+
.Union(folder.ChildObjects)), descendancy
255+
);
256+
}
257+
241258
private void BuildSelectedDatasets()
242259
{
243260
_selectedDataSetsWithNoIsExtractionIdentifier =
@@ -347,7 +364,9 @@ private void AddChildren(ProjectCohortsNode projectCohortsNode, DescendancyList
347364
children.Add(savedCohortsNode);
348365
AddChildren(savedCohortsNode, descendancy.Add(savedCohortsNode));
349366

350-
var associatedCohortConfigurations = new CommittedCohortIdentificationNode(projectCohortsNode.Project);
367+
var associatedCohortConfigurations = FolderHelper.BuildFolderTree(projectCohortsNode.Project.GetAssociatedCohortIdentificationConfigurations());
368+
associatedCohortConfigurations.Name = "Associated Cohort Configurations";
369+
associatedCohortConfigurations.Parent = new FolderNode<CohortIdentificationConfiguration>($"\\{projectCohortsNode.Project}\\{projectCohortsNode}");
351370
children.Add(associatedCohortConfigurations);
352371
AddChildren(associatedCohortConfigurations, descendancy.Add(associatedCohortConfigurations));
353372

@@ -371,18 +390,6 @@ private void AddChildren(AssociatedCohortIdentificationTemplatesNode associatedC
371390
AddToDictionaries(children, descendancy);
372391
}
373392

374-
private void AddChildren(CommittedCohortIdentificationNode associatedCohortConfigurations, DescendancyList descendancy)
375-
{
376-
var children = new HashSet<object>();
377-
var associatedCohorts = associatedCohortConfigurations.Project.GetAssociatedCohortIdentificationConfigurations();
378-
foreach (var cohort in associatedCohorts)
379-
{
380-
children.Add(cohort);
381-
}
382-
383-
AddToDictionaries(children, descendancy);
384-
}
385-
386393
private void AddChildren(ProjectSavedCohortsNode savedCohortsNode, DescendancyList descendancy)
387394
{
388395
var children = new HashSet<object>();

Rdmp.Core/Providers/Nodes/CohortNodes/CommittedCohortIdentificationNode.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

Rdmp.UI/NavigationTrack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public NavigationTrack(Func<T, bool> aliveDelegate, Action<T> activate)
6464
public void Prune()
6565
{
6666
_navigationStack = new Stack<T>(_navigationStack.ToArray().Take(MaxHistory + 1).Reverse().Where(_isAlive));
67-
_forward = new Stack<T>(_forward.AsEnumerable().ToArray().AsEnumerable().Reverse().Where(_isAlive));
67+
_forward = new Stack<T>(_forward.ToArray().AsEnumerable().Reverse().Where(_isAlive));
6868
}
6969

7070
/// <summary>

0 commit comments

Comments
 (0)