diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java index 47aa1267b3..a1a2d6a2d5 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.data.impl.DataAgentTarget; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @@ -74,7 +75,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Agent Operation Overview", "Admin Agent Operation", "Overview of administrative agent operations and tasks."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Agent Operation Overview", "Admin Agent Operation", "Overview of administrative agent operations and tasks."); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryAuthorPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryAuthorPageModContentFactoryImpl.java index 15d42a43d3..c3d949c81a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryAuthorPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryAuthorPageModContentFactoryImpl.java @@ -23,6 +23,7 @@ import com.hack23.cia.model.internal.application.data.audit.impl.ViewAuditAuthorSummary; import com.hack23.cia.service.api.DataContainer; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; 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.hack23.cia.web.impl.ui.application.views.common.viewnames.DataSummaryPageMode; @@ -62,7 +63,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Author Summary", "Author Overview", "Detailed summary of authors and their contributions to data records."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Author Summary", "Author Overview", "Detailed summary of authors and their contributions to data records."); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryOverviewPageModContentFactoryImpl.java index 7ed2963e15..18ac8f2b7e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/datasummary/pagemode/DataSummaryOverviewPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.service.api.action.admin.RefreshDataViewsRequest; import com.hack23.cia.service.api.action.admin.RemoveDataRequest; import com.hack23.cia.service.api.action.admin.UpdateSearchIndexRequest; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @@ -95,7 +96,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Data Summary Overview", "Data Summary Overview", "Comprehensive overview of data summaries for administrative review."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Data Summary Overview", "Data Summary Overview", "Comprehensive overview of data summaries for administrative review."); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminAgencyPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminAgencyPageModContentFactoryImpl.java index 9597332e26..911a6ed6c4 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminAgencyPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminAgencyPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.converters.ListPropertyConverter; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentSize; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @@ -101,7 +102,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Agency Management", "Agency Overview", + CardInfoRowUtil.createPageHeader(panel, content, "Admin Agency Management", "Agency Overview", "Manage and review details of agencies, including organizational data and performance metrics."); final DataContainer dataContainer = getApplicationManager().getDataContainer(Agency.class); @@ -148,7 +149,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina leftLayout.addComponent(cardPanel); - createCardHeader(cardContent, "Agency Details"); + CardInfoRowUtil.createCardHeader(cardContent, "Agency Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -157,8 +158,8 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display fields in a card layout (skipping null or empty ones) - addInfoRowIfNotNull(attributesLayout, "Agency Name:", agency.getAgencyName(), VaadinIcons.FLAG); - addInfoRowIfNotNull(attributesLayout, "Description:", agency.getDescription(), VaadinIcons.FILE_TEXT); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Agency Name:", agency.getAgencyName(), VaadinIcons.FLAG); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Description:", agency.getDescription(), VaadinIcons.FILE_TEXT); // Right layout: portals grid getGridFactory().createBasicBeanItemGrid(rightLayout, Portal.class, agency.getPortals(), diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationConfigurationPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationConfigurationPageModContentFactoryImpl.java index 037d3e88d8..0eccf6f95e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationConfigurationPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationConfigurationPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.service.api.action.admin.UpdateApplicationConfigurationRequest; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentSize; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -85,7 +86,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Application Configuration", "Application Configuration", + CardInfoRowUtil.createPageHeader(panel, content, "Admin Application Configuration", "Application Configuration", "View and edit application settings and configurations for optimal performance."); final DataContainer dataContainer = getApplicationManager() @@ -142,7 +143,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina leftLayout.addComponent(cardPanel); - createCardHeader(cardContent,"Application Configuration Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Application Configuration Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -151,19 +152,19 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display relevant fields using info rows, skipping null or empty - addInfoRowIfNotNull(attributesLayout, "Configuration Group:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Configuration Group:", applicationConfiguration.getConfigurationGroup().toString(), VaadinIcons.GROUP); - addInfoRowIfNotNull(attributesLayout, "Component:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Component:", applicationConfiguration.getComponent(), VaadinIcons.TOOLS); - addInfoRowIfNotNull(attributesLayout, "Config Title:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Config Title:", applicationConfiguration.getConfigTitle(), VaadinIcons.FILE_TEXT); - addInfoRowIfNotNull(attributesLayout, "Config Description:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Config Description:", applicationConfiguration.getConfigDescription(), VaadinIcons.FILE_O); - addInfoRowIfNotNull(attributesLayout, "Property Value:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Property Value:", applicationConfiguration.getPropertyValue(), VaadinIcons.PASTE); - addInfoRowIfNotNull(attributesLayout, "Created Date:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(applicationConfiguration.getCreatedDate()), VaadinIcons.CALENDAR); - addInfoRowIfNotNull(attributesLayout, "Updated Date:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Updated Date:", String.valueOf(applicationConfiguration.getUpdatedDate()), VaadinIcons.CALENDAR_CLOCK); // Right side: Form for updating the application configuration diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsChartsPageModContentFactoryImpl.java index 5a747b9a8f..b7df8b418c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsChartsPageModContentFactoryImpl.java @@ -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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -57,7 +58,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Application Event Charts", "Event Analysis", "Visualize and analyze application events using interactive charts and graphs."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Application Event Charts", "Event Analysis", "Visualize and analyze application events using interactive charts and graphs."); getAdminChartDataManager().createApplicationActionEventPageDailySummaryChart(content); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsPageModContentFactoryImpl.java index 9ad9cd2e55..f55e38cea7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationEventsPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Application Events", "Event Details", + CardInfoRowUtil.createPageHeader(panel, content, "Admin Application Events", "Event Details", "Review a comprehensive list of application events, including timestamps and statuses."); final DataContainer dataContainer = getApplicationManager() @@ -105,7 +106,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina content.addComponent(cardPanel); - createCardHeader(cardContent,"Application Event Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Application Event Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -113,27 +114,27 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina attributesLayout.setWidth("100%"); cardContent.addComponent(attributesLayout); - addInfoRowIfNotNull(attributesLayout, "Created Date:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(applicationActionEvent.getCreatedDate()), VaadinIcons.CALENDAR); - addInfoRowIfNotNull(attributesLayout, "Event Group:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Event Group:", String.valueOf(applicationActionEvent.getEventGroup()), VaadinIcons.INFO); - addInfoRowIfNotNull(attributesLayout, "Application Operation:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Application Operation:", String.valueOf(applicationActionEvent.getApplicationOperation()), VaadinIcons.TOOLS); - addInfoRowIfNotNull(attributesLayout, "Page:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Page:", String.valueOf(applicationActionEvent.getPage()), VaadinIcons.FILE_TEXT); - addInfoRowIfNotNull(attributesLayout, "Page Mode:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Page Mode:", String.valueOf(applicationActionEvent.getPageMode()), VaadinIcons.LIST); - addInfoRowIfNotNull(attributesLayout, "Element Id:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Element Id:", String.valueOf(applicationActionEvent.getElementId()), VaadinIcons.POINTER); - addInfoRowIfNotNull(attributesLayout, "Action Name:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Action Name:", String.valueOf(applicationActionEvent.getActionName()), VaadinIcons.PLAY_CIRCLE); - addInfoRowIfNotNull(attributesLayout, "User Id:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "User Id:", String.valueOf(applicationActionEvent.getUserId()), VaadinIcons.USER); - addInfoRowIfNotNull(attributesLayout, "Session Id:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Session Id:", String.valueOf(applicationActionEvent.getSessionId()), VaadinIcons.KEY); - addInfoRowIfNotNull(attributesLayout, "Error Message:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Error Message:", String.valueOf(applicationActionEvent.getErrorMessage()), VaadinIcons.WARNING); - addInfoRowIfNotNull(attributesLayout, "Application Message:", + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Application Message:", String.valueOf(applicationActionEvent.getApplicationMessage()), VaadinIcons.INFO_CIRCLE); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionChartsPageModContentFactoryImpl.java index e07b1b47ae..3f079eb8b7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionChartsPageModContentFactoryImpl.java @@ -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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -56,7 +57,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Application Session Charts", "Session Analysis", "Analyze user sessions using graphical insights to track usage patterns."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Application Session Charts", "Session Analysis", "Analyze user sessions using graphical insights to track usage patterns."); getAdminChartDataManager().createApplicationSessionPageDailySummaryChart(content); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionPageModContentFactoryImpl.java index 59edc80bf8..e273bb557e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminApplicationSessionPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.converters.ListPropertyConverter; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentSize; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @@ -116,7 +117,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader( + CardInfoRowUtil.createPageHeader( panel, content, "Admin Application Sessions", @@ -179,7 +180,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina horizontalLayout.addComponent(cardPanel); horizontalLayout.setExpandRatio(cardPanel, ContentRatio.GRID); - createCardHeader(cardContent,"Application Session Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Application Session Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -188,14 +189,14 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display each field if not null or empty - addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(applicationSession.getCreatedDate()), VaadinIcons.CALENDAR); - addInfoRowIfNotNull(attributesLayout, "Session Type:", applicationSession.getSessionType().toString(), VaadinIcons.CONNECT); - addInfoRowIfNotNull(attributesLayout, "User Id:", applicationSession.getUserId(), VaadinIcons.USER); - addInfoRowIfNotNull(attributesLayout, "Session Id:", applicationSession.getSessionId(), VaadinIcons.KEY); - addInfoRowIfNotNull(attributesLayout, "Operating System:", applicationSession.getOperatingSystem(), VaadinIcons.DESKTOP); - addInfoRowIfNotNull(attributesLayout, "Locale:", applicationSession.getLocale(), VaadinIcons.GLOBE); - addInfoRowIfNotNull(attributesLayout, "IP Information:", applicationSession.getIpInformation(), VaadinIcons.INFO); - addInfoRowIfNotNull(attributesLayout, "User Agent:", applicationSession.getUserAgentInformation(), VaadinIcons.BROWSER); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(applicationSession.getCreatedDate()), VaadinIcons.CALENDAR); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Session Type:", applicationSession.getSessionType().toString(), VaadinIcons.CONNECT); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "User Id:", applicationSession.getUserId(), VaadinIcons.USER); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Session Id:", applicationSession.getSessionId(), VaadinIcons.KEY); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Operating System:", applicationSession.getOperatingSystem(), VaadinIcons.DESKTOP); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Locale:", applicationSession.getLocale(), VaadinIcons.GLOBE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "IP Information:", applicationSession.getIpInformation(), VaadinIcons.INFO); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "User Agent:", applicationSession.getUserAgentInformation(), VaadinIcons.BROWSER); // Right side: grid for ApplicationActionEvent (session events) final VerticalLayout rightLayout = new VerticalLayout(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminCountryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminCountryPageModContentFactoryImpl.java index a377185369..f9007ab86f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminCountryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminCountryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; import com.vaadin.icons.VaadinIcons; @@ -90,7 +91,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, + CardInfoRowUtil.createPageHeader(panel, content, "Admin Country Management", "Country Overview", "Manage and review country-specific data, including metrics and geopolitical information."); @@ -143,7 +144,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina content.addComponent(cardPanel); - createCardHeader(cardContent,"Country Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Country Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -152,12 +153,12 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Show fields if not null or empty - addInfoRowIfNotNull(attributesLayout, "Country ID:", country.getId(), VaadinIcons.FLAG_O); - addInfoRowIfNotNull(attributesLayout, "Name:", country.getCountryName(), VaadinIcons.GLOBE); - addInfoRowIfNotNull(attributesLayout, "ISO2 Code:", country.getIso2Code(), VaadinIcons.CODE); - addInfoRowIfNotNull(attributesLayout, "Capital:", country.getCapitalCity(), VaadinIcons.BUILDING); - addInfoRowIfNotNull(attributesLayout, "Longitude:", country.getLongitude(), VaadinIcons.ARROWS_LONG_H); - addInfoRowIfNotNull(attributesLayout, "Latitude:", country.getLatitude(), VaadinIcons.ARROWS_LONG_H); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Country ID:", country.getId(), VaadinIcons.FLAG_O); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Name:", country.getCountryName(), VaadinIcons.GLOBE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "ISO2 Code:", country.getIso2Code(), VaadinIcons.CODE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Capital:", country.getCapitalCity(), VaadinIcons.BUILDING); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Longitude:", country.getLongitude(), VaadinIcons.ARROWS_LONG_H); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Latitude:", country.getLatitude(), VaadinIcons.ARROWS_LONG_H); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminLanguagePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminLanguagePageModContentFactoryImpl.java index f78477cadc..8295aa3f1f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminLanguagePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminLanguagePageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.LanguageData_; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; 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.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -84,7 +85,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, + CardInfoRowUtil.createPageHeader(panel, content, "Admin Language Management", "Language Overview", "Administer and update language settings and configurations for the platform."); @@ -141,7 +142,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina horizontalLayout.addComponent(cardPanel); - createCardHeader(cardContent,"Language Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Language Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -150,10 +151,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display each field if not null or empty - addInfoRowIfNotNull(attributesLayout, "Language Name:", languageData.getLanguageName(), VaadinIcons.GLOBE); - addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(languageData.getCreatedDate()), VaadinIcons.CALENDAR); - addInfoRowIfNotNull(attributesLayout, "Last Modified Date:", String.valueOf(languageData.getLastModifiedDate()), VaadinIcons.CALENDAR_CLOCK); - addInfoRowIfNotNull(attributesLayout, "Language Enabled:", String.valueOf(languageData.isLanguageEnabled()), VaadinIcons.CHECK); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Language Name:", languageData.getLanguageName(), VaadinIcons.GLOBE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(languageData.getCreatedDate()), VaadinIcons.CALENDAR); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Last Modified Date:", String.valueOf(languageData.getLastModifiedDate()), VaadinIcons.CALENDAR_CLOCK); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Language Enabled:", String.valueOf(languageData.isLanguageEnabled()), VaadinIcons.CHECK); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminPortalPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminPortalPageModContentFactoryImpl.java index b02ede269b..5f23b4abc9 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminPortalPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminPortalPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.Portal_; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; import com.vaadin.icons.VaadinIcons; @@ -82,7 +83,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, + CardInfoRowUtil.createPageHeader(panel, content, "Admin Portal Management", "Portal Overview", "Centralized management interface for accessing and controlling administrative tools." @@ -135,7 +136,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina content.addComponent(cardPanel); - createCardHeader(cardContent,"Portal Details"); + CardInfoRowUtil.createCardHeader(cardContent,"Portal Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -144,10 +145,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display each field if not null or empty - addInfoRowIfNotNull(attributesLayout, "Portal Name:", portal.getPortalName(), VaadinIcons.GLOBE_WIRE); - addInfoRowIfNotNull(attributesLayout, "Description:", portal.getDescription(), VaadinIcons.FILE_TEXT); - addInfoRowIfNotNull(attributesLayout, "Portal Type:", portal.getPortalType().toString(), VaadinIcons.VIEWPORT); - addInfoRowIfNotNull(attributesLayout, "Google Map API Key:", portal.getGoogleMapApiKey(), VaadinIcons.KEY); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Portal Name:", portal.getPortalName(), VaadinIcons.GLOBE_WIRE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Description:", portal.getDescription(), VaadinIcons.FILE_TEXT); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Portal Type:", portal.getPortalType().toString(), VaadinIcons.VIEWPORT); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Google Map API Key:", portal.getGoogleMapApiKey(), VaadinIcons.KEY); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminUserAccountPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminUserAccountPageModContentFactoryImpl.java index b8b9bc2781..41757f9e4e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminUserAccountPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminUserAccountPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.service.api.action.admin.ManageUserAccountRequest; import com.hack23.cia.service.api.action.admin.ManageUserAccountRequest.AccountOperation; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @@ -87,7 +88,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin User Account Management", "User Account Overview", + CardInfoRowUtil.createPageHeader(panel, content, "Admin User Account Management", "User Account Overview", "Manage user accounts, including roles, permissions, and activity logs."); final DataContainer dataContainer = getApplicationManager() @@ -120,7 +121,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina content.addComponent(cardPanel); - createCardHeader(cardContent,"User Account Details"); + CardInfoRowUtil.createCardHeader(cardContent,"User Account Details"); // Attributes layout final VerticalLayout attributesLayout = new VerticalLayout(); @@ -129,12 +130,12 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Display fields using a card layout approach with null-check - addInfoRowIfNotNull(attributesLayout, "Username:", userAccount.getUsername(), VaadinIcons.USER); - addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(userAccount.getCreatedDate()), + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Username:", userAccount.getUsername(), VaadinIcons.USER); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Created Date:", String.valueOf(userAccount.getCreatedDate()), VaadinIcons.CALENDAR); - addInfoRowIfNotNull(attributesLayout, "Email:", userAccount.getEmail(), VaadinIcons.ENVELOPE); - addInfoRowIfNotNull(attributesLayout, "Country:", userAccount.getCountry(), VaadinIcons.GLOBE); - addInfoRowIfNotNull(attributesLayout, "Number Of Visits:", String.valueOf(userAccount.getNumberOfVisits()), + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Email:", userAccount.getEmail(), VaadinIcons.ENVELOPE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Country:", userAccount.getCountry(), VaadinIcons.GLOBE); + CardInfoRowUtil.addInfoRowIfNotNull(attributesLayout, "Number Of Visits:", String.valueOf(userAccount.getNumberOfVisits()), VaadinIcons.EYE); final VerticalLayout overviewLayout = new VerticalLayout(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/EmailPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/EmailPageModContentFactoryImpl.java index 9307715660..e001b9605c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/EmailPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/EmailPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.action.admin.SendEmailRequest; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; 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.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content, "Admin Email Management", "Email Overview", "Page for managing email configurations and communications within the agency."); + CardInfoRowUtil.createPageHeader(panel, content, "Admin Email Management", "Email Overview", "Page for managing email configurations and communications within the agency."); final VerticalLayout emailLayout = createPanelContent(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/AbstractPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/AbstractPageModContentFactoryImpl.java index 29faa1f326..4081db68ac 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/AbstractPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/AbstractPageModContentFactoryImpl.java @@ -25,17 +25,11 @@ import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.AdminChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.formfactory.api.FormFactory; import com.hack23.cia.web.impl.ui.application.views.common.gridfactory.api.GridFactory; -import com.hack23.cia.web.impl.ui.application.views.common.labelfactory.LabelFactory; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.ApplicationMenuItemFactory; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageLinkFactory; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; -import com.vaadin.icons.VaadinIcons; -import com.vaadin.server.Responsive; import com.vaadin.server.Sizeable.Unit; -import com.vaadin.shared.ui.ContentMode; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.Tab; import com.vaadin.ui.VerticalLayout; @@ -217,174 +211,6 @@ protected static final String getPageId(final String parameters) { } } - /** - * Creates the page header. - * - * @param panel the panel - * @param panelContent the panel content - * @param header the header - * @param pageHeader the page header - * @param pageDescription the page description - */ - protected static final void createPageHeader(final Panel panel, final VerticalLayout panelContent, final String header, final String pageHeader, final String pageDescription) { - panel.setCaption(header); - LabelFactory.createHeader2Label(panelContent, pageHeader); - final Label descriptionLabel = new Label(pageDescription); - descriptionLabel.addStyleName("itembox"); - Responsive.makeResponsive(descriptionLabel); - descriptionLabel.setWidth(100, Unit.PERCENTAGE); - panelContent.addComponent(descriptionLabel); - panelContent.setExpandRatio(descriptionLabel,ContentRatio.SMALL); - } - - /** - * Adds an info row to the parent layout if value is not null or empty. - * - * @param parent the parent layout - * @param caption the caption - * @param value the value - * @param icon the icon - */ - protected final void addInfoRowIfNotNull(final VerticalLayout parent, final String caption, final String value, - final VaadinIcons icon) { - if (value != null && !value.trim().isEmpty() && !"null".equalsIgnoreCase(value)) { - parent.addComponent(createInfoRow(caption, value, icon)); - } - } - - /** - * Creates a simple info row (caption and value) with optional icon. - * - * @param caption the field caption - * @param value the field value - * @param icon a VaadinIcons icon - * @return a HorizontalLayout representing the info row - */ - protected final HorizontalLayout createInfoRow(final String caption, final String value, VaadinIcons icon) { - return createInfoRow(caption,value,icon,null); - } - - - /** - * Creates a row displaying a caption and value, with optional icon and tooltip. - * - * @param caption the field caption - * @param value the field value - * @param icon a VaadinIcons icon for better visual cue - * @param tooltip optional tooltip to provide more info - * @return a HorizontalLayout representing the info row - */ - protected final HorizontalLayout createInfoRow(final String caption, final String value, VaadinIcons icon, - final String tooltip) { - final HorizontalLayout layout = new HorizontalLayout(); - layout.setSpacing(true); - layout.addStyleName("metric-label"); - layout.setWidthUndefined(); - - if (icon != null) { - final Label iconLabel = new Label(icon.getHtml(), ContentMode.HTML); - iconLabel.addStyleName("card-info-icon"); - if (tooltip != null && !tooltip.isEmpty()) { - iconLabel.setDescription(tooltip); - } - layout.addComponent(iconLabel); - } - - final Label captionLabel = new Label(caption); - captionLabel.addStyleName("card-info-caption"); - if (tooltip != null && !tooltip.isEmpty()) { - captionLabel.setDescription(tooltip); - } - - final Label valueLabel = new Label(value != null ? value : ""); - valueLabel.addStyleName("card-info-value"); - - layout.addComponents(captionLabel, valueLabel); - return layout; - } - - /** - * Creates a section layout with a title and consistent styling. - * - * @param title the section title - * @return the vertical layout configured for the section - */ - protected final VerticalLayout createSectionLayout(String title) { - final VerticalLayout layout = new VerticalLayout(); - layout.setSpacing(true); - layout.setMargin(true); - layout.addStyleName("card-details-column"); - layout.setWidth("100%"); - - final Label header = new Label(title); - header.addStyleName("card-section-title"); - layout.addComponent(header); - - // Add some vertical padding after the header - final Label padding = new Label(); - padding.setHeight("10px"); - layout.addComponent(padding); - - return layout; - } - - /** - * Creates the metric row. - * - * @param icon the icon - * @param linkComponent the link component - * @param description the description - * @param valueText the value text - * @return the horizontal layout - */ - protected final HorizontalLayout createMetricRow(VaadinIcons icon, com.vaadin.ui.Component linkComponent, - String description, String valueText) { - final HorizontalLayout layout = new HorizontalLayout(); - layout.setSpacing(true); - layout.addStyleName("metric-label"); - layout.setWidthUndefined(); - - final Label iconLabel = new Label(icon.getHtml(), ContentMode.HTML); - iconLabel.setDescription(description); - - // Value displayed outside of the link - Label valueLabel = null; - if (valueText != null && !valueText.isEmpty()) { - valueLabel = new Label(valueText); - valueLabel.addStyleName("metric-value"); - } - - layout.addComponent(iconLabel); - layout.addComponent(linkComponent); - if (valueLabel != null) { - layout.addComponent(valueLabel); - } - - return layout; - } - - protected final void createCardHeader(final VerticalLayout cardContent, final String titleText) { - // Card Header - final HorizontalLayout headerLayout = new HorizontalLayout(); - headerLayout.setSpacing(true); - headerLayout.setWidth("100%"); - headerLayout.addStyleName("card-header-section"); - - final Label titleLabel = new Label(titleText, ContentMode.HTML); - titleLabel.addStyleName("card-title"); - titleLabel.setWidthUndefined(); - headerLayout.addComponent(titleLabel); - - cardContent.addComponent(headerLayout); - - // Divider line - final Label divider = new Label("
", ContentMode.HTML); - divider.addStyleName("card-divider"); - divider.setWidth("100%"); - cardContent.addComponent(divider); - } - - /** * Gets the page link factory. * diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java new file mode 100644 index 0000000000..589984e4b9 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java @@ -0,0 +1,191 @@ +package com.hack23.cia.web.impl.ui.application.views.common.pagemode; + +import com.hack23.cia.web.impl.ui.application.views.common.labelfactory.LabelFactory; +import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.server.Responsive; +import com.vaadin.server.Sizeable.Unit; +import com.vaadin.shared.ui.ContentMode; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.VerticalLayout; + +/** + * The Class CardInfoRowUtil. + */ +public class CardInfoRowUtil { + + /** + * Creates the page header. + * + * @param panel the panel + * @param panelContent the panel content + * @param header the header + * @param pageHeader the page header + * @param pageDescription the page description + */ + public static final void createPageHeader(final Panel panel, final VerticalLayout panelContent, final String header, final String pageHeader, final String pageDescription) { + panel.setCaption(header); + LabelFactory.createHeader2Label(panelContent, pageHeader); + final Label descriptionLabel = new Label(pageDescription); + descriptionLabel.addStyleName("itembox"); + Responsive.makeResponsive(descriptionLabel); + descriptionLabel.setWidth(100, Unit.PERCENTAGE); + panelContent.addComponent(descriptionLabel); + panelContent.setExpandRatio(descriptionLabel,ContentRatio.SMALL); + } + + /** + * Adds an info row to the parent layout if value is not null or empty. + * + * @param parent the parent layout + * @param caption the caption + * @param value the value + * @param icon the icon + */ + public static final void addInfoRowIfNotNull(final VerticalLayout parent, final String caption, final String value, + final VaadinIcons icon) { + if (value != null && !value.trim().isEmpty() && !"null".equalsIgnoreCase(value)) { + parent.addComponent(CardInfoRowUtil.createInfoRow(caption, value, icon)); + } + } + + /** + * Creates a simple info row (caption and value) with optional icon. + * + * @param caption the field caption + * @param value the field value + * @param icon a VaadinIcons icon + * @return a HorizontalLayout representing the info row + */ + public static final HorizontalLayout createInfoRow(final String caption, final String value, VaadinIcons icon) { + return CardInfoRowUtil.createInfoRow(caption,value,icon,null); + } + + /** + * Creates a row displaying a caption and value, with optional icon and tooltip. + * + * @param caption the field caption + * @param value the field value + * @param icon a VaadinIcons icon for better visual cue + * @param tooltip optional tooltip to provide more info + * @return a HorizontalLayout representing the info row + */ + public static final HorizontalLayout createInfoRow(final String caption, final String value, VaadinIcons icon, + final String tooltip) { + final HorizontalLayout layout = new HorizontalLayout(); + layout.setSpacing(true); + layout.addStyleName("metric-label"); + layout.setWidthUndefined(); + + if (icon != null) { + final Label iconLabel = new Label(icon.getHtml(), ContentMode.HTML); + iconLabel.addStyleName("card-info-icon"); + if (tooltip != null && !tooltip.isEmpty()) { + iconLabel.setDescription(tooltip); + } + layout.addComponent(iconLabel); + } + + final Label captionLabel = new Label(caption); + captionLabel.addStyleName("card-info-caption"); + if (tooltip != null && !tooltip.isEmpty()) { + captionLabel.setDescription(tooltip); + } + + final Label valueLabel = new Label(value != null ? value : ""); + valueLabel.addStyleName("card-info-value"); + + layout.addComponents(captionLabel, valueLabel); + return layout; + } + + /** + * Creates a section layout with a title and consistent styling. + * + * @param title the section title + * @return the vertical layout configured for the section + */ + public static VerticalLayout createSectionLayout(String title) { + final VerticalLayout layout = new VerticalLayout(); + layout.setSpacing(true); + layout.setMargin(true); + layout.addStyleName("card-details-column"); + layout.setWidth("100%"); + + final Label header = new Label(title); + header.addStyleName("card-section-title"); + layout.addComponent(header); + + // Add some vertical padding after the header + final Label padding = new Label(); + padding.setHeight("10px"); + layout.addComponent(padding); + + return layout; + } + + /** + * Creates the metric row. + * + * @param icon the icon + * @param linkComponent the link component + * @param description the description + * @param valueText the value text + * @return the horizontal layout + */ + public static final HorizontalLayout createMetricRow(VaadinIcons icon, com.vaadin.ui.Component linkComponent, + String description, String valueText) { + final HorizontalLayout layout = new HorizontalLayout(); + layout.setSpacing(true); + layout.addStyleName("metric-label"); + layout.setWidthUndefined(); + + final Label iconLabel = new Label(icon.getHtml(), ContentMode.HTML); + iconLabel.setDescription(description); + + // Value displayed outside of the link + Label valueLabel = null; + if (valueText != null && !valueText.isEmpty()) { + valueLabel = new Label(valueText); + valueLabel.addStyleName("metric-value"); + } + + layout.addComponent(iconLabel); + layout.addComponent(linkComponent); + if (valueLabel != null) { + layout.addComponent(valueLabel); + } + + return layout; + } + + /** + * Creates the card header. + * + * @param cardContent the card content + * @param titleText the title text + */ + public static final void createCardHeader(final VerticalLayout cardContent, final String titleText) { + // Card Header + final HorizontalLayout headerLayout = new HorizontalLayout(); + headerLayout.setSpacing(true); + headerLayout.setWidth("100%"); + headerLayout.addStyleName("card-header-section"); + + final Label titleLabel = new Label(titleText, ContentMode.HTML); + titleLabel.addStyleName("card-title"); + titleLabel.setWidthUndefined(); + headerLayout.addComponent(titleLabel); + + cardContent.addComponent(headerLayout); + + // Divider line + final Label divider = new Label("
", ContentMode.HTML); + divider.addStyleName("card-divider"); + divider.setWidth("100%"); + cardContent.addComponent(divider); + } + +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/DashboardViewOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/DashboardViewOverviewPageModContentFactoryImpl.java index c2de2769be..6a748879a7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/DashboardViewOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/DashboardViewOverviewPageModContentFactoryImpl.java @@ -116,7 +116,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "CitizenIntelligence Agency::Dashboard Overview", "Dashboard Overview", "Visualize political activity in Sweden, present key performance indicators and metadata."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewLoginPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewLoginPageModContentFactoryImpl.java index 7218f2bce6..d51bb48054 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewLoginPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewLoginPageModContentFactoryImpl.java @@ -73,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content,"Login","Login User","Secure login for agency users."); + CardInfoRowUtil.createPageHeader(panel, content,"Login","Login User","Secure login for agency users."); final VerticalLayout loginLayout = new VerticalLayout(); loginLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewOverviewPageModContentFactoryImpl.java index 2893d35841..cf73ebe881 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewOverviewPageModContentFactoryImpl.java @@ -54,7 +54,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, panelContent,"Overview","Overview","Visualize political activity in Sweden, present key performance indicators and metadata for the actors on national level."); + CardInfoRowUtil.createPageHeader(panel, panelContent,"Overview","Overview","Visualize political activity in Sweden, present key performance indicators and metadata for the actors on national level."); getMenuItemFactory().createOverviewPage(panelContent); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER, diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewPageVisitHistoryPageModContentFactoryImpl.java index 3e57fdad6f..1483760e29 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewPageVisitHistoryPageModContentFactoryImpl.java @@ -56,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content,"Page Visits","Page Visits","History of page visits to understand user engagement."); + CardInfoRowUtil.createPageHeader(panel, content,"Page Visits","Page Visits","History of page visits to understand user engagement."); createPageVisitHistory(NAME,pageId,content); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewRegisterPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewRegisterPageModContentFactoryImpl.java index de39054f35..af8d923535 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewRegisterPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/MainViewRegisterPageModContentFactoryImpl.java @@ -71,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - createPageHeader(panel, content,"Register","Register User","Register new users with essential details."); + CardInfoRowUtil.createPageHeader(panel, content,"Register","Register User","Register new users with essential details."); final VerticalLayout registerLayout = new VerticalLayout(); registerLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java new file mode 100644 index 0000000000..96c12b9428 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java @@ -0,0 +1,287 @@ +package com.hack23.cia.web.impl.ui.application.views.common.pagemode; + +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember; +import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician; +import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPoliticianBallotSummary; +import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPoliticianExperienceSummary; +import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualOutcomeSummary; +import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; +import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageLinkFactory; +import com.vaadin.icons.VaadinIcons; +import com.vaadin.ui.VerticalLayout; + +/** + * The Class PoliticianLeaderboardUtil. + */ +@Service +public class PoliticianLeaderboardUtil extends CardInfoRowUtil { + + /** The page link factory. */ + @Autowired + public PageLinkFactory pageLinkFactory; + + /** + * Instantiates a new politician leaderboard util. + */ + public PoliticianLeaderboardUtil() { + } + + /** + * Adds the political analysis comment. + * + * @param layout the layout + * @param experienceSummary the experience summary + */ + public final void addPoliticalAnalysisComment(VerticalLayout layout, + ViewRiksdagenPoliticianExperienceSummary experienceSummary) { + // Split the analysis points and create a bullet list + final String[] analysisPoints = experienceSummary.getPoliticalAnalysisComment().split("\\s*\\|\\|\\s*"); + final StringBuilder analys=new StringBuilder(); + for (final String point : analysisPoints) { + if (StringUtils.isNotBlank(point)) { + analys.append(" • ").append(point); + } + } + + // Political Analysis Comment + if (StringUtils.isNotBlank(experienceSummary.getPoliticalAnalysisComment())) { + layout.addComponent(createInfoRow("Analysis:", + analys.toString(), + VaadinIcons.COMMENT, + "Political career analysis")); + } + } + + /** + * Adds the knowledge areas. + * + * @param layout the layout + * @param experienceSummary the experience summary + */ + public final void addKnowledgeAreas(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { + if (experienceSummary.getKnowledgeAreas() != null && !experienceSummary.getKnowledgeAreas().isEmpty()) { + final String topAreas = experienceSummary.getKnowledgeAreas().stream() + .filter(ka -> ka.getArea() != null && !ka.getArea().equals("Other")) + .sorted((ka1, ka2) -> ka2.getWeightedExp().compareTo(ka1.getWeightedExp())) + .limit(3) + .map(ka -> String.format(Locale.ENGLISH,"%s ", + ka.getArea())) + .collect(Collectors.joining(", ")); + + if (!topAreas.isEmpty()) { + layout.addComponent(createInfoRow("Key Policy Areas:", + topAreas, + VaadinIcons.CLIPBOARD_TEXT, + "Main areas of expertise with weighted importance")); + } + } + } + + /** + * Adds the top roles. + * + * @param layout the layout + * @param experienceSummary the experience summary + */ + public final void addTopRoles(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { + if (experienceSummary.getRoles() != null && !experienceSummary.getRoles().isEmpty()) { + final String topRoles = experienceSummary.getRoles().stream() + .filter(role -> role.getRole() != null && !role.getRole().equals("Other")) + .sorted((r1, r2) -> r2.getWeightedExp().compareTo(r1.getWeightedExp())) + .limit(3) + .map(role -> String.format(Locale.ENGLISH,"%s", + role.getRole())) + .collect(Collectors.joining(", ")); + + if (!topRoles.isEmpty()) { + layout.addComponent(createInfoRow("Key Political Roles:", + topRoles, + VaadinIcons.USERS, + "Most significant positions with weighted importance")); + } + } + } + + /** + * Adds the experience metrics. + * + * @param layout the layout + * @param experienceSummary the experience summary + */ + public final void addExperienceMetrics(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { + if (experienceSummary != null) { + // Career Overview + layout.addComponent(createInfoRow("Career Phase:", + experienceSummary.getCareerPhase().toString().replace("_", " "), + VaadinIcons.CALENDAR_CLOCK, + "Current career stage")); + + // Experience Level + layout.addComponent(createInfoRow("Experience Level:", + experienceSummary.getExperienceLevel().toString().replace("_", " "), + VaadinIcons.CHART_TIMELINE, + "Overall political experience classification")); + + // Leadership Profile + layout.addComponent(createInfoRow("Leadership Role:", + experienceSummary.getLeadershipProfile().toString().replace("_", " "), + VaadinIcons.USER_STAR, + "Leadership experience level")); + + // Specialization + layout.addComponent(createInfoRow("Expertise:", + experienceSummary.getSpecializationLevel().toString().replace("_", " "), + VaadinIcons.SPECIALIST, + "Area of specialization")); + + + } + } + + /** + * Adds the legislative metrics. + * + * @param layout the layout + * @param politician the politician + */ + public final void addLegislativeMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician) { + + layout.addComponent(createInfoRow("Documents/Year:", String.format(Locale.ENGLISH,"%.1f", politician.getAverageDocsPerYear()), + VaadinIcons.FILE_TEXT, "Average documents per year")); + layout.addComponent(createInfoRow("Individual Motions:", String.valueOf(politician.getIndividualMotions()), + VaadinIcons.USER, "Personal motions submitted")); + layout.addComponent(createInfoRow("Party Motions:", String.valueOf(politician.getPartyMotions()), + VaadinIcons.GROUP, "Party-based motions")); + layout.addComponent(createInfoRow("Committee Motions:", String.valueOf(politician.getCommitteeMotions()), + VaadinIcons.GROUP, "Committee-based motions")); + layout.addComponent(createInfoRow("Document Impact:", politician.getDocActivityProfile(), VaadinIcons.CHART_3D, + "Legislative influence assessment")); + } + + /** + * Adds the party alignment metrics. + * + * @param layout the layout + * @param politician the politician + * @param ballotSummary the ballot summary + */ + public final void addPartyAlignmentMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, + ViewRiksdagenPoliticianBallotSummary ballotSummary) { + + layout.addComponent(createInfoRow("Party Loyalty:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary != null ? ballotSummary.getLoyaltyRate() : 0.0), + VaadinIcons.GROUP, "Party line adherence")); + layout.addComponent(createInfoRow("Independence Rate:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary != null ? ballotSummary.getRebelRate() : 0.0), + VaadinIcons.RANDOM, "Votes against party line")); + layout.addComponent(createInfoRow("Cross-Party Collaboration:", + String.format(Locale.ENGLISH,"%.1f%%", politician.getCollaborationPercentage()), VaadinIcons.CONNECT, + "Inter-party cooperation")); + layout.addComponent(createInfoRow("Multi-Party Motions:", String.valueOf(politician.getMultiPartyMotions()), + VaadinIcons.USERS, "Cross-party legislative initiatives")); + } + + + + /** + * Adds the parliamentary performance metrics. + * + * @param layout the layout + * @param politician the politician + * @param ballotSummary the ballot summary + */ + public final void addParliamentaryPerformanceMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, + ViewRiksdagenPoliticianBallotSummary ballotSummary) { + + layout.addComponent( + createInfoRow("Attendance Rate:", + String.format(Locale.ENGLISH, "%.1f%%", 100 - (ballotSummary != null ? ballotSummary.getAbsenceRate() : 0.0)), + VaadinIcons.USER_CHECK, "Session attendance rate")); + layout.addComponent(createInfoRow("Voting Success:", + String.format(Locale.ENGLISH, "%.1f%%", ballotSummary != null ? ballotSummary.getSuccessRate() : 0.0), + VaadinIcons.TROPHY, "Votes on winning side")); + layout.addComponent(createInfoRow("Activity Level:", politician.getDocActivityLevel(), VaadinIcons.CHART_LINE, + "Overall engagement level")); + layout.addComponent(createInfoRow("Analysis Comment:", + String.valueOf(ballotSummary != null ? ballotSummary.getAnalysisComment() : 0), VaadinIcons.USER_CARD, + "Analysis Comment")); + } + + /** + * Adds the ministry role summary. + * + * @param cardLayout the card layout + * @param govMember the gov member + * @param governmentBodyByMinistry the government body by ministry + * @param reportByMinistry the report by ministry + */ + public final void addMinistryRoleSummary(final VerticalLayout cardLayout, + final ViewRiksdagenGovermentRoleMember govMember, + final Map> governmentBodyByMinistry, + final Map> reportByMinistry) { + + cardLayout.addComponent(pageLinkFactory.addMinistryPageLink(govMember.getDetail())); + + final List ministryBodies = governmentBodyByMinistry.get(govMember.getDetail()); + if (ministryBodies == null || ministryBodies.isEmpty()) { + return; + } + + final int totalHeadCount = ministryBodies.stream().mapToInt(GovernmentBodyAnnualSummary::getAnnualWorkHeadCount) + .sum(); + final int bodyCount = ministryBodies.size(); + + cardLayout.addComponent(createMetricRow(VaadinIcons.GROUP, + pageLinkFactory.addMinistryGovermentBodiesPageLink(govMember.getDetail()), + "Number of government bodies", String.valueOf(bodyCount))); + + cardLayout.addComponent(createMetricRow(VaadinIcons.USER, + pageLinkFactory.addMinistryGovermentBodiesHeadcountPageLink(govMember.getDetail()), + "Total headcount of government bodies", String.valueOf(totalHeadCount))); + + final List outcomeSummaries = reportByMinistry.get(govMember.getDetail()); + double currentYearIncome = 0; + double currentYearSpending = 0; + final int CURRENT_YEAR = 2024; + final String INKOMSTTITELGRUPPSNAMN = "Inkomsttitelgruppsnamn"; + final String EXPENDITURE_GROUP_NAME = "Utgiftsområdesnamn"; + + if (outcomeSummaries != null) { + final Map annualIncome = outcomeSummaries.stream() + .filter(t -> t.getDescriptionFields().get(INKOMSTTITELGRUPPSNAMN) != null) + .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, + Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); + + final Map annualSpending = outcomeSummaries.stream() + .filter(t -> t.getDescriptionFields().get(EXPENDITURE_GROUP_NAME) != null) + .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, + Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); + + if (annualIncome.get(CURRENT_YEAR) != null) { + currentYearIncome = annualIncome.get(CURRENT_YEAR) / 1000; + } + + if (annualSpending.get(CURRENT_YEAR) != null) { + currentYearSpending = annualSpending.get(CURRENT_YEAR) / 1000; + } + } + + final String incomeStr = String.format(Locale.ENGLISH, "%.2f B SEK", currentYearIncome); + cardLayout.addComponent(createMetricRow(VaadinIcons.ARROW_UP, + pageLinkFactory.addMinistryGovermentBodiesIncomePageLink(govMember.getDetail()), + "Yearly Income (B SEK)", incomeStr)); + + final String spendingStr = String.format(Locale.ENGLISH, "%.2f B SEK", currentYearSpending); + cardLayout.addComponent(createMetricRow(VaadinIcons.ARROW_DOWN, + pageLinkFactory.addMinistrGovermentBodiesSpendingPageLink(govMember.getDetail()), + "Yearly Spending (B SEK)", spendingStr)); + } + +} \ No newline at end of file diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java index 76bf3daf74..1f382a844a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java @@ -41,6 +41,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.BallotChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.server.Sizeable.Unit; @@ -117,13 +118,13 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .getAllBy(ViewRiksdagenCommitteeBallotDecisionSummary_.ballotId, pageId); if (!decisionSummaries.isEmpty()) { - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ballot Charts : " + decisionSummaries.get(0).getTitle() + " - " + decisionSummaries.get(0).getSubTitle(), "Ballot Trends and Visualizations", "Provides insights into election trends by visualizing ballot data, assisting in strategic decision-making and voter engagement analysis."); } else { - createPageHeader(panel, panelContent, "Ballot Charts : " + ballots.get(0).getEmbeddedId().getConcern(), + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ballot Charts : " + ballots.get(0).getEmbeddedId().getConcern(), "Ballot Trends and Visualizations", "Provides insights into election trends by visualizing ballot data, assisting in strategic decision-making and voter engagement analysis."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java index da44223735..3530f9cd7c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java @@ -35,6 +35,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @@ -141,7 +142,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina } subTitle = "Ballot Details"; - createPageHeader(panel, panelContent, mainTitle, subTitle, + CardInfoRowUtil.createPageHeader(panel, panelContent, mainTitle, subTitle, "Explore and analyze ballot results and voting statistics."); // Card panel @@ -160,7 +161,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.GRID); - createCardHeader(cardContent,"Ballot Information"); + CardInfoRowUtil.createCardHeader(cardContent,"Ballot Information"); // Two-column layout final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -169,10 +170,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Ballot Profile (Textual and identifying attributes) - final VerticalLayout profileDetailsLayout = createSectionLayout("Ballot Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Ballot Profile"); // Right column: Voting Statistics (Numeric and outcome attributes) - final VerticalLayout serviceStatsLayout = createSectionLayout("Voting Statistics"); + final VerticalLayout serviceStatsLayout = CardInfoRowUtil.createSectionLayout("Voting Statistics"); attributesLayout.addComponents(profileDetailsLayout, serviceStatsLayout); @@ -180,16 +181,16 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (useDecisionSummaries) { final ViewRiksdagenCommitteeBallotDecisionSummary ds = decisionSummaries.get(FIRST_OBJECT); // Show essential profile fields - profileDetailsLayout.addComponent(createInfoRow("Vote Date:", String.valueOf(ds.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); - profileDetailsLayout.addComponent(createInfoRow("Title:", ds.getTitle(), VaadinIcons.FILE_TEXT_O, "Title of the ballot")); - profileDetailsLayout.addComponent(createInfoRow("SubTitle:", ds.getSubTitle(), VaadinIcons.FILE_TEXT, "Subtitle of the ballot")); - profileDetailsLayout.addComponent(createInfoRow("Decision Type:", ds.getDecisionType(), VaadinIcons.QUESTION_CIRCLE, "Type of decision")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Vote Date:", String.valueOf(ds.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Title:", ds.getTitle(), VaadinIcons.FILE_TEXT_O, "Title of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("SubTitle:", ds.getSubTitle(), VaadinIcons.FILE_TEXT, "Subtitle of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Decision Type:", ds.getDecisionType(), VaadinIcons.QUESTION_CIRCLE, "Type of decision")); // Stats fields - serviceStatsLayout.addComponent(createInfoRow("Concern:", ds.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); - serviceStatsLayout.addComponent(createInfoRow("Ballot Type:", ds.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); - serviceStatsLayout.addComponent(createInfoRow("Winner:", ds.getWinner(), VaadinIcons.TROPHY, "Winner or outcome")); - serviceStatsLayout.addComponent(createInfoRow("Approved:", String.valueOf(ds.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Concern:", ds.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot Type:", ds.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Winner:", ds.getWinner(), VaadinIcons.TROPHY, "Winner or outcome")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Approved:", String.valueOf(ds.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); // Optional: If still too crowded, remove againstProposal fields // serviceStatsLayout.addComponent(createInfoRow("Against Proposal Parties:", ds.getAgainstProposalParties(), VaadinIcons.WARNING, "Parties against the proposal")); @@ -198,21 +199,21 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina // Non-decision scenario final ViewRiksdagenVoteDataBallotSummary bs = ballots.get(FIRST_OBJECT); // Profile fields - profileDetailsLayout.addComponent(createInfoRow("Ballot ID:", bs.getEmbeddedId().getBallotId(), VaadinIcons.CLIPBOARD_USER, "Ballot identification")); - profileDetailsLayout.addComponent(createInfoRow("RM:", bs.getRm(), VaadinIcons.CALENDAR, "Session (RM) identifier")); - profileDetailsLayout.addComponent(createInfoRow("Vote Date:", String.valueOf(bs.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); - profileDetailsLayout.addComponent(createInfoRow("Issue:", bs.getEmbeddedId().getIssue(), VaadinIcons.CLIPBOARD_TEXT, "The specific issue voted upon")); - profileDetailsLayout.addComponent(createInfoRow("Concern:", bs.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); - profileDetailsLayout.addComponent(createInfoRow("Ballot Type:", bs.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); - profileDetailsLayout.addComponent(createInfoRow("Label:", bs.getLabel(), VaadinIcons.FILE_TEXT, "Short label or description")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot ID:", bs.getEmbeddedId().getBallotId(), VaadinIcons.CLIPBOARD_USER, "Ballot identification")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("RM:", bs.getRm(), VaadinIcons.CALENDAR, "Session (RM) identifier")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Vote Date:", String.valueOf(bs.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Issue:", bs.getEmbeddedId().getIssue(), VaadinIcons.CLIPBOARD_TEXT, "The specific issue voted upon")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Concern:", bs.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot Type:", bs.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Label:", bs.getLabel(), VaadinIcons.FILE_TEXT, "Short label or description")); // Stats fields - serviceStatsLayout.addComponent(createInfoRow("Total Votes:", String.valueOf(bs.getTotalVotes()), VaadinIcons.GROUP, "Total number of votes cast")); - serviceStatsLayout.addComponent(createInfoRow("Yes Votes:", String.valueOf(bs.getYesVotes()), VaadinIcons.THUMBS_UP, "Number of 'yes' votes")); - serviceStatsLayout.addComponent(createInfoRow("No Votes:", String.valueOf(bs.getNoVotes()), VaadinIcons.THUMBS_DOWN, "Number of 'no' votes")); - serviceStatsLayout.addComponent(createInfoRow("Abstain Votes:", String.valueOf(bs.getAbstainVotes()), VaadinIcons.SPLIT, "Number of abstentions")); - serviceStatsLayout.addComponent(createInfoRow("Absent Votes:", String.valueOf(bs.getAbsentVotes()), VaadinIcons.EXIT_O, "Number of absent voters")); - serviceStatsLayout.addComponent(createInfoRow("Approved:", String.valueOf(bs.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Votes:", String.valueOf(bs.getTotalVotes()), VaadinIcons.GROUP, "Total number of votes cast")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Yes Votes:", String.valueOf(bs.getYesVotes()), VaadinIcons.THUMBS_UP, "Number of 'yes' votes")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("No Votes:", String.valueOf(bs.getNoVotes()), VaadinIcons.THUMBS_DOWN, "Number of 'no' votes")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Abstain Votes:", String.valueOf(bs.getAbstainVotes()), VaadinIcons.SPLIT, "Number of abstentions")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Absent Votes:", String.valueOf(bs.getAbsentVotes()), VaadinIcons.EXIT_O, "Number of absent voters")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Approved:", String.valueOf(bs.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); } // Spacer before Party Ballot Summary diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java index 4f74edd2f0..8069cd9e44 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -87,7 +88,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Ballot Decision Summary " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Ballot Decision Summary", "Summary of ballot decisions made by the specified committee."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Ballot Decision Summary " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Ballot Decision Summary", "Summary of ballot decisions made by the specified committee."); final DataContainer committeeBallotDecisionPartyDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeBallotDecisionSummary.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java index 5e64bb66ba..fbbf63aa32 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Current Members History", "Tracks and presents historical data about committee members' participation."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Current Members History", "Tracks and presents historical data about committee members' participation."); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java index 4393be2b9d..3cab7e5fe8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java @@ -37,6 +37,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.common.chartfactory.api.DecisionFlowChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -123,7 +124,7 @@ private static List createAvailableYears() { private void setupMenuAndHeader(MenuBar menuBar, Panel panel, VerticalLayout panelContent, String pageId, ViewRiksdagenCommittee committee) { getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Decision Flow " + committee.getEmbeddedId().getDetail(), "Decision Flow", "Analyze decision-making processes within committees." diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionSummaryPageModContentFactoryImpl.java index 9c63b25149..ff6c264b51 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionSummaryPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -83,7 +84,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Decision Summary", "Decision Summary", "Overview of decisions made by the committee."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Decision Summary", "Decision Summary", "Overview of decisions made by the committee."); final DataContainer committeeDecisionDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeDecisions.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java index 99097b07cf..5add29ab73 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java @@ -27,6 +27,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.common.chartfactory.api.DecisionChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -62,7 +63,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Daily Committee Decisions " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Summary of Decision Types", "Displays a summary of daily committee decision-making activity."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Daily Committee Decisions " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Summary of Decision Types", "Displays a summary of daily committee decision-making activity."); chartDataManager.createDecisionTypeChart(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java index c12594db49..096fda93b5 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.OrgDocumentChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -62,7 +63,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Documents " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Document Activity Overview", "Tracks and visualizes the activity associated with committee documents."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Documents " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Document Activity Overview", "Tracks and visualizes the activity associated with committee documents."); chartDataManager.createDocumentHistoryChartByOrg(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java index 8903c04dc2..e5534eef33 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -74,7 +75,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Document History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Document History", "Displays the historical progression of documents managed by committees."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Document History", "Displays the historical progression of documents managed by committees."); final DataContainer politicianDocumentDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPoliticianDocument.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java index f9bf2f1581..5eb2245613 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Member History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Member Participation History", "Analyzes and presents participation trends for committee members."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Member History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Member Participation History", "Analyzes and presents participation trends for committee members."); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java index 70e0ae1ba1..6090f240ad 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Overview " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Details", "Detailed insights into parliamentary committees and their activities."); @@ -95,7 +96,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - createCardHeader(cardContent,"Committee: " + viewRiksdagenCommittee.getEmbeddedId().getDetail()); + CardInfoRowUtil.createCardHeader(cardContent,"Committee: " + viewRiksdagenCommittee.getEmbeddedId().getDetail()); // Two-column layout for committee attributes final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -104,49 +105,49 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // First column: Committee Profile (keep existing, but add activity level) - final VerticalLayout profileDetailsLayout = createSectionLayout("Committee Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Committee Profile"); - profileDetailsLayout.addComponent(createInfoRow("Detail:", viewRiksdagenCommittee.getEmbeddedId().getDetail(), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Detail:", viewRiksdagenCommittee.getEmbeddedId().getDetail(), VaadinIcons.INFO_CIRCLE, "Internal identifier detail for the committee")); - profileDetailsLayout.addComponent(createInfoRow("Status:", viewRiksdagenCommittee.isActive() ? "Active" : "Inactive", + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Status:", viewRiksdagenCommittee.isActive() ? "Active" : "Inactive", VaadinIcons.FLAG, "Current committee status")); - profileDetailsLayout.addComponent(createInfoRow("Activity Level:", viewRiksdagenCommittee.getActivityLevel(), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Activity Level:", viewRiksdagenCommittee.getActivityLevel(), VaadinIcons.CHART, "Committee's current activity level")); - profileDetailsLayout.addComponent(createInfoRow("First Assignment:", String.valueOf(viewRiksdagenCommittee.getFirstAssignmentDate()), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("First Assignment:", String.valueOf(viewRiksdagenCommittee.getFirstAssignmentDate()), VaadinIcons.CALENDAR, "Date the committee's first assignment started")); - profileDetailsLayout.addComponent(createInfoRow("Last Assignment:", String.valueOf(viewRiksdagenCommittee.getLastAssignmentDate()), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Last Assignment:", String.valueOf(viewRiksdagenCommittee.getLastAssignmentDate()), VaadinIcons.CALENDAR_CLOCK, "Date of the committee's most recent assignment")); // Second column: Membership Statistics - final VerticalLayout membershipStatsLayout = createSectionLayout("Membership Statistics"); + final VerticalLayout membershipStatsLayout = CardInfoRowUtil.createSectionLayout("Membership Statistics"); - membershipStatsLayout.addComponent(createInfoRow("Current Members:", String.valueOf(viewRiksdagenCommittee.getCurrentMemberSize()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Current Members:", String.valueOf(viewRiksdagenCommittee.getCurrentMemberSize()), VaadinIcons.GROUP, "Total current committee members")); - membershipStatsLayout.addComponent(createInfoRow("Regular Members:", String.valueOf(viewRiksdagenCommittee.getCurrentRegularMembers()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Regular Members:", String.valueOf(viewRiksdagenCommittee.getCurrentRegularMembers()), VaadinIcons.USER, "Number of current regular members")); - membershipStatsLayout.addComponent(createInfoRow("Leadership Positions:", String.valueOf(viewRiksdagenCommittee.getCurrentLeadershipPositions()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Leadership Positions:", String.valueOf(viewRiksdagenCommittee.getCurrentLeadershipPositions()), VaadinIcons.STAR, "Current number of leadership positions")); - membershipStatsLayout.addComponent(createInfoRow("Substitute Positions:", String.valueOf(viewRiksdagenCommittee.getCurrentSubstitutePositions()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Substitute Positions:", String.valueOf(viewRiksdagenCommittee.getCurrentSubstitutePositions()), VaadinIcons.USER_CLOCK, "Current number of substitute positions")); - membershipStatsLayout.addComponent(createInfoRow("Total Leadership Roles:", String.valueOf(viewRiksdagenCommittee.getTotalLeadershipPositions()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Leadership Roles:", String.valueOf(viewRiksdagenCommittee.getTotalLeadershipPositions()), VaadinIcons.USERS, "Historical total of leadership positions")); - membershipStatsLayout.addComponent(createInfoRow("Total Substitute Roles:", String.valueOf(viewRiksdagenCommittee.getTotalSubstitutePositions()), + membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Substitute Roles:", String.valueOf(viewRiksdagenCommittee.getTotalSubstitutePositions()), VaadinIcons.USERS, "Historical total of substitute positions")); // Third column: Document Statistics - final VerticalLayout documentStatsLayout = createSectionLayout("Document Statistics"); + final VerticalLayout documentStatsLayout = CardInfoRowUtil.createSectionLayout("Document Statistics"); - documentStatsLayout.addComponent(createInfoRow("Total Documents:", String.valueOf(viewRiksdagenCommittee.getTotalDocuments()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Documents:", String.valueOf(viewRiksdagenCommittee.getTotalDocuments()), VaadinIcons.FILE_TEXT, "Total number of documents produced")); - documentStatsLayout.addComponent(createInfoRow("Documents Last Year:", String.valueOf(viewRiksdagenCommittee.getDocumentsLastYear()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Documents Last Year:", String.valueOf(viewRiksdagenCommittee.getDocumentsLastYear()), VaadinIcons.FILE_O, "Documents produced in the last year")); - documentStatsLayout.addComponent(createInfoRow("Avg Documents/Member:", String.format(Locale.ENGLISH,"%.1f", viewRiksdagenCommittee.getAvgDocumentsPerMember()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Avg Documents/Member:", String.format(Locale.ENGLISH,"%.1f", viewRiksdagenCommittee.getAvgDocumentsPerMember()), VaadinIcons.CHART_LINE, "Average documents per committee member")); - documentStatsLayout.addComponent(createInfoRow("Committee Motions:", String.valueOf(viewRiksdagenCommittee.getTotalCommitteeMotions()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Committee Motions:", String.valueOf(viewRiksdagenCommittee.getTotalCommitteeMotions()), VaadinIcons.FILE_PRESENTATION, "Total number of committee motions")); - documentStatsLayout.addComponent(createInfoRow("Total Assignments:", String.valueOf(viewRiksdagenCommittee.getTotalAssignments()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Assignments:", String.valueOf(viewRiksdagenCommittee.getTotalAssignments()), VaadinIcons.TASKS, "Total number of assignments")); - documentStatsLayout.addComponent(createInfoRow("Days Served:", String.valueOf(viewRiksdagenCommittee.getTotalDaysServed()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Days Served:", String.valueOf(viewRiksdagenCommittee.getTotalDaysServed()), VaadinIcons.CLOCK, "Total days of committee service")); // Clear existing components and add all three columns diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java index 8533fed4f4..7c72578e66 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Visits", "Page Visit History for Committees", "Tracks user interaction with committee pages for analytical purposes."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Visits", "Page Visit History for Committees", "Tracks user interaction with committee pages for analytical purposes."); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java index 40d3be45b0..76a9a87353 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.CommitteeDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Committee Rankings", "Ranking of All Committees", "Provides comparative rankings for committees based on performance or metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Ranking of All Committees", "Provides comparative rankings for committees based on performance or metrics."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java index 9988d2a171..88c8d00194 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.CommitteeDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -73,7 +74,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Rankings", "Committee by Party Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Committee by Party Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java index 6db55c575a..210688ff3c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -73,7 +74,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Rankings", "Current Committee Parties Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Current Committee Parties Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java index 37ab50286d..70030af3d6 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.CommitteeDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -69,7 +70,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Rankings", "Current Committees", "Provides comparative rankings for committees based on performance or metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Current Committees", "Provides comparative rankings for committees based on performance or metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java index 6b2b994ca5..5070d1cfda 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -97,7 +98,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Ranking Overview", "Committee Rankings", "Analyze committee rankings with a focus on membership, performance, and activity metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Ranking Overview", "Committee Rankings", "Analyze committee rankings with a focus on membership, performance, and activity metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java index 320287ac8c..f1fdb1dba0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -57,7 +58,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Rankings", "Ranking Details", "Analyze and compare rankings of parliamentary committees based on performance."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Ranking Details", "Analyze and compare rankings of parliamentary committees based on performance."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java index a172b755b7..ad59dbdb52 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Committee Rankings", "Page Visit History", "Tracks and visualizes the history of page visits for committee rankings."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Page Visit History", "Tracks and visualizes the history of page visits for committee rankings."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java index 6e2328b42c..52d01588f7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.CommitteeGhantChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommitteePageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -63,7 +64,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Role Gantt Chart " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Role Timeline", "Visualize the timeline and duration of roles within the committee, highlighting key assignments and transitions."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Role Gantt Chart " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Role Timeline", "Visualize the timeline and duration of roles within the committee, highlighting key assignments and transitions."); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/CountryRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/CountryRankingOverviewPageModContentFactoryImpl.java index a8c1567f98..0f6d125c8f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/CountryRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/CountryRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -49,7 +50,7 @@ public CountryRankingOverviewPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getCountryMenuItemFactory().createCountryTopicMenu(menuBar); - createPageHeader(panel, panelContent,"Country Rankings","Ranking Overview","Visualize and compare country-level political or economic indicators."); + CardInfoRowUtil.createPageHeader(panel, panelContent,"Country Rankings","Ranking Overview","Visualize and compare country-level political or economic indicators."); final String pageId = getPageId(parameters); getCountryMenuItemFactory().createOverviewPage(panelContent); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COUNTRY_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/WorldIndicatorsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/WorldIndicatorsPageModContentFactoryImpl.java index 1209c84766..1e98f8a36f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/WorldIndicatorsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/country/pagemode/WorldIndicatorsPageModContentFactoryImpl.java @@ -36,6 +36,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.WorldIndicatorChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; import com.vaadin.server.Responsive; @@ -67,7 +68,7 @@ public WorldIndicatorsPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getCountryMenuItemFactory().createCountryTopicMenu(menuBar); - createPageHeader(panel, panelContent, "Country Indicator", "Country Indicator", + CardInfoRowUtil.createPageHeader(panel, panelContent, "Country Indicator", "Country Indicator", "Compare key performance indicators across multiple countries."); final String pageId = getPageId(parameters); @@ -114,15 +115,15 @@ private void createDataIndicatorSummaryChartPanel(final VerticalLayout verticalL // For each field in AS_LIST, we create a row if (indicatorSummaryValue.getIndicatorName() != null) { - card.addComponent(createInfoRow("Indicator Name:", indicatorSummaryValue.getIndicatorName(), + card.addComponent(CardInfoRowUtil.createInfoRow("Indicator Name:", indicatorSummaryValue.getIndicatorName(), VaadinIcons.INFO_CIRCLE, "Name of the indicator")); } if (indicatorSummaryValue.getSourceValue() != null) { - card.addComponent(createInfoRow("Source Value:", indicatorSummaryValue.getSourceValue(), + card.addComponent(CardInfoRowUtil.createInfoRow("Source Value:", indicatorSummaryValue.getSourceValue(), VaadinIcons.GLOBE, "Source of this indicator data")); } if (indicatorSummaryValue.getSourceOrganization() != null) { - card.addComponent(createInfoRow("Source Organization:", indicatorSummaryValue.getSourceOrganization(), + card.addComponent(CardInfoRowUtil.createInfoRow("Source Organization:", indicatorSummaryValue.getSourceOrganization(), VaadinIcons.INSTITUTION, "Organization providing this data")); } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java index 9655147aaf..e9965a778b 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document Activity", "Activity Overview", "Analyze document activities, including modifications, approvals, and related events."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Activity", "Activity Overview", "Analyze document activities, including modifications, approvals, and related events."); if (documentStatusContainer != null && documentStatusContainer.getDocumentActivityContainer() != null && documentStatusContainer.getDocumentActivityContainer().getDocumentActivities() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java index ced4c32fe2..e1dd7cbf85 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java @@ -34,6 +34,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.ExternalAttachmentDownloadLink; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.StreamSourceImplementation; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.server.StreamResource; @@ -114,7 +115,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document Attachments", "Attachments Overview", "Explore and manage attachments associated with the document."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Attachments", "Attachments Overview", "Explore and manage attachments associated with the document."); if (documentStatusContainer != null && documentStatusContainer.getDocumentAttachmentContainer() != null && documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java index fb14d21f04..e2caf05539 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.shared.ui.ContentMode; @@ -65,7 +66,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Document Data", "Data Overview", "Detailed view of the document's core data and metadata."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Data", "Data Overview", "Detailed view of the document's core data and metadata."); final DataContainer documentContentDataDataContainer = getApplicationManager() diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java index 1f191a0138..29af4a7513 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java @@ -33,6 +33,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document Decision", "Decision Overview", "Review decisions made regarding the document and their implications."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Decision", "Decision Overview", "Review decisions made regarding the document and their implications."); if (documentStatusContainer != null && documentStatusContainer.getDocumentProposal() != null && documentStatusContainer.getDocumentProposal().getProposal() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java index ba7af27dac..efd0dedbb8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -69,7 +70,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document Details", "Details Overview", "Comprehensive details about the document, including key attributes and content."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Details", "Details Overview", "Comprehensive details about the document, including key attributes and content."); if (documentStatusContainer != null && documentStatusContainer.getDocumentDetailContainer() != null && documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java index fd77498e5f..83a04fec29 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Overview " + documentElement.getTitle() + " " + documentElement.getSubTitle(), "Document Details", "Access and explore official documents and reports."); @@ -90,7 +91,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - createCardHeader(cardContent,"Document Information"); + CardInfoRowUtil.createCardHeader(cardContent,"Document Information"); // Two-column layout final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -99,35 +100,35 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Document Profile (from DocumentElement) - final VerticalLayout profileLayout = createSectionLayout("Document Profile"); + final VerticalLayout profileLayout = CardInfoRowUtil.createSectionLayout("Document Profile"); // Display a selection of DocumentElement fields // Choose key fields: title, subTitle, org, documentType, status, rm, // madePublicDate, createdDate - profileLayout.addComponent(createInfoRow("Title:", documentElement.getTitle(), VaadinIcons.FILE_TEXT_O, + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Title:", documentElement.getTitle(), VaadinIcons.FILE_TEXT_O, "Main title of the document")); if (!StringUtils.isEmpty(documentElement.getSubTitle())) { - profileLayout.addComponent(createInfoRow("SubTitle:", documentElement.getSubTitle(), VaadinIcons.FILE_TEXT, + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("SubTitle:", documentElement.getSubTitle(), VaadinIcons.FILE_TEXT, "Subtitle or complementary title")); } - profileLayout.addComponent(createInfoRow("Organization (Org):", documentElement.getOrg(), + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Organization (Org):", documentElement.getOrg(), VaadinIcons.INSTITUTION, "Originating organization or entity")); - profileLayout.addComponent(createInfoRow("Document Type:", documentElement.getDocumentType(), + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Document Type:", documentElement.getDocumentType(), VaadinIcons.FILE_CODE, "Type of the document")); - profileLayout.addComponent(createInfoRow("Status:", documentElement.getStatus(), VaadinIcons.QUESTION_CIRCLE, + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Status:", documentElement.getStatus(), VaadinIcons.QUESTION_CIRCLE, "Current status of the document")); profileLayout - .addComponent(createInfoRow("Made Public Date:", String.valueOf(documentElement.getMadePublicDate()), + .addComponent(CardInfoRowUtil.createInfoRow("Made Public Date:", String.valueOf(documentElement.getMadePublicDate()), VaadinIcons.CALENDAR_USER, "Date when the document was made public")); // Right column: Metadata & Status (from DocumentStatusContainer and // DocumentData) - final VerticalLayout metadataLayout = createSectionLayout("Metadata & Status"); + final VerticalLayout metadataLayout = CardInfoRowUtil.createSectionLayout("Metadata & Status"); if (documentStatusContainer != null) { // DocumentCategory (from DocumentStatusContainer) if (!StringUtils.isEmpty(documentStatusContainer.getDocumentCategory())) { - metadataLayout.addComponent(createInfoRow("Document Category:", + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Document Category:", documentStatusContainer.getDocumentCategory(), VaadinIcons.BOOK, "Category of this document")); } @@ -136,20 +137,20 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (documentData != null) { // Choose a few key fields from DocumentData if (!StringUtils.isEmpty(documentData.getLabel())) { - metadataLayout.addComponent(createInfoRow("Label:", documentData.getLabel(), VaadinIcons.TAG, + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Label:", documentData.getLabel(), VaadinIcons.TAG, "Short identifying label")); } if (!StringUtils.isEmpty(documentData.getTempLabel())) { - metadataLayout.addComponent(createInfoRow("Temp Label:", documentData.getTempLabel(), + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Temp Label:", documentData.getTempLabel(), VaadinIcons.EDIT, "Temporary label or note")); } if (!StringUtils.isEmpty(documentData.getHangarId())) { - metadataLayout.addComponent(createInfoRow("Hangar ID:", documentData.getHangarId(), + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Hangar ID:", documentData.getHangarId(), VaadinIcons.CLIPBOARD, "Storage or reference ID")); } if (documentData.getNumberValue() != null) { metadataLayout - .addComponent(createInfoRow("Number Value:", String.valueOf(documentData.getNumberValue()), + .addComponent(CardInfoRowUtil.createInfoRow("Number Value:", String.valueOf(documentData.getNumberValue()), VaadinIcons.BAR_CHART, "Numeric value associated with the document")); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java index cd3a961269..00e31238f1 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -51,7 +52,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Documents - Page Visit History", "Engagement Insights", "Tracking how interest in policy materials evolves."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java index 8d5b412195..d67791e80e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -73,7 +74,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document Person References", "Person References", "Identify and explore references to individuals within the document."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Person References", "Person References", "Identify and explore references to individuals within the document."); if (documentStatusContainer != null && documentStatusContainer.getDocumentPersonReferenceContainer() != null && documentStatusContainer.getDocumentPersonReferenceContainer() diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java index 81a103df57..7d44203565 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.DocumentPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -69,7 +70,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - createPageHeader(panel, panelContent, "Document References", "References Overview", "Analyze and review references within the document, including cross-references."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document References", "References Overview", "Analyze and review references within the document, including cross-references."); if (documentStatusContainer != null && documentStatusContainer.getDocumentReferenceContainer() != null && documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java index 8da11461ed..3d0b1b758b 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java @@ -29,6 +29,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.paging.PagingUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -73,7 +74,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final int pageNr= getPageNr(parameters); getDocumentMenuItemFactory().createDocumentsMenuBar(menuBar); - createPageHeader(panel, panelContent, "Documents Overview", "Documents Repository", "Comprehensive repository of Swedish Parliament(Riksdagen) documents."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Documents Overview", "Documents Repository", "Comprehensive repository of Swedish Parliament(Riksdagen) documents."); final DataContainer documentElementDataContainer = getApplicationManager() .getDataContainer(DocumentElement.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/SearchDocumentPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/SearchDocumentPageModContentFactoryImpl.java index f26f3f5705..1fab1389c8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/SearchDocumentPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/SearchDocumentPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.DocumentMenuItemFactory; import com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractBasicPageModContentFactoryImpl; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SearchDocumentClickListener; @@ -76,7 +77,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); documentMenuItemFactory.createDocumentsMenuBar(menuBar); - createPageHeader(panel, panelContent,"Search","Document Search","Search and access detailed parliamentary documents."); + CardInfoRowUtil.createPageHeader(panel, panelContent,"Search","Document Search","Search and access detailed parliamentary documents."); final VerticalLayout searchLayout = new VerticalLayout(); searchLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryCurrentMembersPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryCurrentMembersPageModContentFactoryImpl.java index bf5d95dccf..2122902bc2 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryCurrentMembersPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryCurrentMembersPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Members " + viewRiksdagenMinistry.getNameId(), "Current Members of Ministry", "Details the current composition of ministry members."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Members " + viewRiksdagenMinistry.getNameId(), "Current Members of Ministry", "Details the current composition of ministry members."); final DataContainer govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentActivityPageModContentFactoryImpl.java index 00d3327521..14acb9fcbe 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentActivityPageModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.OrgDocumentChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -61,7 +62,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Documents " + viewRiksdagenMinistry.getNameId(), "Document Activity Overview", "Tracks and visualizes the activity associated with ministry documents."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Documents " + viewRiksdagenMinistry.getNameId(), "Document Activity Overview", "Tracks and visualizes the activity associated with ministry documents."); chartDataManager.createDocumentHistoryChartByOrg(panelContent, viewRiksdagenMinistry.getNameId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentHistoryPageModContentFactoryImpl.java index 74c53c8c0d..53c89deffc 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryDocumentHistoryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -73,7 +74,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Document History " + viewRiksdagenMinistry.getNameId(), "Ministry Document History", "Displays the historical progression of documents managed by ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document History " + viewRiksdagenMinistry.getNameId(), "Ministry Document History", "Displays the historical progression of documents managed by ministries."); final DataContainer politicianDocumentDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPoliticianDocument.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesExpenditureModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesExpenditureModContentFactoryImpl.java index 8828d96a58..5a8a552ca6 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesExpenditureModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesExpenditureModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Expenditure Analysis " + viewRiksdagenMinistry.getNameId(), "Government Bodies Expenditure Analysis", "Provides detailed expenditure data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Expenditure Analysis " + viewRiksdagenMinistry.getNameId(), "Government Bodies Expenditure Analysis", "Provides detailed expenditure data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyExpenditureSummaryChart(panelContent, viewRiksdagenMinistry.getNameId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesHeadcountModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesHeadcountModContentFactoryImpl.java index e399404948..04589579bf 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesHeadcountModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesHeadcountModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Government Bodies Headcount " + viewRiksdagenMinistry.getNameId(), "Government Bodies Headcount", "Provides detailed headcount data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Government Bodies Headcount " + viewRiksdagenMinistry.getNameId(), "Government Bodies Headcount", "Provides detailed headcount data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyHeadcountSummaryChart(panelContent, viewRiksdagenMinistry.getNameId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesIncomeModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesIncomeModContentFactoryImpl.java index caf186350c..bdf313a6c9 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesIncomeModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryGovernmentBodiesIncomeModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Government Bodies Income " + viewRiksdagenMinistry.getNameId(), "Government Bodies Income", "Provides detailed income data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Bodies Income " + viewRiksdagenMinistry.getNameId(), "Government Bodies Income", "Provides detailed income data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyIncomeSummaryChart(panelContent, viewRiksdagenMinistry.getNameId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryMemberHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryMemberHistoryPageModContentFactoryImpl.java index d5bd844d22..655f28c8a2 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryMemberHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryMemberHistoryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Member History " + viewRiksdagenMinistry.getNameId(), "Member History", "Details the historical composition of ministry members."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Member History " + viewRiksdagenMinistry.getNameId(), "Member History", "Details the historical composition of ministry members."); final DataContainer govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryOverviewPageModContentFactoryImpl.java index e54c7f269b..da976bbc6d 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryOverviewPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Overview " + viewRiksdagenMinistry.getNameId(), "Ministry Details", @@ -98,7 +99,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); // Header layout - createCardHeader(cardContent,viewRiksdagenMinistry.getNameId()); + CardInfoRowUtil.createCardHeader(cardContent,viewRiksdagenMinistry.getNameId()); // Multi-column layout for attributes final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -107,41 +108,41 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Column 1: Basic Ministry Details - final VerticalLayout profileDetailsLayout = createSectionLayout("Ministry Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Ministry Profile"); - profileDetailsLayout.addComponent(createInfoRow("Ministry ID:", viewRiksdagenMinistry.getNameId(), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ministry ID:", viewRiksdagenMinistry.getNameId(), VaadinIcons.INFO_CIRCLE, "Ministry identifier")); - profileDetailsLayout.addComponent(createInfoRow("Status:", viewRiksdagenMinistry.isActive() ? "Active" : "Inactive", + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Status:", viewRiksdagenMinistry.isActive() ? "Active" : "Inactive", VaadinIcons.FLAG, "Current ministry status")); - profileDetailsLayout.addComponent(createInfoRow("Current Members:", String.valueOf(viewRiksdagenMinistry.getCurrentMemberSize()), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Current Members:", String.valueOf(viewRiksdagenMinistry.getCurrentMemberSize()), VaadinIcons.GROUP, "Number of current ministry members")); - profileDetailsLayout.addComponent(createInfoRow("Activity Level:", viewRiksdagenMinistry.getActivityLevel(), + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Activity Level:", viewRiksdagenMinistry.getActivityLevel(), VaadinIcons.CHART, "Ministry's current activity level")); // Column 2: Service Statistics - final VerticalLayout serviceStatsLayout = createSectionLayout("Service Statistics"); + final VerticalLayout serviceStatsLayout = CardInfoRowUtil.createSectionLayout("Service Statistics"); - serviceStatsLayout.addComponent(createInfoRow("Total Assignments:", String.valueOf(viewRiksdagenMinistry.getTotalAssignments()), + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Assignments:", String.valueOf(viewRiksdagenMinistry.getTotalAssignments()), VaadinIcons.TASKS, "Total number of assignments")); - serviceStatsLayout.addComponent(createInfoRow("First Assignment:", String.valueOf(viewRiksdagenMinistry.getFirstAssignmentDate()), + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("First Assignment:", String.valueOf(viewRiksdagenMinistry.getFirstAssignmentDate()), VaadinIcons.CALENDAR, "Date of first ministry assignment")); - serviceStatsLayout.addComponent(createInfoRow("Last Assignment:", String.valueOf(viewRiksdagenMinistry.getLastAssignmentDate()), + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Last Assignment:", String.valueOf(viewRiksdagenMinistry.getLastAssignmentDate()), VaadinIcons.CALENDAR_CLOCK, "Date of most recent assignment")); - serviceStatsLayout.addComponent(createInfoRow("Total Days Served:", String.valueOf(viewRiksdagenMinistry.getTotalDaysServed()), + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Days Served:", String.valueOf(viewRiksdagenMinistry.getTotalDaysServed()), VaadinIcons.CLOCK, "Total days of ministry service")); // Column 3: Document Statistics - final VerticalLayout documentStatsLayout = createSectionLayout("Document Statistics"); + final VerticalLayout documentStatsLayout = CardInfoRowUtil.createSectionLayout("Document Statistics"); - documentStatsLayout.addComponent(createInfoRow("Total Documents:", String.valueOf(viewRiksdagenMinistry.getTotalDocuments()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Documents:", String.valueOf(viewRiksdagenMinistry.getTotalDocuments()), VaadinIcons.FILE_TEXT, "Total number of ministry documents")); - documentStatsLayout.addComponent(createInfoRow("Documents Last Year:", String.valueOf(viewRiksdagenMinistry.getDocumentsLastYear()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Documents Last Year:", String.valueOf(viewRiksdagenMinistry.getDocumentsLastYear()), VaadinIcons.FILE_O, "Documents produced in the last year")); - documentStatsLayout.addComponent(createInfoRow("Avg Documents/Member:", String.format(Locale.ENGLISH,"%.1f", viewRiksdagenMinistry.getAvgDocumentsPerMember()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Avg Documents/Member:", String.format(Locale.ENGLISH,"%.1f", viewRiksdagenMinistry.getAvgDocumentsPerMember()), VaadinIcons.CHART_LINE, "Average documents per ministry member")); - documentStatsLayout.addComponent(createInfoRow("Total Propositions:", String.valueOf(viewRiksdagenMinistry.getTotalPropositions()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Propositions:", String.valueOf(viewRiksdagenMinistry.getTotalPropositions()), VaadinIcons.FILE_PRESENTATION, "Total number of propositions")); - documentStatsLayout.addComponent(createInfoRow("Government Bills:", String.valueOf(viewRiksdagenMinistry.getTotalGovernmentBills()), + documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Government Bills:", String.valueOf(viewRiksdagenMinistry.getTotalGovernmentBills()), VaadinIcons.FILE_TEXT_O, "Total number of government bills")); // Add all columns to the attributes layout diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryPageVisitHistoryPageModContentFactoryImpl.java index 578f075d8e..8e77e2593c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryPageVisitHistoryPageModContentFactoryImpl.java @@ -25,6 +25,7 @@ import com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Page Visit History " + viewRiksdagenMinistry.getNameId(), "Page Visit History", "Tracks and visualizes the history of page visits for ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Page Visit History " + viewRiksdagenMinistry.getNameId(), "Page Visit History", "Tracks and visualizes the history of page visits for ministries."); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllMinistriesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllMinistriesChartsPageModContentFactoryImpl.java index add4447e35..a7b56480ef 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllMinistriesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllMinistriesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.MinistryDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -68,7 +69,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "All Ministries", "Visual representation of all ministries and their total headcount."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "All Ministries", "Visual representation of all ministries and their total headcount."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllPartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllPartiesChartsPageModContentFactoryImpl.java index 73e783b1d1..6c79acd2f0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllPartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllPartiesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.MinistryDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -68,7 +69,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "All Parties", "Visual representation of all parties and their total days served."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "All Parties", "Visual representation of all parties and their total days served."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllRolesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllRolesChartsPageModContentFactoryImpl.java index e64b07f40c..2b56e973bb 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllRolesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingAllRolesChartsPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.MinistryGhantChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -64,7 +65,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "All Roles", "Visual representation of all government roles."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "All Roles", "Visual representation of all government roles."); final DataContainer govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java index d7dc552451..2b5854dbac 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.MinistryDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -65,7 +66,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Ministry Rankings", "Current Ministries", "Visual representation of current ministries and their total headcount."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "Current Ministries", "Visual representation of current ministries and their total headcount."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesChartsPageModContentFactoryImpl.java index 42c3bfc031..efe3288cfc 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -67,7 +68,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "Current Parties", "Visual representation of current parties and their headcount."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "Current Parties", "Visual representation of current parties and their headcount."); final HorizontalLayout chartLayout = new HorizontalLayout(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModContentFactoryImpl.java index 8e67ab1f6c..9a2acfaa3f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModContentFactoryImpl.java @@ -7,6 +7,7 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Service; @@ -24,6 +25,8 @@ import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualOutcomeSummary; import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.PoliticianLeaderboardUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -60,18 +63,16 @@ public final class MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModCon /** The Constant DISPLAYS_SIZE_XM_DEVICE. */ private static final int DISPLAYS_SIZE_XM_DEVICE = 6; - /** The Constant EXPENDITURE_GROUP_NAME. */ - private static final String EXPENDITURE_GROUP_NAME = "Utgiftsområdesnamn"; - - /** The Constant INKOMSTTITELGRUPPSNAMN. */ - private static final String INKOMSTTITELGRUPPSNAMN = "Inkomsttitelgruppsnamn"; - /** The Constant CURRENT_YEAR. */ private static final int CURRENT_YEAR = 2024; /** The esv api. */ private final EsvApi esvApi; + @Autowired + private PoliticianLeaderboardUtil politicianLeaderboardUtil; + + /** * Instantiates a new ministry ranking current parties leader scoreboard charts page mod content factory impl. * @@ -103,7 +104,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "Leader Scoreboard", + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "Leader Scoreboard", "Visual representation of ministry leaders and their performance."); final ResponsiveRow row = RowUtil.createGridLayout(panelContent); @@ -249,7 +250,7 @@ private Panel createBaseballStyleCard(ViewRiksdagenGovermentRoleMember govMember cardContent.setSizeFull(); cardPanel.setContent(cardContent); - createCardHeader(cardContent,govMember.getRoleCode() + " " + govMember.getFirstName() + " " + govMember.getLastName() + CardInfoRowUtil.createCardHeader(cardContent,govMember.getRoleCode() + " " + govMember.getFirstName() + " " + govMember.getLastName() + " (" + govMember.getParty() + ")"); cardContent.addComponent(getPageLinkFactory().createPoliticianPageLink(politician)); @@ -323,12 +324,12 @@ private Panel createBaseballStyleCard(ViewRiksdagenGovermentRoleMember govMember sectionsGrid.setWidth("100%"); // Add the four main sections - final VerticalLayout politicalRoleLayout = createSectionLayout("Political Role & Influence"); + final VerticalLayout politicalRoleLayout = CardInfoRowUtil.createSectionLayout("Political Role & Influence"); addPoliticalRoleMetrics(politicalRoleLayout, govMember, politician, ballotSummary, experienceSummary); sectionsGrid.addComponent(politicalRoleLayout); - final VerticalLayout performanceLayout = createSectionLayout("Parliamentary Performance"); - addParliamentaryPerformanceMetrics(performanceLayout, politician, ballotSummary); + final VerticalLayout performanceLayout = CardInfoRowUtil.createSectionLayout("Parliamentary Performance"); + politicianLeaderboardUtil.addParliamentaryPerformanceMetrics(performanceLayout, politician, ballotSummary); sectionsGrid.addComponent(performanceLayout); cardContent.addComponent(sectionsGrid); @@ -338,16 +339,16 @@ private Panel createBaseballStyleCard(ViewRiksdagenGovermentRoleMember govMember sections2Grid.setWidth("100%"); - final VerticalLayout legislativeLayout = createSectionLayout("Legislative Activity"); - addLegislativeMetrics(legislativeLayout, politician); + final VerticalLayout legislativeLayout = CardInfoRowUtil.createSectionLayout("Legislative Activity"); + politicianLeaderboardUtil.addLegislativeMetrics(legislativeLayout, politician); sections2Grid.addComponent(legislativeLayout); - final VerticalLayout alignmentLayout = createSectionLayout("Party Alignment"); - addPartyAlignmentMetrics(alignmentLayout, politician, ballotSummary); + final VerticalLayout alignmentLayout = CardInfoRowUtil.createSectionLayout("Party Alignment"); + politicianLeaderboardUtil.addPartyAlignmentMetrics(alignmentLayout, politician, ballotSummary); sections2Grid.addComponent(alignmentLayout); cardContent.addComponent(sections2Grid); - addMinistryRoleSummary(cardContent, govMember, governmentBodyByMinistry, reportByMinistry); + politicianLeaderboardUtil.addMinistryRoleSummary(cardContent, govMember, governmentBodyByMinistry, reportByMinistry); return cardPanel; } @@ -361,11 +362,9 @@ private Panel createBaseballStyleCard(ViewRiksdagenGovermentRoleMember govMember private boolean isPartyLeader(String personId) { final DataContainer partyRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyRoleMember.class); - final List partyRoles = partyRoleMemberDataContainer.findListByProperty( new Object[] { personId, Boolean.TRUE }, ViewRiksdagenPartyRoleMember_.personId, ViewRiksdagenPartyRoleMember_.active); - return partyRoles.stream().anyMatch(r -> "Partiledare".equalsIgnoreCase(r.getRoleCode())); } @@ -378,89 +377,13 @@ private boolean isPartyLeader(String personId) { private ViewRiksdagenPartyRoleMember getPartyLeaderRole(String personId) { final DataContainer partyRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyRoleMember.class); - final List partyRoles = partyRoleMemberDataContainer.findListByProperty( new Object[] { personId, Boolean.TRUE }, ViewRiksdagenPartyRoleMember_.personId, ViewRiksdagenPartyRoleMember_.active); - return partyRoles.stream().filter(r -> "Partiledare".equalsIgnoreCase(r.getRoleCode())).findFirst() .orElse(null); } - /** - * Adds the ministry role summary. - * - * @param cardLayout the card layout - * @param govMember the gov member - * @param governmentBodyByMinistry the government body by ministry - * @param reportByMinistry the report by ministry - */ - private void addMinistryRoleSummary(final VerticalLayout cardLayout, - final ViewRiksdagenGovermentRoleMember govMember, - final Map> governmentBodyByMinistry, - final Map> reportByMinistry) { - - cardLayout.addComponent(getPageLinkFactory().addMinistryPageLink(govMember.getDetail())); - - final List ministryBodies = governmentBodyByMinistry.get(govMember.getDetail()); - final int totalHeadCount = ministryBodies.stream().mapToInt(GovernmentBodyAnnualSummary::getAnnualWorkHeadCount) - .sum(); - - // Bodies count - final int bodyCount = ministryBodies.size(); - cardLayout.addComponent(createMetricRow(VaadinIcons.GROUP, - getPageLinkFactory().addMinistryGovermentBodiesPageLink(govMember.getDetail()), - "Number of government bodies", String.valueOf(bodyCount) // display the count separately - )); - - // Headcount - cardLayout.addComponent(createMetricRow(VaadinIcons.USER, - getPageLinkFactory().addMinistryGovermentBodiesHeadcountPageLink(govMember.getDetail()), - "Total headcount of government bodies", String.valueOf(totalHeadCount) // display the headcount - // separately - )); - - final List outcomeSummaries = reportByMinistry.get(govMember.getDetail()); - double currentYearIncome = 0; - double currentYearSpending = 0; - if (outcomeSummaries != null) { - final Map annualIncome = outcomeSummaries.stream() - .filter(t -> t.getDescriptionFields().get(INKOMSTTITELGRUPPSNAMN) != null) - .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, - Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); - - final Map annualSpending = outcomeSummaries.stream() - .filter(t -> t.getDescriptionFields().get(EXPENDITURE_GROUP_NAME) != null) - .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, - Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); - - if (annualIncome.get(CURRENT_YEAR) != null) { - currentYearIncome = annualIncome.get(CURRENT_YEAR) / 1000; - } - - if (annualSpending.get(CURRENT_YEAR) != null) { - currentYearSpending = annualSpending.get(CURRENT_YEAR) / 1000; - } - } - - // Income - final String incomeStr = String.format(Locale.ENGLISH,"%.2f B SEK", currentYearIncome); - cardLayout.addComponent(createMetricRow(VaadinIcons.ARROW_UP, - getPageLinkFactory().addMinistryGovermentBodiesIncomePageLink(govMember.getDetail()), - "Yearly Income (B SEK)", incomeStr // display income outside link - )); - - // Spending - final String spendingStr = String.format(Locale.ENGLISH,"%.2f B SEK", currentYearSpending); - cardLayout.addComponent( - createMetricRow(VaadinIcons.ARROW_DOWN, getPageLinkFactory().addMinistrGovermentBodiesSpendingPageLink( - govMember.getDetail()), "Yearly Spending (B SEK)", spendingStr // display - // spending - // outside - // link - )); - } - /** * Adds the political role metrics. @@ -474,181 +397,25 @@ private void addMinistryRoleSummary(final VerticalLayout cardLayout, private void addPoliticalRoleMetrics(VerticalLayout layout, ViewRiksdagenGovermentRoleMember govMember, ViewRiksdagenPolitician politician, ViewRiksdagenPoliticianBallotSummary ballotSummary, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { - layout.addComponent(createInfoRow("Current Role:", govMember.getRoleCode(), VaadinIcons.INSTITUTION, + layout.addComponent(CardInfoRowUtil.createInfoRow("Current Role:", govMember.getRoleCode(), VaadinIcons.INSTITUTION, "Current position in parliament")); - layout.addComponent(createInfoRow("Career Length:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Career Length:", String.format(Locale.ENGLISH,"%,d days", govMember.getTotalDaysServed()), VaadinIcons.TIMER, "Years in parliament")); - - layout.addComponent(createInfoRow("Total Propositions:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Total Propositions:", String.format(Locale.ENGLISH,"%,d", govMember.getTotalPropositions()), VaadinIcons.GROUP, "Total Propositions")); - layout.addComponent(createInfoRow("Total Government Bills:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Total Government Bills:", String.format(Locale.ENGLISH,"%,d", govMember.getTotalGovernmentBills()), VaadinIcons.GROUP, "Total Government Bills")); + politicianLeaderboardUtil.addTopRoles(layout, experienceSummary); + politicianLeaderboardUtil.addKnowledgeAreas(layout, experienceSummary); + politicianLeaderboardUtil.addExperienceMetrics(layout,experienceSummary); + politicianLeaderboardUtil.addPoliticalAnalysisComment(layout, experienceSummary); - // Top Roles - if (experienceSummary.getRoles() != null && !experienceSummary.getRoles().isEmpty()) { - final String topRoles = experienceSummary.getRoles().stream() - .filter(role -> role.getRole() != null && !role.getRole().equals("Other")) - .sorted((r1, r2) -> r2.getWeightedExp().compareTo(r1.getWeightedExp())) - .limit(3) - .map(role -> String.format(Locale.ENGLISH,"%s", - role.getRole())) - .collect(Collectors.joining(", ")); - - if (!topRoles.isEmpty()) { - layout.addComponent(createInfoRow("Key Political Roles:", - topRoles, - VaadinIcons.USERS, - "Most significant positions with weighted importance")); - } - } - - // Top Knowledge Areas - if (experienceSummary.getKnowledgeAreas() != null && !experienceSummary.getKnowledgeAreas().isEmpty()) { - final String topAreas = experienceSummary.getKnowledgeAreas().stream() - .filter(ka -> ka.getArea() != null && !ka.getArea().equals("Other")) - .sorted((ka1, ka2) -> ka2.getWeightedExp().compareTo(ka1.getWeightedExp())) - .limit(3) - .map(ka -> String.format(Locale.ENGLISH,"%s ", - ka.getArea())) - .collect(Collectors.joining(", ")); - - if (!topAreas.isEmpty()) { - layout.addComponent(createInfoRow("Key Policy Areas:", - topAreas, - VaadinIcons.CLIPBOARD_TEXT, - "Main areas of expertise with weighted importance")); - } - } - - - addExperienceMetrics(layout,experienceSummary); - - // Split the analysis points and create a bullet list - final String[] analysisPoints = experienceSummary.getPoliticalAnalysisComment().split("\\s*\\|\\|\\s*"); - final StringBuilder analys=new StringBuilder(); - for (final String point : analysisPoints) { - if (StringUtils.isNotBlank(point)) { - analys.append(" • ").append(point); - } - } - - // Political Analysis Comment - if (StringUtils.isNotBlank(experienceSummary.getPoliticalAnalysisComment())) { - layout.addComponent(createInfoRow("Analysis:", - analys.toString(), - VaadinIcons.COMMENT, - "Political career analysis")); - } - - } - - - /** - * Adds the experience metrics. - * - * @param layout the layout - * @param experienceSummary the experience summary - */ - private void addExperienceMetrics(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { - if (experienceSummary != null) { - // Career Overview - layout.addComponent(createInfoRow("Career Phase:", - experienceSummary.getCareerPhase().toString().replace("_", " "), - VaadinIcons.CALENDAR_CLOCK, - "Current career stage")); - - // Experience Level - layout.addComponent(createInfoRow("Experience Level:", - experienceSummary.getExperienceLevel().toString().replace("_", " "), - VaadinIcons.CHART_TIMELINE, - "Overall political experience classification")); - - // Leadership Profile - layout.addComponent(createInfoRow("Leadership Role:", - experienceSummary.getLeadershipProfile().toString().replace("_", " "), - VaadinIcons.USER_STAR, - "Leadership experience level")); - - // Specialization - layout.addComponent(createInfoRow("Expertise:", - experienceSummary.getSpecializationLevel().toString().replace("_", " "), - VaadinIcons.SPECIALIST, - "Area of specialization")); - - - } - } - - - /** - * Adds the parliamentary performance metrics. - * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary - */ - private void addParliamentaryPerformanceMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent( - createInfoRow("Attendance Rate:", String.format(Locale.ENGLISH,"%.1f%%", 100 - (ballotSummary != null ? ballotSummary.getAbsenceRate() : 0.0)), - VaadinIcons.USER_CHECK, "Session attendance rate")); - layout.addComponent(createInfoRow("Voting Success:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary != null ? ballotSummary.getSuccessRate() : 0.0), - VaadinIcons.TROPHY, "Votes on winning side")); - layout.addComponent(createInfoRow("Activity Level:", politician.getDocActivityLevel(), VaadinIcons.CHART_LINE, - "Overall engagement level")); - layout.addComponent( - createInfoRow("Influence Score:", String.format(Locale.ENGLISH,"%.1f", ballotSummary.getVotingConsistencyScore()), - VaadinIcons.CHART_GRID, "Overall parliamentary influence")); - - } - - /** - * Adds the legislative metrics. - * - * @param layout the layout - * @param politician the politician - */ - private void addLegislativeMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician) { - - layout.addComponent(createInfoRow("Documents/Year:", String.format(Locale.ENGLISH,"%.1f", politician.getAverageDocsPerYear()), - VaadinIcons.FILE_TEXT, "Average documents per year")); - layout.addComponent(createInfoRow("Individual Motions:", String.valueOf(politician.getIndividualMotions()), - VaadinIcons.USER, "Personal motions submitted")); - layout.addComponent(createInfoRow("Party Motions:", String.valueOf(politician.getPartyMotions()), - VaadinIcons.GROUP, "Party-based motions")); - layout.addComponent(createInfoRow("Committee Motions:", String.valueOf(politician.getCommitteeMotions()), - VaadinIcons.GROUP, "Committee-based motions")); - layout.addComponent(createInfoRow("Document Impact:", politician.getDocActivityProfile(), VaadinIcons.CHART_3D, - "Legislative influence assessment")); - } - - /** - * Adds the party alignment metrics. - * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary - */ - private void addPartyAlignmentMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent(createInfoRow("Party Loyalty:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary != null ? ballotSummary.getLoyaltyRate() : 0.0), - VaadinIcons.GROUP, "Party line adherence")); - layout.addComponent(createInfoRow("Independence Rate:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary != null ? ballotSummary.getRebelRate() : 0.0), - VaadinIcons.RANDOM, "Votes against party line")); - layout.addComponent(createInfoRow("Cross-Party Collaboration:", - String.format(Locale.ENGLISH,"%.1f%%", politician.getCollaborationPercentage()), VaadinIcons.CONNECT, - "Inter-party cooperation")); - layout.addComponent(createInfoRow("Multi-Party Motions:", String.valueOf(politician.getMultiPartyMotions()), - VaadinIcons.USERS, "Cross-party legislative initiatives")); } - /** * Matches. * diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingDataGridPageModContentFactoryImpl.java index 6948a0272c..5e937ff882 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingDataGridPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -80,7 +81,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Ministry Ranking Dashboard", "Ministry Rankings", "Compare ministry rankings to assess their assignments, performance, and overall impact."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Ranking Dashboard", "Ministry Rankings", "Compare ministry rankings to assess their assignments, performance, and overall impact."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java index cf09260175..dd1140bcd5 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -58,7 +59,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Bodies", "Government Body Headcount", "Provides detailed headcount data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Bodies", "Government Body Headcount", "Provides detailed headcount data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyHeadcountSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyExpenditurePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyExpenditurePageModContentFactoryImpl.java index a27422c6db..74853ae0a1 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyExpenditurePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyExpenditurePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Bodies Expenditure", "Government Body Expenditure", "Provides detailed expenditure data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Bodies Expenditure", "Government Body Expenditure", "Provides detailed expenditure data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyExpenditureSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyIncomePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyIncomePageModContentFactoryImpl.java index b0b10c7b8e..1ce577099f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyIncomePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentBodyIncomePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Bodies Income", "Government Body Income", "Provides detailed income data for government bodies under ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Bodies Income", "Government Body Income", "Provides detailed income data for government bodies under ministries."); governmentBodyChartDataManager.createMinistryGovernmentBodyIncomeSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentOutcomePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentOutcomePageModContentFactoryImpl.java index 85f8992866..458bc99d70 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentOutcomePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingGovernmentOutcomePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentOutcomeChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Ranking - Government Outcomes", "Evaluating Results", "Evaluating ministry influence on governance results."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingOverviewPageModContentFactoryImpl.java index 0bb1b058ea..0a8a2735e9 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -51,7 +52,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Ministry Rankings", "Ranking Overview", "Evaluate and compare the performance of various ministries."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "Ranking Overview", "Evaluate and compare the performance of various ministries."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingPageVisitHistoryPageModContentFactoryImpl.java index c23cb07258..6454b78508 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -54,7 +55,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Ministry Rankings", "Page Visit History", "Tracks and visualizes the history of page visits for ministry rankings."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Rankings", "Page Visit History", "Tracks and visualizes the history of page visits for ministry rankings."); getAdminChartDataManager().createApplicationActionEventPageModeDailySummaryChart(panelContent,NAME); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRoleGhantPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRoleGhantPageModContentFactoryImpl.java index 5634f56482..610681b59f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRoleGhantPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/goverment/pagemode/MinistryRoleGhantPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.MinistryGhantChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.MinistryPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -64,7 +65,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenMinistry viewRiksdagenMinistry = getItem(parameters); getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Ministry Role Ghant " + viewRiksdagenMinistry.getNameId(), "Role Ghant", "Visual representation of ministry roles over time."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Ministry Role Ghant " + viewRiksdagenMinistry.getNameId(), "Role Ghant", "Visual representation of ministry roles over time."); final DataContainer govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyExpenditurePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyExpenditurePageModContentFactoryImpl.java index 4cba05f4fe..546346750c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyExpenditurePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyExpenditurePageModContentFactoryImpl.java @@ -29,6 +29,7 @@ import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -67,7 +68,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (governmentBodyAnnualSummary != null) { getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId,governmentBodyAnnualSummary.getName()); - createPageHeader(panel, panelContent, "Government Body Expenditure " + governmentBodyAnnualSummary.getName(), "Expenditure Details", "Explore detailed expenditure information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Expenditure " + governmentBodyAnnualSummary.getName(), "Expenditure Details", "Explore detailed expenditure information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyExpenditureSummaryChart(panelContent, governmentBodyAnnualSummary.getName()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyHeadcountPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyHeadcountPageModContentFactoryImpl.java index 00a1b99a5b..071457c4d8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyHeadcountPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyHeadcountPageModContentFactoryImpl.java @@ -29,6 +29,7 @@ import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -65,7 +66,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (governmentBodyAnnualSummary != null) { getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId,governmentBodyAnnualSummary.getName()); - createPageHeader(panel, panelContent, "Government Body Headcount " + governmentBodyAnnualSummary.getName(), "Headcount Details", "Explore detailed headcount information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Headcount " + governmentBodyAnnualSummary.getName(), "Headcount Details", "Explore detailed headcount information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyHeadcountSummaryChart(panelContent, governmentBodyAnnualSummary.getName()); } getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME, diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyIncomePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyIncomePageModContentFactoryImpl.java index 386cb054f3..2f519ff8b3 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyIncomePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyIncomePageModContentFactoryImpl.java @@ -29,6 +29,7 @@ import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -66,7 +67,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (governmentBodyAnnualSummary != null) { getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId,governmentBodyAnnualSummary.getName()); - createPageHeader(panel, panelContent, "Government Body Income " + governmentBodyAnnualSummary.getName(), "Income Details", "Explore detailed income information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Income " + governmentBodyAnnualSummary.getName(), "Income Details", "Explore detailed income information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyIncomeSummaryChart(panelContent, governmentBodyAnnualSummary.getName()); } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyOverviewPageModContentFactoryImpl.java index cedf8a8e5d..d9ec406b28 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyOverviewPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; @@ -66,7 +67,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId, governmentBodyAnnualSummary.getName()); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Overview " + governmentBodyAnnualSummary.getName(), "Government Details", "Explore detailed information about government bodies and their functions."); @@ -87,7 +88,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - createCardHeader(cardContent,"Government Body Information"); + CardInfoRowUtil.createCardHeader(cardContent,"Government Body Information"); // Two-column layout final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -96,28 +97,28 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Organization Profile - final VerticalLayout profileDetailsLayout = createSectionLayout("Organization Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Organization Profile"); // Add fields for Organization Profile - profileDetailsLayout.addComponent(createInfoRow("Name:", governmentBodyAnnualSummary.getName(), VaadinIcons.INFO_CIRCLE, "Government body name")); - profileDetailsLayout.addComponent(createInfoRow("ID:", governmentBodyAnnualSummary.getGovermentBodyId(), VaadinIcons.CLIPBOARD_USER, "Unique government body identifier")); - profileDetailsLayout.addComponent(createInfoRow("Ministry:", governmentBodyAnnualSummary.getMinistry(), VaadinIcons.INSTITUTION, "Ministry overseeing the body")); - profileDetailsLayout.addComponent(createInfoRow("Org Number:", governmentBodyAnnualSummary.getOrgNumber(), VaadinIcons.BOOK, "Official organization number")); - profileDetailsLayout.addComponent(createInfoRow("M Code:", governmentBodyAnnualSummary.getmCode(), VaadinIcons.CODE, "Internal M code identifier")); - profileDetailsLayout.addComponent(createInfoRow("VAT:", governmentBodyAnnualSummary.getVat(), VaadinIcons.MONEY, "VAT number")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Name:", governmentBodyAnnualSummary.getName(), VaadinIcons.INFO_CIRCLE, "Government body name")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("ID:", governmentBodyAnnualSummary.getGovermentBodyId(), VaadinIcons.CLIPBOARD_USER, "Unique government body identifier")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ministry:", governmentBodyAnnualSummary.getMinistry(), VaadinIcons.INSTITUTION, "Ministry overseeing the body")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Org Number:", governmentBodyAnnualSummary.getOrgNumber(), VaadinIcons.BOOK, "Official organization number")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("M Code:", governmentBodyAnnualSummary.getmCode(), VaadinIcons.CODE, "Internal M code identifier")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("VAT:", governmentBodyAnnualSummary.getVat(), VaadinIcons.MONEY, "VAT number")); // Right column: Annual Statistics - final VerticalLayout serviceStatsLayout = createSectionLayout("Annual Statistics"); + final VerticalLayout serviceStatsLayout = CardInfoRowUtil.createSectionLayout("Annual Statistics"); // Add fields for Annual Statistics - serviceStatsLayout.addComponent(createInfoRow("Year:", String.valueOf(governmentBodyAnnualSummary.getYear()), VaadinIcons.CALENDAR, "The reporting year")); - serviceStatsLayout.addComponent(createInfoRow("Annual Work Head Count:", String.valueOf(governmentBodyAnnualSummary.getAnnualWorkHeadCount()), VaadinIcons.USER_CHECK, "Annual average number of full-time equivalents")); - serviceStatsLayout.addComponent(createInfoRow("Head Count:", String.valueOf(governmentBodyAnnualSummary.getHeadCount()), VaadinIcons.GROUP, "Total number of staff members")); - serviceStatsLayout.addComponent(createInfoRow("Consecutive Number:", String.valueOf(governmentBodyAnnualSummary.getConsecutiveNumber()), VaadinIcons.LINES_LIST, "Internal consecutive reference number")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Year:", String.valueOf(governmentBodyAnnualSummary.getYear()), VaadinIcons.CALENDAR, "The reporting year")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Annual Work Head Count:", String.valueOf(governmentBodyAnnualSummary.getAnnualWorkHeadCount()), VaadinIcons.USER_CHECK, "Annual average number of full-time equivalents")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Head Count:", String.valueOf(governmentBodyAnnualSummary.getHeadCount()), VaadinIcons.GROUP, "Total number of staff members")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Consecutive Number:", String.valueOf(governmentBodyAnnualSummary.getConsecutiveNumber()), VaadinIcons.LINES_LIST, "Internal consecutive reference number")); // If comment is short and informative, display it if (governmentBodyAnnualSummary.getComment() != null && !governmentBodyAnnualSummary.getComment().isEmpty()) { - serviceStatsLayout.addComponent(createInfoRow("Comment:", governmentBodyAnnualSummary.getComment(), VaadinIcons.COMMENT_ELLIPSIS, "Additional remarks or notes")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Comment:", governmentBodyAnnualSummary.getComment(), VaadinIcons.COMMENT_ELLIPSIS, "Additional remarks or notes")); } attributesLayout.addComponents(profileDetailsLayout, serviceStatsLayout); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyPageVisitHistoryPageModContentFactoryImpl.java index 387ba6d99f..703b458d54 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -58,7 +59,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId,pageId); - createPageHeader(panel, panelContent, "Government Body Page Visit History", "Page Visit History", "Track the visit history of government body pages."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Page Visit History", "Page Visit History", "Track the visit history of government body pages."); getAdminChartDataManager().createApplicationActionEventPageModeDailySummaryChart(panelContent,NAME); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingDataGridPageModContentFactoryImpl.java index be29b4dc46..613486fef7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingDataGridPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.service.external.esv.api.EsvApi; import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -76,7 +77,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getGovernmentBodyRankingMenuItemFactory().createGovernmentBodyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Government Body Ranking Overview", "Government Body Rankings", "Examine rankings of government bodies based on roles, efficiency, and achievements."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Ranking Overview", "Government Body Rankings", "Examine rankings of government bodies based on roles, efficiency, and achievements."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingExpenditurePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingExpenditurePageModContentFactoryImpl.java index e5eacb900a..b02ff16883 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingExpenditurePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingExpenditurePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Body Expenditure", "Expenditure Details", "Explore detailed expenditure information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Expenditure", "Expenditure Details", "Explore detailed expenditure information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyExpenditureSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingHeadCountPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingHeadCountPageModContentFactoryImpl.java index 52573d7a79..5f90abc044 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingHeadCountPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingHeadCountPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Body Headcount", "Headcount Details", "Explore detailed headcount information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Headcount", "Headcount Details", "Explore detailed headcount information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyHeadcountSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingIncomePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingIncomePageModContentFactoryImpl.java index c6405ddf73..7750097d89 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingIncomePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingIncomePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.GovernmentBodyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.GovernmentBodyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Body Income", "Income Details", "Explore detailed income information for government bodies."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Income", "Income Details", "Explore detailed income information for government bodies."); governmentBodyChartDataManager.createGovernmentBodyIncomeSummaryChart(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingOverviewPageModContentFactoryImpl.java index dfd4432918..685f7bca77 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -51,7 +52,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getGovernmentBodyRankingMenuItemFactory().createGovernmentBodyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Government Body Rankings", "Ranking Overview", "Analyze and rank government bodies based on predefined metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Rankings", "Ranking Overview", "Analyze and rank government bodies based on predefined metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingPageVisitHistoryPageModContentFactoryImpl.java index 551720ed55..46e4061f7f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/govermentbody/pagemode/GovernmentBodyRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -58,7 +59,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Government Body Ranking Page Visit History", "Page Visit History", "Track the visit history of government body ranking pages."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Body Ranking Page Visit History", "Page Visit History", "Track the visit history of government body ranking pages."); getAdminChartDataManager().createApplicationActionEventPageModeDailySummaryChart(panelContent,NAME); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationEventsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationEventsPageModContentFactoryImpl.java index 190286d8cf..ab69558416 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationEventsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationEventsPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.UserHomeMenuItemFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserHomePageMode; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -83,7 +84,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (userAccount.isPresent()) { userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::User Events",USER_EVENTS,"All past user events"); + CardInfoRowUtil.createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::User Events",USER_EVENTS,"All past user events"); final DataContainer eventDataContainer = getApplicationManager() .getDataContainer(ApplicationActionEvent.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationSessionsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationSessionsPageModContentFactoryImpl.java index 192b0b92f8..8faa341b21 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationSessionsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeApplicationSessionsPageModContentFactoryImpl.java @@ -32,6 +32,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.converters.ListPropertyConverter; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.UserHomeMenuItemFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserHomePageMode; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -85,7 +86,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (userAccount.isPresent()) { userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::User Visits",USER_VISITS,"All past user visits"); + CardInfoRowUtil.createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::User Visits",USER_VISITS,"All past user visits"); final DataContainer sessionDataContainer = getApplicationManager() .getDataContainer(ApplicationSession.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeOverviewPageModContentFactoryImpl.java index 8e94249c6c..0c1a652658 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeOverviewPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.service.api.action.application.LogoutRequest; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.UserHomeMenuItemFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.LogoutClickListener; @@ -87,7 +88,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::Overview",OVERVIEW,"Manage user and security settings"); + CardInfoRowUtil.createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::Overview",OVERVIEW,"Manage user and security settings"); // Logout button final Button logoutButton = new Button(LOGOUT, VaadinIcons.SIGN_OUT); @@ -112,7 +113,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - createCardHeader(cardContent,"User Account Information"); + CardInfoRowUtil.createCardHeader(cardContent,"User Account Information"); // Two-column layout for user attributes final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -121,22 +122,22 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Basic Profile - final VerticalLayout profileLayout = createSectionLayout("Profile Details"); + final VerticalLayout profileLayout = CardInfoRowUtil.createSectionLayout("Profile Details"); // Display key fields from user account in Profile Details final UserAccount account = userAccount.get(); - profileLayout.addComponent(createInfoRow("Username:", account.getUsername(), VaadinIcons.USER, "Your unique username")); - profileLayout.addComponent(createInfoRow("Email:", account.getEmail(), VaadinIcons.ENVELOPE_O, "Your registered email address")); - profileLayout.addComponent(createInfoRow("Country:", account.getCountry(), VaadinIcons.GLOBE, "Country of residence")); - profileLayout.addComponent(createInfoRow("Created Date:", String.valueOf(account.getCreatedDate()), VaadinIcons.CALENDAR, "Date when the account was created")); + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Username:", account.getUsername(), VaadinIcons.USER, "Your unique username")); + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Email:", account.getEmail(), VaadinIcons.ENVELOPE_O, "Your registered email address")); + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Country:", account.getCountry(), VaadinIcons.GLOBE, "Country of residence")); + profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Created Date:", String.valueOf(account.getCreatedDate()), VaadinIcons.CALENDAR, "Date when the account was created")); // Right column: Status & Statistics - final VerticalLayout statusLayout = createSectionLayout("Status & Statistics"); + final VerticalLayout statusLayout = CardInfoRowUtil.createSectionLayout("Status & Statistics"); - statusLayout.addComponent(createInfoRow("User Type:", account.getUserType().toString(), VaadinIcons.INFO_CIRCLE, "Type of user account")); - statusLayout.addComponent(createInfoRow("User Role:", account.getUserRole().toString(), VaadinIcons.USER_CHECK, "Your assigned role in the system")); - statusLayout.addComponent(createInfoRow("Email Status:", account.getUserEmailStatus().toString(), VaadinIcons.ENVELOPE, "Status of email verification")); - statusLayout.addComponent(createInfoRow("Number of Visits:", String.valueOf(account.getNumberOfVisits()), VaadinIcons.CHART, "How many times you have visited")); + statusLayout.addComponent(CardInfoRowUtil.createInfoRow("User Type:", account.getUserType().toString(), VaadinIcons.INFO_CIRCLE, "Type of user account")); + statusLayout.addComponent(CardInfoRowUtil.createInfoRow("User Role:", account.getUserRole().toString(), VaadinIcons.USER_CHECK, "Your assigned role in the system")); + statusLayout.addComponent(CardInfoRowUtil.createInfoRow("Email Status:", account.getUserEmailStatus().toString(), VaadinIcons.ENVELOPE, "Status of email verification")); + statusLayout.addComponent(CardInfoRowUtil.createInfoRow("Number of Visits:", String.valueOf(account.getNumberOfVisits()), VaadinIcons.CHART, "How many times you have visited")); attributesLayout.addComponents(profileLayout, statusLayout); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeSecuritySettingsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeSecuritySettingsPageModContentFactoryImpl.java index 987d475379..50f29a4116 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeSecuritySettingsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/home/pagemode/UserHomeSecuritySettingsPageModContentFactoryImpl.java @@ -34,6 +34,7 @@ import com.hack23.cia.service.api.action.user.SetGoogleAuthenticatorCredentialRequest; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.UserHomeMenuItemFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserHomePageMode; @@ -120,7 +121,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::Security Settings",SECURITY_SETTINGS,"Manage user security settings"); + CardInfoRowUtil.createPageHeader(panel, panelContent,"CitizenIntelligence Agency::UserHome::Security Settings",SECURITY_SETTINGS,"Manage user security settings"); final VerticalLayout overviewLayout = new VerticalLayout(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDecisionActivityByTypePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDecisionActivityByTypePageModContentFactoryImpl.java index 59fe323b53..417a38471c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDecisionActivityByTypePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDecisionActivityByTypePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.DecisionChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Decision Activity by Type", "Policy Priorities", "Comparing legislative outputs to reveal policy priorities."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDocumentActivityByTypePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDocumentActivityByTypePageModContentFactoryImpl.java index 9aa7c78207..2949300291 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDocumentActivityByTypePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsDocumentActivityByTypePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.DocumentChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -57,7 +58,7 @@ public ParliamentChartsDocumentActivityByTypePageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Document Activity by Type", "Information Dynamics", "Uncovering how information shapes legislative agendas."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyAgePageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyAgePageModContentFactoryImpl.java index fe11b8a089..3e0dae3a5a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyAgePageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyAgePageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -55,7 +56,7 @@ public ParliamentChartsPartyAgePageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Party Age Dynamics", "Generational Shifts", "Examining generational shifts influencing governance."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyGenderPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyGenderPageModContentFactoryImpl.java index 759fe2c5b7..699dce16ac 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyGenderPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyGenderPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -56,7 +57,7 @@ public ParliamentChartsPartyGenderPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Party Gender Analysis", "Representation Patterns", "Assessing representation and inclusive leadership patterns."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyWinnerPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyWinnerPageModContentFactoryImpl.java index 7c33ff0d31..72c788835a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyWinnerPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentChartsPartyWinnerPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; @@ -56,7 +57,7 @@ public ParliamentChartsPartyWinnerPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Party Winner Charts", "Prevailing Forces", "Identifying parties prevailing in legislative contests."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentDecisionFlowPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentDecisionFlowPageModContentFactoryImpl.java index e557964a7a..f889e72bfe 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentDecisionFlowPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentDecisionFlowPageModContentFactoryImpl.java @@ -37,6 +37,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.common.chartfactory.api.DecisionFlowChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -127,7 +128,7 @@ private static List createAvailableYears() { */ private void setupMenuAndHeader(MenuBar menuBar, Panel panel, VerticalLayout panelContent) { getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, TITLE, SUBTITLE, DESCRIPTION); + CardInfoRowUtil.createPageHeader(panel, panelContent, TITLE, SUBTITLE, DESCRIPTION); } /** diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentOverviewPageModContentFactoryImpl.java index dc689ed690..2a2fd7e8ec 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -48,7 +49,7 @@ public ParliamentOverviewPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, "Parliament Overview", "Parliament Details", "Insights into parliamentary structure, members, and activities."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament Overview", "Parliament Details", "Insights into parliamentary structure, members, and activities."); getParliamentMenuItemFactory().createOverviewPage(panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentPageVisitHistoryPageModContentFactoryImpl.java index d259406e20..841f613b2d 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Page Visit History", "Engagement Over Time", "Tracing shifts in engagement with legislative proceedings."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRiskPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRiskPageModContentFactoryImpl.java index e51532c441..8a6b7f6538 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRiskPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRiskPageModContentFactoryImpl.java @@ -37,6 +37,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.RiskIndicators; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ComplianceCheckPageItemRendererClickListener; @@ -67,7 +68,7 @@ public ParliamentRiskPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Risk Assessment", "Identifying Vulnerabilities", "Identifying institutional vulnerabilities and threats."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRuleViolationsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRuleViolationsPageModContentFactoryImpl.java index bb854f185a..ccc8af88ea 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRuleViolationsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/parliament/pagemode/ParliamentRuleViolationsPageModContentFactoryImpl.java @@ -36,6 +36,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.RiskIndicators; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RuleViolationPageItemRendererClickListener; @@ -67,7 +68,7 @@ public ParliamentRuleViolationsPageModContentFactoryImpl() { public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Parliament - Rule Violations", "Procedural Oversight", "Highlighting procedural breaches and oversight challenges."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCoalitionsAgainstAnnualSummaryChartPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCoalitionsAgainstAnnualSummaryChartPageModContentFactoryImpl.java index 0869f29b09..8bd9e74e45 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCoalitionsAgainstAnnualSummaryChartPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCoalitionsAgainstAnnualSummaryChartPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyCoalationChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Party Coalitions Against " + viewRiksdagenParty.getPartyName(), "Party Coalitions", "Review the summary of party coalitions against the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Coalitions Against " + viewRiksdagenParty.getPartyName(), "Party Coalitions", "Review the summary of party coalitions against the selected party."); chartDataManager.createPartyChart(panelContent,pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeBallotDecisionSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeBallotDecisionSummaryPageModContentFactoryImpl.java index c8d13ac87f..99b029aa1e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeBallotDecisionSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeBallotDecisionSummaryPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -92,7 +93,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Ballot Decision Summary " + viewRiksdagenParty.getPartyName(), "Ballot Decisions", "Review the summary of committee ballot decisions for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Ballot Decision Summary " + viewRiksdagenParty.getPartyName(), "Ballot Decisions", "Review the summary of committee ballot decisions for the selected party."); final DataContainer committeeBallotDecisionPartyDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeBallotDecisionPartySummary.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeRolesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeRolesPageModContentFactoryImpl.java index fe586bc76b..53e843f53e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeRolesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCommitteeRolesPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -66,7 +67,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Committee Roles " +viewRiksdagenParty.getPartyName(), "Committee Members", "Explore the roles and members of various committees within the party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Roles " +viewRiksdagenParty.getPartyName(), "Committee Members", "Explore the roles and members of various committees within the party."); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentLeadersPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentLeadersPageModContentFactoryImpl.java index 6c1cd457fd..8891c14750 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentLeadersPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentLeadersPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -65,7 +66,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Current Leaders " + viewRiksdagenParty.getPartyName(), "Party Leadership", "Meet the current leaders of the party and their roles."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Current Leaders " + viewRiksdagenParty.getPartyName(), "Party Leadership", "Meet the current leaders of the party and their roles."); final DataContainer partyRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentMembersPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentMembersPageModContentFactoryImpl.java index b469990b7d..e9fca9751e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentMembersPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyCurrentMembersPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -77,7 +78,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Current Members " +viewRiksdagenParty.getPartyName(), "Party Members", "Discover the current members of the party and their roles."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Current Members " +viewRiksdagenParty.getPartyName(), "Party Members", "Discover the current members of the party and their roles."); final DataContainer politicianDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPolitician.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentActivityPageModContentFactoryImpl.java index c190f78bb1..483916ba97 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentActivityPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyDocumentChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Document Activity " + viewRiksdagenParty.getPartyName(), "Document Activity details", "Review the summary of document activity for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Activity " + viewRiksdagenParty.getPartyName(), "Document Activity details", "Review the summary of document activity for the selected party."); documentChartDataManager.createDocumentHistoryPartyChart(panelContent, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentHistoryPageModContentFactoryImpl.java index 69f8a5db9a..e853d81d23 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyDocumentHistoryPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -66,7 +67,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Document History " + viewRiksdagenParty.getPartyName(), "Historical Documents", "Explore the historical documents associated with the party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Document History " + viewRiksdagenParty.getPartyName(), "Historical Documents", "Explore the historical documents associated with the party."); final DataContainer politicianDocumentDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPoliticianDocument.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyGovernmentRolesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyGovernmentRolesPageModContentFactoryImpl.java index 7ea7033ed6..508ddde8c7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyGovernmentRolesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyGovernmentRolesPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -65,7 +66,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Government Roles " + viewRiksdagenParty.getPartyName(), "Government Members", "Explore the roles and members of the government within the party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Government Roles " + viewRiksdagenParty.getPartyName(), "Government Members", "Explore the roles and members of the government within the party."); final DataContainer govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyLeaderHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyLeaderHistoryPageModContentFactoryImpl.java index b9524f7e3f..f3f22f088d 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyLeaderHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyLeaderHistoryPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -64,7 +65,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Leader History " + viewRiksdagenParty.getPartyName(), "Party Leaders", "Explore the history of party leaders and their roles."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Leader History " + viewRiksdagenParty.getPartyName(), "Party Leaders", "Explore the history of party leaders and their roles."); final DataContainer partyRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyMemberHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyMemberHistoryPageModContentFactoryImpl.java index 7bd06f347b..c564a5c96b 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyMemberHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyMemberHistoryPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -83,7 +84,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Member History " + viewRiksdagenParty.getPartyName(), "Party Members", "Explore the history of party members and their roles."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Member History " + viewRiksdagenParty.getPartyName(), "Party Members", "Explore the history of party members and their roles."); final DataContainer partyMembernDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyOverviewPageModContentFactoryImpl.java index 1ec2ff2fda..1880fb03b6 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyOverviewPageModContentFactoryImpl.java @@ -29,6 +29,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.icons.VaadinIcons; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Party Overview " + viewRiksdagenParty.getPartyName(), + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Overview " + viewRiksdagenParty.getPartyName(), "Party Details", "Explore detailed information about political parties and their activities."); final Link addPartyPageLink = getPageLinkFactory().addPartyPageLink(viewRiksdagenParty); @@ -99,7 +100,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - createCardHeader(cardContent,viewRiksdagenParty.getPartyName()); + CardInfoRowUtil.createCardHeader(cardContent,viewRiksdagenParty.getPartyName()); // Create single row for four sections final HorizontalLayout sectionsLayout = new HorizontalLayout(); @@ -108,25 +109,25 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(sectionsLayout); // 1. Political Influence & Position - final VerticalLayout politicalInfluenceLayout = createSectionLayout("Political Influence & Position"); + final VerticalLayout politicalInfluenceLayout = CardInfoRowUtil.createSectionLayout("Political Influence & Position"); addPoliticalInfluenceMetrics(politicalInfluenceLayout, viewRiksdagenParty, viewRiksdagenPartySummary); sectionsLayout.addComponent(politicalInfluenceLayout); sectionsLayout.setExpandRatio(politicalInfluenceLayout, 1.0f); // 2. Parliamentary Engagement - final VerticalLayout parliamentaryEngagementLayout = createSectionLayout("Parliamentary Engagement"); + final VerticalLayout parliamentaryEngagementLayout = CardInfoRowUtil.createSectionLayout("Parliamentary Engagement"); addParliamentaryEngagementMetrics(parliamentaryEngagementLayout, viewRiksdagenParty, viewRiksdagenPartySummary); sectionsLayout.addComponent(parliamentaryEngagementLayout); sectionsLayout.setExpandRatio(parliamentaryEngagementLayout, 1.0f); // 3. Legislative Impact - final VerticalLayout legislativeImpactLayout = createSectionLayout("Legislative Impact"); + final VerticalLayout legislativeImpactLayout = CardInfoRowUtil.createSectionLayout("Legislative Impact"); addLegislativeImpactMetrics(legislativeImpactLayout, viewRiksdagenParty, viewRiksdagenPartySummary); sectionsLayout.addComponent(legislativeImpactLayout); sectionsLayout.setExpandRatio(legislativeImpactLayout, 1.0f); // 4. Member Performance - final VerticalLayout memberPerformanceLayout = createSectionLayout("Member Performance"); + final VerticalLayout memberPerformanceLayout = CardInfoRowUtil.createSectionLayout("Member Performance"); addMemberPerformanceMetrics(memberPerformanceLayout, viewRiksdagenParty, viewRiksdagenPartySummary); sectionsLayout.addComponent(memberPerformanceLayout); sectionsLayout.setExpandRatio(memberPerformanceLayout, 1.0f); @@ -159,29 +160,29 @@ private void addPoliticalInfluenceMetrics(VerticalLayout layout, if (summary != null) { // Government Influence - layout.addComponent(createInfoRow("Government Position:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Government Position:", summary.isActiveGovernment() ? "In Government" : "Opposition", VaadinIcons.INSTITUTION, "Current position in government")); - layout.addComponent(createInfoRow("Ministers:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Ministers:", String.valueOf(summary.getCurrentMinistryAssignments()), VaadinIcons.GROUP, "Current ministerial positions")); // Parliamentary Strength - layout.addComponent(createInfoRow("Parliament Members:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Parliament Members:", String.valueOf(party.getHeadCount()), VaadinIcons.USERS, "Total number of parliament members")); - layout.addComponent(createInfoRow("Committee Positions:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Committee Positions:", String.valueOf(summary.getCurrentCommitteeAssignments()), VaadinIcons.CLIPBOARD_USER, "Current committee assignments")); // Leadership Roles - layout.addComponent(createInfoRow("Leadership Positions:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Leadership Positions:", String.valueOf(summary.getCurrentCommitteeLeadershipAssignments()), VaadinIcons.STAR, "Current committee leadership roles")); @@ -202,24 +203,24 @@ private void addParliamentaryEngagementMetrics(VerticalLayout layout, if (summary != null) { // Active Participation - layout.addComponent(createInfoRow("Parliament Activity:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Parliament Activity:", String.format(Locale.ENGLISH,"%.1f%%", calculateActivityRate(summary.getTotalActiveParliament(), party.getHeadCount())), VaadinIcons.CHART_LINE, "Percentage of active members in parliament")); // Committee Engagement - layout.addComponent(createInfoRow("Committee Involvement:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Committee Involvement:", String.valueOf(summary.getTotalActiveCommittee()), VaadinIcons.USERS, "Members active in committees")); // Historical Presence - layout.addComponent(createInfoRow("Days in Government:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Days in Government:", String.format(Locale.ENGLISH,"%,d", summary.getTotalDaysServedGovernment()), VaadinIcons.CLOCK, "Total days served in government")); - layout.addComponent(createInfoRow("Parliamentary Experience:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Parliamentary Experience:", String.format(Locale.ENGLISH,"%,d", summary.getTotalDaysServedParliament()), VaadinIcons.CALENDAR_CLOCK, "Total days served in parliament")); @@ -240,29 +241,29 @@ private void addLegislativeImpactMetrics(VerticalLayout layout, if (summary != null) { // Legislative Production - layout.addComponent(createInfoRow("Total Motions:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Total Motions:", String.valueOf(summary.getTotalPartyMotions()), VaadinIcons.FILE_TEXT, "Total party-initiated motions")); - layout.addComponent(createInfoRow("Recent Activity:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Recent Activity:", String.valueOf(summary.getTotalDocumentsLastYear()), VaadinIcons.CHART_TIMELINE, "Documents produced in the last year")); // Cross-party Cooperation - layout.addComponent(createInfoRow("Collaboration Rate:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Collaboration Rate:", String.format(Locale.ENGLISH,"%.1f%%", summary.getAvgCollaborationPercentage()), VaadinIcons.CONNECT, "Cross-party collaboration percentage")); - layout.addComponent(createInfoRow("Joint Initiatives:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Joint Initiatives:", String.valueOf(summary.getTotalCollaborativeMotions()), VaadinIcons.USERS, "Multi-party collaborative motions")); // Legislative Efficiency - layout.addComponent(createInfoRow("Productivity:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Productivity:", String.format(Locale.ENGLISH,"%.1f", summary.getAvgDocumentsPerMember()), VaadinIcons.CHART_GRID, "Average documents per member")); @@ -283,7 +284,7 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, if (summary != null) { // Activity Distribution - layout.addComponent(createInfoRow("High Performers:", + layout.addComponent(CardInfoRowUtil.createInfoRow("High Performers:", String.format(Locale.ENGLISH,"%d (%d%%)", summary.getVeryHighActivityMembers(), calculatePercentage(summary.getVeryHighActivityMembers(), party.getHeadCount())), @@ -291,14 +292,14 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, "Members with very high activity levels")); // Member Focus Areas - layout.addComponent(createInfoRow("Party Policy Focus:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Party Policy Focus:", String.format(Locale.ENGLISH,"%d (%d%%)", summary.getPartyFocusedMembers(), calculatePercentage(summary.getPartyFocusedMembers(), party.getHeadCount())), VaadinIcons.FLAG, "Members focused on party policy work")); - layout.addComponent(createInfoRow("Committee Focus:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Committee Focus:", String.format(Locale.ENGLISH,"%d (%d%%)", summary.getCommitteeFocusedMembers(), calculatePercentage(summary.getCommitteeFocusedMembers(), party.getHeadCount())), @@ -306,7 +307,7 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, "Members focused on committee work")); // Collaboration Metrics - layout.addComponent(createInfoRow("Collaborative Members:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Collaborative Members:", String.format(Locale.ENGLISH,"%d (%d%%)", summary.getHighlyCollaborativeMembers(), calculatePercentage(summary.getHighlyCollaborativeMembers(), party.getHeadCount())), diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyPageVisitHistoryPageModContentFactoryImpl.java index d5172ebb93..640a4b9bbf 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyPageVisitHistoryPageModContentFactoryImpl.java @@ -25,6 +25,7 @@ import com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Page Visit History " + viewRiksdagenParty.getPartyName(), "Visit History", "Review the history of page visits for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Page Visit History " + viewRiksdagenParty.getPartyName(), "Visit History", "Review the history of page visits for the selected party."); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingAllPartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingAllPartiesChartsPageModContentFactoryImpl.java index 55e544747b..6314401722 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingAllPartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingAllPartiesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "All Parties Charts", "Party Performance", "Analyze the performance of all political parties using various charts."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "All Parties Charts", "Party Performance", "Analyze the performance of all political parties using various charts."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentCommitteeChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentCommitteeChartsPageModContentFactoryImpl.java index 0c9e3098eb..6594d8f695 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentCommitteeChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentCommitteeChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Current Committee Charts", "Committee Performance", "Analyze the performance of current committees using various charts."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Current Committee Charts", "Committee Performance", "Analyze the performance of current committees using various charts."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.java index 46bf4ca8f7..9c238d7e33 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -72,7 +73,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Current Government Charts", "Government Performance", "Analyze the performance of the current government using various charts."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Current Government Charts", "Government Performance", "Analyze the performance of the current government using various charts."); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesChartsPageModContentFactoryImpl.java index 6d19e27116..f9851b178e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesChartsPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -71,7 +72,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Ranking - Current Parties Charts", "Current Party Dynamics", "Current parties: gauging influence and strategic footholds."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesLeaderScoreboardPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesLeaderScoreboardPageModContentFactoryImpl.java index b22bb77a8c..87ff6a71c7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesLeaderScoreboardPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentPartiesLeaderScoreboardPageModContentFactoryImpl.java @@ -43,6 +43,8 @@ import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualOutcomeSummary; import com.hack23.cia.service.external.esv.api.GovernmentBodyAnnualSummary; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.PoliticianLeaderboardUtil; import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; @@ -76,6 +78,9 @@ public final class PartyRankingCurrentPartiesLeaderScoreboardPageModContentFacto @Autowired private EsvApi esvApi; + @Autowired + private PoliticianLeaderboardUtil politicianLeaderboardUtil; + /** * Instantiates a new party ranking current parties leader scoreboard page mod content factory impl. */ @@ -100,7 +105,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Current Party Leaders Scoreboard", "Leader Performance", + CardInfoRowUtil.createPageHeader(panel, panelContent, "Current Party Leaders Scoreboard", "Leader Performance", "Evaluate the performance of current party leaders including those not in government."); final HorizontalLayout chartLayout = new HorizontalLayout(); @@ -255,7 +260,7 @@ private Panel createLeaderCard(final ViewRiksdagenPolitician leader, final ViewR cardContent.setSizeFull(); cardPanel.setContent(cardContent); - createCardHeader(cardContent,"Partiledare " + leader.getFirstName() + " " + leader.getLastName() + " (" + CardInfoRowUtil.createCardHeader(cardContent,"Partiledare " + leader.getFirstName() + " " + leader.getLastName() + " (" + leader.getParty() + ")"); // Politician detail link @@ -295,7 +300,7 @@ private Panel createLeaderCard(final ViewRiksdagenPolitician leader, final ViewR final ViewRiksdagenPolitician pol = leader; // same as leader govMember = findGovernmentRoleForLeader(pol); if (govMember != null) { - addMinistryRoleSummary(cardContent, govMember, governmentBodyByMinistry, reportByMinistry); + politicianLeaderboardUtil.addMinistryRoleSummary(cardContent, govMember, governmentBodyByMinistry, reportByMinistry); } } else { @@ -350,12 +355,12 @@ private Panel createLeaderCard(final ViewRiksdagenPolitician leader, final ViewR // Add the four main sections - final VerticalLayout politicalRoleLayout = createSectionLayout("Political Role & Influence"); + final VerticalLayout politicalRoleLayout = CardInfoRowUtil.createSectionLayout("Political Role & Influence"); addPoliticalRoleMetrics(politicalRoleLayout,getPartyLeaderRole(leader.getPersonId()), govMember, leader, ballotSummary,experienceSummary); sectionsGrid.addComponent(politicalRoleLayout); - final VerticalLayout performanceLayout = createSectionLayout("Parliamentary Performance"); - addParliamentaryPerformanceMetrics(performanceLayout, leader, ballotSummary); + final VerticalLayout performanceLayout = CardInfoRowUtil.createSectionLayout("Parliamentary Performance"); + politicianLeaderboardUtil.addParliamentaryPerformanceMetrics(performanceLayout, leader, ballotSummary); sectionsGrid.addComponent(performanceLayout); cardContent.addComponent(sectionsGrid); @@ -365,12 +370,12 @@ private Panel createLeaderCard(final ViewRiksdagenPolitician leader, final ViewR sections2Grid.setWidth("100%"); - final VerticalLayout legislativeLayout = createSectionLayout("Legislative Activity"); - addLegislativeMetrics(legislativeLayout, leader); + final VerticalLayout legislativeLayout = CardInfoRowUtil.createSectionLayout("Legislative Activity"); + politicianLeaderboardUtil.addLegislativeMetrics(legislativeLayout, leader); sections2Grid.addComponent(legislativeLayout); - final VerticalLayout alignmentLayout = createSectionLayout("Party Alignment"); - addPartyAlignmentMetrics(alignmentLayout, leader, ballotSummary); + final VerticalLayout alignmentLayout = CardInfoRowUtil.createSectionLayout("Party Alignment"); + politicianLeaderboardUtil.addPartyAlignmentMetrics(alignmentLayout, leader, ballotSummary); sections2Grid.addComponent(alignmentLayout); cardContent.addComponent(sections2Grid); @@ -396,88 +401,6 @@ private ViewRiksdagenGovermentRoleMember findGovernmentRoleForLeader(ViewRiksdag .findFirst().orElse(null); } - /** - * Adds the ministry role summary. - * - * @param cardLayout the card layout - * @param govMember the gov member - * @param governmentBodyByMinistry the government body by ministry - * @param reportByMinistry the report by ministry - */ - private void addMinistryRoleSummary(final VerticalLayout cardLayout, - final ViewRiksdagenGovermentRoleMember govMember, - final Map> governmentBodyByMinistry, - final Map> reportByMinistry) { - - cardLayout.addComponent(getPageLinkFactory().addMinistryPageLink(govMember.getDetail())); - - final List ministryBodies = governmentBodyByMinistry.get(govMember.getDetail()); - if (ministryBodies == null || ministryBodies.isEmpty()) { - return; - } - - final int totalHeadCount = ministryBodies.stream().mapToInt(GovernmentBodyAnnualSummary::getAnnualWorkHeadCount) - .sum(); - final int bodyCount = ministryBodies.size(); - - cardLayout.addComponent(createMetricRow(VaadinIcons.GROUP, - getPageLinkFactory().addMinistryGovermentBodiesPageLink(govMember.getDetail()), - "Number of government bodies", String.valueOf(bodyCount))); - - cardLayout.addComponent(createMetricRow(VaadinIcons.USER, - getPageLinkFactory().addMinistryGovermentBodiesHeadcountPageLink(govMember.getDetail()), - "Total headcount of government bodies", String.valueOf(totalHeadCount))); - - final List outcomeSummaries = reportByMinistry.get(govMember.getDetail()); - double currentYearIncome = 0; - double currentYearSpending = 0; - final int CURRENT_YEAR = 2024; - final String INKOMSTTITELGRUPPSNAMN = "Inkomsttitelgruppsnamn"; - final String EXPENDITURE_GROUP_NAME = "Utgiftsområdesnamn"; - - if (outcomeSummaries != null) { - final Map annualIncome = outcomeSummaries.stream() - .filter(t -> t.getDescriptionFields().get(INKOMSTTITELGRUPPSNAMN) != null) - .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, - Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); - - final Map annualSpending = outcomeSummaries.stream() - .filter(t -> t.getDescriptionFields().get(EXPENDITURE_GROUP_NAME) != null) - .collect(Collectors.groupingBy(GovernmentBodyAnnualOutcomeSummary::getYear, - Collectors.summingDouble(GovernmentBodyAnnualOutcomeSummary::getYearTotal))); - - if (annualIncome.get(CURRENT_YEAR) != null) { - currentYearIncome = annualIncome.get(CURRENT_YEAR) / 1000; - } - - if (annualSpending.get(CURRENT_YEAR) != null) { - currentYearSpending = annualSpending.get(CURRENT_YEAR) / 1000; - } - } - - final String incomeStr = String.format(Locale.ENGLISH, "%.2f B SEK", currentYearIncome); - cardLayout.addComponent(createMetricRow(VaadinIcons.ARROW_UP, - getPageLinkFactory().addMinistryGovermentBodiesIncomePageLink(govMember.getDetail()), - "Yearly Income (B SEK)", incomeStr)); - - final String spendingStr = String.format(Locale.ENGLISH, "%.2f B SEK", currentYearSpending); - cardLayout.addComponent(createMetricRow(VaadinIcons.ARROW_DOWN, - getPageLinkFactory().addMinistrGovermentBodiesSpendingPageLink(govMember.getDetail()), - "Yearly Spending (B SEK)", spendingStr)); - } - - /** - * Matches. - * - * @param page the page - * @param parameters the parameters - * @return true, if successful - */ - @Override - public boolean matches(final String page, final String parameters) { - return NAME.equals(page) && StringUtils.contains(parameters, PageMode.CHARTS.toString()) - && parameters.contains(ChartIndicators.CURRENTPARTYLEADERSCORECARD.toString()); - } /** @@ -493,184 +416,52 @@ public boolean matches(final String page, final String parameters) { private void addPoliticalRoleMetrics(VerticalLayout layout, ViewRiksdagenPartyRoleMember riksdagenPartyRoleMember, ViewRiksdagenGovermentRoleMember govMember, ViewRiksdagenPolitician politician, ViewRiksdagenPoliticianBallotSummary ballotSummary, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { + addPartyExperince(layout, riksdagenPartyRoleMember, govMember, politician); + + // Top Roles + politicianLeaderboardUtil.addTopRoles(layout, experienceSummary); + + // Top Knowledge Areas + politicianLeaderboardUtil.addKnowledgeAreas(layout, experienceSummary); + + politicianLeaderboardUtil.addExperienceMetrics(layout,experienceSummary); + + politicianLeaderboardUtil.addPoliticalAnalysisComment(layout, experienceSummary); + + } + + private void addPartyExperince(VerticalLayout layout, ViewRiksdagenPartyRoleMember riksdagenPartyRoleMember, + ViewRiksdagenGovermentRoleMember govMember, ViewRiksdagenPolitician politician) { if (govMember != null) { - layout.addComponent(createInfoRow("Role:", govMember != null ? govMember.getRoleCode() : "N/A", VaadinIcons.INSTITUTION, + layout.addComponent(CardInfoRowUtil.createInfoRow("Role:", govMember != null ? govMember.getRoleCode() : "N/A", VaadinIcons.INSTITUTION, "Current position in Government")); - layout.addComponent(createInfoRow("Career Length Government:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Career Length Government:", String.format(Locale.ENGLISH,"%,d days", govMember != null ? govMember.getTotalDaysServed() : 0), VaadinIcons.TIMER, "Years in Government")); } else { - layout.addComponent(createInfoRow("Career Length Parlimanet:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Career Length Parlimanet:", String.format(Locale.ENGLISH,"%,d days", politician != null ? politician.getTotalDaysServedParliament() : 0), VaadinIcons.TIMER, "Years in Parlimanet")); } - layout.addComponent(createInfoRow("Current Party Role:", riksdagenPartyRoleMember != null ? riksdagenPartyRoleMember.getRoleCode() : "N/A", VaadinIcons.INSTITUTION, + layout.addComponent(CardInfoRowUtil.createInfoRow("Current Party Role:", riksdagenPartyRoleMember != null ? riksdagenPartyRoleMember.getRoleCode() : "N/A", VaadinIcons.INSTITUTION, "Current position in Party")); - layout.addComponent(createInfoRow("Career Length Party Leader:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Career Length Party Leader:", String.format(Locale.ENGLISH,"%,d days", riksdagenPartyRoleMember != null ? riksdagenPartyRoleMember.getTotalDaysServed() : 0), VaadinIcons.TIMER, "Years as Party Leader")); - - // Top Roles - if (experienceSummary.getRoles() != null && !experienceSummary.getRoles().isEmpty()) { - final String topRoles = experienceSummary.getRoles().stream() - .filter(role -> role.getRole() != null && !role.getRole().equals("Other")) - .sorted((r1, r2) -> r2.getWeightedExp().compareTo(r1.getWeightedExp())) - .limit(3) - .map(role -> String.format(Locale.ENGLISH,"%s", - role.getRole())) - .collect(Collectors.joining(", ")); - - if (!topRoles.isEmpty()) { - layout.addComponent(createInfoRow("Key Political Roles:", - topRoles, - VaadinIcons.USERS, - "Most significant positions with weighted importance")); - } - } - - // Top Knowledge Areas - if (experienceSummary.getKnowledgeAreas() != null && !experienceSummary.getKnowledgeAreas().isEmpty()) { - final String topAreas = experienceSummary.getKnowledgeAreas().stream() - .filter(ka -> ka.getArea() != null && !ka.getArea().equals("Other")) - .sorted((ka1, ka2) -> ka2.getWeightedExp().compareTo(ka1.getWeightedExp())) - .limit(3) - .map(ka -> String.format(Locale.ENGLISH,"%s ", - ka.getArea())) - .collect(Collectors.joining(", ")); - - if (!topAreas.isEmpty()) { - layout.addComponent(createInfoRow("Key Policy Areas:", - topAreas, - VaadinIcons.CLIPBOARD_TEXT, - "Main areas of expertise with weighted importance")); - } - } - - - addExperienceMetrics(layout,experienceSummary); - - // Split the analysis points and create a bullet list - final String[] analysisPoints = experienceSummary.getPoliticalAnalysisComment().split("\\s*\\|\\|\\s*"); - final StringBuilder analys=new StringBuilder(); - for (final String point : analysisPoints) { - if (StringUtils.isNotBlank(point)) { - analys.append(" • ").append(point); - } - } - - // Political Analysis Comment - if (StringUtils.isNotBlank(experienceSummary.getPoliticalAnalysisComment())) { - layout.addComponent(createInfoRow("Analysis:", - analys.toString(), - VaadinIcons.COMMENT, - "Political career analysis")); - } - - } - - /** - * Adds the experience metrics. - * - * @param layout the layout - * @param experienceSummary the experience summary - */ - private void addExperienceMetrics(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { - if (experienceSummary != null) { - // Career Overview - layout.addComponent(createInfoRow("Career Phase:", - experienceSummary.getCareerPhase().toString().replace("_", " "), - VaadinIcons.CALENDAR_CLOCK, - "Current career stage")); - - // Experience Level - layout.addComponent(createInfoRow("Experience Level:", - experienceSummary.getExperienceLevel().toString().replace("_", " "), - VaadinIcons.CHART_TIMELINE, - "Overall political experience classification")); - - // Leadership Profile - layout.addComponent(createInfoRow("Leadership Role:", - experienceSummary.getLeadershipProfile().toString().replace("_", " "), - VaadinIcons.USER_STAR, - "Leadership experience level")); - - // Specialization - layout.addComponent(createInfoRow("Expertise:", - experienceSummary.getSpecializationLevel().toString().replace("_", " "), - VaadinIcons.SPECIALIST, - "Area of specialization")); - - - } - } - - - - /** - * Adds the parliamentary performance metrics. - * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary - */ - private void addParliamentaryPerformanceMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent( - createInfoRow("Attendance Rate:", - String.format(Locale.ENGLISH, "%.1f%%", 100 - (ballotSummary != null ? ballotSummary.getAbsenceRate() : 0.0)), - VaadinIcons.USER_CHECK, "Session attendance rate")); - layout.addComponent(createInfoRow("Voting Success:", - String.format(Locale.ENGLISH, "%.1f%%", ballotSummary != null ? ballotSummary.getSuccessRate() : 0.0), - VaadinIcons.TROPHY, "Votes on winning side")); - layout.addComponent(createInfoRow("Activity Level:", politician.getDocActivityLevel(), VaadinIcons.CHART_LINE, - "Overall engagement level")); - layout.addComponent(createInfoRow("Analysis Comment:", - String.valueOf(ballotSummary != null ? ballotSummary.getAnalysisComment() : 0), VaadinIcons.USER_CARD, - "Analysis Comment")); } /** - * Adds the legislative metrics. - * - * @param layout the layout - * @param politician the politician - */ - private void addLegislativeMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician) { - - layout.addComponent(createInfoRow("Documents/Year:", - String.format(Locale.ENGLISH, "%.1f", politician.getAverageDocsPerYear()), VaadinIcons.FILE_TEXT, - "Average documents per year")); - layout.addComponent(createInfoRow("Individual Motions:", String.valueOf(politician.getIndividualMotions()), - VaadinIcons.USER, "Personal motions submitted")); - layout.addComponent(createInfoRow("Committee Motions:", String.valueOf(politician.getCommitteeMotions()), - VaadinIcons.GROUP, "Committee-based motions")); - layout.addComponent(createInfoRow("Document Impact:", politician.getDocActivityProfile(), VaadinIcons.CHART_3D, - "Legislative influence assessment")); - } - - /** - * Adds the party alignment metrics. + * Matches. * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary + * @param page the page + * @param parameters the parameters + * @return true, if successful */ - private void addPartyAlignmentMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent(createInfoRow("Party Loyalty:", - String.format(Locale.ENGLISH, "%.1f%%", ballotSummary != null ? ballotSummary.getLoyaltyRate() : 0.0), - VaadinIcons.GROUP, "Party line adherence")); - layout.addComponent(createInfoRow("Independence Rate:", - String.format(Locale.ENGLISH, "%.1f%%", ballotSummary != null ? ballotSummary.getRebelRate() : 0.0), - VaadinIcons.RANDOM, "Votes against party line")); - layout.addComponent(createInfoRow("Cross-Party Collaboration:", - String.format(Locale.ENGLISH, "%.1f%%", politician.getCollaborationPercentage()), VaadinIcons.CONNECT, - "Inter-party cooperation")); - layout.addComponent(createInfoRow("Multi-Party Motions:", String.valueOf(politician.getMultiPartyMotions()), - VaadinIcons.USERS, "Cross-party legislative initiatives")); + @Override + public boolean matches(final String page, final String parameters) { + return NAME.equals(page) && StringUtils.contains(parameters, PageMode.CHARTS.toString()) + && parameters.contains(ChartIndicators.CURRENTPARTYLEADERSCORECARD.toString()); } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingDataGridPageModContentFactoryImpl.java index b5bd64cabb..a01d103669 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingDataGridPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -128,7 +129,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Party Performance Dashboard", "Party Rankings", "Evaluate political parties using data on legislative activity, assignments, and influence."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Performance Dashboard", "Party Rankings", "Evaluate political parties using data on legislative activity, assignments, and influence."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingOverviewPageModContentFactoryImpl.java index ff1fcb112d..9dd4233cc1 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -54,7 +55,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Party Rankings", "Ranking Overview", "Compare and rank political parties based on predefined metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Rankings", "Ranking Overview", "Compare and rank political parties based on predefined metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingPageVisitHistoryPageModContentFactoryImpl.java index 1d7dc904ad..58b712b212 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -58,7 +59,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - createPageHeader(panel, panelContent, "Page Visit History", "User Activity", "Track the history of page visits for party rankings."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Page Visit History", "User Activity", "Track the history of page visits for party rankings."); getAdminChartDataManager().createApplicationActionEventPageModeDailySummaryChart(panelContent,NAME); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRoleGhantPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRoleGhantPageModContentFactoryImpl.java index 1040cfaf7e..536f656a24 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRoleGhantPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRoleGhantPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.PartyGhantChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -66,8 +67,8 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Party Role Ghant " + viewRiksdagenParty.getPartyName(), "Party Ghant Deatails", "Review the party role ghant history for the selected party."); - createPageHeader(panel, panelContent, viewRiksdagenParty.getPartyName(), viewRiksdagenParty.getPartyId(), ROLE_GHANT); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Role Ghant " + viewRiksdagenParty.getPartyName(), "Party Ghant Deatails", "Review the party role ghant history for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenParty.getPartyName(), viewRiksdagenParty.getPartyId(), ROLE_GHANT); final DataContainer partyRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPartyRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartySupportAnnualSummaryChartPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartySupportAnnualSummaryChartPageModContentFactoryImpl.java index 29e8d35d3f..9ae4ec295a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartySupportAnnualSummaryChartPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartySupportAnnualSummaryChartPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartySupportsChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Party Support " + viewRiksdagenParty.getPartyName(), "Party Support Deatails", "Review the party support history for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Support " + viewRiksdagenParty.getPartyName(), "Party Support Deatails", "Review the party support history for the selected party."); chartDataManager.createPartyChart(panelContent,pageId); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARTY_VIEW, ApplicationEventGroup.USER, NAME, parameters, diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyVoteHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyVoteHistoryPageModContentFactoryImpl.java index a15aefc607..4af6ca9dda 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyVoteHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyVoteHistoryPageModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.GenericChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -83,7 +84,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Vote History " + viewRiksdagenParty.getPartyName(), "Ballots", "Review the voting history for the selected party."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Vote History " + viewRiksdagenParty.getPartyName(), "Ballots", "Review the voting history for the selected party."); getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenVoteDataBallotPartySummary.class, diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyWonDailySummaryChartPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyWonDailySummaryChartPageModContentFactoryImpl.java index f1515e31b5..ec18b5a581 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyWonDailySummaryChartPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyWonDailySummaryChartPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PartyChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.vaadin.ui.Layout; import com.vaadin.ui.MenuBar; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenParty viewRiksdagenParty = getItem(parameters); getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, "Party Won Daily Summary Chart " + viewRiksdagenParty.getPartyName(), "Daily Summary", "Analyze the daily summary of party wins over time."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Party Won Daily Summary Chart " + viewRiksdagenParty.getPartyName(), "Daily Summary", "Analyze the daily summary of party wins over time."); chartDataManager.createPartyLineChart(panelContent, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianBallotDecisionSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianBallotDecisionSummaryPageModContentFactoryImpl.java index 6670929977..00f890c3e0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianBallotDecisionSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianBallotDecisionSummaryPageModContentFactoryImpl.java @@ -31,6 +31,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -81,7 +82,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Ballot Decision Summary", "Decision Summary Overview", "Summarize and analyze the politician's voting decisions on various ballots."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Ballot Decision Summary", "Decision Summary Overview", "Summarize and analyze the politician's voting decisions on various ballots."); final DataContainer committeeBallotDecisionPartyDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeBallotDecisionPoliticianSummary.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentActivityPageModContentFactoryImpl.java index c5d69dfa3d..2024d74f57 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentActivityPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PersonDocumentChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -60,7 +61,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Document Activity", "Activity Overview", "Detailed insights into the politician's document-related legislative activities."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Document Activity", "Activity Overview", "Detailed insights into the politician's document-related legislative activities."); documentChartDataManager.createPersonDocumentHistoryChart(panelContent, viewRiksdagenPolitician.getPersonId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentHistoryPageModContentFactoryImpl.java index 3d13d297cc..a720ba182c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianDocumentHistoryPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -70,7 +71,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Document History", "History Overview", "Historical record of documents associated with the politician's roles and activities."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Document History", "History Overview", "Historical record of documents associated with the politician's roles and activities."); final DataContainer politicianDocumentDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPoliticianDocument.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianIndicatorsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianIndicatorsPageModContentFactoryImpl.java index 5c905b24ce..015e06406a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianIndicatorsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianIndicatorsPageModContentFactoryImpl.java @@ -26,6 +26,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.common.chartfactory.api.PoliticianChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -59,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Performance Indicators", "Indicator Overview", "Key performance indicators reflecting the politician's impact and activity."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Performance Indicators", "Indicator Overview", "Key performance indicators reflecting the politician's impact and activity."); politicianChartDataManager.createPersonLineChart(panelContent, viewRiksdagenPolitician.getPersonId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianOverviewPageModContentFactoryImpl.java index 1241e4dbfc..e1d2f44912 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianOverviewPageModContentFactoryImpl.java @@ -19,10 +19,9 @@ package com.hack23.cia.web.impl.ui.application.views.user.politician.pagemode; import java.util.Date; -import java.util.Locale; -import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Component; @@ -32,6 +31,8 @@ import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPoliticianExperienceSummary; 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.common.pagemode.CardInfoRowUtil; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.PoliticianLeaderboardUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @@ -53,6 +54,9 @@ @Component public final class PoliticianOverviewPageModContentFactoryImpl extends AbstractPoliticianPageModContentFactoryImpl { + @Autowired + private PoliticianLeaderboardUtil politicianLeaderboardUtil; + /** * Instantiates a new politician overview page mod content factory impl. */ @@ -83,7 +87,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Overview " + viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + " (" + viewRiksdagenPolitician.getParty() + ')', "Politician Details", "Detailed profiles and activities of politicians."); @@ -145,14 +149,39 @@ private void createOverviewContent(final VerticalLayout panelContent, final Pers final ViewRiksdagenPoliticianExperienceSummary experienceSummary, final String pageId) { - // Link to politician detail page - final Link createPoliticianPageLink = getPageLinkFactory().createPoliticianPageLink(personData); - createPoliticianPageLink.addStyleName("card-subtitle"); - panelContent.addComponent(createPoliticianPageLink); - panelContent.setExpandRatio(createPoliticianPageLink, ContentRatio.SMALL); + addPoliticalLink(panelContent, personData); - // Create a panel (card) for the politician final Panel cardPanel = new Panel(); + final VerticalLayout cardContent = createCardContent(panelContent, cardPanel); + + + CardInfoRowUtil.createCardHeader(cardContent,viewRiksdagenPolitician.getFirstName() + " " + viewRiksdagenPolitician.getLastName() + + " (" + viewRiksdagenPolitician.getParty() + ")"); + + // Party link + addPartyLink(viewRiksdagenPolitician, cardContent); + + + addAllSections(personData, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary, experienceSummary, + cardContent); + + // After the card, add the overview layout for extended details + final VerticalLayout overviewLayout = new VerticalLayout(); + overviewLayout.setSizeFull(); + panelContent.addComponent(overviewLayout); + panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM); + + getPoliticianMenuItemFactory().createOverviewPage(overviewLayout, pageId); + } + + /** + * Creates the card content. + * + * @param panelContent the panel content + * @param cardPanel the card panel + * @return the vertical layout + */ + private VerticalLayout createCardContent(final VerticalLayout panelContent, final Panel cardPanel) { cardPanel.addStyleName("politician-overview-card"); cardPanel.setWidth("100%"); cardPanel.setHeightUndefined(); @@ -166,34 +195,24 @@ private void createOverviewContent(final VerticalLayout panelContent, final Pers panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); + return cardContent; + } - - createCardHeader(cardContent,viewRiksdagenPolitician.getFirstName() + " " + viewRiksdagenPolitician.getLastName() - + " (" + viewRiksdagenPolitician.getParty() + ")"); - - // Party link - final Link partyLink = new Link("Party " + viewRiksdagenPolitician.getParty(), - new ExternalResource("#!" + UserViews.PARTY_VIEW_NAME + "/" + viewRiksdagenPolitician.getParty())); - partyLink.setIcon(VaadinIcons.GROUP); - partyLink.addStyleName("card-title"); - cardContent.addComponent(partyLink); - - + /** + * Adds the all sections. + * + * @param personData the person data + * @param viewRiksdagenPolitician the view riksdagen politician + * @param viewRiksdagenPoliticianBallotSummary the view riksdagen politician ballot summary + * @param experienceSummary the experience summary + * @param cardContent the card content + */ + private void addAllSections(final PersonData personData, final ViewRiksdagenPolitician viewRiksdagenPolitician, + final ViewRiksdagenPoliticianBallotSummary viewRiksdagenPoliticianBallotSummary, + final ViewRiksdagenPoliticianExperienceSummary experienceSummary, final VerticalLayout cardContent) { // Image and details layout final HorizontalLayout imageAndDetailsLayout = new HorizontalLayout(); - imageAndDetailsLayout.setSpacing(true); - imageAndDetailsLayout.setWidth("100%"); - cardContent.addComponent(imageAndDetailsLayout); - - // Politician image (smaller) - final String imageUrl = personData.getImageUrl192().replace("http://", "https://"); - final Image image = new Image("", new ExternalResource(imageUrl)); - image.setDescription( - "Picture of " + viewRiksdagenPolitician.getFirstName() + " " + viewRiksdagenPolitician.getLastName()); - image.setWidth(100, Unit.PIXELS); - image.addStyleName("politician-image"); - - imageAndDetailsLayout.addComponent(image); + addImage(personData, viewRiksdagenPolitician, cardContent, imageAndDetailsLayout); final HorizontalLayout sectionsGrid = new HorizontalLayout(); sectionsGrid.setSpacing(true); @@ -202,82 +221,89 @@ private void createOverviewContent(final VerticalLayout panelContent, final Pers imageAndDetailsLayout.setExpandRatio(sectionsGrid, 1.0f); // 1. Political Role & Influence - final VerticalLayout politicalRoleLayout = createSectionLayout("Political Role & Influence"); + final VerticalLayout politicalRoleLayout = CardInfoRowUtil.createSectionLayout("Political Role & Influence"); addPoliticalRoleMetrics(politicalRoleLayout, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary,experienceSummary); sectionsGrid.addComponent(politicalRoleLayout); sectionsGrid.setExpandRatio(politicalRoleLayout, 1.0f); - final VerticalLayout experienceLayout = createSectionLayout("Experience & Expertise"); - addExperienceMetrics(experienceLayout, experienceSummary); + final VerticalLayout experienceLayout = CardInfoRowUtil.createSectionLayout("Experience & Expertise"); + politicianLeaderboardUtil.addExperienceMetrics(experienceLayout, experienceSummary); sectionsGrid.addComponent(experienceLayout); sectionsGrid.setExpandRatio(experienceLayout, 1.0f); // 2. Parliamentary Performance - final VerticalLayout performanceLayout = createSectionLayout("Parliamentary Performance"); - addParliamentaryPerformanceMetrics(performanceLayout, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary); + final VerticalLayout performanceLayout = CardInfoRowUtil.createSectionLayout("Parliamentary Performance"); + politicianLeaderboardUtil.addParliamentaryPerformanceMetrics(performanceLayout, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary); sectionsGrid.addComponent(performanceLayout); sectionsGrid.setExpandRatio(performanceLayout, 1.0f); // 3. Legislative Activity - final VerticalLayout legislativeLayout = createSectionLayout("Legislative Impact"); - addLegislativeMetrics(legislativeLayout, viewRiksdagenPolitician); + final VerticalLayout legislativeLayout = CardInfoRowUtil.createSectionLayout("Legislative Impact"); + politicianLeaderboardUtil.addLegislativeMetrics(legislativeLayout, viewRiksdagenPolitician); sectionsGrid.addComponent(legislativeLayout); sectionsGrid.setExpandRatio(legislativeLayout, 1.0f); // 4. Party Alignment & Cooperation - final VerticalLayout partyAlignmentLayout = createSectionLayout("Party Alignment & Cooperation"); - addPartyAlignmentMetrics(partyAlignmentLayout, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary); + final VerticalLayout partyAlignmentLayout = CardInfoRowUtil.createSectionLayout("Party Alignment & Cooperation"); + politicianLeaderboardUtil.addPartyAlignmentMetrics(partyAlignmentLayout, viewRiksdagenPolitician, viewRiksdagenPoliticianBallotSummary); sectionsGrid.addComponent(partyAlignmentLayout); sectionsGrid.setExpandRatio(partyAlignmentLayout, 1.0f); imageAndDetailsLayout.addComponent(sectionsGrid); imageAndDetailsLayout.setExpandRatio(sectionsGrid, ContentRatio.SMALL_GRID); + } - // After the card, add the overview layout for extended details - final VerticalLayout overviewLayout = new VerticalLayout(); - overviewLayout.setSizeFull(); - panelContent.addComponent(overviewLayout); - panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM); - - getPoliticianMenuItemFactory().createOverviewPage(overviewLayout, pageId); + /** + * Adds the political link. + * + * @param panelContent the panel content + * @param personData the person data + */ + private void addPoliticalLink(final VerticalLayout panelContent, final PersonData personData) { + final Link createPoliticianPageLink = getPageLinkFactory().createPoliticianPageLink(personData); + createPoliticianPageLink.addStyleName("card-subtitle"); + panelContent.addComponent(createPoliticianPageLink); + panelContent.setExpandRatio(createPoliticianPageLink, ContentRatio.SMALL); } + /** + * Adds the party link. + * + * @param viewRiksdagenPolitician the view riksdagen politician + * @param cardContent the card content + */ + private void addPartyLink(final ViewRiksdagenPolitician viewRiksdagenPolitician, final VerticalLayout cardContent) { + final Link partyLink = new Link("Party " + viewRiksdagenPolitician.getParty(), + new ExternalResource("#!" + UserViews.PARTY_VIEW_NAME + "/" + viewRiksdagenPolitician.getParty())); + partyLink.setIcon(VaadinIcons.GROUP); + partyLink.addStyleName("card-title"); + cardContent.addComponent(partyLink); + } /** - * Adds the experience metrics. + * Adds the image. * - * @param layout the layout - * @param experienceSummary the experience summary + * @param personData the person data + * @param viewRiksdagenPolitician the view riksdagen politician + * @param cardContent the card content + * @param imageAndDetailsLayout the image and details layout */ - private void addExperienceMetrics(VerticalLayout layout, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { - if (experienceSummary != null) { - // Career Overview - layout.addComponent(createInfoRow("Career Phase:", - experienceSummary.getCareerPhase().toString().replace("_", " "), - VaadinIcons.CALENDAR_CLOCK, - "Current career stage")); - - // Experience Level - layout.addComponent(createInfoRow("Experience Level:", - experienceSummary.getExperienceLevel().toString().replace("_", " "), - VaadinIcons.CHART_TIMELINE, - "Overall political experience classification")); - - // Leadership Profile - layout.addComponent(createInfoRow("Leadership Role:", - experienceSummary.getLeadershipProfile().toString().replace("_", " "), - VaadinIcons.USER_STAR, - "Leadership experience level")); - - // Specialization - layout.addComponent(createInfoRow("Expertise:", - experienceSummary.getSpecializationLevel().toString().replace("_", " "), - VaadinIcons.SPECIALIST, - "Area of specialization")); - - - } + private void addImage(final PersonData personData, final ViewRiksdagenPolitician viewRiksdagenPolitician, + final VerticalLayout cardContent, final HorizontalLayout imageAndDetailsLayout) { + imageAndDetailsLayout.setSpacing(true); + imageAndDetailsLayout.setWidth("100%"); + cardContent.addComponent(imageAndDetailsLayout); + + // Politician image (smaller) + final String imageUrl = personData.getImageUrl192().replace("http://", "https://"); + final Image image = new Image("", new ExternalResource(imageUrl)); + image.setDescription( + "Picture of " + viewRiksdagenPolitician.getFirstName() + " " + viewRiksdagenPolitician.getLastName()); + image.setWidth(100, Unit.PIXELS); + image.addStyleName("politician-image"); + + imageAndDetailsLayout.addComponent(image); } @@ -292,131 +318,21 @@ private void addExperienceMetrics(VerticalLayout layout, ViewRiksdagenPolitician private void addPoliticalRoleMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, ViewRiksdagenPoliticianBallotSummary ballotSummary, ViewRiksdagenPoliticianExperienceSummary experienceSummary) { - layout.addComponent(createInfoRow("Current Role:", ballotSummary.getStatus(), VaadinIcons.INSTITUTION, + layout.addComponent(CardInfoRowUtil.createInfoRow("Current Role:", ballotSummary.getStatus(), VaadinIcons.INSTITUTION, "Current position in parliament")); - layout.addComponent(createInfoRow("Region:", ballotSummary.getElectionRegion(), VaadinIcons.MAP_MARKER, + layout.addComponent(CardInfoRowUtil.createInfoRow("Region:", ballotSummary.getElectionRegion(), VaadinIcons.MAP_MARKER, "Electoral district")); - layout.addComponent(createInfoRow("Career Length:", + layout.addComponent(CardInfoRowUtil.createInfoRow("Career Length:", calculateServiceYears(politician.getFirstAssignmentDate(), politician.getLastAssignmentDate()), VaadinIcons.TIMER, "Years in parliament")); - // Top Roles - if (experienceSummary.getRoles() != null && !experienceSummary.getRoles().isEmpty()) { - final String topRoles = experienceSummary.getRoles().stream() - .filter(role -> role.getRole() != null && !role.getRole().equals("Other")) - .sorted((r1, r2) -> r2.getWeightedExp().compareTo(r1.getWeightedExp())) - .limit(3) - .map(role -> String.format(Locale.ENGLISH,"%s", - role.getRole())) - .collect(Collectors.joining(", ")); - - if (!topRoles.isEmpty()) { - layout.addComponent(createInfoRow("Key Political Roles:", - topRoles, - VaadinIcons.USERS, - "Most significant positions with weighted importance")); - } - } - - // Top Knowledge Areas - if (experienceSummary.getKnowledgeAreas() != null && !experienceSummary.getKnowledgeAreas().isEmpty()) { - final String topAreas = experienceSummary.getKnowledgeAreas().stream() - .filter(ka -> ka.getArea() != null && !ka.getArea().equals("Other")) - .sorted((ka1, ka2) -> ka2.getWeightedExp().compareTo(ka1.getWeightedExp())) - .limit(3) - .map(ka -> String.format(Locale.ENGLISH,"%s ", - ka.getArea())) - .collect(Collectors.joining(", ")); - - if (!topAreas.isEmpty()) { - layout.addComponent(createInfoRow("Key Policy Areas:", - topAreas, - VaadinIcons.CLIPBOARD_TEXT, - "Main areas of expertise with weighted importance")); - } - } - - - // Split the analysis points and create a bullet list - final String[] analysisPoints = experienceSummary.getPoliticalAnalysisComment().split("\\s*\\|\\|\\s*"); - final StringBuilder analys=new StringBuilder(); - for (final String point : analysisPoints) { - if (StringUtils.isNotBlank(point)) { - analys.append(" • ").append(point); - } - } - - // Political Analysis Comment - if (StringUtils.isNotBlank(experienceSummary.getPoliticalAnalysisComment())) { - layout.addComponent(createInfoRow("Analysis:", - analys.toString(), - VaadinIcons.COMMENT, - "Political career analysis")); - } + politicianLeaderboardUtil.addTopRoles(layout, experienceSummary); + politicianLeaderboardUtil.addKnowledgeAreas(layout, experienceSummary); + politicianLeaderboardUtil.addExperienceMetrics(layout,experienceSummary); + politicianLeaderboardUtil.addPoliticalAnalysisComment(layout, experienceSummary); } - /** - * Adds the parliamentary performance metrics. - * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary - */ - private void addParliamentaryPerformanceMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent( - createInfoRow("Attendance Rate:", String.format(Locale.ENGLISH,"%.1f%%", 100 - ballotSummary.getAbsenceRate()), - VaadinIcons.USER_CHECK, "Session attendance rate")); - layout.addComponent(createInfoRow("Voting Success:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary.getSuccessRate()), - VaadinIcons.TROPHY, "Votes on winning side")); - layout.addComponent(createInfoRow("Activity Level:", politician.getDocActivityLevel(), VaadinIcons.CHART_LINE, - "Overall engagement level")); - } - - /** - * Adds the legislative metrics. - * - * @param layout the layout - * @param politician the politician - */ - private void addLegislativeMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician) { - - layout.addComponent(createInfoRow("Documents/Year:", String.format(Locale.ENGLISH,"%.1f", politician.getAverageDocsPerYear()), - VaadinIcons.FILE_TEXT, "Average documents per year")); - layout.addComponent(createInfoRow("Individual Motions:", String.valueOf(politician.getIndividualMotions()), - VaadinIcons.USER, "Personal motions submitted")); - - layout.addComponent(createInfoRow("Party Motions:", String.valueOf(politician.getPartyMotions()), - VaadinIcons.USER, "Party motions signed")); - - layout.addComponent(createInfoRow("Committee Motions:", String.valueOf(politician.getCommitteeMotions()), - VaadinIcons.GROUP, "Committee-based motions")); - layout.addComponent(createInfoRow("Document Impact:", politician.getDocActivityProfile(), VaadinIcons.CHART_3D, - "Legislative influence assessment")); - } - - /** - * Adds the party alignment metrics. - * - * @param layout the layout - * @param politician the politician - * @param ballotSummary the ballot summary - */ - private void addPartyAlignmentMetrics(VerticalLayout layout, ViewRiksdagenPolitician politician, - ViewRiksdagenPoliticianBallotSummary ballotSummary) { - - layout.addComponent(createInfoRow("Party Loyalty:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary.getLoyaltyRate()), - VaadinIcons.GROUP, "Party line adherence")); - layout.addComponent(createInfoRow("Independence Rate:", String.format(Locale.ENGLISH,"%.1f%%", ballotSummary.getRebelRate()), - VaadinIcons.RANDOM, "Votes against party line")); - layout.addComponent(createInfoRow("Cross-Party Collaboration:", - String.format(Locale.ENGLISH,"%.1f%%", politician.getCollaborationPercentage()), VaadinIcons.CONNECT, - "Inter-party cooperation")); - layout.addComponent(createInfoRow("Multi-Party Motions:", String.valueOf(politician.getMultiPartyMotions()), - VaadinIcons.USERS, "Cross-party legislative initiatives")); - } /** * Calculate service years. diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianPageVisitHistoryPageModContentFactoryImpl.java index c8cf94fb64..6edc0f62fc 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianPageVisitHistoryPageModContentFactoryImpl.java @@ -25,6 +25,7 @@ import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -57,7 +58,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Page Visit History", "Visit Trends", "Analyze patterns and trends in the politician's page visit history."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Page Visit History", "Visit Trends", "Analyze patterns and trends in the politician's page visit history."); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsAllPartiesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsAllPartiesPageModContentFactoryImpl.java index a4265204c1..a4354a3ca8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsAllPartiesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsAllPartiesPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @@ -69,7 +70,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getPoliticianRankingMenuItemFactory().createPoliticianRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Ranking - All Parties Charts", "Cross-Party Influence", "All parties: mapping politician influence across coalitions."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsCurrentPartiesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsCurrentPartiesPageModContentFactoryImpl.java index 23fff4076c..955b0ddee8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsCurrentPartiesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingChartsCurrentPartiesPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager; import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @@ -69,7 +70,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getPoliticianRankingMenuItemFactory().createPoliticianRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Ranking - Current Parties Charts", "Current Political Landscape", "Current parties: assessing dynamic political landscapes."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingDataGridPageModContentFactoryImpl.java index 6c270dbc80..e7386f3cda 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingDataGridPageModContentFactoryImpl.java @@ -27,6 +27,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.service.api.DataContainer; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -146,7 +147,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getPoliticianRankingMenuItemFactory().createPoliticianRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Politician Performance Overview", "Politician Rankings", "Review rankings of politicians based on tenure, contributions, and performance metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Performance Overview", "Politician Rankings", "Review rankings of politicians based on tenure, contributions, and performance metrics."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingOverviewPageModContentFactoryImpl.java index 1f04998884..00cba4ce5a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingOverviewPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -56,7 +57,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getPoliticianRankingMenuItemFactory().createPoliticianRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, "Politician Rankings", "Ranking Overview", "Evaluate and rank politicians based on performance and influence."); + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Rankings", "Ranking Overview", "Evaluate and rank politicians based on performance and influence."); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingPageVisitHistoryPageModContentFactoryImpl.java index 3936654c5f..204734970e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -24,6 +24,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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -55,7 +56,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getPoliticianRankingMenuItemFactory().createPoliticianRankingMenuBar(menuBar); - createPageHeader(panel, panelContent, + CardInfoRowUtil.createPageHeader(panel, panelContent, "Politician Ranking - Page Visit History", "Engagement Trends", "Viewing interest trends to understand shifting political focus."); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleGhantPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleGhantPageModContentFactoryImpl.java index 933b792eda..d0d07bf393 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleGhantPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleGhantPageModContentFactoryImpl.java @@ -30,6 +30,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.common.chartfactory.api.PoliticianGhantChartManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -63,7 +64,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role Gantt Chart", "Role Timeline", "Visualize the timeline and duration of roles held by the politician."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role Gantt Chart", "Role Timeline", "Visualize the timeline and duration of roles held by the politician."); final PersonData personData = getApplicationManager().getDataContainer(PersonData.class) .load(viewRiksdagenPolitician.getPersonId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleListPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleListPageModContentFactoryImpl.java index 1a9ec89084..a019f8ecd0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleListPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleListPageModContentFactoryImpl.java @@ -30,6 +30,7 @@ import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.vaadin.ui.Layout; @@ -64,7 +65,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role List", "Roles Overview", "Explore the list of roles held by the politician across their career."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role List", "Roles Overview", "Explore the list of roles held by the politician across their career."); final PersonData personData = getApplicationManager().getDataContainer(PersonData.class) .load(viewRiksdagenPolitician.getPersonId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleSummaryPageModContentFactoryImpl.java index 24d439dc75..fdb34c0c21 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianRoleSummaryPageModContentFactoryImpl.java @@ -28,6 +28,7 @@ import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician; 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.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @@ -80,7 +81,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role Summary", "Summary Overview", "Summarize the key roles and responsibilities of the politician."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Role Summary", "Summary Overview", "Summarize the key roles and responsibilities of the politician."); final PersonData personData = getApplicationManager().getDataContainer(PersonData.class) .load(viewRiksdagenPolitician.getPersonId()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianVotesHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianVotesHistoryPageModContentFactoryImpl.java index 5f6503aa9f..5b37530940 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianVotesHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/politician/pagemode/PoliticianVotesHistoryPageModContentFactoryImpl.java @@ -27,6 +27,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.common.chartfactory.api.GenericChartDataManager; +import com.hack23.cia.web.impl.ui.application.views.common.pagemode.CardInfoRowUtil; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; import com.hack23.cia.web.impl.ui.application.views.pageclicklistener.PageItemPropertyClickListener; @@ -80,7 +81,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters); getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId); - createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Votes History", "Voting Record", "Review the politician's voting history, including key decisions and patterns."); + CardInfoRowUtil.createPageHeader(panel, panelContent, viewRiksdagenPolitician.getFirstName() + ' ' + viewRiksdagenPolitician.getLastName() + '(' + viewRiksdagenPolitician.getParty() + ')' + " Votes History", "Voting Record", "Review the politician's voting history, including key decisions and patterns."); getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenVoteDataBallotPoliticianSummary.class,