From 6da0ddee5da6ac06520962b5f954b229c26b5adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Sat, 28 Dec 2024 00:30:08 +0100 Subject: [PATCH] fix forbiddenapi (#6909) --- ...kingDataGridPageModContentFactoryImpl.java | 18 ++++++++--------- ...kingDataGridPageModContentFactoryImpl.java | 10 +++++----- ...artyOverviewPageModContentFactoryImpl.java | 20 ++++++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) 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 2f460aecbd..2fc589172d 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 @@ -43,9 +43,9 @@ public final class CommitteeRankingDataGridPageModContentFactoryImpl extends AbstractCommitteeRankingPageModContentFactoryImpl { /** The Constant COLUMN_ORDER. */ - private static final String[] COLUMN_ORDER = { - "embeddedId.detail", - "embeddedId", + private static final String[] COLUMN_ORDER = { + "embeddedId.detail", + "embeddedId", "currentMemberSize", "currentLeadershipPositions", "currentSubstitutePositions", @@ -55,21 +55,21 @@ public final class CommitteeRankingDataGridPageModContentFactoryImpl extends Abs "avgDocumentsPerMember", "documentsLastYear", "totalDocuments", - "totalAssignments", - "firstAssignmentDate", + "totalAssignments", + "firstAssignmentDate", "lastAssignmentDate", - "totalDaysServed", + "totalDaysServed", "totalLeadershipPositions", "totalSubstitutePositions" }; /** The Constant HIDE_COLUMNS. */ - private static final String[] HIDE_COLUMNS = { - "active", + private static final String[] HIDE_COLUMNS = { + "active", "embeddedId", "totalFollowUpMotions" }; - + /** The Constant COMMITTEES. */ private static final String COMMITTEES = "Committees"; 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 11a58b46e2..0314aa805a 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 @@ -43,18 +43,18 @@ public final class MinistryRankingDataGridPageModContentFactoryImpl extends AbstractMinistryRankingPageModContentFactoryImpl { - private static final String[] COLUMN_ORDER = { - "nameId", - "currentMemberSize", + private static final String[] COLUMN_ORDER = { + "nameId", + "currentMemberSize", "activityLevel", "avgDocumentsPerMember", "totalPropositions", "totalGovernmentBills", "totalDocuments", "documentsLastYear", - "totalDaysServed", + "totalDaysServed", "totalAssignments", - "firstAssignmentDate", + "firstAssignmentDate", "lastAssignmentDate" }; /** The Constant DATAGRID. */ 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 8eddbb482e..8b1df9ba4b 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 @@ -18,6 +18,8 @@ */ package com.hack23.cia.web.impl.ui.application.views.user.party.pagemode; +import java.util.Locale; + import org.apache.commons.lang3.StringUtils; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Component; @@ -246,7 +248,7 @@ private void addParliamentaryEngagementMetrics(VerticalLayout layout, if (summary != null) { // Active Participation layout.addComponent(createInfoRow("Parliament Activity:", - String.format("%.1f%%", calculateActivityRate(summary.getTotalActiveParliament(), party.getHeadCount())), + String.format(Locale.ENGLISH,"%.1f%%", calculateActivityRate(summary.getTotalActiveParliament(), party.getHeadCount())), VaadinIcons.CHART_LINE, "Percentage of active members in parliament")); @@ -258,12 +260,12 @@ private void addParliamentaryEngagementMetrics(VerticalLayout layout, // Historical Presence layout.addComponent(createInfoRow("Days in Government:", - String.format("%,d", summary.getTotalDaysServedGovernment()), + String.format(Locale.ENGLISH,"%,d", summary.getTotalDaysServedGovernment()), VaadinIcons.CLOCK, "Total days served in government")); layout.addComponent(createInfoRow("Parliamentary Experience:", - String.format("%,d", summary.getTotalDaysServedParliament()), + String.format(Locale.ENGLISH,"%,d", summary.getTotalDaysServedParliament()), VaadinIcons.CALENDAR_CLOCK, "Total days served in parliament")); } @@ -295,7 +297,7 @@ private void addLegislativeImpactMetrics(VerticalLayout layout, // Cross-party Cooperation layout.addComponent(createInfoRow("Collaboration Rate:", - String.format("%.1f%%", summary.getAvgCollaborationPercentage()), + String.format(Locale.ENGLISH,"%.1f%%", summary.getAvgCollaborationPercentage()), VaadinIcons.CONNECT, "Cross-party collaboration percentage")); @@ -306,7 +308,7 @@ private void addLegislativeImpactMetrics(VerticalLayout layout, // Legislative Efficiency layout.addComponent(createInfoRow("Productivity:", - String.format("%.1f", summary.getAvgDocumentsPerMember()), + String.format(Locale.ENGLISH,"%.1f", summary.getAvgDocumentsPerMember()), VaadinIcons.CHART_GRID, "Average documents per member")); } @@ -327,7 +329,7 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, if (summary != null) { // Activity Distribution layout.addComponent(createInfoRow("High Performers:", - String.format("%d (%d%%)", + String.format(Locale.ENGLISH,"%d (%d%%)", summary.getVeryHighActivityMembers(), calculatePercentage(summary.getVeryHighActivityMembers(), party.getHeadCount())), VaadinIcons.STAR, @@ -335,14 +337,14 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, // Member Focus Areas layout.addComponent(createInfoRow("Party Policy Focus:", - String.format("%d (%d%%)", + 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:", - String.format("%d (%d%%)", + String.format(Locale.ENGLISH,"%d (%d%%)", summary.getCommitteeFocusedMembers(), calculatePercentage(summary.getCommitteeFocusedMembers(), party.getHeadCount())), VaadinIcons.CLIPBOARD_USER, @@ -350,7 +352,7 @@ private void addMemberPerformanceMetrics(VerticalLayout layout, // Collaboration Metrics layout.addComponent(createInfoRow("Collaborative Members:", - String.format("%d (%d%%)", + String.format(Locale.ENGLISH,"%d (%d%%)", summary.getHighlyCollaborativeMembers(), calculatePercentage(summary.getHighlyCollaborativeMembers(), party.getHeadCount())), VaadinIcons.CONNECT,