no message

This commit is contained in:
2025-02-20 00:39:59 +03:00
parent 4e3597ba7a
commit f1440dd1e2
13 changed files with 56 additions and 105 deletions

35
.idea/workspace.xml generated
View File

@@ -7,45 +7,18 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientsJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Recipient.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/RecipientsDataSet.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/UI/RecipientsForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientsJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientsJson.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/CredentialsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/CredentialsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/SubsribersDBTable.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.form" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/UserAccountJson.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientsJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/UserAccountsJson.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Recipient.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Recipient.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/RecipientsDataSet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/RecipientsDataSet.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccountsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccountsDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddSubscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AppendBugReportField.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AppendBugReportField.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteSubscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteSubscriberWorkspace.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditAccount.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditSubscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportExecutor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportExecutor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeBugReports.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateBugReportField.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateBugReportField.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/CallbackWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/CallbackWindow.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.form" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />

View File

@@ -8,6 +8,7 @@ import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
@@ -155,15 +156,14 @@ public class BugReport extends rDBObject {
}
//--->
public void CheckSubscribers() {
// for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values())
// subscriber.Select(packedRecipientsJson.contains(subscriber.address));
public void CheckRecipients() {
for (Recipient recipient : Global.componentsServer.db.recipients.Data.values())
recipient.Select(packedRecipientsJson.contains(recipient.email));
}
/*
public void saveRecipientsAsJson(Vector<Subscriber> subscribers) {
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(subscribers));
public void saveRecipientsAsJson(Vector<Recipient> recipients) {
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(recipients));
}
*/
public Vector<String> getRecipients() {
Vector<String> res = new Vector<>();
if (packedRecipientsJson.isEmpty()) return res;

View File

@@ -1,4 +1,5 @@
package _VisualDVM.ComponentsServer.BugReport.Json;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import com.google.gson.annotations.Expose;
import java.util.List;
@@ -9,11 +10,9 @@ public class RecipientsJson {
public RecipientsJson() {
}
//при создании пакета.
/*
public RecipientsJson(Vector<? extends Subscriber> subscribers) {
public RecipientsJson(Vector<? extends Recipient> recipients) {
array = new Vector<>();
for (Subscriber subscriber : subscribers)
array.add(new RecipientJson(subscriber.address));
for (Recipient recipient : recipients)
array.add(new RecipientJson(recipient.email));
}
*/
}

View File

@@ -1,11 +1,11 @@
package _VisualDVM.ComponentsServer.Recipient.Json;
import com.google.gson.annotations.Expose;
public class RecipientJson {
public class UserAccountJson {
@Expose
public String email;
@Expose
public String name;
public RecipientJson(String email_in, String name_in){
public UserAccountJson(String email_in, String name_in){
email = email_in;
name = name_in;
}

View File

@@ -3,7 +3,7 @@ import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class RecipientsJson {
public class UserAccountsJson {
@Expose
public List<RecipientJson> values = new Vector<>();
public List<UserAccountJson> values = new Vector<>();
}

View File

@@ -1,6 +1,6 @@
package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Objects.DBObject;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
public class Recipient extends DBObject {
public String email = "";
public String name = "";
@@ -17,7 +17,7 @@ public class Recipient extends DBObject {
}
public Recipient() {
}
public Recipient(RecipientJson json) {
public Recipient(UserAccountJson json) {
email = json.email;
name = json.name;
}

View File

@@ -2,22 +2,23 @@ package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Tables.DataSet;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import javax.swing.*;
import java.util.Vector;
public class RecipientsDataSet extends DataSet<String, Recipient> {
public RecipientsDataSet() {
super(String.class, Recipient.class);
}
public void Unpack(String packed){
System.out.println(Utils_.Brackets(packed));
clear();
RecipientsJson jsons = Utils_.gson.fromJson(packed, RecipientsJson.class);
for (RecipientJson json: jsons.values){
Global.componentsServer.db.recipients.put(json.email, new Recipient(json));
UserAccountsJson jsons = Utils_.gson.fromJson(packed, UserAccountsJson.class);
for (UserAccountJson userAccountJson: jsons.values){
Global.componentsServer.db.recipients.put(userAccountJson.email, new Recipient(userAccountJson));
}
}
@Override
@@ -32,4 +33,22 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
public String getSingleDescription() {
return "адресат";
}
public Vector<String> getSelectedMails(){
//баг текущий. значит адресаты уже активные и правильные. дополняем их админами и автором.
Vector<String> res = new Vector<>();
for (Recipient recipient:Data.values()){
if (recipient.isSelected()&& !res.contains(recipient.email))
res.add(recipient.email);
}
//--
if (!res.contains(Global.mainModule.getAccount().email))
res.add(Global.mainModule.getAccount().email);
//--
for (String admin_mail : Constants.admins_mails) {
if (!res.contains(admin_mail))
res.add(admin_mail);
}
//--
return res;
}
}

View File

@@ -6,8 +6,8 @@ import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
@@ -52,12 +52,12 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
return res;
}
public String getPackedActiveRecipients(){
RecipientsJson res = new RecipientsJson();
UserAccountsJson res = new UserAccountsJson();
Vector<String> active = new Vector<>();
for (UserAccount userAccount: Data.values()){
if ((userAccount.subscribe_active!=0) && !active.contains(userAccount.email)){
active.add(userAccount.email);
res.values.add(new RecipientJson(userAccount.email, userAccount.name));
res.values.add(new UserAccountJson(userAccount.email, userAccount.name));
}
}
return Utils_.gson.toJson(res);

View File

@@ -76,11 +76,8 @@ public class AppendBugReportField extends ComponentsServerPass<BugReport> {
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
message_text
);
/*
Global.mainModule.getPass(PassCode.Email).Do(
message,
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
);
*/
Global.componentsServer.db.recipients.getSelectedMails());
}
}

View File

@@ -67,12 +67,9 @@ public class PublishBugReport extends Pass<BugReport> {
message.addAttachement(screen);
}
}
/*
Global.mainModule.getPass(PassCode.Email).Do(
message,
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
);
*/
Global.componentsServer.db.recipients.getSelectedMails());
}
@Override
protected void showDone() throws Exception {

View File

@@ -1,8 +1,4 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.Server.ServerCode;

View File

@@ -124,12 +124,9 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
message_text
);
/*
Global.mainModule.getPass(PassCode.Email).Do(
message,
getServer().db.subscribers.checkRecipients(target.getRecipients())
);
*/
Global.componentsServer.db.recipients.getSelectedMails());
}
}
}

View File

@@ -404,33 +404,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
}
@Override
public void ShowAccount() {
/*
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
System.out.println("ROLE IS "+Global.mainModule.getAccount().role);
switch (Global.mainModule.getAccount().role) {
case Undefined:
setUdefinedRights();
break;
case User:
//видит только свои баги.
EnableBugreports();
setUserRights();
break;
case Developer:
EnableBugreports();
setDeveloperRights();
break;
case Admin:
EnableBugreports();
setAdminRights();
break;
default:
EnableBugreports();
break;
}
*/
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
@@ -537,8 +510,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
SwitchListeners(false);
// currentBugReportTabs.setSelectedIndex(0);
BugReport target = Global.componentsServer.db.bugReports.getUI().getCurrent();
// target.CheckSubscribers();
// Global.componentsServer.db.subscribers.ShowUI();
target.CheckRecipients();
Global.componentsServer.db.recipients.ShowUI();
//-
BugReportDescription.setText(target.description);
BugReportDescription.ShowBegin();
@@ -574,7 +547,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
@Override
public void ShowNoCurrentBugReport() {
SwitchListeners(false);
// Global.componentsServer.db.subscribers.ShowUI();
Global.componentsServer.db.recipients.ShowUI();
//-
BugReportDescription.setText("");
BugReportComment.setText("");