Skip to content

Commit

Permalink
Merge pull request #1998 from HicServices/task/RDMP-246-link-cici-wit…
Browse files Browse the repository at this point in the history
…h-cohorts

Task/rdmp 246 link cic with external cohorts
  • Loading branch information
rdteviotdale authored Sep 19, 2024
2 parents ac20b76 + d8b55ca commit 17546a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Re-Instantiate connection to FTP server on FTP Downloader cleanup
- Add AWS S3 Bucket Release component for flat files
- Add UI linkage for projects and cohort builder configurations
- Add goto for Cohort Identification Configuration from External Cohort

## [8.2.3] - 2024-08-05

Expand Down
16 changes: 15 additions & 1 deletion Rdmp.Core/CommandExecution/GoToCommandFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) The University of Dundee 2018-2019
// Copyright (c) The University of Dundee 2018-2024
// This file is part of the Research Data Management Platform (RDMP).
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Expand Down Expand Up @@ -413,6 +413,20 @@ public IEnumerable<IAtomicCommand> GetCommands(object forObject)
OverrideCommandName = "Project(s)",
OverrideIcon = GetImage(RDMPConcept.Project)
};

var obj = ExtractableCohortAuditLogBuilder.GetObjectIfAny(cohort, _activator.RepositoryLocator);
if (obj is not null && obj is CohortIdentificationConfiguration configuration)
{
yield return new ExecuteCommandShow(_activator, () =>
{
return [configuration];
})
{
OverrideCommandName = "Cohort Identification Configuration(s)",
OverrideIcon = GetImage(RDMPConcept.CohortIdentificationConfiguration)
};
}

}

//if it is a masquerader and masquerading as a DatabaseEntity then add a goto the object
Expand Down
6 changes: 2 additions & 4 deletions Rdmp.UI/CohortUI/ExtractableCohortCollectionUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ExtractableCohortCollectionUI()

olvViewLog.AspectGetter = ViewLogAspectGetter;
olvID.AspectGetter = IDAspectGetter;

olvCreatedFrom.AspectGetter = CreatedFromAspectGetter;
lbCohortDatabaseTable.ButtonClick += lbCohortDatabaseTable_ButtonClick;
lbCohortDatabaseTable.RowHeight = 19;

Expand All @@ -57,13 +57,11 @@ public override void SetItemActivator(IActivateItems activator)
{
base.SetItemActivator(activator);

// wait till we have an activator before registering this callback otherwise we will get null reference
olvCreatedFrom.AspectGetter = CreatedFromAspectGetter;
}

private object CreatedFromAspectGetter(object rowObject)
{
if (rowObject is ExtractableCohortDescription ecd)
if (rowObject is ExtractableCohortDescription ecd && Activator is not null)
{
var obj = ExtractableCohortAuditLogBuilder.GetObjectIfAny(ecd.Cohort, Activator.RepositoryLocator);
return obj is ExtractionInformation ei ? $"{ei.CatalogueItem.Catalogue}.{ei}" : obj;
Expand Down
1 change: 1 addition & 0 deletions Rdmp.UI/ProjectUI/ProjectUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private void SetCohorts()

if (Activator.CoreChildProvider is not DataExportChildProvider dxChildProvider)
return;
extractableCohortCollection1.SetItemActivator(Activator);

extractableCohortCollection1.SetupFor(dxChildProvider.Cohorts
.Where(c => c.ExternalProjectNumber == _project.ProjectNumber).ToArray());
Expand Down

0 comments on commit 17546a0

Please sign in to comment.