Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
708 changes: 708 additions & 0 deletions .github/workflows/deploy.yml

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions amp/TEMPLATE/ampTemplate/js_2/esrigis/mainmapPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ function initMap() {
function loadBaseMap() {
map = L.map('map').setView([latitude, longitude], 7);
// create the tile layer with correct attribution
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
if (isOsm) {
var subdomains = ['a', 'b', 'c'];
if (basemapurl !== undefined && basemapurl.indexOf("mqcdn") != -1) {
subdomains = ['otile1', 'otile2', 'otile3', 'otile4'];
}
var osmAttrib = 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osmAttrib = 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
tileLayer = new L.TileLayer(osmUrl, {
minZoom: 0,
maxZoom: 16,
attribution: osmAttrib,
subdomains: subdomains
subdomains: ['a', 'b', 'c']
});
} else {
tileLayer = L.esri.tiledMapLayer({
Expand Down
1 change: 1 addition & 0 deletions amp/TEMPLATE/reampv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"start": "DISABLE_ESLINT=true lerna run start",
"build": "DISABLE_ESLINT=true lerna run build",
"postbuild": "node scripts/sync-build-output.js",
"graph": "nx graph"
},
"author": "",
Expand Down
49 changes: 49 additions & 0 deletions amp/TEMPLATE/reampv2/scripts/sync-build-output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const fs = require('node:fs');
const path = require('node:path');

const rootDir = path.resolve(__dirname, '..');
const legacyBuildDir = path.join(rootDir, 'build');
const reampv2AppBuildDir = path.join(rootDir, 'packages', 'reampv2-app', 'build');
const ampOfflineBuildDir = path.join(rootDir, 'packages', 'ampoffline', 'build');

const copyDirectory = (sourceDir, targetDir) => {
fs.mkdirSync(targetDir, { recursive: true });

fs.readdirSync(sourceDir, { withFileTypes: true }).forEach((entry) => {
const sourcePath = path.join(sourceDir, entry.name);
const targetPath = path.join(targetDir, entry.name);

if (entry.isDirectory()) {
copyDirectory(sourcePath, targetPath);
return;
}

if (entry.isSymbolicLink()) {
fs.symlinkSync(fs.readlinkSync(sourcePath), targetPath);
return;
}

fs.copyFileSync(sourcePath, targetPath);
});
};

const syncBuildDirectory = (sourceDir, targetDir) => {
fs.rmSync(targetDir, { recursive: true, force: true });
copyDirectory(sourceDir, targetDir);
};

if (!fs.existsSync(reampv2AppBuildDir)) {
throw new Error(`Missing required reampv2 build output: ${reampv2AppBuildDir}`);
}

// Publish the legacy top-level path from the reampv2 app bundle because AMP
// menu entries and JSP redirects still point to hash routes like
// /TEMPLATE/reampv2/build/index.html#/report_generator.
syncBuildDirectory(reampv2AppBuildDir, legacyBuildDir);
console.log(`Synced ${reampv2AppBuildDir} -> ${legacyBuildDir}`);

if (fs.existsSync(ampOfflineBuildDir)) {
const legacyAmpOfflineDir = path.join(legacyBuildDir, 'ampoffline');
syncBuildDirectory(ampOfflineBuildDir, legacyAmpOfflineDir);
console.log(`Synced ${ampOfflineBuildDir} -> ${legacyAmpOfflineDir}`);
}
18 changes: 18 additions & 0 deletions amp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@
<name>amp</name>
<url>https://artifactory.dgdev.org/artifactory/amp/</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central-fallback</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
Expand All @@ -79,6 +87,14 @@
<name>amp</name>
<url>https://artifactory.dgdev.org/artifactory/amp/</url>
</pluginRepository>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central-maven-plugins</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>

<profiles>
Expand Down Expand Up @@ -1218,10 +1234,12 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-translate</artifactId>
<version>1.95.3</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>1.111.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ public class GlobalSettingsConstants {

public static final List<String> ECOWAS_COUNTRIES = Arrays.asList(
"BJ", // Benin
"BF", // Burkina Faso
"CI", // Côte d'Ivoire
"GM", // Gambia
"GH", // Ghana
"GN", // Guinea
"GW", // Guinea-Bissau
"LR", // Liberia
"ML", // Mali
"NE", // Niger
"NG", // Nigeria
"SN", // Senegal
"SL", // Sierra Leone
Expand Down Expand Up @@ -278,6 +275,8 @@ public class GlobalSettingsConstants {
public static final String EXEMPT_ORGANIZATION_DOCUMENTS = "Exempt organization to see documents";

public static final String AMP_DASHBOARD_URL = "AMP Dashboard URL";
public static final String DONOR_FUNDING_ADM_LEVEL = "Donor Funding Administrative Level";
public static final String DASHBOARD_CURRENCIES = "Dashboard Currencies";

public static final String NUMBER_OF_INDICATORS_IN_DASHBOARD = "Number of indicators in M&E Dashboard";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ private List<ReportsDashboard> processReportData(GeneratedReport report, String
for (ReportArea statusData : location.getChildren()) {
TextCell statusCell = (TextCell) statusData.getContents().get(status);
for (ReportArea typeOfAssistanceData : statusData.getChildren()) {
//for (ReportArea reportSystemData : statusData.getChildren()) {
//for (ReportArea reportSystemData : statusData.getChildren()) {
TextCell typeOfAssistanceCell= (TextCell) typeOfAssistanceData.getContents().get(typeOfAssistance);
//TextCell reportSystemCell = (TextCell) reportSystemData.getContents().get(reportingSystem);
for (ReportArea reportSystemData : typeOfAssistanceData.getChildren()) {
//for (ReportArea typeOfAssistanceData : reportSystemData.getChildren()) {
//for (ReportArea typeOfAssistanceData : reportSystemData.getChildren()) {
TextCell reportSystemCell = (TextCell) reportSystemData.getContents().get(reportingSystem);
//TextCell typeOfAssistanceCell = (TextCell) typeOfAssistanceData.getContents().get(typeOfAssistance);
for (Map.Entry<ReportOutputColumn, ReportCell> content : reportSystemData.getContents().entrySet()) {
Expand Down Expand Up @@ -182,6 +182,7 @@ public static void sendReportsToServer(List<ReportsDashboard> ampDashboardFundin
// Convert the ampDashboardFunding to JSON using a JSON library (e.g., Gson)
Gson gson = new Gson();
String jsonData = gson.toJson(ampDashboardFunding);
logger.info("Data sent: "+jsonData);

// Get the output stream of the connection
try (OutputStream os = connection.getOutputStream()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<key column="amp_structure_id" />
<one-to-many class="org.digijava.module.aim.dbentity.AmpStructureImg" />
</set>
<list name="coordinates" table="AMP_STRUCTURE_COORDINATE" lazy="false" cascade="all-delete-orphan" inverse="true">
<cache usage="read-write" />
<key column="amp_structure_id" />
<list-index column="index" />
<one-to-many class="org.digijava.module.aim.dbentity.AmpStructureCoordinate" />
</list>


<bag name="coordinates" table="AMP_STRUCTURE_COORDINATE" lazy="false" cascade="all-delete-orphan" inverse="true" order-by="amp_structure_coordinate_id">
<cache usage="read-write" />
<key column="amp_structure_id" />
<one-to-many class="org.digijava.module.aim.dbentity.AmpStructureCoordinate" />
</bag>

</class>
</hibernate-mapping>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<tns:patch closeOnSuccess="true" retryOnFail="true"
xmlns:tns="http://docs.ampdev.net/schemas/xmlpatcher" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docs.ampdev.net/schemas/xmlpatcher ../doc/xmlpatcher.xsd ">
<jira>AMP-31057</jira>
<author>bmokandu</author>
<description>Dashboard Currencies</description>
<apply>
<script>
<lang delimiter=";" type="postgres"><![CDATA[
INSERT INTO amp_global_settings (id, settingsname, settingsvalue, possiblevalues, description, section) VALUES
((select max(id) + 1 FROM amp_global_settings), 'Dashboard Currencies', 'USD|XOF|EUR', '',
'Dashboard Currencies Separated by pipe', 'general');
]]></lang>
</script>
</apply>
</tns:patch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<tns:patch closeOnSuccess="true" retryOnFail="true"
xmlns:tns="http://docs.ampdev.net/schemas/xmlpatcher"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://docs.ampdev.net/schemas/xmlpatcher ../../../schemas/xmlpatcher.xsd">
<jira>AMP-31057</jira>
<keyword>Define possible values for Donor Funding Administrative Level and link to view</keyword>
<author>brianmokandu</author>

<apply>
<script>
<lang delimiter=";" type="postgres">

-- ️ Insert possible values for Donor Funding Administrative Level (if not already existing)
INSERT INTO util_global_settings_possible_ (setting_name, value_id, value_shown)
SELECT 'Donor Funding Administrative Level', 'Administrative Level 0', 'Administrative Level 0'
WHERE NOT EXISTS (
SELECT 1 FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level'
AND value_id = 'Administrative Level 0'
AND value_shown = 'Administrative Level 0'
)
UNION
SELECT 'Donor Funding Administrative Level', 'Administrative Level 1', 'Administrative Level 1'
WHERE NOT EXISTS (
SELECT 1 FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level'
AND value_id = 'Administrative Level 1'
AND value_shown = 'Administrative Level 1'
)
UNION
SELECT 'Donor Funding Administrative Level', 'Administrative Level 2', 'Administrative Level 2'
WHERE NOT EXISTS (
SELECT 1 FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level'
AND value_id = 'Administrative Level 2'
AND value_shown = 'Administrative Level 2'
)
UNION
SELECT 'Donor Funding Administrative Level', 'Administrative Level 3', 'Administrative Level 3'
WHERE NOT EXISTS (
SELECT 1 FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level'
AND value_id = 'Administrative Level 3'
AND value_shown = 'Administrative Level 3'
)
UNION
SELECT 'Donor Funding Administrative Level', 'Administrative Level 4', 'Administrative Level 4'
WHERE NOT EXISTS (
SELECT 1 FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level'
AND value_id = 'Administrative Level 4'
AND value_shown = 'Administrative Level 4'
);

-- Create or replace view for dropdown (value_id kept as varchar)
CREATE OR REPLACE VIEW v_g_donor_funding_settings_admin_levels AS
SELECT
value_id AS id,
value_shown AS value
FROM util_global_settings_possible_
WHERE setting_name = 'Donor Funding Administrative Level';

-- Insert into amp_global_settings if not already existing
INSERT INTO amp_global_settings (id, settingsname, settingsvalue, possiblevalues, description, section, value_translatable)
SELECT
(SELECT COALESCE(MAX(id), 0) + 1 FROM amp_global_settings),
'Donor Funding Administrative Level',
'Administrative Level 0',
'v_g_donor_funding_settings_admin_levels',
'Specifies which administrative level applies when doing donor funding imports',
'general',
TRUE
WHERE NOT EXISTS (
SELECT 1 FROM amp_global_settings
WHERE settingsname = 'Donor Funding Administrative Level'
);

</lang>
</script>
</apply>
</tns:patch>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<lang delimiter=";" type="postgres"><![CDATA[
SELECT setval('amp_global_settings_seq', (SELECT MAX(id) FROM amp_global_settings));
INSERT INTO amp_global_settings(id, settingsname, settingsvalue, possiblevalues, description, section, value_translatable, internal)
VALUES (nextval('amp_global_settings_seq'), 'Login Required For GIS', 'true', 't_Boolean', 'Login Required For GIS', 'gis', null, FALSE);
VALUES ((select max(id) + 1 FROM amp_global_settings), 'Login Required For GIS', 'true', 't_Boolean', 'Login Required For GIS', 'gis', null, FALSE);
]]></lang>
</script>
</apply>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
JOIN ni_all_programs_with_levels apl ON a.amp_program_id = apl.amp_theme_id
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id0
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting

WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id0, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id0, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id1
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id1, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id1, level.amp_theme_id, level.name

) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id2
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id2, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id2, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id3
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id3, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id3, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id4
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id4, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id4, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id5
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id5, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id5, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id6
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id6, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id6, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id7
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id7, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id7, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id8
JOIN amp_program_settings aps ON aps.amp_program_settings_id = a.program_setting
WHERE aps.name = 'National Plan Objective' AND a.program_percentage <> 0
GROUP BY a.amp_activity_id, apl.id8, level.amp_theme_id
GROUP BY a.amp_activity_id, apl.id8, level.amp_theme_id, level.name
) v
ON aav.amp_activity_id = v.amp_activity_id;
]]></lang>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
JOIN all_programs_with_levels oapl ON afpp.amp_program_id = oapl.amp_theme_id
LEFT JOIN amp_theme level ON level.amp_theme_id = apl.id3
WHERE oapl.program_setting_name = 'Tertiary Program'
GROUP BY afpp.pledge_id, apl.id3, level.amp_theme_id,level.name
GROUP BY afpp.pledge_id, apl.id3, level.amp_theme_id,level.name
) v
ON afp.id = v.pledge_id;
</lang>
Expand Down
Loading
Loading