Skip to content

Commit

Permalink
Merge branch 'develop' into task/RDMP-70Excessive-code-reuse-for-show…
Browse files Browse the repository at this point in the history
…-command-to-user
  • Loading branch information
JFriel authored May 14, 2024
2 parents 38bf916 + 7b08b4c commit ac53f53
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
mv `find coverage -type f` db-ui.lcov
dotnet test Rdmp.Core.Tests/Rdmp.Core.Tests.csproj --nologo --collect:"XPlat Code Coverage" --no-build --verbosity minimal -c Release --results-directory coverage -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov
mv `find coverage -type f` db-core.lcov
- uses: coverallsapp/github-action@v2.2.3
- uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.github_token }}
files: ./db-ui.lcov ./db-core.lcov
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
mv `find coverage -type f` fs-ui.lcov
dotnet test Rdmp.Core.Tests/Rdmp.Core.Tests.csproj --nologo --collect:"XPlat Code Coverage" --no-build --verbosity minimal -c Release --results-directory coverage -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov
mv `find coverage -type f` fs-core.lcov
- uses: coverallsapp/github-action@v2.2.3
- uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.github_token }}
files: ./fs-ui.lcov ./fs-core.lcov
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [8.1.6] = Unreleased
## [8.1.6] - Unreleased

## Changed

- Improve error messages for Multi-ExtractionIdentifier extractions
- Add Microsoft.Bcl.AsyncInterfaces 6.0.0 for plugin dependancy tree
- Add prompt to reanem container when adding a cohort filter
- Fix to remove stack trace button from non error popups
- Add ability to set Extraction Categort as "Not Extractable"

## [8.1.5] - 2024-04-03

Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<PackageVersion Include="Spectre.Console" Version="0.49.1"/>
<PackageVersion Include="SSH.NET" Version="2024.0.0"/>
<PackageVersion Include="Terminal.Gui" Version="1.16.0"/>
<PackageVersion Include="YamlDotNet" Version="15.1.2"/>
<PackageVersion Include="YamlDotNet" Version="15.1.4"/>
<PackageVersion Include="ConsoleControl" Version="1.3.0"/>
<PackageVersion Include="Autoupdater.NET.Official" Version="1.8.5"/>
<PackageVersion Include="Autoupdater.NET.Official" Version="1.8.6"/>
<PackageVersion Include="DockPanelSuite.ThemeVS2015" Version="3.1.0"/>
<PackageVersion Include="System.Threading.ThreadPool" Version="4.3.0"/>
<PackageVersion Include="WeCantSpell.Hunspell" Version="5.0.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,25 @@ public override void Execute()
Show("Cannot set the Extraction Category to 'Core' for a Project Specific Catalogue item. It will be saved as 'Project Specific'.");
}

if (ExecuteWithCommit(() => ExecuteImpl(c.Value), $"Set ExtractionCategory to '{c}'", _extractionInformations))
if (ExecuteWithCommit(() => ExecuteImpl(c.Value), c == ExtractionCategory.NotExtractable ? "Make Not Extractable" : $"Set ExtractionCategory to '{c}'", _extractionInformations))
//publish the root Catalogue
Publish(_extractionInformations.First());
}

private void ExecuteImpl(ExtractionCategory category)
{

foreach (var ei in _extractionInformations)
{
ei.ExtractionCategory = category;
ei.SaveToDatabase();
if (category == ExtractionCategory.NotExtractable)
{
ei.DeleteInDatabase();
}
else
{
ei.ExtractionCategory = category;
ei.SaveToDatabase();
}
}
}
}
7 changes: 6 additions & 1 deletion Rdmp.Core/Curation/Data/ExtractionCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ public enum ExtractionCategory
/// <summary>
/// Value can only be used for fetching ExtractionInformations. This means that all will be returned. You cannot set a column to have an ExtractionCategory of Any
/// </summary>
Any
Any,

/// <summary>
/// Value used for improved UI experience, will be set to null when executed
/// </summary>
NotExtractable
}
2 changes: 1 addition & 1 deletion Rdmp.Core/DataExport/Checks/SelectedDataSetsChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void Check(ICheckNotifier notifier)
{
notifier.OnCheckPerformed(
new CheckEventArgs(
$"Could not generate valid extraction SQL for dataset {ds} in configuration {config}",
$"Could not generate valid extraction SQL for dataset {ds} in configuration {config}. {e.Message}",
CheckResult.Fail, e));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ internal sealed class ExtractionInformationStateBasedIconProvider : IObjectState

private static readonly Image<Rgba32> NoIconAvailable = Image.Load<Rgba32>(CatalogueIcons.NoIconAvailable);

private static readonly Image<Rgba32> ExtractionInformationNotExtractable = IconOverlayProvider.GetOverlayNoCache(ExtractionInformationCore, OverlayKind.Delete);

public Image<Rgba32> GetImageIfSupportedObject(object o)
{
if (o is ExtractionCategory cat)
Expand Down Expand Up @@ -67,6 +69,7 @@ private static Image<Rgba32> GetImage(ExtractionCategory category)
ExtractionCategory.Deprecated => ExtractionInformationDeprecated,
ExtractionCategory.ProjectSpecific => ExtractionInformationProjectSpecific,
ExtractionCategory.Any => NoIconAvailable,
ExtractionCategory.NotExtractable => ExtractionInformationNotExtractable,
_ => throw new ArgumentOutOfRangeException(nameof(category))
};
}
Expand Down
4 changes: 2 additions & 2 deletions Rdmp.UI.Tests/UITimeoutAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public TimeoutCommand(TestCommand innerCommand, int timeout) : base(innerCommand
_timeout = timeout;
}

[LibraryImport("user32.dll")]
[LibraryImport("user32.dll", SetLastError = true, EntryPoint = "SendMessageW", StringMarshalling = StringMarshalling.Utf16)]
private static partial IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam);

[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

[LibraryImport("user32.dll")]
[LibraryImport("user32.dll", SetLastError = true, EntryPoint = "GetDlgItemW", StringMarshalling = StringMarshalling.Utf16)]
private static partial IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem);

private string YesNoDialog = "#32770";
Expand Down
4 changes: 2 additions & 2 deletions Rdmp.UI/RichTextBoxEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ private struct CHARFORMAT2_STRUCT
public byte bReserved1;
}

[LibraryImport("user32.dll")]
[LibraryImport("user32.dll", SetLastError = true, EntryPoint = "SendMessageW", StringMarshalling = StringMarshalling.Utf16)]
private static partial IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);

private const int WM_USER = 0x0400;
private const int EM_GETCHARFORMAT = WM_USER + 58;
private const int EM_SETCHARFORMAT = WM_USER + 68;

private const int SCF_SELECTION = 0x0001;
private const int SCF_WORD = 0x0002;
private const int SCF_ALL = 0x0004;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,6 @@ private bool AllAreSameDirection()
.Count() == 1; //if count of distinct directions is 1 then they are all in the same direction
}

[LibraryImport("user32.dll")]
[LibraryImport("user32.dll", SetLastError = true, EntryPoint = "GetScrollPosW", StringMarshalling = StringMarshalling.Utf16)]
private static partial int GetScrollPos(IntPtr hWnd, Orientation nBar);
}
2 changes: 1 addition & 1 deletion Rdmp.UI/TransparentHelpSystem/TransparentHelpForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class TransparentHelpForm : Form
private readonly Control _host;
private Control _highlight;

[LibraryImport("user32.dll", SetLastError = true)]
[LibraryImport("user32.dll", SetLastError = true, EntryPoint = "ShowWindowW", StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool ShowWindow(IntPtr hWnd, int nCmdShow);

Expand Down
6 changes: 3 additions & 3 deletions SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("8.1.5")]
[assembly: AssemblyFileVersion("8.1.5")]
[assembly: AssemblyInformationalVersion("8.1.5")]
[assembly: AssemblyVersion("8.1.6")]
[assembly: AssemblyFileVersion("8.1.6")]
[assembly: AssemblyInformationalVersion("8.1.6-rc1")]
4 changes: 2 additions & 2 deletions directory.build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<Version>8.1.5</Version>
<Version>8.1.6</Version>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
</Project>

0 comments on commit ac53f53

Please sign in to comment.