Skip to content

Commit 974049d

Browse files
committed
Add markup includes to editor home page
1 parent 9485c80 commit 974049d

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

packages/dashboard/src/components/VisualizationsPanel/VisualizationsPanel.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,7 @@ const addVisualization = (type, subType) => {
4646
newVisualizationConfig.visualizationType = type
4747
break
4848
case 'markup-include':
49-
newVisualizationConfig.contentEditor = {
50-
inlineHTML: '<h2>Inline HTML</h2>',
51-
markupVariables: [],
52-
showHeader: true,
53-
srcUrl: '#example',
54-
useInlineHTML: true
55-
}
56-
newVisualizationConfig.theme = 'theme-blue'
57-
newVisualizationConfig.visual = {
58-
border: false,
59-
accent: false,
60-
background: false,
61-
hideBackgroundColor: false,
62-
borderColorTheme: false
63-
}
64-
newVisualizationConfig.showEditorPanel = true
6549
newVisualizationConfig.visualizationType = type
66-
6750
break
6851
case 'dashboardFilters': {
6952
newVisualizationConfig.sharedFilterIndexes = []

packages/editor/src/components/ChooseTab.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import ComboChartIcon from '@cdc/core/assets/icon-combo-chart.svg'
2727
import EpiChartIcon from '@cdc/core/assets/icon-epi-chart.svg'
2828
import TableIcon from '@cdc/core/assets/icon-table.svg'
2929
import WarmingStripesIcon from '@cdc/core/assets/icon-warming-stripes.svg'
30+
import CodeIcon from '@cdc/core/assets/icon-code.svg'
3031
import Icon from '@cdc/core/components/ui/Icon'
3132

3233
import {
@@ -317,6 +318,16 @@ const buttons = [
317318
content: `Specify the calculation of a single data point (such as a percentage value) and present it on a horizontal
318319
scale.`
319320
},
321+
{
322+
id: 26,
323+
category: 'General',
324+
label: 'Markup Include',
325+
type: 'markup-include',
326+
subType: null,
327+
orientation: null,
328+
icon: <CodeIcon />,
329+
content: 'Include custom HTML markup or embed content from external URLs.'
330+
},
320331
{
321332
id: 17,
322333
category: 'General',

packages/editor/src/scss/choose-vis-tab.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
display: grid;
1515
gap: 1em;
1616
&.category_general {
17-
grid-template-columns: repeat(5, 160px);
17+
grid-template-columns: repeat(6, 160px);
1818
}
1919
&.category_charts {
2020
grid-template-columns: repeat(7, 160px);

packages/markup-include/src/CdcMarkupInclude.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const CdcMarkupInclude: React.FC<CdcMarkupIncludeProps> = ({
124124
processedConfig.filters = addValuesToFilters(processedConfig.filters, responseData)
125125
}
126126

127-
updateConfig({ ...configObj, ...processedConfig })
127+
updateConfig({ ...defaults, ...processedConfig })
128128
dispatch({ type: 'SET_LOADING', payload: false })
129129
}
130130

packages/markup-include/src/data/initial-state.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
export default {
22
contentEditor: {
3-
inlineHTML: '<h2>Inline HTML</h2>',
3+
inlineHTML: '<strong>Inline HTML</strong>',
4+
markupVariables: [],
45
showHeader: true,
56
srcUrl: '#example',
67
title: '',
78
titleStyle: 'small',
8-
useInlineHTML: false,
9+
useInlineHTML: true,
910
showNoDataMessage: false,
1011
noDataMessageText: 'No Data Available'
1112
},
1213
data: [],
1314
legend: {},
1415
newViz: true,
16+
showEditorPanel: true,
1517
theme: 'theme-blue',
1618
type: 'markup-include',
19+
visualizationType: 'markup-include',
1720
runtime: null,
1821
visual: {
1922
border: false,

0 commit comments

Comments
 (0)