no message
This commit is contained in:
@@ -8,7 +8,6 @@ import _VisualDVM.GlobalData.Account.AccountRole;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.BugReportState;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.Component.ComponentType;
|
||||
|
||||
import java.io.File;
|
||||
@@ -79,12 +78,13 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
Files.copy(file.toPath(), Paths.get(attachementsDir.getAbsolutePath(), file.getName()), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
//запаковка рута
|
||||
Global.mainModule.getPass(PassCode.ZipFolderPass).Do(Global.mainModule.getRoot().Home.getAbsolutePath(), BugReportInterface.getArchiveFile(target).getAbsolutePath());
|
||||
Global.mainModule.getPass(PassCode.ZipFolderPass).Do(Global.mainModule.getRoot().Home.getAbsolutePath(),
|
||||
target.getArchiveFile().getAbsolutePath());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
double size = Utils_.getFileSizeMegaBytes(BugReportInterface.getArchiveFile(target));
|
||||
double size = Utils_.getFileSizeMegaBytes(target.getArchiveFile());
|
||||
if (size > 100) {
|
||||
Log.Writeln_("Размер запакованного вложения " + size + " Мб превышает 100 Мб");
|
||||
return false;
|
||||
|
||||
@@ -5,7 +5,6 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -32,7 +31,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Global.mainModule.Check(Log, Current.BugReport)) {
|
||||
target = Global.mainModule.getBugReport();
|
||||
if (!BugReportInterface.CheckNotDraft(target, Log))
|
||||
if (!target.CheckNotDraft(Log))
|
||||
return false;
|
||||
fieldName = (String) args[0];
|
||||
addition = (String) args[1];
|
||||
@@ -67,7 +66,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
String message_header = BugReportInterface.getMailTitlePrefix(target);
|
||||
String message_header = target.getMailTitlePrefix();
|
||||
String message_text = "";
|
||||
switch (fieldName) {
|
||||
default:
|
||||
@@ -86,7 +85,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
new EmailMessage(
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text,
|
||||
BugReportInterface.getRecipients(target)
|
||||
target.getRecipients()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
target = (BugReport) args[0];
|
||||
return !BugReportInterface.getArchiveFile(target).exists();
|
||||
return !target.getArchiveFile().exists();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
@@ -19,10 +18,10 @@ public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveBugReport, target.id));
|
||||
Utils_.bytesToFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
|
||||
Utils_.bytesToFile((byte[]) response.object, target.getArchiveFile());
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return BugReportInterface.getArchiveFile(target).exists();
|
||||
return target.getArchiveFile().exists();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
@@ -23,7 +22,7 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Global.mainModule.Check(Log, Current.BugReport) &&
|
||||
(BugReportInterface.CheckNotDraft(target = Global.mainModule.getBugReport(), Log))) {
|
||||
(target = Global.mainModule.getBugReport()).CheckNotDraft(Log)) {
|
||||
if (!target.project_version.isEmpty()) {
|
||||
root = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(),
|
||||
target.id).toFile();
|
||||
@@ -47,9 +46,9 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
|
||||
protected void body() throws Exception {
|
||||
//попытка скачки. проверка существования архива уже там.
|
||||
Global.mainModule.getPass(PassCode.DownloadBugReport).Do(target);
|
||||
if (BugReportInterface.getArchiveFile(target).exists()) {
|
||||
if (target.getArchiveFile().exists()) {
|
||||
Global.mainModule.getPass(PassCode.UnzipFolderPass).Do(
|
||||
BugReportInterface.getArchiveFile(target).getAbsolutePath(),
|
||||
target.getArchiveFile().getAbsolutePath(),
|
||||
root.getAbsolutePath()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.BugReportState;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
|
||||
import java.io.File;
|
||||
@@ -34,7 +33,7 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
if (!UI.Question("Для отчёта об ошибке не назначен исполнитель.\nВсе равно опубликовать его"))
|
||||
return false;
|
||||
}
|
||||
if (!Global.mainModule.getAccount().CheckAccessRights(target.sender_address, Log) && (BugReportInterface.CheckDraft(target, Log))) {
|
||||
if (!Global.mainModule.getAccount().CheckAccessRights(target.sender_address, Log) && (target.CheckDraft(Log))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -43,7 +42,7 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.targets = BugReportInterface.getPackedTargets();
|
||||
target.targets = BugReport.getPackedTargets();
|
||||
target.change_date = new Date().getTime();
|
||||
Global.componentsServer.db.Update(target);
|
||||
target.state = BugReportState.active;
|
||||
@@ -55,10 +54,10 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
Global.componentsServer.db.Update(target);
|
||||
//3- рассылка
|
||||
EmailMessage message = new EmailMessage("Обнаружена ошибка " + Utils_.Brackets(target.id),
|
||||
BugReportInterface.getNewMailText(target),
|
||||
BugReportInterface.getRecipients(target));
|
||||
target.getNewMailText(),
|
||||
target.getRecipients());
|
||||
if (!target.project_version.isEmpty()) {
|
||||
message.addAttachement(BugReportInterface.getArchiveFile(target));
|
||||
message.addAttachement(target.getArchiveFile());
|
||||
//со скринами будет небольшой трабл. потому что теретически возможна ситуация,
|
||||
//что проект черновика бага уже закрыт.
|
||||
if (Global.mainModule.HasProject()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
public class SaveBugReportRecipients extends UpdateBugReportField {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
@@ -11,6 +11,6 @@ public class SaveBugReportRecipients extends UpdateBugReportField {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart("targets", BugReportInterface.getPackedTargets());
|
||||
return super.canStart("targets", BugReport.getPackedTargets());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.BugReport.BugReportState;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
public class SendBugReport extends ComponentsRepositoryPass {
|
||||
@@ -13,7 +12,7 @@ public class SendBugReport extends ComponentsRepositoryPass {
|
||||
//отправить архив.
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
|
||||
Global.mainModule.getBugReport().id,
|
||||
Utils_.fileToBytes(BugReportInterface.getArchiveFile(Global.mainModule.getBugReport()))
|
||||
Utils_.fileToBytes(Global.mainModule.getBugReport().getArchiveFile())
|
||||
));
|
||||
}
|
||||
// синхрон бд
|
||||
|
||||
@@ -6,7 +6,6 @@ import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.BugReportState;
|
||||
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -89,7 +88,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
String message_header = BugReportInterface.getMailTitlePrefix(target);
|
||||
String message_header = target.getMailTitlePrefix();
|
||||
|
||||
/*
|
||||
String message_text = "DUMMY TEXT: ";
|
||||
@@ -126,7 +125,7 @@ public class UpdateBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
new EmailMessage(message_header,
|
||||
message_text,
|
||||
BugReportInterface.getRecipients(target))
|
||||
target.getRecipients())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user