Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funding program field added advanced search filter #1435

Merged
merged 5 commits into from
Oct 4, 2024
Merged
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
3 changes: 3 additions & 0 deletions moped-database/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5505,6 +5505,7 @@
- current_phase_simple
- date_added
- ecapris_subproject_id
- funding_program_names
- funding_source_and_program_names
- funding_source_name
- interim_project_id
Expand Down Expand Up @@ -5557,6 +5558,7 @@
- current_phase_simple
- date_added
- ecapris_subproject_id
- funding_program_names
- funding_source_and_program_names
- funding_source_name
- interim_project_id
Expand Down Expand Up @@ -5609,6 +5611,7 @@
- current_phase_simple
- date_added
- ecapris_subproject_id
- funding_program_names
- funding_source_and_program_names
- funding_source_name
- interim_project_id
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moped-database/views/component_arcgis_online_view.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Most recent migration: moped-database/migrations/1727279529178_update_component_agol_view_school_beacons/up.sql
-- Most recent migration: moped-database/migrations/1727458564792_add_funding_program_to_project_list_view/up.sql

CREATE OR REPLACE VIEW component_arcgis_online_view AS WITH work_types AS (
SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Most recent migration: moped-database/migrations/1727279529178_update_component_agol_view_school_beacons/up.sql
-- Most recent migration: moped-database/migrations/1727458564792_add_funding_program_to_project_list_view/up.sql

CREATE OR REPLACE VIEW exploded_component_arcgis_online_view AS SELECT
component_arcgis_online_view.project_id,
Expand Down
6 changes: 4 additions & 2 deletions moped-database/views/project_list_view.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Most recent migration: moped-database/migrations/1719872865109_add_work_plan_category/up.sql
-- Most recent migration: moped-database/migrations/1727458564792_add_funding_program_to_project_list_view/up.sql

CREATE OR REPLACE VIEW project_list_view AS WITH project_person_list_lookup AS (
SELECT
Expand All @@ -16,6 +16,7 @@ funding_sources_lookup AS (
SELECT
mpf.project_id,
string_agg(DISTINCT mfs.funding_source_name, ', '::text ORDER BY mfs.funding_source_name) AS funding_source_name,
string_agg(DISTINCT mfp.funding_program_name, ', '::text ORDER BY mfp.funding_program_name) AS funding_program_names,
string_agg(
DISTINCT
CASE
Expand Down Expand Up @@ -210,6 +211,7 @@ SELECT
WHERE true AND components.is_deleted = false AND components.project_id = mp.project_id AND feature_signals.signal_id IS NOT null AND feature_signals.is_deleted = false
) AS project_feature,
fsl.funding_source_name,
fsl.funding_program_names,
fsl.funding_source_and_program_names,
ptl.type_name,
(
Expand Down Expand Up @@ -283,4 +285,4 @@ LEFT JOIN LATERAL (
LIMIT 1
) proj_status_update ON true
WHERE mp.is_deleted = false
GROUP BY mp.project_id, mp.project_name, mp.project_description, ppll.project_team_members, mp.ecapris_subproject_id, mp.date_added, mp.is_deleted, me.entity_name, mel.entity_name, mp.updated_at, mp.interim_project_id, mp.parent_project_id, mp.knack_project_id, current_phase.phase_name, current_phase.phase_key, current_phase.phase_name_simple, ptl.type_name, mpcs.components, fsl.funding_source_name, fsl.funding_source_and_program_names, added_by_user.first_name, added_by_user.last_name, mpps.name, cpl.children_project_ids, proj_status_update.project_note, proj_status_update.date_created, work_activities.workgroup_contractors, work_activities.contract_numbers, work_activities.task_order_names, work_activities.task_order_names_short, work_activities.task_orders, districts.project_council_districts, districts.project_and_child_project_council_districts, mepd.min_phase_date, mcpd.min_phase_date;
GROUP BY mp.project_id, mp.project_name, mp.project_description, ppll.project_team_members, mp.ecapris_subproject_id, mp.date_added, mp.is_deleted, me.entity_name, mel.entity_name, mp.updated_at, mp.interim_project_id, mp.parent_project_id, mp.knack_project_id, current_phase.phase_name, current_phase.phase_key, current_phase.phase_name_simple, ptl.type_name, mpcs.components, fsl.funding_source_name, fsl.funding_program_names, fsl.funding_source_and_program_names, added_by_user.first_name, added_by_user.last_name, mpps.name, cpl.children_project_ids, proj_status_update.project_note, proj_status_update.date_created, work_activities.workgroup_contractors, work_activities.contract_numbers, work_activities.task_order_names, work_activities.task_order_names_short, work_activities.task_orders, districts.project_council_districts, districts.project_and_child_project_council_districts, mepd.min_phase_date, mcpd.min_phase_date;
4 changes: 4 additions & 0 deletions moped-editor/src/queries/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,10 @@ export const LOOKUP_TABLES_QUERY = gql`
funding_source_id
funding_source_name
}
moped_fund_programs {
funding_program_id
funding_program_name
}
moped_types(order_by: { type_name: asc }) {
type_id
type_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,23 @@ export const PROJECT_LIST_VIEW_FILTERS_CONFIG = {
"string_is_not_null",
],
},
funding_program_names: {
name: "funding_program_names",
label: "Funding programs",
placeholder: "Funding program",
type: "string",
lookup: {
table_name: "moped_fund_programs",
getOptionLabel: (option) => option.funding_program_name,
operators: ["string_contains_case_insensitive"],
},
defaultOperator: "string_contains_case_insensitive",
operators: [
"string_contains_case_insensitive",
"string_is_null",
"string_is_not_null",
],
},
project_status_update: {
name: "project_status_update",
label: "Status update",
Expand Down