From fa8c17726b95083c176bdfe68dfd1f88908d6de6 Mon Sep 17 00:00:00 2001 From: James Friel Date: Tue, 2 Jul 2024 16:01:23 +0100 Subject: [PATCH 01/19] add initial ticketing update --- Rdmp.Core/Curation/Data/EncryptedString.cs | 2 +- .../Data/TicketingSystemConfiguration.cs | 7 +++ .../Curation/SimpleStringValueEncryption.cs | 2 +- .../Curation/TicketingSystemReleaseStatus.cs | 46 +++++++++++++++++++ .../up/085_AddTicketingReleaseStatuses.sql | 20 ++++++++ Rdmp.Core/Rdmp.Core.csproj | 2 + Rdmp.Core/Ticketing/ITicketingSystem.cs | 3 ++ Rdmp.Core/Ticketing/PluginTicketingSystem.cs | 4 ++ Rdmp.Core/Ticketing/SimpleTicketingSystem.cs | 6 +++ .../ProjectUI/ExtractionConfigurationUI.cs | 2 +- 10 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs create mode 100644 Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql diff --git a/Rdmp.Core/Curation/Data/EncryptedString.cs b/Rdmp.Core/Curation/Data/EncryptedString.cs index 126c6ca373..ca4d294712 100644 --- a/Rdmp.Core/Curation/Data/EncryptedString.cs +++ b/Rdmp.Core/Curation/Data/EncryptedString.cs @@ -40,7 +40,7 @@ public string Value } catch (Exception e) { - if (e.Message.Contains("Bad Length") || e.Message.Contains("data too large for key size")) + if (e.Message.Contains("Bad Length") || e.Message.Contains("data too large for key size")) throw new InvalidOperationException( $"The free text Value supplied to this class was too long to be encrypted (Length of string was {value.Length})", e); diff --git a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs index 00fd3667fa..b9fbdb2a72 100644 --- a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs +++ b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Data.Common; +using System.Linq; using Rdmp.Core.MapsDirectlyToDatabaseTable; using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes; using Rdmp.Core.Repositories; @@ -118,6 +119,11 @@ public TicketingSystemConfiguration(ICatalogueRepository repository, string name }); } + public List GetReleaseStatuses() + { + return Repository.GetAllObjectsWhere("TicketingSystemConfigurationID", this.ID).ToList(); + } + /// internal TicketingSystemConfiguration(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { @@ -127,4 +133,5 @@ internal TicketingSystemConfiguration(ICatalogueRepository repository, DbDataRea Name = r["Name"] as string; DataAccessCredentials_ID = ObjectToNullableInt(r["DataAccessCredentials_ID"]); } + } \ No newline at end of file diff --git a/Rdmp.Core/Curation/SimpleStringValueEncryption.cs b/Rdmp.Core/Curation/SimpleStringValueEncryption.cs index cf7cdf7748..d9911f29b8 100644 --- a/Rdmp.Core/Curation/SimpleStringValueEncryption.cs +++ b/Rdmp.Core/Curation/SimpleStringValueEncryption.cs @@ -19,7 +19,7 @@ namespace Rdmp.Core.Curation; /// public class SimpleStringValueEncryption : IEncryptStrings { - private readonly RSACryptoServiceProvider _turing = new(); + private readonly RSACryptoServiceProvider _turing = new RSACryptoServiceProvider(1024); private const string Key = @" diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs new file mode 100644 index 0000000000..3a72c064e4 --- /dev/null +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -0,0 +1,46 @@ +// Copyright (c) The University of Dundee 2024-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 . + +using Org.BouncyCastle.Security.Certificates; +using Rdmp.Core.Curation.Data; +using Rdmp.Core.MapsDirectlyToDatabaseTable; +using Rdmp.Core.Repositories; +using System; +using System.Collections.Generic; +using System.Data.Common; +namespace Rdmp.Core.Curation +{ + public class TicketingSystemReleaseStatus : DatabaseEntity, INamed + { + + private string _status; + private int? _statusID; + private int _ticketingSystemConfiguratonID; + + public string Name { get => _status; set => SetField(ref _status, value); } + public int? StatusID { get => _statusID; set => SetField(ref _statusID, value); } + public int TicketingSystemConfigurationID { get => _ticketingSystemConfiguratonID; set => SetField(ref _ticketingSystemConfiguratonID, value); } + + public TicketingSystemReleaseStatus() { } + + public TicketingSystemReleaseStatus(ICatalogueRepository repository, string status, int? statusID, TicketingSystemConfiguration config) : base() + { + repository.InsertAndHydrate(this, new Dictionary + { + {"Status", status }, + {"StatusID", statusID is null? statusID: DBNull.Value }, + {"TicketingSystemConfigurationID", config.ID } + }); + } + + public TicketingSystemReleaseStatus(ICatalogueRepository repository, DbDataReader r) : base(repository, r) + { + Name = r["Status"] as string; + StatusID = r["StatusID"] as int?; + TicketingSystemConfigurationID = Int32.Parse(r["TicketingSystemConfigurationID"] as string); + } + } +} diff --git a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql new file mode 100644 index 0000000000..fa7fc1de7d --- /dev/null +++ b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql @@ -0,0 +1,20 @@ +--Version 8.2.1 +--Description: Add lookup table of release status names for a ticketing configuration + + +if not exists (select 1 from sys.tables where name = 'TicketingSystemReleaseStatus') +BEGIN +CREATE TABLE [dbo].[TicketingSystemReleaseStatus]( + [ID] [int] IDENTITY(1,1) NOT NULL, + [Status] [nvarchar](250) NOT NULL, + [StatusID] [int] NULL, + [TicketingSystemConfigurationID] [int] NOT NULL, + FOREIGN KEY (TicketingSystemConfigurationID) REFERENCES TicketingSystemConfiguration(ID), + +CONSTRAINT [PK_TicketingSystemReleaseStatus] PRIMARY KEY CLUSTERED +( + [ID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +END +GO \ No newline at end of file diff --git a/Rdmp.Core/Rdmp.Core.csproj b/Rdmp.Core/Rdmp.Core.csproj index 95a9950395..c7c2c97d2c 100644 --- a/Rdmp.Core/Rdmp.Core.csproj +++ b/Rdmp.Core/Rdmp.Core.csproj @@ -127,6 +127,7 @@ + @@ -251,6 +252,7 @@ + diff --git a/Rdmp.Core/Ticketing/ITicketingSystem.cs b/Rdmp.Core/Ticketing/ITicketingSystem.cs index eb772e62ce..98c52dbc87 100644 --- a/Rdmp.Core/Ticketing/ITicketingSystem.cs +++ b/Rdmp.Core/Ticketing/ITicketingSystem.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.Collections.Generic; using Rdmp.Core.ReusableLibraryCode.Checks; namespace Rdmp.Core.Ticketing; @@ -48,6 +49,8 @@ TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTic string releaseTicket, out string reason, out Exception exception); string GetProjectFolderName(string masterTicket); + + List GetAvailableStatuses(); } public enum TicketingReleaseabilityEvaluation diff --git a/Rdmp.Core/Ticketing/PluginTicketingSystem.cs b/Rdmp.Core/Ticketing/PluginTicketingSystem.cs index afa95545ec..3fb8c1bbec 100644 --- a/Rdmp.Core/Ticketing/PluginTicketingSystem.cs +++ b/Rdmp.Core/Ticketing/PluginTicketingSystem.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.Collections.Generic; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.ReusableLibraryCode.DataAccess; @@ -29,4 +30,7 @@ public abstract TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket( string requestTicket, string releaseTicket, out string reason, out Exception exception); public abstract string GetProjectFolderName(string masterTicket); + + public abstract List GetAvailableStatuses(); + } \ No newline at end of file diff --git a/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs b/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs index 101c155658..e72376bea2 100644 --- a/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs +++ b/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.Collections.Generic; using Rdmp.Core.ReusableLibraryCode; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.ReusableLibraryCode.DataAccess; @@ -55,4 +56,9 @@ public TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string ma public string GetProjectFolderName(string masterTicket) => UsefulStuff.RegexThingsThatAreNotNumbersOrLettersOrUnderscores.Replace(masterTicket, ""); + + public List GetAvailableStatuses() + { + return new List(); + } } \ No newline at end of file diff --git a/Rdmp.UI/ProjectUI/ExtractionConfigurationUI.cs b/Rdmp.UI/ProjectUI/ExtractionConfigurationUI.cs index a68f113be7..b8b503e504 100644 --- a/Rdmp.UI/ProjectUI/ExtractionConfigurationUI.cs +++ b/Rdmp.UI/ProjectUI/ExtractionConfigurationUI.cs @@ -193,7 +193,7 @@ private void SetupPipelineSelectionExtraction() //the user is DefaultPipeline_ID field of ExtractionConfiguration var user = new PipelineUser(typeof(ExtractionConfiguration).GetProperty("DefaultPipeline_ID"), - _extractionConfiguration); + _extractionConfiguration,Activator.RepositoryLocator.CatalogueRepository); //create the UI for this situation var factory = new PipelineSelectionUIFactory(Activator.RepositoryLocator.CatalogueRepository, user, useCase); From 214e68b22e5525789f5df2f69dfc92cee9951dc5 Mon Sep 17 00:00:00 2001 From: James Friel Date: Tue, 2 Jul 2024 16:08:16 +0100 Subject: [PATCH 02/19] fix patch --- .../up/085_AddTicketingReleaseStatuses.sql | 2 +- SharedAssemblyInfo.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql index fa7fc1de7d..8073aed984 100644 --- a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql +++ b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql @@ -1,4 +1,4 @@ ---Version 8.2.1 +--Version: 8.2.1 --Description: Add lookup table of release status names for a ticketing configuration diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index aa2132ac5d..dd82fe9edf 100644 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -10,6 +10,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("8.2.0")] -[assembly: AssemblyFileVersion("8.2.0")] -[assembly: AssemblyInformationalVersion("8.2.0")] +[assembly: AssemblyVersion("8.2.1")] +[assembly: AssemblyFileVersion("8.2.1")] +[assembly: AssemblyInformationalVersion("8.2.1")] From 9bcf26d481ec7467bdf33ebbc61642ab222069da Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 08:22:17 +0100 Subject: [PATCH 03/19] interim --- Rdmp.Core/Curation/Data/EncryptedString.cs | 1 + .../Data/TicketingSystemConfiguration.cs | 3 +- .../Curation/TicketingSystemReleaseStatus.cs | 2 +- ...TicketingSystemConfigurationUI.Designer.cs | 494 +++++++++--------- .../TicketingSystemConfigurationUI.cs | 39 ++ .../TicketingSystemConfigurationUI.resx | 50 +- 6 files changed, 324 insertions(+), 265 deletions(-) diff --git a/Rdmp.Core/Curation/Data/EncryptedString.cs b/Rdmp.Core/Curation/Data/EncryptedString.cs index ca4d294712..c98393b99e 100644 --- a/Rdmp.Core/Curation/Data/EncryptedString.cs +++ b/Rdmp.Core/Curation/Data/EncryptedString.cs @@ -41,6 +41,7 @@ public string Value catch (Exception e) { if (e.Message.Contains("Bad Length") || e.Message.Contains("data too large for key size")) + //todo this should alert the user throw new InvalidOperationException( $"The free text Value supplied to this class was too long to be encrypted (Length of string was {value.Length})", e); diff --git a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs index b9fbdb2a72..24453da6fb 100644 --- a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs +++ b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs @@ -121,7 +121,8 @@ public TicketingSystemConfiguration(ICatalogueRepository repository, string name public List GetReleaseStatuses() { - return Repository.GetAllObjectsWhere("TicketingSystemConfigurationID", this.ID).ToList(); + var x = Repository.GetAllObjects(); + return [.. Repository.GetAllObjectsWhere("TicketingSystemConfigurationID", this.ID)]; } /// diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs index 3a72c064e4..a272fb855d 100644 --- a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -40,7 +40,7 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, DbDataReade { Name = r["Status"] as string; StatusID = r["StatusID"] as int?; - TicketingSystemConfigurationID = Int32.Parse(r["TicketingSystemConfigurationID"] as string); + TicketingSystemConfigurationID = 1;// Int32.Parse(r["TicketingSystemConfigurationID"] as string); } } } diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs index 25c6322dbf..3932c9ba05 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs @@ -28,316 +28,332 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.tbID = new System.Windows.Forms.TextBox(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.gbTicketingSystem = new System.Windows.Forms.GroupBox(); - this.cbDisabled = new System.Windows.Forms.CheckBox(); - this.cbxType = new System.Windows.Forms.ComboBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.ddCredentials = new System.Windows.Forms.ComboBox(); - this.btnDeleteCredentials = new System.Windows.Forms.Button(); - this.btnEditCredentials = new System.Windows.Forms.Button(); - this.btnAddCredentials = new System.Windows.Forms.Button(); - this.btnCheck = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); - this.tbUrl = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.tbName = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.checksUI1 = new Rdmp.UI.ChecksUI.ChecksUI(); - this.btnCreate = new System.Windows.Forms.Button(); - this.btnDelete = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.gbTicketingSystem.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); + label1 = new System.Windows.Forms.Label(); + tbID = new System.Windows.Forms.TextBox(); + splitContainer1 = new System.Windows.Forms.SplitContainer(); + gbTicketingSystem = new System.Windows.Forms.GroupBox(); + label5 = new System.Windows.Forms.Label(); + cbDisabled = new System.Windows.Forms.CheckBox(); + cbxType = new System.Windows.Forms.ComboBox(); + groupBox1 = new System.Windows.Forms.GroupBox(); + ddCredentials = new System.Windows.Forms.ComboBox(); + btnDeleteCredentials = new System.Windows.Forms.Button(); + btnEditCredentials = new System.Windows.Forms.Button(); + btnAddCredentials = new System.Windows.Forms.Button(); + btnCheck = new System.Windows.Forms.Button(); + btnSave = new System.Windows.Forms.Button(); + label4 = new System.Windows.Forms.Label(); + tbUrl = new System.Windows.Forms.TextBox(); + label3 = new System.Windows.Forms.Label(); + tbName = new System.Windows.Forms.TextBox(); + label2 = new System.Windows.Forms.Label(); + checksUI1 = new ChecksUI.ChecksUI(); + btnCreate = new System.Windows.Forms.Button(); + btnDelete = new System.Windows.Forms.Button(); + tbReleases = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); + splitContainer1.Panel1.SuspendLayout(); + splitContainer1.Panel2.SuspendLayout(); + splitContainer1.SuspendLayout(); + gbTicketingSystem.SuspendLayout(); + groupBox1.SuspendLayout(); + SuspendLayout(); // // label1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(36, 25); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(18, 15); - this.label1.TabIndex = 0; - this.label1.Text = "ID"; + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(36, 25); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(18, 15); + label1.TabIndex = 0; + label1.Text = "ID"; // // tbID // - this.tbID.Location = new System.Drawing.Point(64, 22); - this.tbID.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbID.Name = "tbID"; - this.tbID.ReadOnly = true; - this.tbID.Size = new System.Drawing.Size(116, 23); - this.tbID.TabIndex = 1; + tbID.Location = new System.Drawing.Point(64, 22); + tbID.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbID.Name = "tbID"; + tbID.ReadOnly = true; + tbID.Size = new System.Drawing.Size(116, 23); + tbID.TabIndex = 1; // // splitContainer1 // - this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.splitContainer1.Location = new System.Drawing.Point(2, 42); - this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + splitContainer1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + splitContainer1.Location = new System.Drawing.Point(2, 42); + splitContainer1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + splitContainer1.Name = "splitContainer1"; + splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.gbTicketingSystem); + splitContainer1.Panel1.Controls.Add(gbTicketingSystem); // // splitContainer1.Panel2 // - this.splitContainer1.Panel2.Controls.Add(this.checksUI1); - this.splitContainer1.Size = new System.Drawing.Size(1029, 707); - this.splitContainer1.SplitterDistance = 249; - this.splitContainer1.SplitterWidth = 5; - this.splitContainer1.TabIndex = 2; + splitContainer1.Panel2.Controls.Add(checksUI1); + splitContainer1.Size = new System.Drawing.Size(1029, 707); + splitContainer1.SplitterDistance = 249; + splitContainer1.SplitterWidth = 5; + splitContainer1.TabIndex = 2; // // gbTicketingSystem // - this.gbTicketingSystem.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.gbTicketingSystem.Controls.Add(this.cbDisabled); - this.gbTicketingSystem.Controls.Add(this.cbxType); - this.gbTicketingSystem.Controls.Add(this.groupBox1); - this.gbTicketingSystem.Controls.Add(this.btnCheck); - this.gbTicketingSystem.Controls.Add(this.btnSave); - this.gbTicketingSystem.Controls.Add(this.label4); - this.gbTicketingSystem.Controls.Add(this.tbUrl); - this.gbTicketingSystem.Controls.Add(this.label3); - this.gbTicketingSystem.Controls.Add(this.tbName); - this.gbTicketingSystem.Controls.Add(this.label2); - this.gbTicketingSystem.Controls.Add(this.tbID); - this.gbTicketingSystem.Controls.Add(this.label1); - this.gbTicketingSystem.Enabled = false; - this.gbTicketingSystem.Location = new System.Drawing.Point(4, 3); - this.gbTicketingSystem.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbTicketingSystem.Name = "gbTicketingSystem"; - this.gbTicketingSystem.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.gbTicketingSystem.Size = new System.Drawing.Size(1025, 243); - this.gbTicketingSystem.TabIndex = 0; - this.gbTicketingSystem.TabStop = false; - this.gbTicketingSystem.Text = "TicketingSystem"; + gbTicketingSystem.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + gbTicketingSystem.Controls.Add(tbReleases); + gbTicketingSystem.Controls.Add(label5); + gbTicketingSystem.Controls.Add(cbDisabled); + gbTicketingSystem.Controls.Add(cbxType); + gbTicketingSystem.Controls.Add(groupBox1); + gbTicketingSystem.Controls.Add(btnCheck); + gbTicketingSystem.Controls.Add(btnSave); + gbTicketingSystem.Controls.Add(label4); + gbTicketingSystem.Controls.Add(tbUrl); + gbTicketingSystem.Controls.Add(label3); + gbTicketingSystem.Controls.Add(tbName); + gbTicketingSystem.Controls.Add(label2); + gbTicketingSystem.Controls.Add(tbID); + gbTicketingSystem.Controls.Add(label1); + gbTicketingSystem.Enabled = false; + gbTicketingSystem.Location = new System.Drawing.Point(4, 3); + gbTicketingSystem.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbTicketingSystem.Name = "gbTicketingSystem"; + gbTicketingSystem.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + gbTicketingSystem.Size = new System.Drawing.Size(1025, 243); + gbTicketingSystem.TabIndex = 0; + gbTicketingSystem.TabStop = false; + gbTicketingSystem.Text = "TicketingSystem"; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new System.Drawing.Point(0, 196); + label5.Name = "label5"; + label5.Size = new System.Drawing.Size(62, 30); + label5.TabIndex = 19; + label5.Text = "Releasable\r\nStatuses"; + label5.Click += label5_Click; // // cbDisabled // - this.cbDisabled.AutoSize = true; - this.cbDisabled.Location = new System.Drawing.Point(64, 174); - this.cbDisabled.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbDisabled.Name = "cbDisabled"; - this.cbDisabled.Size = new System.Drawing.Size(64, 19); - this.cbDisabled.TabIndex = 17; - this.cbDisabled.Text = "Disable"; - this.cbDisabled.UseVisualStyleBackColor = true; - this.cbDisabled.CheckedChanged += new System.EventHandler(this.cbDisabled_CheckedChanged); + cbDisabled.AutoSize = true; + cbDisabled.Location = new System.Drawing.Point(64, 174); + cbDisabled.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbDisabled.Name = "cbDisabled"; + cbDisabled.Size = new System.Drawing.Size(64, 19); + cbDisabled.TabIndex = 17; + cbDisabled.Text = "Disable"; + cbDisabled.UseVisualStyleBackColor = true; + cbDisabled.CheckedChanged += cbDisabled_CheckedChanged; // // cbxType // - this.cbxType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cbxType.FormattingEnabled = true; - this.cbxType.Location = new System.Drawing.Point(64, 110); - this.cbxType.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cbxType.Name = "cbxType"; - this.cbxType.Size = new System.Drawing.Size(956, 23); - this.cbxType.TabIndex = 3; - this.cbxType.TextChanged += new System.EventHandler(this.tb_TextChanged); + cbxType.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + cbxType.FormattingEnabled = true; + cbxType.Location = new System.Drawing.Point(64, 110); + cbxType.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + cbxType.Name = "cbxType"; + cbxType.Size = new System.Drawing.Size(956, 23); + cbxType.TabIndex = 3; + cbxType.TextChanged += tb_TextChanged; // // groupBox1 // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.ddCredentials); - this.groupBox1.Controls.Add(this.btnDeleteCredentials); - this.groupBox1.Controls.Add(this.btnEditCredentials); - this.groupBox1.Controls.Add(this.btnAddCredentials); - this.groupBox1.Location = new System.Drawing.Point(514, 141); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.groupBox1.Size = new System.Drawing.Size(503, 93); - this.groupBox1.TabIndex = 2; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Credentials"; + groupBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + groupBox1.Controls.Add(ddCredentials); + groupBox1.Controls.Add(btnDeleteCredentials); + groupBox1.Controls.Add(btnEditCredentials); + groupBox1.Controls.Add(btnAddCredentials); + groupBox1.Location = new System.Drawing.Point(514, 141); + groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + groupBox1.Name = "groupBox1"; + groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + groupBox1.Size = new System.Drawing.Size(503, 93); + groupBox1.TabIndex = 2; + groupBox1.TabStop = false; + groupBox1.Text = "Credentials"; // // ddCredentials // - this.ddCredentials.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ddCredentials.FormattingEnabled = true; - this.ddCredentials.Location = new System.Drawing.Point(20, 22); - this.ddCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.ddCredentials.Name = "ddCredentials"; - this.ddCredentials.Size = new System.Drawing.Size(465, 23); - this.ddCredentials.Sorted = true; - this.ddCredentials.TabIndex = 18; - this.ddCredentials.SelectedIndexChanged += new System.EventHandler(this.ddCredentials_SelectedIndexChanged); + ddCredentials.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + ddCredentials.FormattingEnabled = true; + ddCredentials.Location = new System.Drawing.Point(20, 22); + ddCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + ddCredentials.Name = "ddCredentials"; + ddCredentials.Size = new System.Drawing.Size(465, 23); + ddCredentials.Sorted = true; + ddCredentials.TabIndex = 18; + ddCredentials.SelectedIndexChanged += ddCredentials_SelectedIndexChanged; // // btnDeleteCredentials // - this.btnDeleteCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.btnDeleteCredentials.Location = new System.Drawing.Point(310, 53); - this.btnDeleteCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnDeleteCredentials.Name = "btnDeleteCredentials"; - this.btnDeleteCredentials.Size = new System.Drawing.Size(138, 27); - this.btnDeleteCredentials.TabIndex = 17; - this.btnDeleteCredentials.Text = "Delete Credentials"; - this.btnDeleteCredentials.UseVisualStyleBackColor = true; - this.btnDeleteCredentials.Click += new System.EventHandler(this.btnDeleteCredentials_Click); + btnDeleteCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; + btnDeleteCredentials.Location = new System.Drawing.Point(310, 53); + btnDeleteCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnDeleteCredentials.Name = "btnDeleteCredentials"; + btnDeleteCredentials.Size = new System.Drawing.Size(138, 27); + btnDeleteCredentials.TabIndex = 17; + btnDeleteCredentials.Text = "Delete Credentials"; + btnDeleteCredentials.UseVisualStyleBackColor = true; + btnDeleteCredentials.Click += btnDeleteCredentials_Click; // // btnEditCredentials // - this.btnEditCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.btnEditCredentials.Location = new System.Drawing.Point(164, 53); - this.btnEditCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnEditCredentials.Name = "btnEditCredentials"; - this.btnEditCredentials.Size = new System.Drawing.Size(138, 27); - this.btnEditCredentials.TabIndex = 17; - this.btnEditCredentials.Text = "Edit Credentials"; - this.btnEditCredentials.UseVisualStyleBackColor = true; - this.btnEditCredentials.Click += new System.EventHandler(this.btnEditCredentials_Click); + btnEditCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; + btnEditCredentials.Location = new System.Drawing.Point(164, 53); + btnEditCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnEditCredentials.Name = "btnEditCredentials"; + btnEditCredentials.Size = new System.Drawing.Size(138, 27); + btnEditCredentials.TabIndex = 17; + btnEditCredentials.Text = "Edit Credentials"; + btnEditCredentials.UseVisualStyleBackColor = true; + btnEditCredentials.Click += btnEditCredentials_Click; // // btnAddCredentials // - this.btnAddCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.btnAddCredentials.Location = new System.Drawing.Point(20, 53); - this.btnAddCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnAddCredentials.Name = "btnAddCredentials"; - this.btnAddCredentials.Size = new System.Drawing.Size(138, 27); - this.btnAddCredentials.TabIndex = 16; - this.btnAddCredentials.Text = "Add New Credentials"; - this.btnAddCredentials.UseVisualStyleBackColor = true; - this.btnAddCredentials.Click += new System.EventHandler(this.btnAddCredentials_Click); + btnAddCredentials.Anchor = System.Windows.Forms.AnchorStyles.Top; + btnAddCredentials.Location = new System.Drawing.Point(20, 53); + btnAddCredentials.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnAddCredentials.Name = "btnAddCredentials"; + btnAddCredentials.Size = new System.Drawing.Size(138, 27); + btnAddCredentials.TabIndex = 16; + btnAddCredentials.Text = "Add New Credentials"; + btnAddCredentials.UseVisualStyleBackColor = true; + btnAddCredentials.Click += btnAddCredentials_Click; // // btnCheck // - this.btnCheck.Location = new System.Drawing.Point(210, 141); - this.btnCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCheck.Name = "btnCheck"; - this.btnCheck.Size = new System.Drawing.Size(138, 27); - this.btnCheck.TabIndex = 16; - this.btnCheck.Text = "Check"; - this.btnCheck.UseVisualStyleBackColor = true; - this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click); + btnCheck.Location = new System.Drawing.Point(210, 141); + btnCheck.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCheck.Name = "btnCheck"; + btnCheck.Size = new System.Drawing.Size(138, 27); + btnCheck.TabIndex = 16; + btnCheck.Text = "Check"; + btnCheck.UseVisualStyleBackColor = true; + btnCheck.Click += btnCheck_Click; // // btnSave // - this.btnSave.Location = new System.Drawing.Point(64, 141); - this.btnSave.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(138, 27); - this.btnSave.TabIndex = 16; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + btnSave.Location = new System.Drawing.Point(64, 141); + btnSave.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnSave.Name = "btnSave"; + btnSave.Size = new System.Drawing.Size(138, 27); + btnSave.TabIndex = 16; + btnSave.Text = "Save"; + btnSave.UseVisualStyleBackColor = true; + btnSave.Click += btnSave_Click; // // label4 // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(23, 113); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(31, 15); - this.label4.TabIndex = 0; - this.label4.Text = "Type"; + label4.AutoSize = true; + label4.Location = new System.Drawing.Point(23, 113); + label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(31, 15); + label4.TabIndex = 0; + label4.Text = "Type"; // // tbUrl // - this.tbUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbUrl.Location = new System.Drawing.Point(64, 80); - this.tbUrl.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbUrl.Name = "tbUrl"; - this.tbUrl.Size = new System.Drawing.Size(956, 23); - this.tbUrl.TabIndex = 1; - this.tbUrl.TextChanged += new System.EventHandler(this.tb_TextChanged); + tbUrl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tbUrl.Location = new System.Drawing.Point(64, 80); + tbUrl.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbUrl.Name = "tbUrl"; + tbUrl.Size = new System.Drawing.Size(956, 23); + tbUrl.TabIndex = 1; + tbUrl.TextChanged += tb_TextChanged; // // label3 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(32, 83); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(22, 15); - this.label3.TabIndex = 0; - this.label3.Text = "Url"; + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(32, 83); + label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(22, 15); + label3.TabIndex = 0; + label3.Text = "Url"; // // tbName // - this.tbName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbName.Location = new System.Drawing.Point(64, 52); - this.tbName.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.tbName.Name = "tbName"; - this.tbName.Size = new System.Drawing.Size(956, 23); - this.tbName.TabIndex = 1; - this.tbName.TextChanged += new System.EventHandler(this.tb_TextChanged); + tbName.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tbName.Location = new System.Drawing.Point(64, 52); + tbName.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tbName.Name = "tbName"; + tbName.Size = new System.Drawing.Size(956, 23); + tbName.TabIndex = 1; + tbName.TextChanged += tb_TextChanged; // // label2 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 55); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(39, 15); - this.label2.TabIndex = 0; - this.label2.Text = "Name"; + label2.AutoSize = true; + label2.Location = new System.Drawing.Point(15, 55); + label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(39, 15); + label2.TabIndex = 0; + label2.Text = "Name"; // // checksUI1 // - this.checksUI1.AllowsYesNoToAll = true; - this.checksUI1.Dock = System.Windows.Forms.DockStyle.Fill; - this.checksUI1.Location = new System.Drawing.Point(0, 0); - this.checksUI1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); - this.checksUI1.Name = "checksUI1"; - this.checksUI1.Size = new System.Drawing.Size(1029, 453); - this.checksUI1.TabIndex = 0; + checksUI1.AllowsYesNoToAll = true; + checksUI1.Dock = System.Windows.Forms.DockStyle.Fill; + checksUI1.Location = new System.Drawing.Point(0, 0); + checksUI1.Margin = new System.Windows.Forms.Padding(5, 3, 5, 3); + checksUI1.Name = "checksUI1"; + checksUI1.Size = new System.Drawing.Size(1029, 453); + checksUI1.TabIndex = 0; // // btnCreate // - this.btnCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCreate.Location = new System.Drawing.Point(743, 8); - this.btnCreate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnCreate.Name = "btnCreate"; - this.btnCreate.Size = new System.Drawing.Size(138, 27); - this.btnCreate.TabIndex = 17; - this.btnCreate.Text = "Create"; - this.btnCreate.UseVisualStyleBackColor = true; - this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click); + btnCreate.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnCreate.Location = new System.Drawing.Point(743, 8); + btnCreate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCreate.Name = "btnCreate"; + btnCreate.Size = new System.Drawing.Size(138, 27); + btnCreate.TabIndex = 17; + btnCreate.Text = "Create"; + btnCreate.UseVisualStyleBackColor = true; + btnCreate.Click += btnCreate_Click; // // btnDelete // - this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnDelete.Location = new System.Drawing.Point(888, 8); - this.btnDelete.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.btnDelete.Name = "btnDelete"; - this.btnDelete.Size = new System.Drawing.Size(138, 27); - this.btnDelete.TabIndex = 17; - this.btnDelete.Text = "Delete"; - this.btnDelete.UseVisualStyleBackColor = true; - this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); + btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + btnDelete.Location = new System.Drawing.Point(888, 8); + btnDelete.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnDelete.Name = "btnDelete"; + btnDelete.Size = new System.Drawing.Size(138, 27); + btnDelete.TabIndex = 17; + btnDelete.Text = "Delete"; + btnDelete.UseVisualStyleBackColor = true; + btnDelete.Click += btnDelete_Click; + // + // tbReleases + // + tbReleases.Location = new System.Drawing.Point(64, 198); + tbReleases.Name = "tbReleases"; + tbReleases.Size = new System.Drawing.Size(421, 23); + tbReleases.TabIndex = 20; + tbReleases.TextChanged += tReleases_TextChanged; // // TicketingSystemConfigurationUI // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.btnDelete); - this.Controls.Add(this.btnCreate); - this.Controls.Add(this.splitContainer1); - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.Name = "TicketingSystemConfigurationUI"; - this.Size = new System.Drawing.Size(1034, 751); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.gbTicketingSystem.ResumeLayout(false); - this.gbTicketingSystem.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.ResumeLayout(false); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Controls.Add(btnDelete); + Controls.Add(btnCreate); + Controls.Add(splitContainer1); + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "TicketingSystemConfigurationUI"; + Size = new System.Drawing.Size(1034, 751); + splitContainer1.Panel1.ResumeLayout(false); + splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit(); + splitContainer1.ResumeLayout(false); + gbTicketingSystem.ResumeLayout(false); + gbTicketingSystem.PerformLayout(); + groupBox1.ResumeLayout(false); + ResumeLayout(false); } #endregion @@ -363,5 +379,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnDelete; private System.Windows.Forms.Button btnDeleteCredentials; private System.Windows.Forms.CheckBox cbDisabled; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox tbReleases; } } \ No newline at end of file diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index b890f716e7..8ab710b1e1 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -6,6 +6,8 @@ using System; using System.Linq; +using FluentFTP.Helpers; +using Rdmp.Core.Curation; using Rdmp.Core.Curation.Data; using Rdmp.Core.Repositories; using Rdmp.Core.ReusableLibraryCode.Checks; @@ -76,6 +78,7 @@ private void RefreshUIFromDatabase() ddCredentials.Items.AddRange(_activator.RepositoryLocator.CatalogueRepository .GetAllObjects().ToArray()); + if (_ticketingSystemConfiguration == null) { gbTicketingSystem.Enabled = false; @@ -104,6 +107,8 @@ private void RefreshUIFromDatabase() btnCreate.Enabled = false; btnDelete.Enabled = true; btnSave.Enabled = false; + var x = _ticketingSystemConfiguration.GetReleaseStatuses(); + tbReleases.Text = string.Join(',', _ticketingSystemConfiguration.GetReleaseStatuses().Select(s => s.Name).ToList()); } _bLoading = false; @@ -112,6 +117,16 @@ private void RefreshUIFromDatabase() private void btnSave_Click(object sender, EventArgs e) { _ticketingSystemConfiguration.SaveToDatabase(); + + var releases = tbReleases.Text.Split(','); + var existingReleases = _activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere("TicketingSystemConfigurationID", _ticketingSystemConfiguration.ID); + var toDelete = existingReleases.Where(s => !releases.Contains(s.Name)).ToList(); + foreach (var release in releases.Where(rs => !existingReleases.Select(er => er.Name).Contains(rs))) + { + var rs = new TicketingSystemReleaseStatus(_activator.RepositoryLocator.CatalogueRepository, release, null, _ticketingSystemConfiguration); + rs.SaveToDatabase(); + } + toDelete.ForEach(rs => rs.DeleteInDatabase()); btnSave.Enabled = false; RefreshUIFromDatabase(); } @@ -144,6 +159,20 @@ private void btnCheck_Click(object sender, EventArgs e) var factory = new TicketingSystemFactory(_activator.RepositoryLocator.CatalogueRepository); instance = factory.CreateIfExists(_ticketingSystemConfiguration); + if (instance != null) + { + var knownStatuses = instance.GetAvailableStatuses(); + var requestedStatuses = tbReleases.Text.Split(','); + foreach (var status in requestedStatuses) + { + if (!knownStatuses.Contains(status)) + { + checksUI1.OnCheckPerformed(new CheckEventArgs($"{status} is not a known status within the ticketing system", CheckResult.Fail)); + //throw new Exception("Unknown status"); //do something, but maybe on save? + } + } + } + checksUI1.OnCheckPerformed( new CheckEventArgs($"successfully created a instance of {instance.GetType().FullName}", CheckResult.Success)); @@ -191,6 +220,11 @@ private void btnDeleteCredentials_Click(object sender, EventArgs e) RefreshUIFromDatabase(); } + private void tReleases_TextChanged(object sender, EventArgs e) + { + btnSave.Enabled = true; + } + private void tb_TextChanged(object sender, EventArgs e) { if (_bLoading) @@ -236,4 +270,9 @@ private void cbDisabled_CheckedChanged(object sender, EventArgs e) _ticketingSystemConfiguration.SaveToDatabase(); } } + + private void label5_Click(object sender, EventArgs e) + { + + } } \ No newline at end of file diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.resx b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.resx index 1af7de150c..af32865ec1 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.resx +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.resx @@ -1,17 +1,17 @@  - From c859b72176d454047dab6214695534f12f56199e Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 09:05:23 +0100 Subject: [PATCH 04/19] allow blanks --- .../Ticketing/TicketingSystemConstructorParameters.cs | 2 ++ .../Ticketing/TicketingSystemConfigurationUI.cs | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs b/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs index 425d41aa31..b87996fb55 100644 --- a/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs +++ b/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs @@ -4,7 +4,9 @@ // 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 . +using Rdmp.Core.QueryCaching.Aggregation.Arguments; using Rdmp.Core.ReusableLibraryCode.DataAccess; +using System.Collections.Generic; namespace Rdmp.Core.Ticketing; diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 8ab710b1e1..972cb9779c 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -9,6 +9,7 @@ using FluentFTP.Helpers; using Rdmp.Core.Curation; using Rdmp.Core.Curation.Data; +using Rdmp.Core.DataLoad.Engine.LoadProcess.Scheduling.Strategy; using Rdmp.Core.Repositories; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.Ticketing; @@ -121,7 +122,7 @@ private void btnSave_Click(object sender, EventArgs e) var releases = tbReleases.Text.Split(','); var existingReleases = _activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere("TicketingSystemConfigurationID", _ticketingSystemConfiguration.ID); var toDelete = existingReleases.Where(s => !releases.Contains(s.Name)).ToList(); - foreach (var release in releases.Where(rs => !existingReleases.Select(er => er.Name).Contains(rs))) + foreach (var release in releases.Where(rs => rs != "" && !existingReleases.Select(er => er.Name).Contains(rs))) { var rs = new TicketingSystemReleaseStatus(_activator.RepositoryLocator.CatalogueRepository, release, null, _ticketingSystemConfiguration); rs.SaveToDatabase(); @@ -162,13 +163,14 @@ private void btnCheck_Click(object sender, EventArgs e) if (instance != null) { var knownStatuses = instance.GetAvailableStatuses(); - var requestedStatuses = tbReleases.Text.Split(','); + var requestedStatuses = tbReleases.Text.Split(',').Where(s => s != ""); + if (!requestedStatuses.Any()) checksUI1.OnCheckPerformed(new CheckEventArgs($"No Release status set", CheckResult.Fail)); + foreach (var status in requestedStatuses) { if (!knownStatuses.Contains(status)) { checksUI1.OnCheckPerformed(new CheckEventArgs($"{status} is not a known status within the ticketing system", CheckResult.Fail)); - //throw new Exception("Unknown status"); //do something, but maybe on save? } } } From e18188e26330fa3d73cd595d6b95b9c779f7a1b7 Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 09:53:21 +0100 Subject: [PATCH 05/19] pass statuses around --- .../DataExport/DataRelease/ReleaseEnvironmentPotential.cs | 4 ++-- Rdmp.Core/Ticketing/ITicketingSystem.cs | 4 +++- Rdmp.Core/Ticketing/PluginTicketingSystem.cs | 3 ++- Rdmp.Core/Ticketing/SimpleTicketingSystem.cs | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs b/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs index 3d9e9c7d4e..91959018e9 100644 --- a/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs +++ b/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs @@ -7,6 +7,7 @@ using System; using System.Linq; using System.Threading; +using Rdmp.Core.Curation; using Rdmp.Core.Curation.Data; using Rdmp.Core.DataExport.Data; using Rdmp.Core.Repositories; @@ -44,7 +45,6 @@ private void MakeAssessment() var configuration = _repository.CatalogueRepository .GetAllObjectsWhere("IsActive", 1).SingleOrDefault(); if (configuration == null) return; - var factory = new TicketingSystemFactory(_repository.CatalogueRepository); @@ -66,7 +66,7 @@ private void MakeAssessment() try { Assesment = ticketingSystem.GetDataReleaseabilityOfTicket(Project.MasterTicket, - Configuration.RequestTicket, Configuration.ReleaseTicket, out var reason, out var e); + Configuration.RequestTicket, Configuration.ReleaseTicket, _repository.CatalogueRepository.GetAllObjectsWhere("TicketingSystemConfigurationID", configuration.ID).ToList(), out var reason, out var e); Exception = e; Reason = reason; } diff --git a/Rdmp.Core/Ticketing/ITicketingSystem.cs b/Rdmp.Core/Ticketing/ITicketingSystem.cs index 98c52dbc87..3a1d87735a 100644 --- a/Rdmp.Core/Ticketing/ITicketingSystem.cs +++ b/Rdmp.Core/Ticketing/ITicketingSystem.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Rdmp.Core.Curation; using Rdmp.Core.ReusableLibraryCode.Checks; namespace Rdmp.Core.Ticketing; @@ -42,11 +43,12 @@ public interface ITicketingSystem : ICheckable /// /// /// + /// /// /// /// TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTicket, string requestTicket, - string releaseTicket, out string reason, out Exception exception); + string releaseTicket, List acceptedStatuses,out string reason, out Exception exception); string GetProjectFolderName(string masterTicket); diff --git a/Rdmp.Core/Ticketing/PluginTicketingSystem.cs b/Rdmp.Core/Ticketing/PluginTicketingSystem.cs index 3fb8c1bbec..ba1f1d0bc4 100644 --- a/Rdmp.Core/Ticketing/PluginTicketingSystem.cs +++ b/Rdmp.Core/Ticketing/PluginTicketingSystem.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Rdmp.Core.Curation; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.ReusableLibraryCode.DataAccess; @@ -27,7 +28,7 @@ protected PluginTicketingSystem(TicketingSystemConstructorParameters parameters) public abstract void NavigateToTicket(string ticketName); public abstract TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTicket, - string requestTicket, string releaseTicket, out string reason, out Exception exception); + string requestTicket, string releaseTicket, List acceptedStatuses,out string reason, out Exception exception); public abstract string GetProjectFolderName(string masterTicket); diff --git a/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs b/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs index e72376bea2..5a9816eca1 100644 --- a/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs +++ b/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Rdmp.Core.Curation; using Rdmp.Core.ReusableLibraryCode; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.ReusableLibraryCode.DataAccess; @@ -46,7 +47,7 @@ public void NavigateToTicket(string ticketName) } public TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTicket, string requestTicket, - string releaseTicket, out string reason, out Exception exception) + string releaseTicket, List acceptedStatuses, out string reason, out Exception exception) { reason = null; exception = null; From e09beb5cba459585e6b7b047350a810e33addc8d Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 12:49:33 +0100 Subject: [PATCH 06/19] update tests --- .../Curation/Data/TicketingSystemConfiguration.cs | 1 - .../Curation/TicketingSystemReleaseStatus.cs | 8 +++++--- Tests.Common/UnitTests.cs | 15 +++++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs index 24453da6fb..ca7955c6be 100644 --- a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs +++ b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs @@ -121,7 +121,6 @@ public TicketingSystemConfiguration(ICatalogueRepository repository, string name public List GetReleaseStatuses() { - var x = Repository.GetAllObjects(); return [.. Repository.GetAllObjectsWhere("TicketingSystemConfigurationID", this.ID)]; } diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs index a272fb855d..1789f340be 100644 --- a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -4,7 +4,6 @@ // 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 . -using Org.BouncyCastle.Security.Certificates; using Rdmp.Core.Curation.Data; using Rdmp.Core.MapsDirectlyToDatabaseTable; using Rdmp.Core.Repositories; @@ -13,6 +12,9 @@ using System.Data.Common; namespace Rdmp.Core.Curation { + /// + /// Stored a status name and which ticketing system it coresponds to + /// public class TicketingSystemReleaseStatus : DatabaseEntity, INamed { @@ -30,7 +32,7 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, string stat { repository.InsertAndHydrate(this, new Dictionary { - {"Status", status }, + //{"Status", status}, {"StatusID", statusID is null? statusID: DBNull.Value }, {"TicketingSystemConfigurationID", config.ID } }); @@ -40,7 +42,7 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, DbDataReade { Name = r["Status"] as string; StatusID = r["StatusID"] as int?; - TicketingSystemConfigurationID = 1;// Int32.Parse(r["TicketingSystemConfigurationID"] as string); + TicketingSystemConfigurationID = int.Parse(r["TicketingSystemConfigurationID"].ToString()); } } } diff --git a/Tests.Common/UnitTests.cs b/Tests.Common/UnitTests.cs index 447976c0e7..d0f45c5724 100644 --- a/Tests.Common/UnitTests.cs +++ b/Tests.Common/UnitTests.cs @@ -19,6 +19,7 @@ using NUnit.Framework; using Rdmp.Core.CommandExecution; using Rdmp.Core.CommandLine.Interactive; +using Rdmp.Core.Curation; using Rdmp.Core.Curation.Data; using Rdmp.Core.Curation.Data.Aggregation; using Rdmp.Core.Curation.Data.Cache; @@ -408,7 +409,12 @@ public static T WhenIHaveA(MemoryDataExportRepository repository) where T : D if (typeof(T) == typeof(TicketingSystemConfiguration)) return (T)(object)new TicketingSystemConfiguration(repository, "My Ticketing System"); - + if (typeof(T) == typeof(TicketingSystemReleaseStatus)) + { + var ticketingSystem = WhenIHaveA(repository); + ticketingSystem.SaveToDatabase(); + return (T)(object)new TicketingSystemReleaseStatus(repository, "my_status", null, ticketingSystem); + } if (typeof(T) == typeof(SupportingDocument)) return (T)(object)new SupportingDocument(repository, WhenIHaveA(repository), "HelpFile.docx"); @@ -571,16 +577,17 @@ public static T WhenIHaveA(MemoryDataExportRepository repository) where T : D return (T)(object)new Memento(repository, commit, MementoType.Add, cata, null, "placeholder"); } - if(typeof(T) == typeof(LoadMetadataCatalogueLinkage)) + if (typeof(T) == typeof(LoadMetadataCatalogueLinkage)) { var cata = WhenIHaveA(repository); var lmd = WhenIHaveA(repository); - return (T)(object)new LoadMetadataCatalogueLinkage(repository, lmd,cata); + return (T)(object)new LoadMetadataCatalogueLinkage(repository, lmd, cata); } - if (typeof(T) == typeof(Setting)) { + if (typeof(T) == typeof(Setting)) + { return (T)(object)new Setting(repository.CatalogueRepository, "", ""); } From 9d15dca1cea8aa59adc8c0754bb82b25b6df5550 Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 13:45:41 +0100 Subject: [PATCH 07/19] add image --- Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs | 4 ++++ Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx | 9 ++++++--- Rdmp.Core/Icons/IconProvision/RDMPConcept.cs | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs index 1789f340be..2c4dd06f0f 100644 --- a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -7,6 +7,7 @@ using Rdmp.Core.Curation.Data; using Rdmp.Core.MapsDirectlyToDatabaseTable; using Rdmp.Core.Repositories; +using Rdmp.Core.ReusableLibraryCode.Annotations; using System; using System.Collections.Generic; using System.Data.Common; @@ -22,8 +23,11 @@ public class TicketingSystemReleaseStatus : DatabaseEntity, INamed private int? _statusID; private int _ticketingSystemConfiguratonID; + [NotNull] public string Name { get => _status; set => SetField(ref _status, value); } public int? StatusID { get => _statusID; set => SetField(ref _statusID, value); } + + [NotNull] public int TicketingSystemConfigurationID { get => _ticketingSystemConfiguratonID; set => SetField(ref _ticketingSystemConfiguratonID, value); } public TicketingSystemReleaseStatus() { } diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index 571c731520..fa02ec9934 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -757,7 +757,10 @@ ..\LoadMetadataCatalogueLinkage.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\famfamfam\cog.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + ..\famfamfam\cog.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\..\Resources\TicketingSystemReleaseStatus.bmp;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs b/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs index a814693fa9..31ff8cefcf 100644 --- a/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs +++ b/Rdmp.Core/Icons/IconProvision/RDMPConcept.cs @@ -205,5 +205,6 @@ public enum RDMPConcept TableInfoDatabaseNode, Dataset, LoadMetadataCatalogueLinkage, - Setting + Setting, + TicketingSystemReleaseStatus } \ No newline at end of file From ea2651203fef81b6afa005cf9d099e612a334fa7 Mon Sep 17 00:00:00 2001 From: James Friel Date: Wed, 3 Jul 2024 13:50:20 +0100 Subject: [PATCH 08/19] add resources --- .../Resources/LoadMetadataCatalogueLinkage.bmp | Bin 0 -> 3382 bytes .../Resources/TicketingSystemReleaseStatus.bmp | Bin 0 -> 3382 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp create mode 100644 Rdmp.Core/Resources/TicketingSystemReleaseStatus.bmp diff --git a/Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp b/Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a6d33602e5036cc1dd820b2b7555c391d3872daf GIT binary patch literal 3382 zcmeIwA#&YN425B3CLjgbgJ59M!ZSs2!+O&F|~385<;Od{G`DVNC<_-m~q-T0tune z7z^V!&2fx`P-x69&7BM+ghFF>+2Ld$Aru<3B}pd(38B!KEti}OB!og^wv^>$AR!bQ zvt@240|}wfm~#taoD3v{LSsypkPr%u*>;tafrLZSs2!+O&F|~385<;Od{G`DVNC<_-m~q-T0tune z7z^V!&2fx`P-x69&7BM+ghFF>+2Ld$Aru<3B}pd(38B!KEti}OB!og^wv^>$AR!bQ zvt@240|}wfm~#taoD3v{LSsypkPr%u*>;tafrL Date: Wed, 3 Jul 2024 14:07:51 +0100 Subject: [PATCH 09/19] tidy up --- Rdmp.Core/Curation/SimpleStringValueEncryption.cs | 2 +- Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs | 6 +----- .../up/085_AddTicketingReleaseStatuses.sql | 1 - Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs | 5 +---- .../Ticketing/TicketingSystemConfigurationUI.cs | 1 - 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Rdmp.Core/Curation/SimpleStringValueEncryption.cs b/Rdmp.Core/Curation/SimpleStringValueEncryption.cs index d9911f29b8..cf7cdf7748 100644 --- a/Rdmp.Core/Curation/SimpleStringValueEncryption.cs +++ b/Rdmp.Core/Curation/SimpleStringValueEncryption.cs @@ -19,7 +19,7 @@ namespace Rdmp.Core.Curation; /// public class SimpleStringValueEncryption : IEncryptStrings { - private readonly RSACryptoServiceProvider _turing = new RSACryptoServiceProvider(1024); + private readonly RSACryptoServiceProvider _turing = new(); private const string Key = @" diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs index 2c4dd06f0f..b6692cb5cc 100644 --- a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -20,12 +20,10 @@ public class TicketingSystemReleaseStatus : DatabaseEntity, INamed { private string _status; - private int? _statusID; private int _ticketingSystemConfiguratonID; [NotNull] public string Name { get => _status; set => SetField(ref _status, value); } - public int? StatusID { get => _statusID; set => SetField(ref _statusID, value); } [NotNull] public int TicketingSystemConfigurationID { get => _ticketingSystemConfiguratonID; set => SetField(ref _ticketingSystemConfiguratonID, value); } @@ -36,8 +34,7 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, string stat { repository.InsertAndHydrate(this, new Dictionary { - //{"Status", status}, - {"StatusID", statusID is null? statusID: DBNull.Value }, + {"Status", status}, {"TicketingSystemConfigurationID", config.ID } }); } @@ -45,7 +42,6 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, string stat public TicketingSystemReleaseStatus(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { Name = r["Status"] as string; - StatusID = r["StatusID"] as int?; TicketingSystemConfigurationID = int.Parse(r["TicketingSystemConfigurationID"].ToString()); } } diff --git a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql index 8073aed984..e7d9721a18 100644 --- a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql +++ b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql @@ -7,7 +7,6 @@ BEGIN CREATE TABLE [dbo].[TicketingSystemReleaseStatus]( [ID] [int] IDENTITY(1,1) NOT NULL, [Status] [nvarchar](250) NOT NULL, - [StatusID] [int] NULL, [TicketingSystemConfigurationID] [int] NOT NULL, FOREIGN KEY (TicketingSystemConfigurationID) REFERENCES TicketingSystemConfiguration(ID), diff --git a/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs b/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs index b87996fb55..a55c0608e6 100644 --- a/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs +++ b/Rdmp.Core/Ticketing/TicketingSystemConstructorParameters.cs @@ -1,13 +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 . -using Rdmp.Core.QueryCaching.Aggregation.Arguments; using Rdmp.Core.ReusableLibraryCode.DataAccess; -using System.Collections.Generic; - namespace Rdmp.Core.Ticketing; /// diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 972cb9779c..53b6c746e7 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -108,7 +108,6 @@ private void RefreshUIFromDatabase() btnCreate.Enabled = false; btnDelete.Enabled = true; btnSave.Enabled = false; - var x = _ticketingSystemConfiguration.GetReleaseStatuses(); tbReleases.Text = string.Join(',', _ticketingSystemConfiguration.GetReleaseStatuses().Select(s => s.Name).ToList()); } From 8327181b4d7a8f3b67bd01d5c1a10c178c26d7da Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 09:36:12 +0100 Subject: [PATCH 10/19] tidy up --- .../Data/TicketingSystemConfiguration.cs | 6 ++++-- .../DataRelease/ReleaseEnvironmentPotential.cs | 4 ++-- .../up/085_AddTicketingReleaseStatuses.sql | 4 +++- .../Resources/LoadMetadataCatalogueLinkage.bmp | Bin 3382 -> 0 bytes .../Resources/TicketingSystemReleaseStatus.bmp | Bin 3382 -> 0 bytes 5 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp delete mode 100644 Rdmp.Core/Resources/TicketingSystemReleaseStatus.bmp diff --git a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs index ca7955c6be..812de065a1 100644 --- a/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs +++ b/Rdmp.Core/Curation/Data/TicketingSystemConfiguration.cs @@ -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. @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; using System.Data.Common; -using System.Linq; using Rdmp.Core.MapsDirectlyToDatabaseTable; using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes; using Rdmp.Core.Repositories; @@ -119,6 +118,9 @@ public TicketingSystemConfiguration(ICatalogueRepository repository, string name }); } + /// + /// Fetches a list of acceptable release statuses set for the ticketing system + /// public List GetReleaseStatuses() { return [.. Repository.GetAllObjectsWhere("TicketingSystemConfigurationID", this.ID)]; diff --git a/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs b/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs index 91959018e9..161f2bbe52 100644 --- a/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs +++ b/Rdmp.Core/DataExport/DataRelease/ReleaseEnvironmentPotential.cs @@ -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. @@ -66,7 +66,7 @@ private void MakeAssessment() try { Assesment = ticketingSystem.GetDataReleaseabilityOfTicket(Project.MasterTicket, - Configuration.RequestTicket, Configuration.ReleaseTicket, _repository.CatalogueRepository.GetAllObjectsWhere("TicketingSystemConfigurationID", configuration.ID).ToList(), out var reason, out var e); + Configuration.RequestTicket, Configuration.ReleaseTicket, configuration.GetReleaseStatuses(), out var reason, out var e); Exception = e; Reason = reason; } diff --git a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql index e7d9721a18..3abd354e36 100644 --- a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql +++ b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql @@ -16,4 +16,6 @@ CONSTRAINT [PK_TicketingSystemReleaseStatus] PRIMARY KEY CLUSTERED )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END -GO \ No newline at end of file +GO + +-- add cascade delete when we delete a ticketing system \ No newline at end of file diff --git a/Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp b/Rdmp.Core/Resources/LoadMetadataCatalogueLinkage.bmp deleted file mode 100644 index a6d33602e5036cc1dd820b2b7555c391d3872daf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3382 zcmeIwA#&YN425B3CLjgbgJ59M!ZSs2!+O&F|~385<;Od{G`DVNC<_-m~q-T0tune z7z^V!&2fx`P-x69&7BM+ghFF>+2Ld$Aru<3B}pd(38B!KEti}OB!og^wv^>$AR!bQ zvt@240|}wfm~#taoD3v{LSsypkPr%u*>;tafrLZSs2!+O&F|~385<;Od{G`DVNC<_-m~q-T0tune z7z^V!&2fx`P-x69&7BM+ghFF>+2Ld$Aru<3B}pd(38B!KEti}OB!og^wv^>$AR!bQ zvt@240|}wfm~#taoD3v{LSsypkPr%u*>;tafrL Date: Thu, 4 Jul 2024 09:40:27 +0100 Subject: [PATCH 11/19] fix build --- Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index fa02ec9934..9011579e31 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -760,7 +760,4 @@ ..\famfamfam\cog.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\..\Resources\TicketingSystemReleaseStatus.bmp;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file + From d1240382da23229e493ac692bc02b5f805ba64b9 Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 09:47:16 +0100 Subject: [PATCH 12/19] add icon --- .../CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql | 4 +--- Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql index 3abd354e36..f44590b5af 100644 --- a/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql +++ b/Rdmp.Core/Databases/CatalogueDatabase/up/085_AddTicketingReleaseStatuses.sql @@ -8,7 +8,7 @@ CREATE TABLE [dbo].[TicketingSystemReleaseStatus]( [ID] [int] IDENTITY(1,1) NOT NULL, [Status] [nvarchar](250) NOT NULL, [TicketingSystemConfigurationID] [int] NOT NULL, - FOREIGN KEY (TicketingSystemConfigurationID) REFERENCES TicketingSystemConfiguration(ID), + FOREIGN KEY (TicketingSystemConfigurationID) REFERENCES TicketingSystemConfiguration(ID) ON DELETE CASCADE, CONSTRAINT [PK_TicketingSystemReleaseStatus] PRIMARY KEY CLUSTERED ( @@ -17,5 +17,3 @@ CONSTRAINT [PK_TicketingSystemReleaseStatus] PRIMARY KEY CLUSTERED ) ON [PRIMARY] END GO - --- add cascade delete when we delete a ticketing system \ No newline at end of file diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index 9011579e31..48f88ca8c7 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -760,4 +760,7 @@ ..\famfamfam\cog.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + ..\TicketingSystemConfiguration1.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file From 23cb04d3d7598fa1ca78acf45a2eef68e7b37241 Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 09:48:13 +0100 Subject: [PATCH 13/19] add image --- Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx | 4 ++-- Rdmp.Core/Icons/TicketingSystemReleaseStatus.png | Bin 0 -> 538 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Rdmp.Core/Icons/TicketingSystemReleaseStatus.png diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index 48f88ca8c7..f33525f753 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -761,6 +761,6 @@ ..\famfamfam\cog.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\TicketingSystemConfiguration1.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\TicketingSystemReleaseStatus.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - \ No newline at end of file + diff --git a/Rdmp.Core/Icons/TicketingSystemReleaseStatus.png b/Rdmp.Core/Icons/TicketingSystemReleaseStatus.png new file mode 100644 index 0000000000000000000000000000000000000000..d0fb946cb59f9ae0f6ad55f4b9e90e531b2e8498 GIT binary patch literal 538 zcmV+#0_FXQP)<{97<5HgbW?9;ba!ELWdLwtX>N2bZe?^J zG%hhNHvLWs=l}o#m`OxIR5(v#`2YVuS$Ot|X}UmsbkV7~sVh$}WdVs{RY(ZWJ2}&& z^FY&$lAW3V>vxtvn|@$Y!lEPdSuhj=0f@kgLGtrX%yetoU3D{hQSg5dPFxo8ziMsC z1fXG@xD4~V@%C!uvBw7+kj3YonCVrsqvR6IprqxI|J-{VmN>LpN`TeC6eDYDo7mDZ z=fc!WO-ITe}{I>rstU c9{$e&0GZ*3&?>xCi~s-t07*qoM6N<$f~gbdKL7v# literal 0 HcmV?d00001 From f1e544e86161fd13013d0695dfd1d7dce37e13cc Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 10:56:43 +0100 Subject: [PATCH 14/19] fix test --- Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs | 6 +++--- .../Ticketing/TicketingSystemConfigurationUI.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs index b6692cb5cc..0dcf4eb6d5 100644 --- a/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs +++ b/Rdmp.Core/Curation/TicketingSystemReleaseStatus.cs @@ -16,14 +16,14 @@ namespace Rdmp.Core.Curation /// /// Stored a status name and which ticketing system it coresponds to /// - public class TicketingSystemReleaseStatus : DatabaseEntity, INamed + public class TicketingSystemReleaseStatus : DatabaseEntity { private string _status; private int _ticketingSystemConfiguratonID; [NotNull] - public string Name { get => _status; set => SetField(ref _status, value); } + public string Status { get => _status; set => SetField(ref _status, value); } [NotNull] public int TicketingSystemConfigurationID { get => _ticketingSystemConfiguratonID; set => SetField(ref _ticketingSystemConfiguratonID, value); } @@ -41,7 +41,7 @@ public TicketingSystemReleaseStatus(ICatalogueRepository repository, string stat public TicketingSystemReleaseStatus(ICatalogueRepository repository, DbDataReader r) : base(repository, r) { - Name = r["Status"] as string; + Status = r["Status"] as string; TicketingSystemConfigurationID = int.Parse(r["TicketingSystemConfigurationID"].ToString()); } } diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 53b6c746e7..1616abc6b8 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -108,7 +108,7 @@ private void RefreshUIFromDatabase() btnCreate.Enabled = false; btnDelete.Enabled = true; btnSave.Enabled = false; - tbReleases.Text = string.Join(',', _ticketingSystemConfiguration.GetReleaseStatuses().Select(s => s.Name).ToList()); + tbReleases.Text = string.Join(',', _ticketingSystemConfiguration.GetReleaseStatuses().Select(s => s.Status).ToList()); } _bLoading = false; @@ -120,8 +120,8 @@ private void btnSave_Click(object sender, EventArgs e) var releases = tbReleases.Text.Split(','); var existingReleases = _activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere("TicketingSystemConfigurationID", _ticketingSystemConfiguration.ID); - var toDelete = existingReleases.Where(s => !releases.Contains(s.Name)).ToList(); - foreach (var release in releases.Where(rs => rs != "" && !existingReleases.Select(er => er.Name).Contains(rs))) + var toDelete = existingReleases.Where(s => !releases.Contains(s.Status)).ToList(); + foreach (var release in releases.Where(rs => rs != "" && !existingReleases.Select(er => er.Status).Contains(rs))) { var rs = new TicketingSystemReleaseStatus(_activator.RepositoryLocator.CatalogueRepository, release, null, _ticketingSystemConfiguration); rs.SaveToDatabase(); From c6aba420c1feff74adecca79348c0368d7ba97cb Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 11:26:44 +0100 Subject: [PATCH 15/19] add changelog --- CHANGELOG.md | 4 ++++ .../Ticketing/TicketingSystemConfigurationUI.cs | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf80a91c2e..f94a1ce919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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.2.1] - Unreleased + +- Add Release status optiosn to the ticketing system + ## [8.2.0] - Unreleased ## Changed diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 1616abc6b8..35ca2d38ab 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -123,7 +123,7 @@ private void btnSave_Click(object sender, EventArgs e) var toDelete = existingReleases.Where(s => !releases.Contains(s.Status)).ToList(); foreach (var release in releases.Where(rs => rs != "" && !existingReleases.Select(er => er.Status).Contains(rs))) { - var rs = new TicketingSystemReleaseStatus(_activator.RepositoryLocator.CatalogueRepository, release, null, _ticketingSystemConfiguration); + var rs = new TicketingSystemReleaseStatus(_activator.RepositoryLocator.CatalogueRepository, release.Trim(), null, _ticketingSystemConfiguration); rs.SaveToDatabase(); } toDelete.ForEach(rs => rs.DeleteInDatabase()); @@ -133,7 +133,6 @@ private void btnSave_Click(object sender, EventArgs e) private void btnCreate_Click(object sender, EventArgs e) { - new TicketingSystemConfiguration(_activator.RepositoryLocator.CatalogueRepository, "New Ticketing System"); RefreshUIFromDatabase(); } @@ -167,7 +166,7 @@ private void btnCheck_Click(object sender, EventArgs e) foreach (var status in requestedStatuses) { - if (!knownStatuses.Contains(status)) + if (!knownStatuses.Contains(status.Trim())) { checksUI1.OnCheckPerformed(new CheckEventArgs($"{status} is not a known status within the ticketing system", CheckResult.Fail)); } From 1e99827a4f5ccfb941c4fe1bdb4f46a87a4d7302 Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 13:16:03 +0100 Subject: [PATCH 16/19] fix error not poping --- Rdmp.Core/Curation/Data/EncryptedString.cs | 1 - Rdmp.UI/Rules/BinderWithErrorProviderFactory.cs | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Rdmp.Core/Curation/Data/EncryptedString.cs b/Rdmp.Core/Curation/Data/EncryptedString.cs index c98393b99e..ca4d294712 100644 --- a/Rdmp.Core/Curation/Data/EncryptedString.cs +++ b/Rdmp.Core/Curation/Data/EncryptedString.cs @@ -41,7 +41,6 @@ public string Value catch (Exception e) { if (e.Message.Contains("Bad Length") || e.Message.Contains("data too large for key size")) - //todo this should alert the user throw new InvalidOperationException( $"The free text Value supplied to this class was too long to be encrypted (Length of string was {value.Length})", e); diff --git a/Rdmp.UI/Rules/BinderWithErrorProviderFactory.cs b/Rdmp.UI/Rules/BinderWithErrorProviderFactory.cs index d615d898ab..85ef578afc 100644 --- a/Rdmp.UI/Rules/BinderWithErrorProviderFactory.cs +++ b/Rdmp.UI/Rules/BinderWithErrorProviderFactory.cs @@ -31,8 +31,8 @@ public void Bind(Control c, string propertyName, T databaseObject, string dat DataSourceUpdateMode updateMode, Func getter) where T : IMapsDirectlyToDatabaseTable { c.DataBindings.Clear(); - c.DataBindings.Add(propertyName, databaseObject, dataMember, formattingEnabled, updateMode); - + var dataBinding = c.DataBindings.Add(propertyName, databaseObject, dataMember, formattingEnabled, updateMode); + dataBinding.BindingComplete += new BindingCompleteEventHandler(BindingHandler); var property = databaseObject.GetType().GetProperty(dataMember); if (property.GetCustomAttributes(typeof(UniqueAttribute), true).Any()) @@ -47,4 +47,10 @@ public void Bind(Control c, string propertyName, T databaseObject, string dat if (dataMember.Equals("Name") && databaseObject is INamed) new NoBadNamesRule(_activator, databaseObject, getter, c, dataMember); } + + private void BindingHandler(object sender, BindingCompleteEventArgs e) + { + if (e.BindingCompleteState != BindingCompleteState.Success) + MessageBox.Show("Error: " + e.ErrorText); + } } \ No newline at end of file From e078cc80cf005181a7f178ef23ca7a8ac99c29a6 Mon Sep 17 00:00:00 2001 From: James Friel Date: Thu, 4 Jul 2024 15:32:43 +0100 Subject: [PATCH 17/19] add missing line --- .../Ticketing/TicketingSystemConfigurationUI.Designer.cs | 2 +- .../LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs index 3932c9ba05..5f774320d4 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.Designer.cs @@ -314,7 +314,7 @@ private void InitializeComponent() btnCreate.TabIndex = 17; btnCreate.Text = "Create"; btnCreate.UseVisualStyleBackColor = true; - btnCreate.Click += btnCreate_Click; + this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click); // // btnDelete // diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 35ca2d38ab..49b125b2cd 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -133,6 +133,7 @@ private void btnSave_Click(object sender, EventArgs e) private void btnCreate_Click(object sender, EventArgs e) { + new TicketingSystemConfiguration(_activator.RepositoryLocator.CatalogueRepository, "New Ticketing System"); RefreshUIFromDatabase(); } From 8c89fad80a215bedfd9491652beb48226199e2fe Mon Sep 17 00:00:00 2001 From: James Friel Date: Tue, 9 Jul 2024 11:24:57 +0100 Subject: [PATCH 18/19] fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4969577b9d..b16eae5832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [8.2.1] - Unreleased -- Add Release status optiosn to the ticketing system +- Add Release status options to the ticketing system ## [8.2.0] - 2024-07-09 From d095ae6b90e00b52605830f4c8ac9d1ae543791d Mon Sep 17 00:00:00 2001 From: James Friel Date: Tue, 9 Jul 2024 13:00:09 +0100 Subject: [PATCH 19/19] tidy up --- .../Ticketing/TicketingSystemConfigurationUI.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs index 49b125b2cd..81bbcdf678 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingSystemConfigurationUI.cs @@ -11,6 +11,7 @@ using Rdmp.Core.Curation.Data; using Rdmp.Core.DataLoad.Engine.LoadProcess.Scheduling.Strategy; using Rdmp.Core.Repositories; +using Rdmp.Core.ReusableLibraryCode; using Rdmp.Core.ReusableLibraryCode.Checks; using Rdmp.Core.Ticketing; using Rdmp.UI.ItemActivation; @@ -162,15 +163,12 @@ private void btnCheck_Click(object sender, EventArgs e) if (instance != null) { var knownStatuses = instance.GetAvailableStatuses(); - var requestedStatuses = tbReleases.Text.Split(',').Where(s => s != ""); + var requestedStatuses = tbReleases.Text.Split(',').Where(s => s.Trim() != ""); if (!requestedStatuses.Any()) checksUI1.OnCheckPerformed(new CheckEventArgs($"No Release status set", CheckResult.Fail)); - foreach (var status in requestedStatuses) + foreach (var status in requestedStatuses.Where(s => !knownStatuses.Contains(s.Trim()))) { - if (!knownStatuses.Contains(status.Trim())) - { - checksUI1.OnCheckPerformed(new CheckEventArgs($"{status} is not a known status within the ticketing system", CheckResult.Fail)); - } + checksUI1.OnCheckPerformed(new CheckEventArgs($"{status} is not a known status within the ticketing system", CheckResult.Fail)); } }