@eeacms/volto-cca-policy 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +259 -3
  2. package/jest-addon.config.js +4 -2
  3. package/locales/bg/LC_MESSAGES/volto.po +576 -0
  4. package/locales/cs/LC_MESSAGES/volto.po +576 -0
  5. package/locales/da/LC_MESSAGES/volto.po +576 -0
  6. package/locales/de/LC_MESSAGES/volto.po +576 -0
  7. package/locales/el/LC_MESSAGES/volto.po +576 -0
  8. package/locales/en/LC_MESSAGES/volto.po +576 -0
  9. package/locales/es/LC_MESSAGES/volto.po +576 -0
  10. package/locales/et/LC_MESSAGES/volto.po +576 -0
  11. package/locales/fi/LC_MESSAGES/volto.po +576 -0
  12. package/locales/fr/LC_MESSAGES/volto.po +576 -0
  13. package/locales/ga/LC_MESSAGES/volto.po +576 -0
  14. package/locales/hr/LC_MESSAGES/volto.po +576 -0
  15. package/locales/hu/LC_MESSAGES/volto.po +576 -0
  16. package/locales/is/LC_MESSAGES/volto.po +576 -0
  17. package/locales/it/LC_MESSAGES/volto.po +576 -0
  18. package/locales/lt/LC_MESSAGES/volto.po +576 -0
  19. package/locales/lv/LC_MESSAGES/volto.po +576 -0
  20. package/locales/mt/LC_MESSAGES/volto.po +576 -0
  21. package/locales/nl/LC_MESSAGES/volto.po +576 -0
  22. package/locales/nn/LC_MESSAGES/volto.po +576 -0
  23. package/locales/pl/LC_MESSAGES/volto.po +576 -0
  24. package/locales/pt/LC_MESSAGES/volto.po +576 -0
  25. package/locales/ro/LC_MESSAGES/volto.po +576 -0
  26. package/locales/sk/LC_MESSAGES/volto.po +576 -0
  27. package/locales/sl/LC_MESSAGES/volto.po +576 -0
  28. package/locales/sv/LC_MESSAGES/volto.po +576 -0
  29. package/locales/tr/LC_MESSAGES/volto.po +576 -0
  30. package/locales/volto.pot +577 -1
  31. package/package.json +1 -1
  32. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.jsx +224 -0
  33. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.test.jsx +173 -0
  34. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueContentView.jsx +189 -0
  35. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.jsx +272 -0
  36. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.test.jsx +160 -0
  37. package/src/components/Search/NavigatorCatalogue/utils.js +157 -0
  38. package/src/components/Search/NavigatorCatalogue/utils.test.js +132 -0
  39. package/src/components/Search/NavigatorGuide/NavigatorGuideContentView.jsx +409 -0
  40. package/src/components/Search/NavigatorGuide/NavigatorGuideLayout.jsx +8 -0
  41. package/src/components/index.js +2 -0
  42. package/src/components/theme/CompareTools/CompareToolsPanel.jsx +151 -0
  43. package/src/components/theme/CompareTools/CompareToolsPanel.test.jsx +96 -0
  44. package/src/components/theme/CompareTools/CompareToolsView.jsx +475 -0
  45. package/src/components/theme/CompareTools/CompareToolsView.test.jsx +110 -0
  46. package/src/components/theme/CompareTools/utils.js +111 -0
  47. package/src/components/theme/CompareTools/utils.test.jsx +217 -0
  48. package/src/components/theme/Views/ExtendedToolView.jsx +201 -201
  49. package/src/components/theme/Views/ExtendedToolView.test.jsx +420 -58
  50. package/src/constants.js +0 -48
  51. package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +1 -1
  52. package/src/helpers/Utils.jsx +29 -0
  53. package/src/helpers/index.js +3 -0
  54. package/src/index.js +28 -2
  55. package/src/search/index.js +6 -0
  56. package/src/search/navigator_catalogue/config.js +89 -0
  57. package/src/search/navigator_catalogue/facets.js +86 -0
  58. package/src/search/navigator_catalogue/views.js +28 -0
  59. package/src/search/navigator_guide/config.js +70 -0
  60. package/src/search/navigator_guide/facets.js +31 -0
  61. package/src/search/navigator_guide/guideSteps.js +93 -0
  62. package/src/slate-styles.less +4 -0
  63. package/src/state.js +1 -0
  64. package/theme/elements/button.overrides +0 -11
  65. package/theme/elements/label.overrides +15 -0
  66. package/theme/globals/blocks.less +3 -2
  67. package/theme/globals/navigator.less +1090 -0
  68. package/theme/globals/site.overrides +5 -0
  69. package/theme/tokens/colors.less +2 -0
  70. package/artifacts/BLOCKS.md +0 -167
  71. package/artifacts/link-integrity-workflow/README.md +0 -76
  72. package/artifacts/link-integrity-workflow/index.md +0 -33
  73. package/artifacts/link-integrity-workflow/link-integrity-block-fields-report.md +0 -132
  74. package/artifacts/link-integrity-workflow/link-integrity-blocks-report.md +0 -52
  75. package/artifacts/link-integrity-workflow/understanding-link-integrity.md +0 -143
  76. package/artifacts/link-integrity-workflow/volto-block-link-analysis.md +0 -63
  77. package/artifacts/link-integrity-workflow/volto-block-link-discovery.md +0 -60
  78. package/artifacts/test-fixes/test-fixes-specification.md +0 -267
@@ -5,6 +5,8 @@ import installMissionToolsSearch from './mission_tools/config-tools';
5
5
  import installMissionProjectsSearch from './mission_projects/config-projects';
6
6
  import installMissionFundingSearch from './mission_funding/config-funding';
7
7
  import installMissionAllSearch from './mission_all/config-all';
8
+ import installNavigatorCatalogueSearch from './navigator_catalogue/config';
9
+ import installNavigatorGuideSearch from './navigator_guide/config';
8
10
 
9
11
  const extraQueryParams = {
10
12
  text_fields: [
@@ -35,6 +37,8 @@ const applyConfig = (config) => {
35
37
  installMissionToolsSearch,
36
38
  installMissionFundingSearch,
37
39
  installMissionAllSearch,
40
+ installNavigatorCatalogueSearch,
41
+ installNavigatorGuideSearch,
38
42
  ].reduce((acc, cur) => cur(acc), config.settings.searchlib);
39
43
 
40
44
  const searchui = config.settings.searchlib.searchui;
@@ -44,6 +48,8 @@ const applyConfig = (config) => {
44
48
  searchui.missionStoriesSearch.extraQueryParams = extraQueryParams;
45
49
  searchui.missionToolsSearch.extraQueryParams = extraQueryParams;
46
50
  searchui.missionAll.extraQueryParams = extraQueryParams;
51
+ searchui.navigatorCatalogueSearch.extraQueryParams = extraQueryParams;
52
+ searchui.navigatorGuideSearch.extraQueryParams = extraQueryParams;
47
53
 
48
54
  // console.log(config.settings.searchlib);
49
55
 
@@ -0,0 +1,89 @@
1
+ import { mergeConfig } from '@eeacms/search';
2
+ import { build_runtime_mappings } from '@eeacms/volto-globalsearch/utils';
3
+ import { getClientProxyAddress } from './../utils';
4
+ import { vocab } from './../vocabulary';
5
+
6
+ import facets from './facets';
7
+ import views from './views';
8
+
9
+ const navigatorCatalogueConfig = {
10
+ title: 'Navigator Catalogue',
11
+ ...views,
12
+ };
13
+
14
+ export const clusters = {
15
+ name: 'op_cluster',
16
+ field: 'objectProvides',
17
+ clusters: [
18
+ {
19
+ name: 'Tools',
20
+ icon: { name: 'wrench' },
21
+ values: ['Tool'],
22
+ },
23
+ ].map((cluster) => ({
24
+ ...cluster,
25
+ defaultResultView: 'horizontalCard',
26
+ })),
27
+ };
28
+
29
+ export default function installNavigatorCatalogueSearch(config) {
30
+ const envConfig = {
31
+ ...navigatorCatalogueConfig,
32
+ ...(process.env.RAZZLE_ENV_CONFIG
33
+ ? JSON.parse(process.env.RAZZLE_ENV_CONFIG)
34
+ : {}),
35
+ };
36
+
37
+ const pjson = require('@eeacms/volto-cca-policy/../package.json');
38
+
39
+ envConfig.app_name = pjson.name;
40
+ envConfig.app_version = pjson.version;
41
+
42
+ config.searchui.navigatorCatalogueSearch = {
43
+ ...mergeConfig(envConfig, config.searchui.globalsearchbase),
44
+ elastic_index: '_es/globalsearch',
45
+ index_name: 'data_searchui',
46
+ host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
47
+ vocab,
48
+ runtime_mappings: build_runtime_mappings(clusters),
49
+ };
50
+
51
+ const { navigatorCatalogueSearch } = config.searchui;
52
+
53
+ navigatorCatalogueSearch.showClusters = false;
54
+
55
+ navigatorCatalogueSearch.contentSectionsParams = {
56
+ ...navigatorCatalogueSearch.contentSectionsParams,
57
+ enable: false,
58
+ };
59
+
60
+ navigatorCatalogueSearch.permanentFilters.push({
61
+ term: {
62
+ cluster_name: 'cca_navigator',
63
+ },
64
+ });
65
+
66
+ navigatorCatalogueSearch.permanentFilters.push({
67
+ bool: {
68
+ must_not: [
69
+ {
70
+ term: {
71
+ 'seo_noindex.keyword': 'true',
72
+ },
73
+ },
74
+ ],
75
+ },
76
+ });
77
+
78
+ navigatorCatalogueSearch.facets = facets;
79
+ navigatorCatalogueSearch.views = views;
80
+ navigatorCatalogueSearch.contentBodyComponent =
81
+ 'NavigatorCatalogueContentView';
82
+
83
+ if (typeof window !== 'undefined') {
84
+ config.searchui.navigatorCatalogueSearch.host =
85
+ process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
86
+ }
87
+
88
+ return config;
89
+ }
@@ -0,0 +1,86 @@
1
+ import { multiTermFacet } from '@eeacms/search';
2
+ import { defineMessages } from 'react-intl';
3
+ import {
4
+ cca_adaptation_sectors,
5
+ cca_climate_impacts,
6
+ geographic_countries,
7
+ language,
8
+ } from './../common';
9
+
10
+ const messages = defineMessages({
11
+ adaptationSupportCycleStep: {
12
+ id: 'Adaptation Support Cycle Step',
13
+ defaultMessage: 'Adaptation Support Cycle Step',
14
+ },
15
+ userGroups: {
16
+ id: 'User Groups',
17
+ defaultMessage: 'User Groups',
18
+ },
19
+ typeOfOutputs: {
20
+ id: 'Type of Outputs',
21
+ defaultMessage: 'Type of Outputs',
22
+ },
23
+ typeOfData: {
24
+ id: 'Type of Data',
25
+ defaultMessage: 'Type of Data',
26
+ },
27
+ licenseStatus: {
28
+ id: 'License status',
29
+ defaultMessage: 'License status',
30
+ },
31
+ natureBasedSolution: {
32
+ id: 'Nature-based solution',
33
+ defaultMessage: 'Nature-based solution',
34
+ },
35
+ });
36
+
37
+ const facets = [
38
+ cca_adaptation_sectors,
39
+ cca_climate_impacts,
40
+ geographic_countries,
41
+ language,
42
+ multiTermFacet({
43
+ field: 'cca_adaptation_support_cycle_step.keyword',
44
+ isFilterable: false,
45
+ isMulti: true,
46
+ label: messages.adaptationSupportCycleStep,
47
+ alwaysVisible: false,
48
+ }),
49
+ multiTermFacet({
50
+ field: 'cca_intended_user_groups.keyword',
51
+ isFilterable: false,
52
+ isMulti: true,
53
+ label: messages.userGroups,
54
+ alwaysVisible: false,
55
+ }),
56
+ multiTermFacet({
57
+ field: 'cca_type_of_outputs.keyword',
58
+ isFilterable: false,
59
+ isMulti: true,
60
+ label: messages.typeOfOutputs,
61
+ alwaysVisible: false,
62
+ }),
63
+ multiTermFacet({
64
+ field: 'cca_type_of_data.keyword',
65
+ isFilterable: false,
66
+ isMulti: true,
67
+ label: messages.typeOfData,
68
+ alwaysVisible: false,
69
+ }),
70
+ multiTermFacet({
71
+ field: 'cca_license_status.keyword',
72
+ isFilterable: false,
73
+ isMulti: true,
74
+ label: messages.licenseStatus,
75
+ alwaysVisible: false,
76
+ }),
77
+ multiTermFacet({
78
+ field: 'cca_nature_based_solution.keyword',
79
+ isFilterable: false,
80
+ isMulti: true,
81
+ label: messages.natureBasedSolution,
82
+ alwaysVisible: false,
83
+ }),
84
+ ];
85
+
86
+ export default facets;
@@ -0,0 +1,28 @@
1
+ const viewsCatalogue = {
2
+ resultViews: [
3
+ {
4
+ id: 'listing',
5
+ title: 'List view',
6
+ icon: 'ri-list-check',
7
+ render: null,
8
+ isDefault: true,
9
+ factories: {
10
+ view: 'HorizontalCard.Group',
11
+ item: 'NavigatorCatalogueCardItem',
12
+ },
13
+ },
14
+ {
15
+ id: 'map',
16
+ title: 'Map view',
17
+ icon: 'ri-map-2-line',
18
+ render: null,
19
+ isDefault: false,
20
+ factories: {
21
+ view: 'NavigatorCatalogueMapView',
22
+ item: 'NavigatorCatalogueCardItem',
23
+ },
24
+ },
25
+ ],
26
+ };
27
+
28
+ export default viewsCatalogue;
@@ -0,0 +1,70 @@
1
+ import { mergeConfig } from '@eeacms/search';
2
+
3
+ import { getClientProxyAddress } from './../utils';
4
+ import { vocab } from './../vocabulary';
5
+ import facets from './facets';
6
+
7
+ const previewResultsLimit = 3;
8
+
9
+ const navigatorGuideConfig = {
10
+ title: 'Navigator Guide',
11
+ landingPageURL: '/en/navigator',
12
+ alwaysSearchOnInitialLoad: true,
13
+ resultsPerPage: previewResultsLimit,
14
+ previewResultsLimit,
15
+ trackUrlState: true,
16
+ showLandingPage: false,
17
+ layoutComponent: 'NavigatorGuideLayout',
18
+ contentBodyComponent: 'NavigatorGuideContentView',
19
+ resultsPageURL: '/en/navigator/tool-catalogue',
20
+ };
21
+
22
+ export default function installNavigatorGuideSearch(config) {
23
+ const pjson = require('@eeacms/volto-cca-policy/../package.json');
24
+ const appConfig = {
25
+ ...navigatorGuideConfig,
26
+ app_name: pjson.name,
27
+ app_version: pjson.version,
28
+ };
29
+
30
+ config.searchui.navigatorGuideSearch = {
31
+ ...mergeConfig(appConfig, config.searchui.globalsearchbase),
32
+ elastic_index: '_es/globalsearch',
33
+ index_name: 'data_searchui',
34
+ host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
35
+ vocab,
36
+ facets,
37
+ };
38
+
39
+ const { navigatorGuideSearch } = config.searchui;
40
+
41
+ navigatorGuideSearch.contentSectionsParams = {
42
+ ...navigatorGuideSearch.contentSectionsParams,
43
+ enable: false,
44
+ };
45
+
46
+ navigatorGuideSearch.permanentFilters.push({
47
+ bool: {
48
+ must_not: [
49
+ {
50
+ term: {
51
+ 'seo_noindex.keyword': 'true',
52
+ },
53
+ },
54
+ ],
55
+ },
56
+ });
57
+
58
+ navigatorGuideSearch.permanentFilters.push({
59
+ term: {
60
+ cluster_name: 'cca_navigator',
61
+ },
62
+ });
63
+
64
+ if (typeof window !== 'undefined') {
65
+ navigatorGuideSearch.host =
66
+ process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
67
+ }
68
+
69
+ return config;
70
+ }
@@ -0,0 +1,31 @@
1
+ import { multiTermFacet } from '@eeacms/search';
2
+ import { defineMessages } from 'react-intl';
3
+ import {
4
+ cca_adaptation_sectors,
5
+ cca_climate_impacts,
6
+ geographic_countries,
7
+ language,
8
+ } from './../common';
9
+
10
+ const messages = defineMessages({
11
+ adaptationSupportCycleStep: {
12
+ id: 'Adaptation Support Cycle Step',
13
+ defaultMessage: 'Adaptation Support Cycle Step',
14
+ },
15
+ });
16
+
17
+ const facets = [
18
+ cca_adaptation_sectors,
19
+ cca_climate_impacts,
20
+ geographic_countries,
21
+ language,
22
+ multiTermFacet({
23
+ field: 'cca_adaptation_support_cycle_step.keyword',
24
+ isFilterable: false,
25
+ isMulti: true,
26
+ label: messages.adaptationSupportCycleStep,
27
+ alwaysVisible: false,
28
+ }),
29
+ ];
30
+
31
+ export default facets;
@@ -0,0 +1,93 @@
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ const messages = defineMessages({
4
+ adaptationSectors: {
5
+ id: 'Adaptation Sectors',
6
+ defaultMessage: 'Adaptation Sectors',
7
+ },
8
+ adaptationSectorsQuestion: {
9
+ id: 'What sectors does your work focus on?',
10
+ defaultMessage: 'What sectors does your work focus on?',
11
+ },
12
+ adaptationSectorsDescription: {
13
+ id: 'Start the guided tour by selecting one or more sector. On the right, you will begin to see a preview of the available tools, filtered according to your selections.',
14
+ defaultMessage:
15
+ 'Start the guided tour by selecting one or more sector. On the right, you will begin to see a preview of the available tools, filtered according to your selections.',
16
+ },
17
+ climateImpacts: {
18
+ id: 'Climate Impacts',
19
+ defaultMessage: 'Climate Impacts',
20
+ },
21
+ climateImpactsQuestion: {
22
+ id: 'Which climate hazard are you addressing?',
23
+ defaultMessage: 'Which climate hazard are you addressing?',
24
+ },
25
+ climateImpactsDescription: {
26
+ id: 'Choose one or more hazards relevant to your work. This narrows tools to those covering your risk.',
27
+ defaultMessage:
28
+ 'Choose one or more hazards relevant to your work. This narrows tools to those covering your risk.',
29
+ },
30
+ adaptationStage: {
31
+ id: 'Adaptation Stage',
32
+ defaultMessage: 'Adaptation Stage',
33
+ },
34
+ adaptationStageQuestion: {
35
+ id: 'What stage of the adaptation stage are you working on?',
36
+ defaultMessage: 'What stage of the adaptation stage are you working on?',
37
+ },
38
+ adaptationStageDescription: {
39
+ id: 'The steps follows the Climate-ADAPT Adaptation Support Tool cycle. Pick the stage(s) you need support for - we keep tools that help at thor points in the process.',
40
+ defaultMessage:
41
+ 'The steps follows the Climate-ADAPT Adaptation Support Tool cycle. Pick the stage(s) you need support for - we keep tools that help at thor points in the process.',
42
+ },
43
+ coverage: {
44
+ id: 'Coverage',
45
+ defaultMessage: 'Coverage',
46
+ },
47
+ coverageQuestion: {
48
+ id: 'Which spatial coverage do you need?',
49
+ defaultMessage: 'Which spatial coverage do you need?',
50
+ },
51
+ coverageDescription: {
52
+ id: 'Pick the levels your work operates at. We keep tools whose data and guidance reach those scales.',
53
+ defaultMessage:
54
+ 'Pick the levels your work operates at. We keep tools whose data and guidance reach those scales.',
55
+ },
56
+ });
57
+
58
+ const guideSteps = [
59
+ {
60
+ id: 'adaptationSectors',
61
+ label: messages.adaptationSectors,
62
+ title: messages.adaptationSectorsQuestion,
63
+ description: messages.adaptationSectorsDescription,
64
+ field: 'cca_adaptation_sectors.keyword',
65
+ filterType: 'all',
66
+ },
67
+ {
68
+ id: 'climateImpacts',
69
+ label: messages.climateImpacts,
70
+ title: messages.climateImpactsQuestion,
71
+ description: messages.climateImpactsDescription,
72
+ field: 'cca_climate_impacts.keyword',
73
+ filterType: 'any',
74
+ },
75
+ {
76
+ id: 'adaptationStage',
77
+ label: messages.adaptationStage,
78
+ title: messages.adaptationStageQuestion,
79
+ description: messages.adaptationStageDescription,
80
+ field: 'cca_adaptation_support_cycle_step.keyword',
81
+ filterType: 'any',
82
+ },
83
+ // {
84
+ // id: 'coverage',
85
+ // label: messages.coverage,
86
+ // title: messages.coverageQuestion,
87
+ // description: messages.coverageDescription,
88
+ // field: 'cca_geographical_scale.keyword',
89
+ // filterType: 'any',
90
+ // },
91
+ ];
92
+
93
+ export default guideSteps;
@@ -13,3 +13,7 @@
13
13
  font-size: 1rem;
14
14
  line-height: 1.3;
15
15
  }
16
+
17
+ .green-text {
18
+ color: #289588;
19
+ }
package/src/state.js CHANGED
@@ -1,3 +1,4 @@
1
1
  import { atom } from 'jotai';
2
2
 
3
3
  export const selectedLanguageAtom = atom(null);
4
+ export const navigatorGuideStepAtom = atom(0);
@@ -9,14 +9,3 @@
9
9
  outline: none;
10
10
  }
11
11
  }
12
-
13
- .ui.basic.primary.button,
14
- .ui.basic.secondary.button {
15
- box-shadow: none !important;
16
-
17
- &:hover,
18
- &:active {
19
- background: transparent !important;
20
- box-shadow: none !important;
21
- }
22
- }
@@ -0,0 +1,15 @@
1
+ .ui.medium.labels .label,
2
+ .ui.medium.label {
3
+ border-color: @green;
4
+ background-color: @green;
5
+
6
+ &:hover {
7
+ border-color: @green;
8
+ background-color: @green;
9
+ }
10
+ }
11
+
12
+ .ui.label {
13
+ font-size: 14px;
14
+ line-height: inherit;
15
+ }
@@ -27,8 +27,9 @@
27
27
  }
28
28
  }
29
29
 
30
- .ui.items > .item > img + .content {
31
- padding-left: 1rem;
30
+ .ui.items > .item > img + .content,
31
+ .ui.items > .item > .icon + .content {
32
+ padding-left: 1rem !important;
32
33
  }
33
34
 
34
35
  // Fix alignment issue in slate box