Skip to content

Commit

Permalink
ui test refactoring (#7043)
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers authored Jan 17, 2025
1 parent d2accd2 commit e7b3fc3
Show file tree
Hide file tree
Showing 101 changed files with 1,432 additions and 1,776 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/init-postgresql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export NVM_DIR=""
su - postgres -c "psql -c 'CREATE USER eris WITH password '\''discord'\'';'"
su - postgres -c "psql -c 'CREATE DATABASE cia_dev;'"
su - postgres -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE cia_dev to eris;'"
su - postgres -c "psql -c 'ALTER USER eris WITH SUPERUSER;'"
su - postgres -c "psql -d cia_dev -c 'GRANT ALL ON SCHEMA public TO eris;'"
su - postgres -c "psql -d cia_dev -c 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO eris;'"
su - postgres -c "psql -d cia_dev -c 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO eris;'"
Expand Down Expand Up @@ -100,7 +101,7 @@ echo "ssl = on" >> /etc/postgresql/16/main/postgresql.conf
echo "ssl_cert_file = '/var/lib/postgresql/16/main/server.crt'" >> /etc/postgresql/16/main/postgresql.conf
echo "ssl_key_file = '/var/lib/postgresql/16/main/server.key'" >> /etc/postgresql/16/main/postgresql.conf
echo "max_prepared_transactions = 100" >> /etc/postgresql/16/main/postgresql.conf
echo "shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto'" >> /etc/postgresql/16/main/postgresql.conf
echo "shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto, pgml'" >> /etc/postgresql/16/main/postgresql.conf
echo "pgaudit.log = ddl" >> /etc/postgresql/16/main/postgresql.conf
echo "pg_stat_statements.track = all" >> /etc/postgresql/16/main/postgresql.conf
echo "pg_stat_statements.max = 10000" >> /etc/postgresql/16/main/postgresql.conf
Expand Down
4 changes: 2 additions & 2 deletions citizen-intelligence-agency/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<exec executable="${maven.binary}" dir=".">
<env key="MAVEN_OPTS" value="-server -Xmx6048m -Xms6048m " />
<arg
line="clean install site -Prelease-site -Dtest=no -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DforkMode=once -Dannotation.failOnError=false" />
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-cia-all" description="cia-site-cia-all" depends="init">
Expand Down Expand Up @@ -220,4 +220,4 @@
<arg line="site:deploy -Pweb-modules" />
</exec>
</target>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,19 @@ public final class AdminViewConstants {
/** The Constant EMAIL_OVERVIEW. */
public static final String EMAIL_OVERVIEW = "Email Overview";

/** The Constant ADMIN_MONITORING. */
public static final String ADMIN_MONITORING = "Admin Monitoring";

/** The Constant MONITORING_CONTEXT_PATH. */
public static final String MONITORING_CONTEXT_PATH = "./monitoring";

/** The Constant ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON. */
public static final String ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON = "Deploy Agents:Sweden";

/** The Constant ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON. */
public static final String ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON = "Deploy Agents:World";

public static final String ADMIN_AGENT_OPERATION_DEPLOY_DESC = "Gathering osint";


}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package com.hack23.cia.web.impl.ui.application.views.admin.agentoperations.pagemode;

import java.text.MessageFormat;

import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -49,21 +47,12 @@
public final class AgentOperationsOverviewPageModContentFactoryImpl
extends AbstractAgentOperationsPageModContentFactoryImpl {

/** The Constant BUTTON_ID_PATTERN. */
private static final String BUTTON_ID_PATTERN = "{0}.{1}.{2}";

/** The Constant BUTTON_PATTERN. */
private static final String BUTTON_PATTERN = "Start {0} {1}";

/** The Constant NAME. */
public static final String NAME = AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME;

/** The Constant WILL_FETCH_DATA_FROM_SOURCE. */
private static final String WILL_FETCH_DATA_FROM_SOURCE = "Will fetch data from source";

/**
* Instantiates a new agent operations overview page mod content factory
* impl.
* Instantiates a new agent operations overview page mod content factory impl.
*/
public AgentOperationsOverviewPageModContentFactoryImpl() {
super();
Expand All @@ -76,7 +65,8 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina

getMenuItemFactory().createMainPageMenuBar(menuBar);

CardInfoRowUtil.createPageHeader(panel, content, AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW, AdminViewConstants.ADMIN_AGENT_OPERATION, AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW);
CardInfoRowUtil.createPageHeader(panel, content, AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW,
AdminViewConstants.ADMIN_AGENT_OPERATION, AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW);

final HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSizeFull();
Expand All @@ -91,16 +81,20 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina

final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);

for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget) , VaadinIcons.BULLSEYE);
importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
RowUtil.createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
}
final Button deployAgentSwedenButton = new Button(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON, VaadinIcons.BULLSEYE);
deployAgentSwedenButton.addClickListener(
new StartAgentClickListener(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN, DataAgentOperation.IMPORT));
deployAgentSwedenButton.setId(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON);
RowUtil.createRowItem(grid, deployAgentSwedenButton, AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_DESC);
final Button deployAgentWorldButton = new Button(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON, VaadinIcons.BULLSEYE);
deployAgentWorldButton.addClickListener(
new StartAgentClickListener(DataAgentTarget.MODEL_EXTERNAL_WORLDBANK, DataAgentOperation.IMPORT));
deployAgentWorldButton.setId(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON);
RowUtil.createRowItem(grid, deployAgentWorldButton, AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_DESC);

final String pageId = getPageId(parameters);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN,
NAME, null, pageId);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW,
ApplicationEventGroup.ADMIN, NAME, null, pageId);

return content;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
import com.hack23.cia.web.impl.ui.application.action.ViewAction;
import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants;
import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews;
import com.vaadin.server.ExternalResource;
Expand All @@ -38,11 +39,6 @@
@Component
public final class AdminMonitoringPageModContentFactoryImpl extends AbstractAdminSystemPageModContentFactoryImpl {

/** The Constant ADMIN_MONITORING. */
private static final String ADMIN_MONITORING = "Admin Monitoring";

/** The Constant MONITORING_CONTEXT_PATH. */
private static final String MONITORING_CONTEXT_PATH = "./monitoring";

/** The Constant NAME. */
public static final String NAME = AdminViews.ADMIN_MONITORING_VIEW_NAME;
Expand All @@ -64,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina

getMenuItemFactory().createMainPageMenuBar(menuBar);

final BrowserFrame browser = new BrowserFrame(ADMIN_MONITORING, new ExternalResource(MONITORING_CONTEXT_PATH));
final BrowserFrame browser = new BrowserFrame(AdminViewConstants.ADMIN_MONITORING, new ExternalResource(AdminViewConstants.MONITORING_CONTEXT_PATH));
browser.setSizeFull();

content.addComponent(browser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,59 @@
* The Interface MenuItemAdminConstants.
*/
public interface MenuItemAdminConstants {

/** The admin text. */
String ADMIN_TEXT = "Admin";

/** The agency. */
String AGENCY = "Agency";

/** The agent operations text. */
String AGENT_OPERATIONS_TEXT = "Agent operations";

/** The application. */
String APPLICATION = "Application";

/** The application configuration. */
String APPLICATION_CONFIGURATION = "System settings";

/** The application event. */
String APPLICATION_EVENT = "Application Event";

/** The application event charts. */
String APPLICATION_EVENT_CHARTS = "Application Event charts";

/** The application session. */
String APPLICATION_SESSION = "Application Session";

/** The application session charts. */
String APPLICATION_SESSION_CHARTS = "Active Daily Users";

/** The system performance. */
String SYSTEM_PERFORMANCE = "System Performance";

/** The management. */
String MANAGEMENT = "Management";

/** The configuration. */
String CONFIGURATION = "Configuration";

/** The portal. */
String PORTAL = "Portal";

/** The email. */
String EMAIL = "Email";

/** The language. */
String LANGUAGE = "Language";


/** The Constant DATA_AUTHOR_SUMMARY. */
String DATA_AUTHOR_SUMMARY = "Data author summary";

/** The Constant DATA_SUMMARY_TEXT. */
String DATA_SUMMARY_TEXT = "Data Summary";



}
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
* Constants for committee-related menu items.
*/
public interface MenuItemCommitteeConstants {

/** The committee ranking text. */
// Base committee labels
String COMMITTEE_RANKING_TEXT = "Committee Ranking";

/** The committee roles. */
String COMMITTEE_ROLES = "Committee Roles";

/** The committees link text. */
String COMMITTEES_LINK_TEXT = "Committees";

/** The committee ranking description. */
// Committee descriptions
String COMMITTEE_RANKING_DESCRIPTION = "Committees: shaping policy debates.";

/** The committees description. */
String COMMITTEES_DESCRIPTION = "All committees: roles and responsibilities.";

/** The committee roles description. */
String COMMITTEE_ROLES_DESCRIPTION = "Committee roles description";

/** The page visit history description. */
String PAGE_VISIT_HISTORY_DESCRIPTION = "View history of page visit for this page.";

/** The documents text. */
// Document and ballot related
String DOCUMENTS_TEXT = "Documents";

/** The ballots text. */
String BALLOTS_TEXT = "Ballots";

/** The ballot decision summary text. */
String BALLOT_DECISION_SUMMARY_TEXT = "Ballot Decision Summary";

/** The current committees text. */
// Other committee constants
String CURRENT_COMMITTEES_TEXT = "Current Committees";

/** The committee history text. */
String COMMITTEE_HISTORY_TEXT = "Committee History";

/** The committee details text. */
String COMMITTEE_DETAILS_TEXT = "Committee Details";
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* The Interface MenuItemConstants.
*/
public interface MenuItemConstants extends
public interface MenuItemConstants extends
MenuItemLayoutConstants,
MenuItemPartyConstants,
MenuItemUserConstants,
Expand All @@ -22,71 +22,71 @@ public interface MenuItemConstants extends
MenuItemParliamentConstants,
MenuItemRiskConstants,
MenuItemPageVisitConstants {

/** The dashboard. */
// Core navigation constants
String DASHBOARD = "Dashboard";

/** The main. */
String MAIN = "Main";

/** The start text. */
String START_TEXT = "Start";

/** The overview text. */
String OVERVIEW_TEXT = "Overview";

/** The ranking text. */
String RANKING_TEXT = "Ranking";

/** The by topic. */
String BY_TOPIC = "By Topic";

/** The list all. */
String LIST_ALL = "List All";

/** The login. */
// Security related constants
String LOGIN = "Login";

/** The logout. */
String LOGOUT = "Logout";

/** The register. */
String REGISTER = "Register";

/** The role admin. */
String ROLE_ADMIN = "ROLE_ADMIN";

/** The role user. */
String ROLE_USER = "ROLE_USER";

/** The user home. */
// UserHomeMenuItemFactoryImpl constants
String USER_HOME = "User Home";

/** The user profile. */
String USER_PROFILE = "User Profile";

/** The user settings. */
String USER_SETTINGS = "User Settings";

/** The user logout. */
String USER_LOGOUT = "User Logout";

/** The user home description. */
String USER_HOME_DESCRIPTION = "Navigate to user home page";

/** The user profile description. */
String USER_PROFILE_DESCRIPTION = "View and edit user profile";

/** The user settings description. */
String USER_SETTINGS_DESCRIPTION = "Adjust user settings";

/** The user logout description. */
String USER_LOGOUT_DESCRIPTION = "Logout from the application";


/** The Constant MANAGEMENT. */
String MANAGEMENT = "Management";

Expand Down
Loading

0 comments on commit e7b3fc3

Please sign in to comment.