Skip to content

Commit 4292169

Browse files
committed
Fixes to content of the react dashboard guide
1 parent a2b11b3 commit 4292169

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

Diff for: guides/react-dashboard/content/4_explore_page.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ order: 4
55

66
On the Explore page, the user either creates a new chart or updates the existing one. To do so, the user should be able to select measures, dimensions, apply filters if needed, and select a chart type. We also need to provide a way to save a new chart to the dashboard or to update the existing one when editing.
77

8-
The GIF below shows how the page will look after the styling is applied.
8+
The image below shows how the page will look after the styling is applied.
99

10-
<GIF>
10+
![](/images/4-screenshot-1.png)
1111

1212
Let’s break down the page into components. We need a modal window to let the user set or update the chart’s title—`<TitleModal />`. Next, we have a page’s header—`<PageHeader />`. Inside the page’s header to the right, we have a button that is used to either add a chart to the dashboard or update it. It is a regular `<Button />` component from antd’s UI kit. To the left—a page’s title, which either displays a chart’s title when editing or just says ‘Explore’ when we are building a new one. Let’s call it an `<ExploreTitle />` component.
1313

Diff for: guides/react-dashboard/content/5_query_builder.md

+2-19
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ component. Feel free to skip this part if you don't need to style it. Below, you
88
can see the final design of the query builder, which we'll have by the end of this
99
part.
1010

11-
<QUERY BUILDER GIF>
11+
`video: /videos/5-video.mp4`
1212

1313
The query builder component in the template, `<ExploreQueryBuilder />`, is built based on the
1414
`<QueryBuilder />` component from the `@cubejs-client/react` package. The `<QueryBuilder />` abstracts state management and API calls to Cube.js Backend. It uses render prop and doesn’t render anything itself, but calls the render function instead. This way it gives maximum flexibility to building a custom-tailored UI with a minimal API.
@@ -28,7 +28,6 @@ with the following.
2828

2929
```jsx
3030
import React from "react";
31-
import * as PropTypes from "prop-types";
3231
import { Row, Col, Card, Divider } from "antd";
3332
import styled from 'styled-components';
3433
import { QueryBuilder } from "@cubejs-client/react";
@@ -191,7 +190,6 @@ with the following.
191190

192191
```jsx
193192
import React from 'react';
194-
import * as PropTypes from 'prop-types';
195193
import MemberDropdown from './MemberDropdown';
196194
import RemoveButtonGroup from './RemoveButtonGroup';
197195
import MemberGroupTitle from './MemberGroupTitle';
@@ -237,7 +235,6 @@ following.
237235

238236
```jsx
239237
import React from 'react';
240-
import * as PropTypes from 'prop-types';
241238
import { Button, Dropdown } from 'antd';
242239

243240
import PlusIcon from './PlusIcon';
@@ -326,11 +323,6 @@ const ButtonDropdown = ({ overlay, type, ...buttonProps }) => {
326323
)
327324
}
328325

329-
ButtonDropdown.propTypes = {
330-
overlay: PropTypes.object.isRequired,
331-
type: PropTypes.oneOf(['new', 'icon', 'selected'])
332-
};
333-
334326
export default ButtonDropdown;
335327
```
336328

@@ -345,7 +337,6 @@ with the following.
345337

346338
```jsx
347339
import React from 'react';
348-
import * as PropTypes from 'prop-types';
349340
import { Button } from 'antd';
350341
import removeButtonSvg from './remove-button.svg';
351342

@@ -482,7 +473,6 @@ following.
482473

483474
```jsx
484475
import React from 'react';
485-
import * as PropTypes from 'prop-types';
486476
import {
487477
Menu
488478
} from 'antd';
@@ -593,7 +583,6 @@ Finally, update the `<FilterGroup />` component in `src/components/QueryBuilder/
593583

594584
```jsx
595585
import React from 'react';
596-
import * as PropTypes from 'prop-types';
597586
import { Select } from 'antd';
598587
import MemberDropdown from './MemberDropdown';
599588
import RemoveButtonGroup from './RemoveButtonGroup';
@@ -657,7 +646,6 @@ following.
657646

658647
```jsx
659648
import React from 'react';
660-
import * as PropTypes from 'prop-types';
661649
import {
662650
Menu, Icon, Dropdown
663651
} from 'antd';
@@ -689,7 +677,7 @@ const SelectChartType = ({ chartType, updateChartType }) => {
689677
{ChartTypes.map(m => (
690678
<Menu.Item key={m.title} onClick={() => updateChartType(m.name)}>
691679
<Icon type={m.icon} />
692-
{m.title}
680+
&nbsp;{m.title}
693681
</Menu.Item>
694682
))}
695683
</Menu>
@@ -707,11 +695,6 @@ const SelectChartType = ({ chartType, updateChartType }) => {
707695
);
708696
};
709697

710-
SelectChartType.propTypes = {
711-
chartType: PropTypes.string.isRequired,
712-
updateChartType: PropTypes.func.isRequired
713-
};
714-
715698
export default SelectChartType;
716699
```
717700

Diff for: guides/react-dashboard/demo/schema/Orders.js

-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ cube(`Orders`, {
1717
type: `count`,
1818
},
1919

20-
countCompleted: {
21-
type: `count`,
22-
filters: [{
23-
sql: `${completed}`
24-
}]
25-
},
26-
2720
totalAmount: {
2821
sql: `${amount}`,
2922
type: `sum`,
598 KB
Loading

0 commit comments

Comments
 (0)