-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
399 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
JiraPlugin.UI/CommandExecution/AtomicCommands/ExecuteCommandLinkProjectToJiraAsset.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using InterfaceToJira.RestApiClient2.JiraModel; | ||
using JiraPlugin.UI.JiraUI; | ||
using Rdmp.Core.CommandExecution; | ||
using Rdmp.Core.CommandExecution.AtomicCommands; | ||
using Rdmp.Core.DataExport.Data; | ||
using Rdmp.UI.ExtractionUIs.JoinsAndLookups; | ||
using Rdmp.UI.ItemActivation; | ||
namespace JiraPlugin.UI.CommandExecution.AtomicCommands; | ||
|
||
public class ExecuteCommandLinkProjectToJiraAsset: BasicCommandExecution, IAtomicCommand | ||
{ | ||
private IActivateItems _activator; | ||
private Project _project; | ||
public ExecuteCommandLinkProjectToJiraAsset(IBasicActivateItems activator, Project project) { | ||
_activator = activator as IActivateItems; | ||
_project = project; | ||
} | ||
|
||
public override void Execute() | ||
{ | ||
base.Execute(); | ||
_activator.Activate<LinkProjectToJiraAssetUI, Project>(_project); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using JiraPlugin.UI.CommandExecution.AtomicCommands; | ||
using Rdmp.Core; | ||
using Rdmp.Core.CommandExecution; | ||
using Rdmp.Core.CommandExecution.AtomicCommands; | ||
using Rdmp.Core.DataExport.Data; | ||
|
||
namespace JiraPlugin.UI.CommandExecution; | ||
|
||
public class JiraPluginMenu : PluginUserInterface | ||
{ | ||
readonly IBasicActivateItems _activator; | ||
|
||
public JiraPluginMenu(IBasicActivateItems itemActivator) : base(itemActivator) | ||
{ | ||
_activator = itemActivator; | ||
} | ||
|
||
public override IEnumerable<IAtomicCommand> GetAdditionalRightClickMenuItems(object o) | ||
{ | ||
if (_activator != null && o is Project) | ||
{ | ||
return new[] { new ExecuteCommandLinkProjectToJiraAsset(_activator,(Project)o) }; | ||
} | ||
|
||
return base.GetAdditionalRightClickMenuItems(o); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<DebugType>embedded</DebugType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<StartupObject /> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\JiraPlugin\JiraPlugin.csproj" /> | ||
<ProjectReference Include="..\RDMP\Rdmp.Core\Rdmp.Core.csproj" /> | ||
<ProjectReference Include="..\RDMP\Rdmp.UI\Rdmp.UI.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
111 changes: 111 additions & 0 deletions
111
JiraPlugin.UI/JiraUI/LinkProjectToJiraAssetUI.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Rdmp.UI.TestsAndSetup.ServicePropogation; | ||
using Rdmp.UI; | ||
using System.ComponentModel; | ||
using Rdmp.Core.DataExport.Data; | ||
using Rdmp.Core.Curation.Data; | ||
using Rdmp.UI.ItemActivation; | ||
using InterfaceToJira.RestApiClient2; | ||
using HIC.Common.InterfaceToJira.JIRA.RestApiClient2; | ||
using HIC.Common.InterfaceToJira; | ||
|
||
namespace JiraPlugin.UI.JiraUI; | ||
|
||
public partial class LinkProjectToJiraAssetUI : LinkProjectToJiraAssetUI_Design | ||
{ | ||
private Project _project; | ||
private TicketingSystemConfiguration _ticketingSystemConfiguration; | ||
private JiraAPIClient _client; | ||
public LinkProjectToJiraAssetUI() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public override void SetDatabaseObject(IActivateItems activator, Project databaseObject) | ||
{ | ||
_project = databaseObject; | ||
var jiraAccounts = activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere<TicketingSystemConfiguration>("Type", "JiraPlugin.JIRATicketingSystem"); | ||
if (!jiraAccounts.Any()) | ||
{ | ||
//error out | ||
lblError.Text = "No Jira Ticketing systems found. Please create one before attempting to link to Jira assets."; | ||
lblError.Visible = true; | ||
return; | ||
} | ||
cbJiraConfiguration.Items.Clear(); | ||
cbJiraConfiguration.Items.AddRange(jiraAccounts); | ||
cbJiraConfiguration.Enabled = true; | ||
|
||
} | ||
|
||
public override string GetTabName() => $"Link Project to Jira Asset"; | ||
|
||
private void cbJiraConfiguration_SelectedIndexChanged(object sender, EventArgs e) | ||
{ | ||
_ticketingSystemConfiguration = (TicketingSystemConfiguration)cbJiraConfiguration.Items[cbJiraConfiguration.SelectedIndex]; | ||
//var jiraAccount = new JiraAccount(new HIC.Common.InterfaceToJira.JiraApiConfiguration() | ||
//{ | ||
// ServerUrl = _ticketingSystemConfiguration.Url, | ||
// User = _ticketingSystemConfiguration.DataAccessCredentials.Username, | ||
// Password = _ticketingSystemConfiguration.DataAccessCredentials.GetDecryptedPassword(), | ||
//}); | ||
//_client = new JiraAPIClient(jiraAccount); | ||
_client ??= new JiraAPIClient(new JiraAccount(new JiraApiConfiguration | ||
{ | ||
ServerUrl = _ticketingSystemConfiguration.Url, | ||
User = _ticketingSystemConfiguration.DataAccessCredentials.Username, | ||
Password = _ticketingSystemConfiguration.DataAccessCredentials.GetDecryptedPassword(), | ||
ApiUrl = _ticketingSystemConfiguration.Url | ||
})); | ||
var projects = _client.GetAllProjectAssets(); | ||
cbAssets.Items.Clear(); | ||
cbAssets.Items.Add(projects); | ||
cbAssets.Enabled = true; | ||
} | ||
} | ||
|
||
|
||
//[TypeDescriptionProvider(typeof(AbstractControlDescriptionProvider<LinkProjectToJiraAssetUI_Design, UserControl>))] | ||
//public abstract class LinkProjectToJiraAssetUI_Design : RDMPSingleDatabaseObjectControl<Project> | ||
//{ | ||
//} |
Oops, something went wrong.