From bc4f2c79b5da79ccf050df05387e8890d5784cf9 Mon Sep 17 00:00:00 2001 From: Danil Kislov Date: Wed, 27 Mar 2019 10:26:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8B=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=20=D0=B7=D0=B0=20=D0=B4=D0=B5=D0=BD=D1=8C=20-=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D0=BD=D1=8F=D0=B5=D0=BC=20=D0=B2=D1=81=D0=B5?= =?UTF-8?q?=D0=B3=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .semver.txt | 2 +- README.md | 1 - src/JiraTimeBot/Configuration/Settings.cs | 1 - src/JiraTimeBot/JiraIntegration/JiraApi.cs | 8 ++- src/JiraTimeBot/Properties/AssemblyInfo.cs | 62 +++++++++++----------- src/JiraTimeBot/UI/frmSettings.Designer.cs | 21 ++------ src/JiraTimeBot/UI/frmSettings.cs | 2 - 7 files changed, 39 insertions(+), 58 deletions(-) diff --git a/.semver.txt b/.semver.txt index 28dff43..2e9116b 100644 --- a/.semver.txt +++ b/.semver.txt @@ -1 +1 @@ -1.0.35 +1.0.36 diff --git a/README.md b/README.md index f422a19..dad9bca 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ - Задача "учёта времени" - задача, куда будет списываться по 30 минут в день на "затраты на учет времени". Должна содержать знак '-'. - Время запуска - время автоматического запуска бота. Если была установлена галочка "тестовый прогон" - она будет снята. - Добавлять описание (Режим Mercurial) - добавлять ли в описание CommitMessage, если не установлено - добавляются стандартные фразы программистов (типа "написание кода"). - - Заменять время за день - если галочка установлена, то время внесенное пользователем за день будет удалено и заменено на добавленное ботом. # Скачать Скачать актуальную версию можно тут: https://github.com/monster1025/JiraTimeBot/releases/latest diff --git a/src/JiraTimeBot/Configuration/Settings.cs b/src/JiraTimeBot/Configuration/Settings.cs index 708eb6d..b0791e5 100644 --- a/src/JiraTimeBot/Configuration/Settings.cs +++ b/src/JiraTimeBot/Configuration/Settings.cs @@ -23,7 +23,6 @@ namespace JiraTimeBot.Configuration public WorkType WorkType { get; set; } public string JiraQuery { get; set; } public string TimeControlTask { get; set; } - public bool RemoveWorklogsAddedByUser { get; set; } public static Settings LoadAndCheck(Action settingsSource, Action errorMessageReporter) { diff --git a/src/JiraTimeBot/JiraIntegration/JiraApi.cs b/src/JiraTimeBot/JiraIntegration/JiraApi.cs index b7e4b2e..40217c7 100644 --- a/src/JiraTimeBot/JiraIntegration/JiraApi.cs +++ b/src/JiraTimeBot/JiraIntegration/JiraApi.cs @@ -76,13 +76,14 @@ namespace JiraTimeBot.JiraIntegration { if (!taskTimeItems.Any(f => f.Branch.Equals(issue.Key.Value, StringComparison.InvariantCulture))) { - _log.Trace($"Удаляю добавленный руками WorkLog для задачи {issue.Key.Value}."); var workLogs = issue.GetWorklogsAsync(cancellationToken).Result; var userWorklogs = workLogs.Where(w => w.CreateDate.GetValueOrDefault().Date == date && w.Author.Equals(settings.JiraUserName, StringComparison.InvariantCultureIgnoreCase)).ToList(); foreach (var userWorklog in userWorklogs) { + _log.Trace($"Удаляю добавленный руками WorkLog для задачи {issue.Key.Value}: {userWorklog.TimeSpent}, {userWorklog.Comment}."); + if (!dummy) { issue.DeleteWorklogAsync(userWorklog, token: cancellationToken); @@ -103,10 +104,7 @@ namespace JiraTimeBot.JiraIntegration date = date.Value.Date; //Удаляем добавленные вручную пользователем данные. - if (settings.AddCommentsToWorklog) - { - RemoveWorklogsAddedByUser(taskTimeItems, settings, date, dummy, cancellationToken); - } + RemoveWorklogsAddedByUser(taskTimeItems, settings, date, dummy, cancellationToken); foreach (TaskTimeItem taskTimeItem in taskTimeItems) { diff --git a/src/JiraTimeBot/Properties/AssemblyInfo.cs b/src/JiraTimeBot/Properties/AssemblyInfo.cs index fe8b321..4083cb6 100644 --- a/src/JiraTimeBot/Properties/AssemblyInfo.cs +++ b/src/JiraTimeBot/Properties/AssemblyInfo.cs @@ -1,31 +1,31 @@ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JiraTimeBot")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("JiraTimeBot")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.35")] -[assembly: AssemblyFileVersion("1.0.35")] -[assembly: AssemblyInformationalVersion("1.0.35")] +using System.Reflection; +using System.Runtime.InteropServices; +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JiraTimeBot")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JiraTimeBot")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.36")] +[assembly: AssemblyFileVersion("1.0.36")] +[assembly: AssemblyInformationalVersion("1.0.36")] diff --git a/src/JiraTimeBot/UI/frmSettings.Designer.cs b/src/JiraTimeBot/UI/frmSettings.Designer.cs index ce6f6ca..0abbfa0 100644 --- a/src/JiraTimeBot/UI/frmSettings.Designer.cs +++ b/src/JiraTimeBot/UI/frmSettings.Designer.cs @@ -49,7 +49,6 @@ this.label8 = new System.Windows.Forms.Label(); this.txtTimeControlTask = new System.Windows.Forms.TextBox(); this.chkAutostart = new System.Windows.Forms.CheckBox(); - this.chkRemoveAddedByUser = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // label5 @@ -154,7 +153,7 @@ // chkAddComments // this.chkAddComments.AutoSize = true; - this.chkAddComments.Location = new System.Drawing.Point(56, 277); + this.chkAddComments.Location = new System.Drawing.Point(65, 277); this.chkAddComments.Name = "chkAddComments"; this.chkAddComments.Size = new System.Drawing.Size(133, 17); this.chkAddComments.TabIndex = 31; @@ -163,7 +162,7 @@ // // btnSave // - this.btnSave.Location = new System.Drawing.Point(92, 322); + this.btnSave.Location = new System.Drawing.Point(86, 300); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(75, 23); this.btnSave.TabIndex = 32; @@ -228,29 +227,18 @@ // chkAutostart // this.chkAutostart.AutoSize = true; - this.chkAutostart.Location = new System.Drawing.Point(56, 254); + this.chkAutostart.Location = new System.Drawing.Point(65, 254); this.chkAutostart.Name = "chkAutostart"; this.chkAutostart.Size = new System.Drawing.Size(96, 17); this.chkAutostart.TabIndex = 40; this.chkAutostart.Text = "Автозагрузка"; this.chkAutostart.UseVisualStyleBackColor = true; // - // chkRemoveAddedByUser - // - this.chkRemoveAddedByUser.AutoSize = true; - this.chkRemoveAddedByUser.Location = new System.Drawing.Point(56, 299); - this.chkRemoveAddedByUser.Name = "chkRemoveAddedByUser"; - this.chkRemoveAddedByUser.Size = new System.Drawing.Size(153, 17); - this.chkRemoveAddedByUser.TabIndex = 41; - this.chkRemoveAddedByUser.Text = "Заменять время за день"; - this.chkRemoveAddedByUser.UseVisualStyleBackColor = true; - // // frmSettings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(243, 357); - this.Controls.Add(this.chkRemoveAddedByUser); + this.ClientSize = new System.Drawing.Size(243, 334); this.Controls.Add(this.chkAutostart); this.Controls.Add(this.label8); this.Controls.Add(this.txtTimeControlTask); @@ -306,6 +294,5 @@ private System.Windows.Forms.Label label8; private System.Windows.Forms.TextBox txtTimeControlTask; private System.Windows.Forms.CheckBox chkAutostart; - private System.Windows.Forms.CheckBox chkRemoveAddedByUser; } } \ No newline at end of file diff --git a/src/JiraTimeBot/UI/frmSettings.cs b/src/JiraTimeBot/UI/frmSettings.cs index cba1c0f..aa50f22 100644 --- a/src/JiraTimeBot/UI/frmSettings.cs +++ b/src/JiraTimeBot/UI/frmSettings.cs @@ -37,7 +37,6 @@ namespace JiraTimeBot.UI txtRoundTo.Text = settings.RountToMinutes.ToString(); cboWorkType.SelectedIndex = (int) settings.WorkType; txtTimeControlTask.Text = settings.TimeControlTask; - chkRemoveAddedByUser.Checked = settings.RemoveWorklogsAddedByUser; txtJQL.Text = settings.JiraQuery; txtJQL.Enabled = settings.WorkType == WorkType.JiraLogs; } @@ -61,7 +60,6 @@ namespace JiraTimeBot.UI WorkType = (WorkType) cboWorkType.SelectedIndex, JiraQuery = txtJQL.Text, TimeControlTask = txtTimeControlTask.Text, - RemoveWorklogsAddedByUser = chkRemoveAddedByUser.Checked }; //LockUnlock(false);