@cdc/editor 4.24.4 → 4.24.7

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.
@@ -1,36 +0,0 @@
1
- import _ from 'lodash'
2
-
3
- export const formatConfigBeforeSave = configToStrip => {
4
- let strippedConfig = { ...configToStrip }
5
-
6
- if (strippedConfig.type === 'dashboard') {
7
- if (strippedConfig.datasets) {
8
- Object.keys(strippedConfig.datasets).forEach(datasetKey => {
9
- delete strippedConfig.datasets[datasetKey].formattedData
10
- if (strippedConfig.datasets[datasetKey].dataUrl) {
11
- delete strippedConfig.datasets[datasetKey].data
12
- }
13
- })
14
- }
15
- if (strippedConfig.visualizations) {
16
- Object.keys(strippedConfig.visualizations).forEach(vizKey => {
17
- strippedConfig.visualizations[vizKey] = _.omit(strippedConfig.visualizations[vizKey], ['runtime', 'formattedData', 'data'])
18
- })
19
- }
20
- if (strippedConfig.rows) {
21
- strippedConfig.rows.forEach(row => {
22
- if (row.dataKey) {
23
- row = _.omit(row, ['data', 'formattedData'])
24
- }
25
- })
26
- }
27
- } else {
28
- delete strippedConfig.runtime
29
- delete strippedConfig.formattedData
30
- if (strippedConfig.dataUrl) {
31
- delete strippedConfig.data
32
- }
33
- }
34
-
35
- return strippedConfig
36
- }