промежуточный. загрузка адресатов для багов без наличия их в бд.
This commit is contained in:
@@ -8,7 +8,6 @@ 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.Subscribes.Subscriber;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
@@ -155,13 +154,16 @@ public class BugReport extends rDBObject {
|
||||
return project_version.isEmpty();
|
||||
}
|
||||
//--->
|
||||
|
||||
public void CheckSubscribers() {
|
||||
for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values())
|
||||
subscriber.Select(packedRecipientsJson.contains(subscriber.address));
|
||||
// for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values())
|
||||
// subscriber.Select(packedRecipientsJson.contains(subscriber.address));
|
||||
}
|
||||
/*
|
||||
public void saveRecipientsAsJson(Vector<Subscriber> subscribers) {
|
||||
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(subscribers));
|
||||
}
|
||||
*/
|
||||
public Vector<String> getRecipients() {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (packedRecipientsJson.isEmpty()) return res;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
@@ -10,9 +9,11 @@ public class RecipientsJson {
|
||||
public RecipientsJson() {
|
||||
}
|
||||
//при создании пакета.
|
||||
/*
|
||||
public RecipientsJson(Vector<? extends Subscriber> subscribers) {
|
||||
array = new Vector<>();
|
||||
for (Subscriber subscriber : subscribers)
|
||||
array.add(new RecipientJson(subscriber.address));
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -2,24 +2,21 @@ package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
|
||||
import _VisualDVM.ComponentsServer.Recipient.RecipientsDataSet;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.SubsribersDBTable;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Vector;
|
||||
public class BugReportsDatabase extends SQLiteDatabase {
|
||||
public BugReportsDBTable bugReports;
|
||||
public SubsribersDBTable subscribers;
|
||||
public SubscriberWorkspaceDBTable workspaces; //рабочие пространства для машин.
|
||||
public RecipientsDataSet recipients = new RecipientsDataSet();
|
||||
public BugReportsDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
||||
}
|
||||
@Override
|
||||
protected void initAllTables() throws Exception {
|
||||
addTable(bugReports = new BugReportsDBTable());
|
||||
addTable(subscribers = new SubsribersDBTable());
|
||||
addTable(workspaces = new SubscriberWorkspaceDBTable());
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
@@ -38,12 +35,12 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
public void DropUI() {
|
||||
super.DropUI();
|
||||
bugReports.ClearUI();
|
||||
subscribers.ClearUI();
|
||||
workspaces.ClearUI();
|
||||
recipients.ClearUI();
|
||||
}
|
||||
@Override
|
||||
public void ResetUI() {
|
||||
bugReports.ShowUI();
|
||||
recipients.ShowUI(); //todo временно.
|
||||
super.ResetUI();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
void ReceiveBugReportsDatabase() throws Exception {
|
||||
response.object = Utils_.fileToBytes(db.getFile());
|
||||
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
|
||||
}
|
||||
void ReceiveBugReport() throws Exception {
|
||||
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
|
||||
@@ -263,7 +264,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
String email = data[0];
|
||||
String machineURL = data[1];
|
||||
String login = data[2];
|
||||
response.object = db.workspaces.findWorkspace(email, machineURL, login);
|
||||
response.object = credentials_db.workspaces.findWorkspace(email, machineURL, login);
|
||||
}
|
||||
void GetComponentChangesLog() throws Exception {
|
||||
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
|
||||
@@ -382,9 +383,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
case ReceiveComponent:
|
||||
ReceiveComponent();
|
||||
break;
|
||||
case CheckURLRegistered:
|
||||
CheckURLRegistered();
|
||||
break;
|
||||
case GetComponentsVersionsInfo:
|
||||
GetComponentsVersionsInfo();
|
||||
break;
|
||||
@@ -428,6 +426,9 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
case DeleteUserAccount:
|
||||
DeleteUserAccount();
|
||||
break;
|
||||
case CheckURLRegistered:
|
||||
CheckURLRegistered();
|
||||
break;
|
||||
default:
|
||||
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Passes.PassCode_;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
public class CredentialsDatabase extends SQLiteDatabase {
|
||||
public UserAccountsDBTable userAccounts;
|
||||
public SubscriberWorkspaceDBTable workspaces;
|
||||
public CredentialsDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "credentials.sqlite").toFile());
|
||||
}
|
||||
@Override
|
||||
protected void initAllTables() throws Exception {
|
||||
addTable(userAccounts = new UserAccountsDBTable());
|
||||
addTable(workspaces = new SubscriberWorkspaceDBTable());
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getSynchronizePassCode() {
|
||||
@@ -22,10 +31,12 @@ public class CredentialsDatabase extends SQLiteDatabase {
|
||||
public void DropUI() {
|
||||
super.DropUI();
|
||||
userAccounts.ClearUI();
|
||||
workspaces.ClearUI();
|
||||
}
|
||||
@Override
|
||||
public void ResetUI() {
|
||||
userAccounts.ShowUI();
|
||||
super.ResetUI();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package _VisualDVM.ComponentsServer.Recipient.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class RecipientJson {
|
||||
@Expose
|
||||
public String email;
|
||||
@Expose
|
||||
public String name;
|
||||
public RecipientJson(String email_in, String name_in){
|
||||
email = email_in;
|
||||
name = name_in;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package _VisualDVM.ComponentsServer.Recipient.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class RecipientsJson {
|
||||
@Expose
|
||||
public List<RecipientJson> values = new Vector<>();
|
||||
}
|
||||
24
src/_VisualDVM/ComponentsServer/Recipient/Recipient.java
Normal file
24
src/_VisualDVM/ComponentsServer/Recipient/Recipient.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package _VisualDVM.ComponentsServer.Recipient;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
|
||||
public class Recipient extends DBObject {
|
||||
public String email = "";
|
||||
public String name = "";
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return email;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Recipient src_ = (Recipient) src;
|
||||
email = src_.email;
|
||||
name = src_.name;
|
||||
}
|
||||
public Recipient() {
|
||||
}
|
||||
public Recipient(RecipientJson json) {
|
||||
email = json.email;
|
||||
name = json.name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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.UI.RecipientsForm;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
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));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new RecipientsForm(this,mountPanel);
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "адресаты";
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "адресат";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package _VisualDVM.ComponentsServer.Recipient.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
|
||||
import javax.swing.*;
|
||||
public class RecipientsForm extends DataSetControlForm<Recipient> {
|
||||
public RecipientsForm(DataSet<?, Recipient> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected void createColumns() {
|
||||
AddColumns(
|
||||
new ColumnInfo<Recipient>("Имя") {
|
||||
@Override
|
||||
public Object getFieldAt(Recipient object) {
|
||||
return object.name;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
@@ -46,17 +46,13 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSubscriberWorkspace;
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteSubscriberWorkspace);
|
||||
return new DataMenuBar(dataSource.getPluralDescription());
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(SubscriberWorkspace object) {
|
||||
Subscriber subscriber = Global.componentsServer.db.subscribers.getUI().getCurrent();
|
||||
return super.isObjectVisible(object) && (subscriber != null) && subscriber.address.equals(object.email) &&
|
||||
(Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(subscriber.address));
|
||||
UserAccount account = Global.componentsServer.credentials_db.userAccounts.getUI().getCurrent();
|
||||
return super.isObjectVisible(object) && (account != null) && account.email.equals(object.email) &&
|
||||
(Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(account.email));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Subscribes;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class Subscriber extends DBObject {
|
||||
//todo скорее всего вывести.ибо дублер UserAccount
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public String address = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String name = "";
|
||||
@Description("DEFAULT 'User'")
|
||||
public AccountRole role = AccountRole.User; //права доступа
|
||||
@Description("DEFAULT 1")
|
||||
public int mailOn = 1;
|
||||
//---
|
||||
public Subscriber() {
|
||||
}
|
||||
public Subscriber(String address_in) {
|
||||
address = address_in;
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return address;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Subscriber s = (Subscriber) src;
|
||||
name = s.name;
|
||||
role = s.role;
|
||||
mailOn = s.mailOn;
|
||||
}
|
||||
//как объект будут называть по внешним ключам.
|
||||
public String getFKName() {
|
||||
return "email";
|
||||
}
|
||||
public Object getEmptyFK() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Subscribes;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.UI.SubsribersForm;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SubsribersDBTable extends DBTable<String, Subscriber> {
|
||||
public SubsribersDBTable() {
|
||||
super(String.class, Subscriber.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "адресат";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "адресаты";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new SubsribersForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
//-
|
||||
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
public Vector<String> getActiveSubscribers(){
|
||||
Vector<String> res = new Vector<>();
|
||||
for (Subscriber subscriber : Data.values()) {
|
||||
if ((subscriber.mailOn != 0) && !res.contains(subscriber.address))
|
||||
res.add(subscriber.address);
|
||||
}
|
||||
for (String admin_mail : Constants.admins_mails) {
|
||||
if (!res.contains(admin_mail))
|
||||
res.add(admin_mail);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public Vector<String> checkRecipients(Vector<String> recipients){
|
||||
Vector<String> res = new Vector<>();
|
||||
for (String address: recipients){
|
||||
if (this.containsKey(address) && get(address).mailOn!=0){
|
||||
res.add(address);
|
||||
}
|
||||
}
|
||||
//--
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Subscribes.UI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberFields> {
|
||||
public SubscriberDialog() {
|
||||
super(SubscriberFields.class);
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 250;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 450;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
if (fields.tfName.getText().isEmpty())
|
||||
Log.Writeln("Имя учётной записи не может быть пустым");
|
||||
Utils_.validateEmail(fields.tfAddress.getText(), Log);
|
||||
if (fields.tfAddress.getText().isEmpty())
|
||||
Log.Writeln_("Адрес электронной почты не может быть пустым");
|
||||
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.db.subscribers.Data.containsKey(fields.tfAddress.getText()))) {
|
||||
Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке.");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.name);
|
||||
fields.tfAddress.setText(Result.address);
|
||||
fields.cbMail.setSelected(Result.mailOn != 0);
|
||||
UI.TrySelect(fields.cbRole, Result.role);
|
||||
}
|
||||
@Override
|
||||
public void SetEditLimits() {
|
||||
fields.tfAddress.setEditable(false);
|
||||
}
|
||||
private AccountRole getSelectedRole() {
|
||||
return (AccountRole) fields.cbRole.getSelectedItem();
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.name = fields.tfName.getText();
|
||||
Result.address = fields.tfAddress.getText();
|
||||
Result.mailOn = fields.cbMail.isSelected() ? 1 : 0;
|
||||
Result.role = getSelectedRole();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.Subscribes.UI.SubscriberFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="81c98" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="имя"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="8f1c6">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="4c488" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="адрес"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="675ad" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a96c1" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="1c24b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="роль"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="81d94" class="javax.swing.JComboBox" binding="cbRole" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="fe07e" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="рассылка"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e0879" class="javax.swing.JCheckBox" binding="cbMail">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<horizontalAlignment value="0"/>
|
||||
<icon value="Common/icons/NotPick.png"/>
|
||||
<selectedIcon value="Common/icons/Pick.png"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Будет ли включена рассылка для этого пользователя"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -1,27 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Subscribes.UI;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class SubscriberFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
public JTextField tfAddress;
|
||||
public JComboBox<AccountRole> cbRole;
|
||||
public JCheckBox cbMail;
|
||||
private JPanel content;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
tfAddress = new StyledTextField();
|
||||
cbRole = new JComboBox<>();
|
||||
cbRole.addItem(AccountRole.User);
|
||||
cbRole.addItem(AccountRole.Developer);
|
||||
cbRole.addItem(AccountRole.Admin);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Subscribes.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SubsribersForm extends DataSetControlForm<Subscriber> {
|
||||
public SubsribersForm(DataSet<?, Subscriber> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected ColumnInfo<Subscriber> createPKColumn() {
|
||||
return new ColumnInfo<Subscriber>(dataSource.getPKName()) {
|
||||
@Override
|
||||
public Object getFieldAt(Subscriber object) {
|
||||
return object.getPK();
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void createColumns() {
|
||||
AddColumns(
|
||||
new ColumnInfo<Subscriber>("Имя") {
|
||||
@Override
|
||||
public Object getFieldAt(Subscriber object) {
|
||||
return object.name;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<Subscriber>("Роль") {
|
||||
@Override
|
||||
public Object getFieldAt(Subscriber object) {
|
||||
return object.role.getDescription();
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
|
||||
}
|
||||
},
|
||||
new ColumnInfo<Subscriber>("Рассылка") {
|
||||
@Override
|
||||
public Object getFieldAt(Subscriber object) {
|
||||
return (object.mailOn == 0) ? "выключена" : "включена";
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return PassCode.DeleteSubscriber;
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription(),
|
||||
PassCode.SaveBugReportExecutor,
|
||||
PassCode.SaveBugReportRecipients,
|
||||
PassCode.AddSubscriber,
|
||||
PassCode.EditSubscriber,
|
||||
PassCode.DeleteSubscriber);
|
||||
}
|
||||
@Override
|
||||
protected DBObjectDialog<Subscriber, ? extends DialogFields> getDialog() {
|
||||
return new SubscriberDialog();
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFi
|
||||
Utils_.validateEmail(fields.tfAddress.getText(), Log);
|
||||
if (fields.tfAddress.getText().isEmpty())
|
||||
Log.Writeln_("Адрес электронной почты не может быть пустым");
|
||||
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.db.subscribers.Data.containsKey(fields.tfAddress.getText()))) {
|
||||
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.credentials_db.userAccounts.Data.containsKey(fields.tfAddress.getText()))) {
|
||||
Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
package _VisualDVM.ComponentsServer.UserAccount;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
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.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class UserAccountsDBTable extends iDBTable<UserAccount> {
|
||||
public UserAccountsDBTable() {
|
||||
super(UserAccount.class);
|
||||
@@ -34,4 +44,23 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
|
||||
public String getPluralDescription() {
|
||||
return "учётные записи";
|
||||
}
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
//-
|
||||
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
public String getPackedActiveRecipients(){
|
||||
RecipientsJson res = new RecipientsJson();
|
||||
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));
|
||||
}
|
||||
}
|
||||
return Utils_.gson.toJson(res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,6 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||
UserAccount account = null;
|
||||
//--
|
||||
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
|
||||
PassCode.AddSubscriber,
|
||||
PassCode.EditSubscriber,
|
||||
PassCode.DeleteSubscriber,
|
||||
PassCode.DeleteSubscriberWorkspace,
|
||||
//--
|
||||
PassCode.DownloadAllBugReportsArchives,
|
||||
//--
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.PublishServerObject;
|
||||
public class AddSubscriber extends PublishServerObject<ComponentsServer, Subscriber> {
|
||||
public AddSubscriber() {
|
||||
super(Global.componentsServer, Subscriber.class);
|
||||
}
|
||||
}
|
||||
@@ -76,9 +76,11 @@ 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())
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSubscriber extends DeleteServerObject<ComponentsServer, Subscriber> {
|
||||
public DeleteSubscriber() {
|
||||
super(Global.componentsServer, Subscriber.class);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSubscriberWorkspace extends DeleteServerObject<ComponentsServer, SubscriberWorkspace> {
|
||||
public DeleteSubscriberWorkspace() {
|
||||
super(Global.componentsServer, SubscriberWorkspace.class);
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.UI.SubscriberDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
|
||||
import javax.swing.*;
|
||||
public class EditAccount extends Email {
|
||||
public String name;
|
||||
public String email;
|
||||
String password;
|
||||
SubscriberDialog f = new SubscriberDialog() {
|
||||
{
|
||||
fields.cbRole.setEnabled(false);
|
||||
}
|
||||
};
|
||||
public static int getRandomIntegerBetweenRange(int min, int max) {
|
||||
return (int) ((Math.random() * ((max - min) + 1)) + min);
|
||||
}
|
||||
@Override
|
||||
protected boolean isSafe() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Subscriber res = new Subscriber(); // объект для заполнения полей.не более.
|
||||
if (f.ShowDialog("Регистрация", res)) {
|
||||
if (!Utils_.validateEmail(res.address, Log)) {
|
||||
return false;
|
||||
}
|
||||
name = res.name;
|
||||
email = res.address;
|
||||
password = String.valueOf(getRandomIntegerBetweenRange(1111, 9999));
|
||||
return super.canStart(
|
||||
new EmailMessage("Код подтверждения визуализатора для: " + Utils_.Brackets(name), password),
|
||||
email
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
String attempt = null;
|
||||
do {
|
||||
attempt = JOptionPane.showInputDialog(null,
|
||||
new String[]{"Введите код активации, полученный по почте"},
|
||||
"Подтверждение адреса почты",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
if (attempt != null) {
|
||||
if (attempt.equals(password)) {
|
||||
UI.Info("Почта успешно подтверждена!");
|
||||
return true;
|
||||
} else {
|
||||
UI.Error("Неверный код активации.\nПовторите попытку.");
|
||||
}
|
||||
} else {
|
||||
UI.Info("Подтверждение почты отменено");
|
||||
return false;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Global.mainModule.getAccount().name = name;
|
||||
Global.mainModule.getAccount().email = email;
|
||||
Global.mainModule.getDb().Update(Global.mainModule.getAccount());
|
||||
//это не регистрация. только заполнение почты в своей бд и ее подтверждение на реальность.
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.EditServerObject;
|
||||
public class EditSubscriber extends EditServerObject<ComponentsServer, Subscriber> {
|
||||
public EditSubscriber() {
|
||||
super(Global.componentsServer, Subscriber.class);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
// target.targets = BugReport.getPackedTargets();
|
||||
target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems());
|
||||
// target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems());
|
||||
target.change_date = new Date().getTime();
|
||||
Global.componentsServer.db.Update(target);
|
||||
target.state = BugReportState.active;
|
||||
@@ -67,10 +67,12 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
message.addAttachement(screen);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
|
||||
);
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PublishComponent extends ComponentsServerPass<Component> {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
unsafeEmail.Do(message, Global.componentsServer.db.subscribers.getActiveSubscribers());
|
||||
// unsafeEmail.Do(message, Global.componentsServer.db.subscribers.getActiveSubscribers());
|
||||
//---
|
||||
if (target.getComponentType().equals(ComponentType.Sapfor_F) && f.fields.cbAssemblyOnServer.isSelected()) {
|
||||
Global.mainModule.getUI().getMainWindow().FocusTesting();
|
||||
|
||||
@@ -11,9 +11,12 @@ public class SaveBugReportExecutor extends UpdateBugReportField {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return false;
|
||||
/*
|
||||
return Global.componentsServer.db.subscribers.getUI().CheckCurrent(Log) &&
|
||||
super.canStart("executor", Global.componentsServer.db.subscribers.getUI().getCurrent().name,
|
||||
"executor_address", Global.componentsServer.db.subscribers.getUI().getCurrent().address
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class SaveBugReportRecipients extends UpdateBugReportField {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart("packedRecipientsJson", Utils_.gson.toJson(new RecipientsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems())));
|
||||
//return super.canStart("packedRecipientsJson", Utils_.gson.toJson(new RecipientsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems())));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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;
|
||||
@@ -22,6 +26,7 @@ public class SynchronizeBugReports extends ComponentsServerPass<Object> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
request.server_response.Unpack(new_db_file = Utils.getTempFileName("bdb"));
|
||||
Global.componentsServer.db.recipients.Unpack(request.server_response.arg);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
@@ -40,6 +41,7 @@ public class TestPass extends Pass {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
System.out.println(Global.componentsServer.credentials_db.userAccounts.getPackedActiveRecipients());
|
||||
// String cpuId = getMotherboardSN();
|
||||
// UI.Info(cpuId);
|
||||
/*
|
||||
|
||||
@@ -124,10 +124,12 @@ 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())
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,6 @@ public enum PassCode implements PassCode_ {
|
||||
DeleteProfile,
|
||||
//-
|
||||
CheckAccount,
|
||||
EditAccount,
|
||||
AddSubscriber,
|
||||
EditSubscriber,
|
||||
DeleteSubscriber,
|
||||
//----
|
||||
SetSelectedFilesLanguage,
|
||||
SetSelectedFilesStyle,
|
||||
@@ -288,7 +284,6 @@ public enum PassCode implements PassCode_ {
|
||||
CreateTestFromFile,
|
||||
CreateTestsFromFiles,
|
||||
CreateGroupFromFiles,
|
||||
DeleteSubscriberWorkspace,
|
||||
ExportDVMPackageToExcel,
|
||||
//->
|
||||
ActualizeDVMPackages,
|
||||
|
||||
@@ -4,8 +4,6 @@ public interface CallbackWindow extends VisualizerForm {
|
||||
void ShowAccount();
|
||||
void ShowBugReports();
|
||||
void ShowNoBugReports();
|
||||
void ShowSubscribers();
|
||||
void ShowNoSubscribers();
|
||||
void ShowCurrentBugReport();
|
||||
void ShowNoCurrentBugReport();
|
||||
void ShowSubscription();
|
||||
@@ -14,7 +12,6 @@ public interface CallbackWindow extends VisualizerForm {
|
||||
ShowAccount();
|
||||
ShowSubscription();
|
||||
ShowBugReports();
|
||||
ShowSubscribers();
|
||||
}
|
||||
String getBugReportDescriptionText();
|
||||
String getBugReportDescriptionAdditionText();
|
||||
|
||||
@@ -16,6 +16,7 @@ public class AdministrationForm implements FormWithSplitters, AdministrationWind
|
||||
public AdministrationForm(){
|
||||
LoadSplitters();
|
||||
Global.componentsServer.credentials_db.userAccounts.mountUI(userAccountsPanel);
|
||||
Global.componentsServer.credentials_db.workspaces.mountUI(workspacesPanel);
|
||||
}
|
||||
@Override
|
||||
public void ShowAll() {
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="bd1dc" binding="subscribersPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<grid id="bd1dc" binding="recipientsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
|
||||
@@ -101,7 +101,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
private JPanel accountPanel;
|
||||
private JPanel bugReportsPanel;
|
||||
private JPanel filterFormPanel;
|
||||
private JPanel subscribersPanel;
|
||||
private JPanel recipientsPanel;
|
||||
private JTabbedPane currentBugReportTabs;
|
||||
private JScrollPane bugSettingsScroll;
|
||||
private JCheckBox BugReportsMyOnlyFilter;
|
||||
@@ -153,8 +153,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
SwitchScreen(Global.normalProperties.SmallScreen);
|
||||
//-
|
||||
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
|
||||
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);
|
||||
// Global.componentsServer.db.workspaces.mountUI(workspacesPanel);
|
||||
Global.componentsServer.db.recipients.mountUI(recipientsPanel);
|
||||
//-
|
||||
if (!Global.mainModule.getPass(PassCode.CheckAccount).isDone()) {
|
||||
accountTools.add(Global.mainModule.getPass(PassCode.CheckAccount).createButton());
|
||||
@@ -457,19 +456,12 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
@Override
|
||||
public void ShowBugReports() {
|
||||
Global.componentsServer.db.bugReports.ShowUI();
|
||||
Global.componentsServer.db.recipients.ShowUI();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoBugReports() {
|
||||
Global.componentsServer.db.bugReports.ClearUI();
|
||||
}
|
||||
@Override
|
||||
public void ShowSubscribers() {
|
||||
Global.componentsServer.db.subscribers.ShowUI();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoSubscribers() {
|
||||
Global.componentsServer.db.subscribers.ClearUI();
|
||||
}
|
||||
private void ShowDraft() {
|
||||
Global.mainModule.setPassesControlsVisible(true,
|
||||
PassCode.PublishBugReport,
|
||||
@@ -545,8 +537,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.CheckSubscribers();
|
||||
// Global.componentsServer.db.subscribers.ShowUI();
|
||||
//-
|
||||
BugReportDescription.setText(target.description);
|
||||
BugReportDescription.ShowBegin();
|
||||
@@ -582,7 +574,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
@Override
|
||||
public void ShowNoCurrentBugReport() {
|
||||
SwitchListeners(false);
|
||||
Global.componentsServer.db.subscribers.ShowUI();
|
||||
// Global.componentsServer.db.subscribers.ShowUI();
|
||||
//-
|
||||
BugReportDescription.setText("");
|
||||
BugReportComment.setText("");
|
||||
|
||||
Reference in New Issue
Block a user