|
4 | 4 | Box,
|
5 | 5 | ColumnLayout,
|
6 | 6 | Container,
|
7 |
| - ExpandableSection, |
| 7 | + ExpandableSection, Header, |
8 | 8 | Icon,
|
9 |
| - LineChart, |
| 9 | + LineChart, Modal, |
10 | 10 | Pagination,
|
11 | 11 | PieChart,
|
12 | 12 | SpaceBetween,
|
@@ -164,6 +164,7 @@ function SQLResultPanel(props: SQLResultProps) {
|
164 | 164 | return Object.fromEntries(map);
|
165 | 165 | });
|
166 | 166 | }
|
| 167 | + |
167 | 168 | return (
|
168 | 169 | <div>
|
169 | 170 | <SpaceBetween size="xxl">
|
@@ -284,6 +285,16 @@ function SQLResultPanel(props: SQLResultProps) {
|
284 | 285 | );
|
285 | 286 | }
|
286 | 287 |
|
| 288 | +const AllDataModalTable = (props: { distributions: []; header: [] }) => { |
| 289 | + return ( |
| 290 | + <Table |
| 291 | + variant="embedded" |
| 292 | + columnDefinitions={props.header} |
| 293 | + items={props.distributions} |
| 294 | + /> |
| 295 | + ); |
| 296 | +}; |
| 297 | + |
287 | 298 | const DataTable = (props: { distributions: []; header: [] }) => {
|
288 | 299 | const {
|
289 | 300 | items,
|
@@ -312,21 +323,57 @@ const DataTable = (props: { distributions: []; header: [] }) => {
|
312 | 323 | return `${count} ${count === 1 ? "match" : "matches"}`;
|
313 | 324 | }
|
314 | 325 |
|
| 326 | + const [visible, setVisible] = useState(false); |
| 327 | + |
315 | 328 | return (
|
316 |
| - <Table |
317 |
| - {...collectionProps} |
318 |
| - variant="embedded" |
319 |
| - columnDefinitions={props.header} |
320 |
| - items={items} |
321 |
| - pagination={<Pagination {...paginationProps} />} |
322 |
| - filter={ |
323 |
| - <TextFilter |
324 |
| - {...filterProps} |
325 |
| - countText={filterCounter(filteredItemsCount)} |
326 |
| - filteringPlaceholder="Search" |
| 329 | + <> |
| 330 | + <Table |
| 331 | + {...collectionProps} |
| 332 | + variant="embedded" |
| 333 | + columnDefinitions={props.header} |
| 334 | + header={ |
| 335 | + <Header |
| 336 | + actions={ |
| 337 | + <Button |
| 338 | + variant="primary" |
| 339 | + onClick={() => setVisible(true)} |
| 340 | + > |
| 341 | + Open |
| 342 | + </Button> |
| 343 | + } |
| 344 | + > |
| 345 | + </Header> |
| 346 | + } |
| 347 | + items={items} |
| 348 | + pagination={<Pagination {...paginationProps} />} |
| 349 | + filter={ |
| 350 | + <TextFilter |
| 351 | + {...filterProps} |
| 352 | + countText={filterCounter(filteredItemsCount)} |
| 353 | + filteringPlaceholder="Search" |
| 354 | + /> |
| 355 | + } |
| 356 | + /> |
| 357 | + <Modal |
| 358 | + onDismiss={() => setVisible(false)} |
| 359 | + visible={visible} |
| 360 | + header="Table" |
| 361 | + footer={ |
| 362 | + <Box float="right"> |
| 363 | + <Button |
| 364 | + variant="primary" |
| 365 | + onClick={() => setVisible(false)} |
| 366 | + > |
| 367 | + Close</Button> |
| 368 | + </Box> |
| 369 | + } |
| 370 | + > |
| 371 | + <AllDataModalTable |
| 372 | + distributions={props.distributions} |
| 373 | + header={props.header} |
327 | 374 | />
|
328 |
| - } |
329 |
| - /> |
| 375 | + </Modal> |
| 376 | + </> |
330 | 377 | );
|
331 | 378 | };
|
332 | 379 |
|
|
0 commit comments