рефактиринг интерфейса при отображении полномочий роли пользователя. ввод настройки отменяющей приглашение регистрации при запуске приложения.
This commit is contained in:
8
.idea/workspace.xml
generated
8
.idea/workspace.xml
generated
@@ -7,7 +7,15 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
|
<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$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Global.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.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/MainUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/MainUI.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/SynchronizationSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Menus/MainMenuBar/SynchronizationSettingsMenu.java" 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" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"Email": "nataliku2@yandex.ru",
|
"Email": "vmk-post@yandex.ru",
|
||||||
"Name": "Test",
|
"Name": "M",
|
||||||
"ServerUserPassword": "mprit_2011",
|
"ServerUserPassword": "mprit_2011",
|
||||||
|
"OfferRegistrationOnStart": false,
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "E:\\Tests",
|
"ProjectsSearchDirectory": "E:\\Tests",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
|
|||||||
@@ -13,14 +13,13 @@ import _VisualDVM.ProjectData.ProjectView;
|
|||||||
import _VisualDVM.TestingSystem.Common.TestingServer;
|
import _VisualDVM.TestingSystem.Common.TestingServer;
|
||||||
import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner;
|
import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner;
|
||||||
import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor;
|
import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
||||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
public class Global {
|
public class Global {
|
||||||
//todo свести большинство к содержимому mainModule, сделать различные типы properties, переместить туда глобальный журнал (?)
|
//todo свести большинство к содержимому mainModule
|
||||||
public static MainModule mainModule = null;
|
public static MainModule mainModule = null;
|
||||||
//Режим
|
//Режим
|
||||||
public static Mode mode = Mode.Undefined;
|
public static Mode mode = Mode.Undefined;
|
||||||
@@ -79,8 +78,7 @@ public class Global {
|
|||||||
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
|
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
|
||||||
try {
|
try {
|
||||||
Utils_.forceDeleteWithCheck(new File(DataDirectory, "credentials.sqlite"));
|
Utils_.forceDeleteWithCheck(new File(DataDirectory, "credentials.sqlite"));
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,6 +202,7 @@ public class Global {
|
|||||||
//light_editor.xml-------->>
|
//light_editor.xml-------->>
|
||||||
mainModule.ActivateDB();
|
mainModule.ActivateDB();
|
||||||
// https://habr.com/ru/articles/446888/ сертификат?
|
// https://habr.com/ru/articles/446888/ сертификат?
|
||||||
|
if (Global.normalProperties.OfferRegistrationOnStart)
|
||||||
mainModule.getPass(PassCode.CheckAccount).Do();
|
mainModule.getPass(PassCode.CheckAccount).Do();
|
||||||
//---------------
|
//---------------
|
||||||
componentsServer.ActivateDB();
|
componentsServer.ActivateDB();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
public String Name = "";
|
public String Name = "";
|
||||||
@Expose
|
@Expose
|
||||||
public String ServerUserPassword="";
|
public String ServerUserPassword="";
|
||||||
|
@Expose
|
||||||
|
public boolean OfferRegistrationOnStart=true;
|
||||||
//--->
|
//--->
|
||||||
@Expose
|
@Expose
|
||||||
public String Workspace = "";
|
public String Workspace = "";
|
||||||
@@ -112,6 +114,8 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
@Override
|
@Override
|
||||||
public String getFieldDescription(String fieldName) {
|
public String getFieldDescription(String fieldName) {
|
||||||
switch (fieldName) {
|
switch (fieldName) {
|
||||||
|
case "OfferRegistrationOnStart":
|
||||||
|
return "Предложение регистрации при запуске";
|
||||||
case "Email":
|
case "Email":
|
||||||
return "Адрес электронной почты";
|
return "Адрес электронной почты";
|
||||||
case "Kernels":
|
case "Kernels":
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class CheckAccount extends ComponentsServerPass {
|
|||||||
@Override
|
@Override
|
||||||
protected void showDone() throws Exception {
|
protected void showDone() throws Exception {
|
||||||
if (Global.mainModule.getUI().hasMainWindow()) {
|
if (Global.mainModule.getUI().hasMainWindow()) {
|
||||||
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowAccount();
|
Global.mainModule.getUI().ShowAccount();
|
||||||
if (Global.componentsServer.db.bugReports.getUI().getCurrent() != null)
|
if (Global.componentsServer.db.bugReports.getUI().getCurrent() != null)
|
||||||
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
||||||
import _VisualDVM.Repository.Server.ServerCode;
|
import _VisualDVM.Repository.Server.ServerCode;
|
||||||
@@ -13,7 +14,7 @@ public class SynchronizeBugReports extends ComponentsServerPass<Object> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
return Global.mainModule.getAccount().CheckRegistered(Log) && SendRequest(ServerCode.ReceiveBugReportsDatabase);
|
return !Global.mainModule.getAccount().role.equals(AccountRole.Undefined) && SendRequest(ServerCode.ReceiveBugReportsDatabase);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void showPreparation() throws Exception {
|
protected void showPreparation() throws Exception {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package _VisualDVM.Visual.Interface;
|
package _VisualDVM.Visual.Interface;
|
||||||
import Common.Visual.VisualizerForm;
|
import Common.Visual.VisualizerForm;
|
||||||
public interface CallbackWindow extends VisualizerForm {
|
public interface CallbackWindow extends VisualizerForm {
|
||||||
void ShowAccount();
|
void ShowAccountInfo(); //отображение в шапке окна обратной связи имени и прав. возможно убрать если нет регистрации вовсе.
|
||||||
void ShowBugReports();
|
void ShowBugReports();
|
||||||
void ShowNoBugReports();
|
void ShowNoBugReports();
|
||||||
void ShowCurrentBugReport();
|
void ShowCurrentBugReport();
|
||||||
@@ -9,7 +9,7 @@ public interface CallbackWindow extends VisualizerForm {
|
|||||||
void ShowSubscription();
|
void ShowSubscription();
|
||||||
//-
|
//-
|
||||||
default void ShowAll() {
|
default void ShowAll() {
|
||||||
ShowAccount();
|
ShowAccountInfo();
|
||||||
ShowSubscription();
|
ShowSubscription();
|
||||||
ShowBugReports();
|
ShowBugReports();
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,8 @@ public interface CallbackWindow extends VisualizerForm {
|
|||||||
void ClearBugReportCommentAdditionText();
|
void ClearBugReportCommentAdditionText();
|
||||||
void FocusRecipients();
|
void FocusRecipients();
|
||||||
void SwitchScreen(boolean small);
|
void SwitchScreen(boolean small);
|
||||||
void setUndefinedRights();
|
void showNoBugReports();
|
||||||
void setUserRights();
|
void showMyOnlyBugReports();
|
||||||
void setAdminRights();
|
void showAllBugreports();
|
||||||
|
void showAllBugReportsAdmin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,51 @@ public class MainUI extends UIModule_ {
|
|||||||
return profilesWindow;
|
return profilesWindow;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
|
void showUndefinedRights(){
|
||||||
|
Global.mainModule.SetUserPassesAccess();
|
||||||
|
getMainWindow().SwitchTestingTabs(false);
|
||||||
|
getMainWindow().SwitchAdministrationTab(false);
|
||||||
|
getTestingMenuBar().showServerAdminLabel(false);
|
||||||
|
getMainWindow().getCallbackWindow().showNoBugReports();
|
||||||
|
};
|
||||||
|
void showUserRights(){
|
||||||
|
Global.mainModule.SetUserPassesAccess();
|
||||||
|
getMainWindow().SwitchTestingTabs(false);
|
||||||
|
getMainWindow().SwitchAdministrationTab(false);
|
||||||
|
getTestingMenuBar().showServerAdminLabel(false);
|
||||||
|
getMainWindow().getCallbackWindow().showMyOnlyBugReports();
|
||||||
|
};
|
||||||
|
void showDeveloperRights(){
|
||||||
|
Global.mainModule.SetDeveloperPassesAccess();
|
||||||
|
getMainWindow().SwitchTestingTabs(true);
|
||||||
|
getMainWindow().SwitchAdministrationTab(false);
|
||||||
|
getTestingMenuBar().showServerAdminLabel(false);
|
||||||
|
getMainWindow().getCallbackWindow().showAllBugreports();
|
||||||
|
}
|
||||||
|
void showAdminRights(){
|
||||||
|
Global.mainModule.SetAdminPassesAccess();
|
||||||
|
getMainWindow().SwitchTestingTabs(true);
|
||||||
|
getMainWindow().SwitchAdministrationTab(true);
|
||||||
|
getTestingMenuBar().showServerAdminLabel(true);
|
||||||
|
getMainWindow().getCallbackWindow().showAllBugReportsAdmin(); //метод избыточный. возможно.
|
||||||
|
};
|
||||||
|
public void ShowAccount(){
|
||||||
|
getMainWindow().getCallbackWindow().ShowAccountInfo();
|
||||||
|
switch (Global.mainModule.getAccount().role) {
|
||||||
|
case Undefined:
|
||||||
|
showUndefinedRights();
|
||||||
|
break;
|
||||||
|
case User:
|
||||||
|
showUserRights();
|
||||||
|
break;
|
||||||
|
case Developer:
|
||||||
|
showDeveloperRights();
|
||||||
|
break;
|
||||||
|
case Admin:
|
||||||
|
showAdminRights();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ public class SynchronizationSettingsMenu extends PropertiesSubmenu {
|
|||||||
public SynchronizationSettingsMenu() {
|
public SynchronizationSettingsMenu() {
|
||||||
super("Синхронизация", null,
|
super("Синхронизация", null,
|
||||||
Global.normalProperties,
|
Global.normalProperties,
|
||||||
|
"OfferRegistrationOnStart",
|
||||||
"AutoBugReportsLoad",
|
"AutoBugReportsLoad",
|
||||||
"AutoTestsLoad");
|
"AutoTestsLoad");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -363,67 +363,34 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
|||||||
accountPanel.add(SC10);
|
accountPanel.add(SC10);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setUndefinedRights(){
|
public void showNoBugReports(){
|
||||||
Global.mainModule.SetUserPassesAccess();
|
|
||||||
UI.Clear(accountPanel);
|
UI.Clear(accountPanel);
|
||||||
accountPanel.add(new CallbackWelcomeForm().content);
|
accountPanel.add(new CallbackWelcomeForm().content);
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(false);
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
|
||||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
|
||||||
adminLabel.setVisible(false);
|
adminLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setUserRights() {
|
public void showMyOnlyBugReports() {
|
||||||
EnableBugreports();
|
EnableBugreports();
|
||||||
LockMyOnly();
|
LockMyOnly();
|
||||||
Global.mainModule.SetUserPassesAccess();
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(false);
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
|
||||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
|
||||||
adminLabel.setVisible(false);
|
adminLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
private void setDeveloperRights() {
|
//возможно перезапуск серверов перетащить во вкладку администрирование? вместе с бекапами. надо подумать.
|
||||||
|
@Override
|
||||||
|
public void showAllBugreports() {
|
||||||
EnableBugreports();
|
EnableBugreports();
|
||||||
UnlockMyOnly();
|
UnlockMyOnly();
|
||||||
Global.mainModule.SetDeveloperPassesAccess();
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
|
||||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
|
||||||
adminLabel.setVisible(false);
|
adminLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setAdminRights() {
|
public void showAllBugReportsAdmin() {
|
||||||
EnableBugreports();
|
EnableBugreports();
|
||||||
UnlockMyOnly();
|
UnlockMyOnly();
|
||||||
Global.mainModule.SetAdminPassesAccess();
|
|
||||||
//--
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
|
|
||||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(true);
|
|
||||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(true);
|
|
||||||
adminLabel.setVisible(true);
|
adminLabel.setVisible(true);
|
||||||
}
|
}
|
||||||
@Override
|
public void ShowAccountInfo() {
|
||||||
public void ShowAccount() {
|
|
||||||
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
|
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
|
||||||
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
|
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
|
||||||
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
|
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
|
||||||
switch (Global.mainModule.getAccount().role) {
|
|
||||||
case Undefined:
|
|
||||||
setUndefinedRights();
|
|
||||||
break;
|
|
||||||
case User:
|
|
||||||
//видит только свои баги.
|
|
||||||
setUserRights();
|
|
||||||
break;
|
|
||||||
case Developer:
|
|
||||||
setDeveloperRights();
|
|
||||||
break;
|
|
||||||
case Admin:
|
|
||||||
setAdminRights();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void ShowBugReports() {
|
public void ShowBugReports() {
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ public class MainForm extends Form implements MainWindow {
|
|||||||
public void Show() {
|
public void Show() {
|
||||||
//приходится идти на это только ПОСЛЕ создания главного окна.
|
//приходится идти на это только ПОСЛЕ создания главного окна.
|
||||||
// иначе ссылка на главное окно в методах пустая.
|
// иначе ссылка на главное окно в методах пустая.
|
||||||
|
Global.mainModule.getUI().ShowAccount();
|
||||||
getCallbackWindow().ShowAll();
|
getCallbackWindow().ShowAll();
|
||||||
getTestsWindow().ShowAll();
|
getTestsWindow().ShowAll();
|
||||||
getCredentialsWindow().ShowAll();
|
getCredentialsWindow().ShowAll();
|
||||||
|
|||||||
Reference in New Issue
Block a user