Skip to content

Commit

Permalink
Revert "design changes for loading, changed the banner, updated tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
mengweieric committed Nov 8, 2023
1 parent ac0de03 commit 5aaf7ba
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 346 deletions.
6 changes: 0 additions & 6 deletions common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,4 @@ export interface TreeItem {
type: TreeItemType;
isExpanded: boolean;
values?: TreeItem[];
isLoading?: boolean
}

export interface isLoading {
flag: boolean;
status: string;
}
5 changes: 2 additions & 3 deletions common/utils/async_query_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ export const pollQueryStatus = (id: string, http: CoreStart['http'], callback) =
status === 'scheduled' ||
status === 'waiting'
) {
callback({status: status})
setTimeout(() => pollQueryStatus(id, http, callback), POLL_INTERVAL_MS);
} else if (status === 'failed') {
callback({ status: 'FAILED', results: [] });
callback([]);
} else if (status === 'success') {
const results = _.get(res.data.resp, 'datarows');
callback({ status: 'SUCCESS', results: results });
callback(results);
}
})
.catch((err) => {
Expand Down
214 changes: 99 additions & 115 deletions public/components/Main/__snapshots__/main.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ exports[`<Main /> spec click clear button 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -243,38 +243,34 @@ exports[`<Main /> spec click clear button 1`] = `
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--directionColumn euiFlexGroup--responsive"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
class="euiEmptyPrompt"
>
<div
class="euiEmptyPrompt"
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
</svg>
<div
class="euiSpacer euiSpacer--m"
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
<h4
class="euiTitle euiTitle--xsmall"
>
Error loading data
</h4>
</div>
</svg>
<div
class="euiSpacer euiSpacer--m"
/>
<h3
class="euiTitle euiTitle--medium"
>
Error loading data
</h3>
</div>
</div>
</div>
Expand Down Expand Up @@ -750,7 +746,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -800,38 +796,34 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--directionColumn euiFlexGroup--responsive"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
class="euiEmptyPrompt"
>
<div
class="euiEmptyPrompt"
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
</svg>
<div
class="euiSpacer euiSpacer--m"
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
<h4
class="euiTitle euiTitle--xsmall"
>
Error loading data
</h4>
</div>
</svg>
<div
class="euiSpacer euiSpacer--m"
/>
<h3
class="euiTitle euiTitle--medium"
>
Error loading data
</h3>
</div>
</div>
</div>
Expand Down Expand Up @@ -1307,7 +1299,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -1357,38 +1349,34 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--directionColumn euiFlexGroup--responsive"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
class="euiEmptyPrompt"
>
<div
class="euiEmptyPrompt"
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
</svg>
<div
class="euiSpacer euiSpacer--m"
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
<h4
class="euiTitle euiTitle--xsmall"
>
Error loading data
</h4>
</div>
</svg>
<div
class="euiSpacer euiSpacer--m"
/>
<h3
class="euiTitle euiTitle--medium"
>
Error loading data
</h3>
</div>
</div>
</div>
Expand Down Expand Up @@ -1864,7 +1852,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -2505,7 +2493,7 @@ exports[`<Main /> spec click run button, response fills null and missing values
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -3145,7 +3133,7 @@ exports[`<Main /> spec click translation button, and response is ok 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down Expand Up @@ -3195,38 +3183,34 @@ exports[`<Main /> spec click translation button, and response is ok 1`] = `
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--directionColumn euiFlexGroup--responsive"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
class="euiEmptyPrompt"
>
<div
class="euiEmptyPrompt"
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--xxLarge euiIcon--danger"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
</svg>
<div
class="euiSpacer euiSpacer--m"
<path
d="M7.59 10.059 7.35 5.18h1.3L8.4 10.06h-.81Zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184ZM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2Zm0-1h12L8 2 2 13Z"
fill-rule="evenodd"
/>
<h4
class="euiTitle euiTitle--xsmall"
>
Error loading data
</h4>
</div>
</svg>
<div
class="euiSpacer euiSpacer--m"
/>
<h3
class="euiTitle euiTitle--medium"
>
Error loading data
</h3>
</div>
</div>
</div>
Expand Down Expand Up @@ -3693,7 +3677,7 @@ exports[`<Main /> spec renders the component 1`] = `
>
<div
class="euiPageSideBar"
style="max-width: 400px; width: 400px; max-height: 1200px; overflow-y: auto;"
style="max-width: 400px; width: 400px; overflow: auto;"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionColumn euiFlexGroup--responsive"
Expand Down
6 changes: 3 additions & 3 deletions public/components/Main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import {
EuiButton,
EuiButtonIcon,
EuiCallOut,
EuiComboBoxOptionOption,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -17,6 +16,7 @@ import {
EuiPanel,
EuiSpacer,
EuiText,
EuiCallOut,
} from '@elastic/eui';
import { IHttpResponse } from 'angular';
import _ from 'lodash';
Expand Down Expand Up @@ -957,8 +957,8 @@ export class Main extends React.Component<MainProps, MainState> {
</EuiFlexGroup>
<EuiPage paddingSize="none">
{this.state.language === 'SQL' && (
<EuiPanel grow ={true}>
<EuiPageSideBar style={{ maxWidth: '400px', width: '400px', maxHeight: '1200px' ,overflowY:'auto'}}>
<EuiPanel>
<EuiPageSideBar style={{ maxWidth: '400px', width: '400px' , overflow: 'auto' }}>
<EuiFlexGroup direction="column">
<EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down
Loading

0 comments on commit 5aaf7ba

Please sign in to comment.