Skip to content

Commit

Permalink
Update data source details to use small buttons (opensearch-project#9057
Browse files Browse the repository at this point in the history
)

* update data source details tabs to use small buttons

Signed-off-by: Ritvi Bhatt <[email protected]>

* Changeset file for PR opensearch-project#9057 created/updated

* update snapshots

Signed-off-by: Ritvi Bhatt <[email protected]>

* update unit test

Signed-off-by: Ritvi Bhatt <[email protected]>

---------

Signed-off-by: Ritvi Bhatt <[email protected]>
Co-authored-by: Ritvi Bhatt <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and AMoo-Miki committed Jan 10, 2025
1 parent d287207 commit 08ded92
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 85 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/9057.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- Update data source details tabs to use small buttons ([#9057](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9057))

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import {
EuiButton,
EuiEmptyPrompt,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -13,6 +12,7 @@ import {
EuiLink,
EuiLoadingSpinner,
EuiPanel,
EuiSmallButton,
EuiSpacer,
EuiTableFieldDataColumnType,
EuiText,
Expand Down Expand Up @@ -133,15 +133,15 @@ export const AccelerationTable = ({

const RefreshButton = () => {
return (
<EuiButton
<EuiSmallButton
onClick={handleRefresh}
isLoading={
isRefreshing ||
isCatalogCacheFetching(databasesLoadStatus, tablesLoadStatus, accelerationsLoadStatus)
}
>
Refresh
</EuiButton>
Update
</EuiSmallButton>
);
};

Expand All @@ -165,7 +165,7 @@ export const AccelerationTable = ({
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup direction="rowReverse" alignItems="flexEnd">
<EuiFlexGroup direction="rowReverse" alignItems="flexEnd" gutterSize="s">
<EuiFlexItem grow={false}>
<CreateAccelerationFlyoutButton
dataSourceName={dataSourceName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from 'react';
import { shallow } from 'enzyme';
import { EuiButton, EuiHealth } from '@elastic/eui';
import { EuiHealth, EuiSmallButton } from '@elastic/eui';
import { ApplicationStart } from 'opensearch-dashboards/public';
import { CachedAcceleration } from '../../../../framework/types';
import {
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('acceleration_utils', () => {
/>
);

wrapper.find(EuiButton).simulate('click');
wrapper.find(EuiSmallButton).simulate('click');
expect(renderCreateAccelerationFlyout).toHaveBeenCalledWith({
dataSourceName: 'test_data_source',
handleRefresh,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiButton, EuiHealth } from '@elastic/eui';
import { EuiHealth, EuiSmallButton } from '@elastic/eui';
import React from 'react';
import { ApplicationStart } from 'opensearch-dashboards/public';
import { DATA_SOURCE_TYPES } from '../../../../framework/constants';
Expand Down Expand Up @@ -103,7 +103,7 @@ export const CreateAccelerationFlyoutButton = ({
dataSourceMDSId?: string;
}) => {
return (
<EuiButton
<EuiSmallButton
onClick={() =>
renderCreateAccelerationFlyout({
dataSourceName,
Expand All @@ -114,7 +114,7 @@ export const CreateAccelerationFlyoutButton = ({
fill
>
Create acceleration
</EuiButton>
</EuiSmallButton>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const AssociatedObjectsTab: React.FC<AssociatedObjectsTabProps> = (props)
};

return (
<EuiFlexGroup direction="row" alignItems="center">
<EuiFlexGroup direction="row" alignItems="center" gutterSize="s">
<EuiFlexItem>
<EuiText size="s">
<h2 className="panel-title">{panelTitle}</h2>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiButton } from '@elastic/eui';
import { EuiSmallButton } from '@elastic/eui';
import React from 'react';
import { ASSC_OBJ_REFRESH_BTN } from './associated_objects_tab_utils';

Expand All @@ -18,8 +18,13 @@ export const AssociatedObjectsRefreshButton: React.FC<AssociatedObjectsRefreshBu
const { isLoading, onClick } = props;

return (
<EuiButton iconType="refresh" onClick={onClick} isLoading={isLoading} isDisabled={isLoading}>
<EuiSmallButton
iconType="refresh"
onClick={onClick}
isLoading={isLoading}
isDisabled={isLoading}
>
{ASSC_OBJ_REFRESH_BTN}
</EuiButton>
</EuiSmallButton>
);
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EuiSpacer,
EuiText,
EuiHorizontalRule,
EuiButton,
EuiSmallButton,
} from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import { EuiPanel } from '@elastic/eui';
Expand Down Expand Up @@ -108,12 +108,12 @@ export const AccessControlTab = (props: AccessControlTabProps) => {
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
<EuiSmallButton
data-test-subj="createButton"
onClick={() => setMode(mode === 'view' ? 'edit' : 'view')}
>
{mode === 'view' ? 'Edit' : 'Cancel'}
</EuiButton>
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 08ded92

Please sign in to comment.