Skip to content

Commit c694fe2

Browse files
author
Chris DeMartini
committed
chore: update api key, string fields only for interaction
1 parent b05ed16 commit c694fe2

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/App.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,18 +576,12 @@ class App extends Component {
576576
}
577577

578578
componentDidMount() {
579-
const _this = this;
580579
window.addEventListener('resize', this.resize, true);
581580
this.resize();
582581

583582
tableauExt
584583
.initializeAsync({configure: this.configure})
585584
.then(() => {
586-
return fetch('https://mapsconfig.tableau.com/v1/config.json');
587-
})
588-
.then(response => {
589-
return response.json();
590-
}).then((configJson) => {
591585
// console.log('tableau config', configJson);
592586
// default tableau settings on initial entry into the extension
593587
// we know if we haven't done anything yet when tableauSettings state = []
@@ -629,8 +623,9 @@ class App extends Component {
629623
// Initialize the current saved settings global
630624
TableauSettings.init();
631625

626+
// default to uber's Kepler key that they requested if user does not enter
632627
this.setState({
633-
tableauKey: (configJson.access_token || []).token,
628+
tableauKey: 'pk.eyJ1IjoidWJlcmRhdGEiLCJhIjoiY2p2OGVvejQwMDJxZzRma2dvdWQ2OTQwcSJ9.VbuIamTa_JayuD2yr5tjaA',
634629
isLoading: false,
635630
height: window.innerHeight,
636631
width: window.innerWidth,
@@ -742,7 +737,7 @@ class App extends Component {
742737
customCallBack={this.customCallBack}
743738
field={'configuration'}
744739
tableauSettings={tableauSettingsState}
745-
configSheetColumns={this.state.ConfigSheetColumns || []}
740+
configSheetColumns={this.state.ConfigSheetStringColumns || []}
746741
/>
747742
<StepButtons
748743
onNextClick={this.onNextStep}

src/components/Configuration/CustomScreen.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class CustomScreen extends React.Component {
6868
<OptionTitle style={{paddingLeft: "8px"}}>{this.props.configTitle}</OptionTitle>
6969
<FormControl className={classes.formControl}>
7070
<InputLabelWithTooltip
71-
title="Mapbox API Key"
72-
tooltipText="Your unique API key for utilizing mapbox"
71+
title="Optional: Mapbox API Key"
72+
tooltipText="Optional: Your unique API key for utilizing mapbox"
7373
/>
7474
<TextField
7575
// className={classes.textField}
@@ -131,7 +131,7 @@ class CustomScreen extends React.Component {
131131
<FormControl className={classes.formControl}>
132132
<InputLabelWithTooltip
133133
title="Hover Identifying Field"
134-
tooltipText="Select which field to take action on"
134+
tooltipText="Select which STRING field to take action on (we require string for interaction)"
135135
/>
136136
<Select
137137
value={tableauSettings.hoverField || "None"}
@@ -164,7 +164,7 @@ class CustomScreen extends React.Component {
164164
<FormControl className={classes.formControl}>
165165
<InputLabelWithTooltip
166166
title="Click Identifying Field"
167-
tooltipText="Select which field to take action on"
167+
tooltipText="Select which STRING field to take action on (we require string for interaction)"
168168
/>
169169
<Select
170170
value={tableauSettings.clickField || "None"}
@@ -182,7 +182,7 @@ class CustomScreen extends React.Component {
182182
<FormControl className={classes.formControl}>
183183
<InputLabelWithTooltip
184184
title="Tableau to Kepler Filter Field"
185-
tooltipText="Select which field to use when filtering Kepler"
185+
tooltipText="Select which STRING field to use when filtering Kepler (we require string for interaction)"
186186
/>
187187
<Select
188188
value={tableauSettings.keplerFilterField || "None"}

src/utils/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,16 @@ export function getSampleForTypeAnalyze({fields, rows, sampleCount = 50}) {
106106
}
107107

108108
export function dataTableToKepler(table) {
109-
const data = [];
109+
const col_names_s = [];
110110
let keplerFields = table.columns.map(columnToKeplerField);
111111

112+
table.columns.map(column => {
113+
if (column.dataType === 'string') {
114+
col_names_s.push(column);
115+
}
116+
});
117+
// console.log('checking the string fields', table, keplerFields, table.columns, col_names_s);
118+
112119
// for string fields, we have to detect their types, because they
113120
// may contain geometry info
114121
keplerFields = analyzeStringFields(keplerFields, table.data);
@@ -121,6 +128,7 @@ export function dataTableToKepler(table) {
121128
return {
122129
isLoading: false,
123130
ConfigSheetColumns: table.columns,
131+
ConfigSheetStringColumns: col_names_s,
124132
ConfigSheetData: {fields: keplerFields, rows: keplerData} //data, we need something more like tableau for kepler
125133
};
126134
}

0 commit comments

Comments
 (0)