mod-build 4.0.15 → 4.0.16

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.0.16
2
+
3
+ - Tech Debt: Moving the `getDefaultTopRecommendedContent()` locally back to the bestcompany-top-recommended repo (as it is not needed as a global function)
4
+
1
5
  ## 4.0.15
2
6
 
3
7
  - Updated the `firstDate` for the Warmer Weather season (needs to match the flags set in the seasonal-updates repository trigger)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.15",
3
+ "version": "4.0.16",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -70,42 +70,6 @@ const getDefaultFormFieldConfig = async (config, folder = 'accessible-components
70
70
  });
71
71
  };
72
72
 
73
- // Default Content for Best Company Top Recommended Pages (Zip Version)
74
- const getDefaultTopRecommendedContent = async (config) => {
75
- let trade = 'solar'; // Currently only available for Solar; But if other trades are needed, let's convert this to an array & grab all default content
76
- const url = `https://api2.bestcompany.com/api/external/${trade}/get-top-recommended`,
77
- apiToken = 'jtsb9RnZYE1UsDy7Wpka4bmaEWYrI7KUDdLQO68ec612336d';
78
-
79
- fs.writeFileSync(`${defaultSettings.srcFolder}/resources/data/defaultContent.json`, '', 'utf8');
80
-
81
- await new Promise((resolve) => {
82
- axiosInstance.get(url, {
83
- headers: {
84
- 'Authorization': `Bearer ${apiToken}`
85
- }
86
- })
87
- .then(async resp => {
88
- if (resp.status !== 200) {
89
- throw new Error(`${resp.status}: Error while fetching default top recommended content`);
90
- }
91
- const defaultTopRecommended = resp.data;
92
- trade = trade.split('-');
93
- const camelCaseTrade = trade.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
94
-
95
- let tradeWrapper = {
96
- [`default${camelCaseTrade}Content`]: defaultTopRecommended
97
- }
98
- fs.appendFileSync(`${defaultSettings.srcFolder}/resources/data/defaultContent.json`, JSON.stringify(tradeWrapper, null, 2), 'utf8');
99
- resolve();
100
- }).catch(error => {
101
- console.error(error);
102
- resolve();
103
- }).finally(() => {
104
- axiosInstance.interceptors.response.eject(responseInterceptor);
105
- });
106
- });
107
- }
108
-
109
73
  const fetchTcpaFromSitegenie = async (config, tempConfig) => {
110
74
  const company = config.company_name;
111
75
  const companyPlaceholder = "<%=company_name%>";
@@ -194,9 +158,6 @@ export default async function(config) {
194
158
  if (!config.tcpaText && config.primary_trade && !tempConfigCreated) {
195
159
  await fetchTcpaFromSitegenie(config, tempConfig);
196
160
  }
197
- if (config.getTopRecommendedContent && !tempConfigCreated) {
198
- await getDefaultTopRecommendedContent(config);
199
- }
200
161
  }
201
162
 
202
163
  if (!tempConfigCreated) {