datajunction-ui 0.0.1-rc.11 → 0.0.1-rc.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datajunction-ui",
3
- "version": "0.0.1-rc.11",
3
+ "version": "0.0.1-rc.12",
4
4
  "description": "DataJunction Metrics Platform UI",
5
5
  "module": "src/index.tsx",
6
6
  "repository": {
@@ -59,7 +59,7 @@ export function SQLBuilderPage() {
59
59
  setData(queryInfo.results);
60
60
  queryInfo.numRows = queryInfo.results[0].rows.length;
61
61
  setViewData(true);
62
- setShowNumRows(100);
62
+ setShowNumRows(10);
63
63
  }
64
64
  };
65
65
  fetchData().catch(console.error);
@@ -126,7 +126,7 @@ export function SQLBuilderPage() {
126
126
  if (selectedMetrics.length && selectedDimensions.length) {
127
127
  const query = await djClient.sqls(selectedMetrics, selectedDimensions);
128
128
  setShowHelp(false);
129
- setQuery(query);
129
+ setQuery(query.sql);
130
130
  } else {
131
131
  resetView();
132
132
  setShowHelp(true);
@@ -175,7 +175,7 @@ export function SQLBuilderPage() {
175
175
  onChange={handleMetricSelect}
176
176
  onMenuClose={handleMetricSelectorClose}
177
177
  />
178
- <h4>Group By</h4>
178
+ <h4>Shared Dimensions</h4>
179
179
  <Select
180
180
  name="dimensions"
181
181
  formatOptionLabel={formatOptionLabel}
@@ -190,32 +190,6 @@ export function SQLBuilderPage() {
190
190
  onChange={handleDimensionSelect}
191
191
  onMenuClose={handleDimensionSelectorClose}
192
192
  />
193
- <h4>Filter By</h4>
194
- <Select
195
- name="filters"
196
- className="filters"
197
- formatOptionLabel={formatOptionLabel}
198
- options={commonDimensionsList}
199
- noOptionsMessage={() =>
200
- 'No shared dimensions found. Try selecting different metrics.'
201
- }
202
- placeholder={`${commonDimensionsList.length} Shared Dimensions`}
203
- isClearable
204
- closeMenuOnSelect={true}
205
- // onChange={handleDimensionSelect}
206
- // onMenuClose={handleDimensionSelectorClose}
207
- />
208
- <Select
209
- name="filters"
210
- className="filters-operator"
211
- // formatOptionLabel={formatOptionLabel}
212
- options={[{value: '=', label: '='}, {value: '>', label: '>'}, {value: '>', label: '>'}]}
213
- placeholder={`Operator`}
214
- closeMenuOnSelect={true}
215
- // onChange={handleDimensionSelect}
216
- // onMenuClose={handleDimensionSelectorClose}
217
- />
218
- <input value={`Value`}></input>
219
193
  </div>
220
194
  <div className="card-header">
221
195
  {showHelp ? (
@@ -277,7 +251,7 @@ export function SQLBuilderPage() {
277
251
  <span style={{ display: 'inline-block' }}>
278
252
  <Select
279
253
  name="num-rows"
280
- defaultValue={numRowsOptions[1]}
254
+ defaultValue={numRowsOptions[0]}
281
255
  options={numRowsOptions}
282
256
  onChange={e => setShowNumRows(e.value)}
283
257
  />
@@ -300,10 +274,9 @@ export function SQLBuilderPage() {
300
274
  )}
301
275
  {submittedQueryInfo ? <QueryInfo {...submittedQueryInfo} /> : <></>}
302
276
  <div>
303
- {/*{query.dialect}*/}
304
277
  {query && !viewData ? (
305
278
  <SyntaxHighlighter language="sql" style={foundation}>
306
- {format(query.sql, {
279
+ {format(query, {
307
280
  language: 'spark',
308
281
  tabWidth: 2,
309
282
  keywordCase: 'upper',
@@ -865,13 +865,3 @@ pre {
865
865
  .inactive {
866
866
  display: none;
867
867
  }
868
-
869
- .filters {
870
- width: 500px;
871
- display: inline-table;
872
- }
873
-
874
- .filters-operator {
875
- width: 200px;
876
- display: inline-table;
877
- }