Skip to content

Commit

Permalink
Merge branch 'develop' into task/improve-find-and-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel authored Aug 7, 2024
2 parents 43cd937 + db0e0db commit 9760165
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 109 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [8.2.4] - Unreleased

- Add New Find & Replace, currently available via User Settings
- Add instance setting to prompt for cohort versioning when comitting
- Improve Cohort Versioning Interface

## [8.2.3] - 2024-08-05

Expand All @@ -29,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add Release status options to the ticketing system
- Improve Interface for Lookup table generation
- Improve read/write access to plugin files for linux systems
- Add directory validity checking to data loads
- Open plugin files read-only to avoid permissions errors on Linux
- Improve PK mapping for ExtractionIdentifiers when extracting data
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Equ" Version="2.3.0" />
<PackageVersion Include="ExcelNumberFormat" Version="1.1.0" />
<PackageVersion Include="FluentFTP" Version="50.1.0" />
<PackageVersion Include="FluentFTP" Version="51.0.0" />
<PackageVersion Include="HIC.SynthEHR" Version="2.0.0" />
<PackageVersion Include="HIC.FAnsiSql" Version="3.2.6" />
<PackageVersion Include="LibArchive.Net" Version="0.1.5" />
Expand All @@ -23,7 +23,7 @@
<PackageVersion Include="YamlDotNet" Version="16.0.0" />
<PackageVersion Include="ConsoleControl" Version="1.3.0" />
<PackageVersion Include="Autoupdater.NET.Official" Version="1.9.1" />
<PackageVersion Include="DockPanelSuite.ThemeVS2015" Version="3.1.0" />
<PackageVersion Include="DockPanelSuite.ThemeVS2015" Version="3.1.1" />
<PackageVersion Include="System.Threading.ThreadPool" Version="4.3.0" />
<PackageVersion Include="WeCantSpell.Hunspell" Version="5.0.0" />
<PackageVersion Include="NUnit" Version="4.1.0" />
Expand All @@ -39,4 +39,4 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// 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.
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.

using System;
using System.Linq;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.Curation.Data.Cohort;
Expand All @@ -13,6 +14,7 @@
using Rdmp.Core.Providers;
using Rdmp.Core.Repositories.Construction;
using Rdmp.Core.ReusableLibraryCode.Icons.IconProvision;
using Rdmp.Core.Setting;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

Expand Down Expand Up @@ -68,7 +70,19 @@ public override void Execute()
if (cic == null)
return;

if (BasicActivator.IsInteractive) {
var PromptForVersionOnCohortCommit = false;
var PromptForVersionOnCohortCommitSetting = BasicActivator.RepositoryLocator.CatalogueRepository.GetAllObjects<Setting.Setting>().Where(s => s.Key == "PromptForVersionOnCohortCommit").FirstOrDefault();
if (PromptForVersionOnCohortCommitSetting is not null) PromptForVersionOnCohortCommit = Convert.ToBoolean(PromptForVersionOnCohortCommitSetting.Value);
if (PromptForVersionOnCohortCommit && BasicActivator.YesNo("It is recommended to save your cohort as a new version before committing. Would you like to do this?", "Save cohort as new version before committing?"))
{
var newVersion = new ExecuteCommandCreateVersionOfCohortConfiguration(BasicActivator, cic);
newVersion.Execute();
var versions = cic.GetVersions();
cic = versions.Last();
}

}
if (Project == null && BasicActivator.CoreChildProvider is DataExportChildProvider dx)
{
var projAssociations = dx.AllProjectAssociatedCics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public override void Execute()
{
CloneCreatedIfAny.Version = _version;
//If no name is provided, use the existing name, but repalce the "(Clone) with the version number"
CloneCreatedIfAny.Name = _name ?? $"{CloneCreatedIfAny.Name[..^7]}:{CloneCreatedIfAny.Version}";
if(CloneCreatedIfAny.Version != null)
CloneCreatedIfAny.Name = _name ?? $"{CloneCreatedIfAny.Name[..^7]}:{CloneCreatedIfAny.Version}";
if (_version is not null)
CloneCreatedIfAny.Frozen = true;
CloneCreatedIfAny.SaveToDatabase();
Expand Down
24 changes: 23 additions & 1 deletion Rdmp.UI/Collections/CohortIdentificationCollectionUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ public override void SetItemActivator(IActivateItems activator)
tlvCohortIdentificationConfigurations.AddObject(Activator.CoreChildProvider
.TemplateAggregateConfigurationsNode);


tlvCohortIdentificationConfigurations.CanExpandGetter = delegate (object x)
{
if (x is CohortIdentificationConfiguration)
{
return ((CohortIdentificationConfiguration)x).GetVersions().Count > 0;
}

return Activator.CoreChildProvider.GetChildren(x).Length > 0;
};

tlvCohortIdentificationConfigurations.ChildrenGetter = delegate (object x)
{
if (x is CohortIdentificationConfiguration)
{
CohortIdentificationConfiguration cic = (CohortIdentificationConfiguration)x;
return cic.GetVersions();
}
return Activator.CoreChildProvider.GetChildren(x);
};

CommonTreeFunctionality.WhitespaceRightClickMenuCommandsGetter = a => new IAtomicCommand[]
{
new ExecuteCommandCreateNewCohortIdentificationConfiguration(a),
Expand Down Expand Up @@ -99,7 +120,8 @@ public override void SetItemActivator(IActivateItems activator)
Alignment = ToolStripItemAlignment.Right,
ToolTipText = "Refresh Object"
};
_refresh.Click += delegate (object sender, EventArgs e) {
_refresh.Click += delegate (object sender, EventArgs e)
{
var cic = Activator.CoreChildProvider.AllCohortIdentificationConfigurations.First();
if (cic is not null)
{
Expand Down
130 changes: 30 additions & 100 deletions Rdmp.UI/LocationsMenu/Versioning/VersioningControlUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Rdmp.UI/SimpleDialogs/InstanceSettings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Rdmp.UI/SimpleDialogs/InstanceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public InstanceSettings(IActivateItems activator)
_settings = _activator.RepositoryLocator.CatalogueRepository.GetAllObjects<Setting>();

RegisterCheckbox(cbAutoSuggestProjectNumbers, "AutoSuggestProjectNumbers");
RegisterCheckbox(cbCohortVersioningOnCommit, "PromptForVersionOnCohortCommit");
_loaded = true;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9760165

Please sign in to comment.