diff --git a/config/facets.facet_source.search_api__views_page__goals__page_1.yml b/config/facets.facet_source.search_api__views_page__goals__page_1.yml new file mode 100644 index 00000000..74bd265e --- /dev/null +++ b/config/facets.facet_source.search_api__views_page__goals__page_1.yml @@ -0,0 +1,9 @@ +uuid: fcf79d3f-f238-4dd6-9faa-fc2c68fb6b2f +langcode: en +status: true +dependencies: { } +id: search_api__views_page__goals__page_1 +name: 'search_api:views_page__goals__page_1' +filter_key: null +url_processor: query_string +breadcrumb: { } diff --git a/config/graphql_compose.settings.yml b/config/graphql_compose.settings.yml index 4fed4bca..c77e363c 100644 --- a/config/graphql_compose.settings.yml +++ b/config/graphql_compose.settings.yml @@ -86,6 +86,9 @@ entity_config: enabled: true indicator: enabled: true + query_load_enabled: true + edges_enabled: true + routes_enabled: true measurement: enabled: true period: diff --git a/config/search_api.index.goals.yml b/config/search_api.index.goals.yml index a1de1900..a3c215a4 100644 --- a/config/search_api.index.goals.yml +++ b/config/search_api.index.goals.yml @@ -8,12 +8,22 @@ dependencies: - search_api.server.database_search module: - node + - storage - taxonomy id: goals name: Goals description: '' read_only: false field_settings: + aggregated_administration: + label: 'Aggregated administration' + property_path: aggregated_field + type: string + configuration: + type: union + fields: + - 'entity:node/field_administration' + - 'entity:storage/field_administration' aggregated_field: label: 'Aggregated field' property_path: aggregated_field @@ -25,6 +35,15 @@ field_settings: - 'entity:node/field_agency' - 'entity:node/field_goals' - 'entity:node/title' + aggregated_type: + label: type + property_path: aggregated_field + type: string + configuration: + type: union + fields: + - 'entity:node/type' + - 'entity:storage/type' field_administration: label: Administration datasource_id: 'entity:node' @@ -53,6 +72,14 @@ datasource_settings: languages: default: true selected: { } + 'entity:storage': + bundles: + default: false + selected: + - indicator + languages: + default: true + selected: { } processor_settings: add_url: { } aggregated_field: { } diff --git a/config/views.view.goals.yml b/config/views.view.goals.yml index eda3fe4a..263c2da2 100644 --- a/config/views.view.goals.yml +++ b/config/views.view.goals.yml @@ -399,10 +399,10 @@ display: options: { } empty: { } sorts: - aggregated_field: - id: aggregated_field + search_api_relevance: + id: search_api_relevance table: search_api_index_goals - field: aggregated_field + field: search_api_relevance relationship: none group_type: group admin_label: '' @@ -684,86 +684,138 @@ display: sort: 50 settings: sort: ASC - field_administration: - id: field_administration + facets_aggregated_administration: + id: facets_aggregated_administration table: search_api_index_goals - field: field_administration + field: facets_aggregated_administration relationship: none group_type: group admin_label: '' - plugin_id: search_api_numeric - operator: '!=' - value: - min: '' - max: '' - value: '54' + plugin_id: facets_filter + operator: '=' + value: '' group: 1 - exposed: false + exposed: true expose: - operator_id: field_administration_op - label: Administration - description: null + operator_id: '' + label: 'Aggregated administration' + description: '' use_operator: false - operator: field_administration_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: field_administration + identifier: aggregated_administration required: false remember: false - multiple: false + multiple: true remember_roles: authenticated: authenticated - min_placeholder: null - max_placeholder: null - placeholder: null + anonymous: '0' + content_editor: '0' + administrator: '0' + next_js_site: '0' is_grouped: false group_info: - label: Administration - description: null - identifier: field_administration + label: '' + description: '' + identifier: '' optional: true widget: select multiple: false remember: false default_group: All default_group_multiple: { } - group_items: - 1: { } - 2: { } - 3: { } - field_administration_1: - id: field_administration_1 + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: false + processor_configs: { } + facets_aggregated_type: + id: facets_aggregated_type table: search_api_index_goals - field: field_administration + field: facets_aggregated_type relationship: none group_type: group admin_label: '' - plugin_id: search_api_numeric + plugin_id: facets_filter operator: '=' - value: - min: '' - max: '' - value: '' + value: '' group: 1 exposed: true expose: - operator_id: field_administration_1_op - label: Administration + operator_id: '' + label: type description: '' use_operator: false - operator: field_administration_1_op + operator: '' operator_limit_selection: false operator_list: { } - identifier: Administration + identifier: aggregated_type required: false remember: false - multiple: false + multiple: true remember_roles: authenticated: authenticated anonymous: '0' content_editor: '0' administrator: '0' next_js_site: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: + raw_value_widget_order: + weights: + sort: 50 + settings: + sort: ASC + aggregated_administration: + id: aggregated_administration + table: search_api_index_goals + field: aggregated_administration + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_string + operator: '!=' + value: + min: '' + max: '' + value: '46' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated min_placeholder: '' max_placeholder: '' placeholder: '' @@ -808,6 +860,221 @@ display: display_plugin: page position: 1 display_options: + filters: + aggregated_field: + id: aggregated_field + table: search_api_index_goals + field: aggregated_field + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_string + operator: '=' + value: + min: '' + max: '' + value: '' + group: 1 + exposed: true + expose: + operator_id: aggregated_field_op + label: 'Aggregated field' + description: '' + use_operator: false + operator: aggregated_field_op + operator_limit_selection: false + operator_list: { } + identifier: aggregated_field + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + content_editor: '0' + administrator: '0' + next_js_site: '0' + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: 'Aggregated field' + description: null + identifier: aggregated_field + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: + 1: { } + 2: { } + 3: { } + facets_name: + id: facets_name + table: search_api_index_goals + field: facets_name + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: 'Topics » Taxonomy term » Name' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: Topics + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + anonymous: '0' + content_editor: '0' + administrator: '0' + next_js_site: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: + combine_processor: + weights: + build: 5 + settings: { } + raw_value_widget_order: + weights: + sort: 50 + settings: + sort: ASC + facets_aggregated_type: + id: facets_aggregated_type + table: search_api_index_goals + field: facets_aggregated_type + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: type + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: aggregated_type + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + anonymous: '0' + content_editor: '0' + administrator: '0' + next_js_site: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: false + processor_configs: { } + facets_aggregated_administration: + id: facets_aggregated_administration + table: search_api_index_goals + field: facets_aggregated_administration + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: 'Aggregated administration' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: aggregated_administration + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + anonymous: '0' + content_editor: '0' + administrator: '0' + next_js_site: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: false + processor_configs: { } + filter_groups: + operator: AND + groups: + 1: AND + defaults: + filters: false + filter_groups: false display_extenders: { } path: goals cache_metadata: diff --git a/src/frontend/components/field--goal-type.tsx b/src/frontend/components/field--goal-type.tsx index fdabcfda..6d0e34d2 100644 --- a/src/frontend/components/field--goal-type.tsx +++ b/src/frontend/components/field--goal-type.tsx @@ -6,6 +6,10 @@ export function FieldGoalType({ field_goal_type }) { goalTypeName = "Agency priority goal"; goalTypeClasses = "bg-primary-vivid"; break; + case "pma": + goalTypeName = "PMA"; + goalTypeClasses = "bg-primary-vivid"; + break; case "strategic": goalTypeName = "Strategic goal"; goalTypeClasses = "bg-base-darkest"; @@ -18,6 +22,10 @@ export function FieldGoalType({ field_goal_type }) { goalTypeName = "Plan"; goalTypeClasses = "bg-base-darkest"; break; + case "indicator": + goalTypeName = "Indicator"; + goalTypeClasses = "bg-base-darkest"; + break; default: goalTypeName = "Default" goalTypeClasses = "bg-base"; diff --git a/src/frontend/components/field--objectives.tsx b/src/frontend/components/field--objectives.tsx index 912eba77..1585ec93 100644 --- a/src/frontend/components/field--objectives.tsx +++ b/src/frontend/components/field--objectives.tsx @@ -72,13 +72,3 @@ export function FieldObjectives({fieldObjectives} : FieldObjectiveProps) { ); } - - // return( - //
Error
+ } +} export default function GoalsSearchView({ filters, goals, total, description }: ViewGoalSearch) { const offsetAmount = 15; const [fulltext, setFulltext] = useState(filters[0]?.value ? filters[0].value : ""); const [administration, setAdministration] = useState("53"); const [totalResults, setTotalResults] = useState(total) - const [displayGoals, setDisplayGoals] = useState(goals) + const [displayGoals, setDisplayGoals] = useState(goals); + const [viewType, setViewType] = useState([]); const [facets, setFacets] = useState(filters[1]?.options ? filters[1].options : []) const [filtersOpen, setFiltersOpen] = useState(false); const [offset, setOffset] = useState(offsetAmount); @@ -37,7 +47,7 @@ export default function GoalsSearchView({ filters, goals, total, description }: e.preventDefault(); } const cleanFacets = facets.map((f) => encodeURIComponent(f)); - const url = `/api/goal-search?fulltext=${fulltext}&facets=${cleanFacets}&administration=${administration}`; + const url = `/api/goal-search?fulltext=${fulltext}&facets=${cleanFacets}&administration=${administration}&type=${viewType}`; setOffset(offsetAmount) try { const response = await fetch(url); @@ -52,7 +62,7 @@ export default function GoalsSearchView({ filters, goals, total, description }: } catch (error) { console.error(error.message); } - }, [fulltext, administration]) + }, [fulltext, administration, viewType]) @@ -100,26 +110,30 @@ export default function GoalsSearchView({ filters, goals, total, description }:- No matching goals. + No matching results.