Skip to content

Commit

Permalink
Merge pull request #331 from wri/release/incredible-iroko-hotfix-2024…
Browse files Browse the repository at this point in the history
…-07-03

[RELEASE] Incredible Iroko Hotfix 2024 07 03
  • Loading branch information
roguenet authored Jul 3, 2024
2 parents a8ceed6 + 124d87f commit bfbaa98
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public function __invoke(Request $request): EntityWithSchemaResource
'proj_boundary' => $projectPitch->proj_boundary,
'states' => $projectPitch->states,
'proj_impact_biodiv' => $projectPitch->biodiversity_impact,
'water_source' => $projectPitch->water_source,
'baseline_biodiversity' => $projectPitch->baseline_biodiversity,
'goal_trees_restored_planting' => $projectPitch->goal_trees_restored_planting,
'goal_trees_restored_anr' => $projectPitch->goal_trees_restored_anr,
'goal_trees_restored_direct_seeding' => $projectPitch->goal_trees_restored_direct_seeding,
]);

foreach ($projectPitch->treeSpecies()->get() as $treeSpecies) {
Expand Down
5 changes: 5 additions & 0 deletions app/Models/V2/Projects/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ class Project extends Model implements MediaModel, AuditableContract, EntityMode
'proj_boundary',
'states',
'proj_impact_biodiv',
'water_source',
'baseline_biodiversity',
'goal_trees_restored_planting',
'goal_trees_restored_anr',
'goal_trees_restored_direct_seeding',
];

public $fileConfiguration = [
Expand Down
13 changes: 13 additions & 0 deletions config/wri/linked-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@
'pro-soil-health' => ['property' => 'soil_health', 'label' => 'Soil Health (project)', 'input_type' => 'long-text'],
'pro-pit-land-use-types' => ['property' => 'land_use_types', 'label' => 'Land use types', 'input_type' => 'select-image', 'multichoice' => true, 'option_list_key' => 'restoration-systems'],
'pro-pit-restoration_strategy' => ['property' => 'restoration_strategy', 'label' => 'Restoration strategy', 'input_type' => 'select-image', 'multichoice' => true, 'option_list_key' => 'restoration-practices'],
'pro-pit-baseline-biodiversity' => ['property' => 'baseline_biodiversity', 'label' => 'Baseline Biodiversity Conditions', 'input_type' => 'long-text'],
'pro-pit-goal-trees-restored-planting' => ['property' => 'goal_trees_restored_planting', 'label' => 'Trees Restored Goal - Planting', 'input_type' => 'number'],
'pro-pit-goal-trees-restored-anr' => ['property' => 'goal_trees_restored_anr', 'label' => 'Trees Restored Goal - ANR', 'input_type' => 'number'],
'pro-pit-goal-trees-restored-direct-seeding' => ['property' => 'goal_trees_restored_direct_seeding', 'label' => 'Trees Restored Goal - Direct Seeding', 'input_type' => 'number'],
],
'file-collections' => [
'pro-pit-fcol-cover' => ['property' => 'cover', 'label' => 'Cover Image', 'input_type' => 'file', 'multichoice' => false],
Expand Down Expand Up @@ -333,6 +337,12 @@
'pro-proj-boundary' => ['property' => 'proj_boundary', 'label' => 'Project Boundary', 'input_type' => 'mapInput'],
'pro-states' => ['property' => 'states', 'label' => 'States', 'input_type' => 'select', 'multichoice' => true, 'option_list_key' => 'states'],
'pro-impact-biodiv' => ['property' => 'proj_impact_biodiv', 'label' => 'Biodiversity Impact (project)', 'input_type' => 'long-text'],
// This is breaking convention for linked field keys because project pitch was already using pro-water-source.
'project-water-source' => ['property' => 'water_source', 'label' => 'Water Source', 'input_type' => 'long-text'],
'pro-baseline-biodiversity' => ['property' => 'baseline_biodiversity', 'label' => 'Baseline Biodiversity Conditions', 'input_type' => 'long-text'],
'pro-goal-trees-restored-planting' => ['property' => 'goal_trees_restored_planting', 'label' => 'Trees Restored Goal - Planting', 'input_type' => 'number'],
'pro-goal-trees-restored-anr' => ['property' => 'goal_trees_restored_anr', 'label' => 'Trees Restored Goal - ANR', 'input_type' => 'number'],
'pro-goal-trees-restored-direct-seeding' => ['property' => 'goal_trees_restored_direct_seeding', 'label' => 'Trees Restored Goal - Direct Seeding', 'input_type' => 'number'],
],
'file-collections' => [
'pro-col-media' => ['property' => 'media', 'label' => 'Media', 'input_type' => 'file', 'multichoice' => true],
Expand Down Expand Up @@ -431,6 +441,9 @@
// TODO (TM-912) Deprecated, to be removed.
'pro-rep-paid-other-activity-description' => ['property' => 'paid_other_activity_description', 'label' => 'Paid Other Activities Description', 'input_type' => 'long-text'],
'pro-rep-other-workdays-description' => ['property' => 'other_workdays_description', 'label' => 'Other Activities Description', 'input_type' => 'long-text'],
'pro-rep-local-engagement-description' => ['property' => 'local_engagement_description', 'label' => 'Response to Local Priorities', 'input_type' => 'long-text'],
'pro-rep-indirect-beneficiaries' => ['property' => 'indirect_beneficiaries', 'label' => 'Number of Indirect Beneficiaries', 'input_type' => 'number'],
'pro-rep-indirect-beneficiaries-description' => ['property' => 'indirect_beneficiaries_description', 'label' => 'Indirect Beneficiaries Description', 'input_type' => 'long-text'],
],
'relations' => [
'pro-rep-rel-tree-species' => [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('v2_project_reports', function (Blueprint $table) {
$table->text('local_engagement_description')->nullable();
$table->integer('indirect_beneficiaries')->nullable();
$table->text('indirect_beneficiaries_description')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('v2_project_reports', function (Blueprint $table) {
$table->dropColumn('local_engagement_description');
$table->dropColumn('indirect_beneficiaries');
$table->dropColumn('indirect_beneficiaries_description');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('v2_projects', function (Blueprint $table) {
$table->text('water_source')->nullable();
$table->text('baseline_biodiversity')->nullable();
$table->integer('goal_trees_restored_planting')->nullable();
$table->integer('goal_trees_restored_anr')->nullable();
$table->integer('goal_trees_restored_direct_seeding')->nullable();
});
Schema::table('project_pitches', function (Blueprint $table) {
$table->text('baseline_biodiversity')->nullable();
$table->integer('goal_trees_restored_planting')->nullable();
$table->integer('goal_trees_restored_anr')->nullable();
$table->integer('goal_trees_restored_direct_seeding')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('v2_projects', function (Blueprint $table) {
$table->dropColumn('water_source');
$table->dropColumn('baseline_biodiversity');
$table->dropColumn('goal_trees_restored_planting');
$table->dropColumn('goal_trees_restored_anr');
$table->dropColumn('goal_trees_restored_direct_seeding');
});
Schema::table('project_pitches', function (Blueprint $table) {
$table->dropColumn('baseline_biodiversity');
$table->dropColumn('goal_trees_restored_planting');
$table->dropColumn('goal_trees_restored_anr');
$table->dropColumn('goal_trees_restored_direct_seeding');
});
}
};

0 comments on commit bfbaa98

Please sign in to comment.