Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit and Finish UX Fixes #1092

Merged
merged 26 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5bf33a1
remove horizontal line below search bar
jowg-amazon Sep 13, 2024
0afeb34
space between header and panel 16px and space around table 16px
jowg-amazon Sep 13, 2024
1e5c8c1
fix 16px around table and search bar
jowg-amazon Sep 13, 2024
bfd05ab
remove pagination from top of table
jowg-amazon Sep 13, 2024
120050b
add button to create monitor
jowg-amazon Sep 13, 2024
599056c
add tooltip to delete
jowg-amazon Sep 13, 2024
23fc71a
remove space on trash icon
jowg-amazon Sep 13, 2024
1e6b6b3
fix gutter size
jowg-amazon Sep 13, 2024
2241053
move edit under actions
jowg-amazon Sep 13, 2024
f3ba90a
fix notifications breadcrumb redirect
jowg-amazon Sep 13, 2024
2f20f89
spacing from title to panel 16 for view monitor
jowg-amazon Sep 13, 2024
3dc5cd0
fix some padding and remove horiz rule for findings section
jowg-amazon Sep 14, 2024
d907151
change update monitor to edit monitor
jowg-amazon Sep 14, 2024
0ebea4f
change update to save and fix padding for create monitor
jowg-amazon Sep 14, 2024
b0a36d4
change monitor details padding and fix link to new page in alerts card
jowg-amazon Sep 16, 2024
cf5d02c
remove boarder when empty state
jowg-amazon Sep 16, 2024
10b79dd
fix search bar spacing above
jowg-amazon Sep 16, 2024
597fe11
make create and edit monitor panels 16px padding
jowg-amazon Sep 16, 2024
80a159d
rename
jowg-amazon Sep 16, 2024
1f2ba30
fix original tabs
jowg-amazon Sep 16, 2024
6795ddf
fix spacing on original monitor page
jowg-amazon Sep 16, 2024
27cef37
add pagination back to the alerts page
jowg-amazon Sep 16, 2024
10664d9
fix spacing for alerts dashboard flyout
jowg-amazon Sep 16, 2024
7fef4c4
cleanup
jowg-amazon Sep 16, 2024
b8fb210
fix unit tests and run yarn test:jest -u
jowg-amazon Sep 16, 2024
6765788
fix cypress tests
jowg-amazon Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions public/components/Breadcrumbs/Breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export async function getBreadcrumb(route, routeState, httpClient) {
console.error(err);
}
const breadcrumbs = [{ text: monitorName, href: `/monitors/${base}` }];
if (action === MONITOR_ACTIONS.UPDATE_MONITOR)
breadcrumbs.push({ text: 'Update monitor', href: '/' });
if (action === MONITOR_ACTIONS.EDIT_MONITOR)
breadcrumbs.push({ text: 'Edit monitor', href: '/' });
if (action === TRIGGER_ACTIONS.CREATE_TRIGGER)
breadcrumbs.push({ text: 'Create trigger', href: '/' });
if (action === TRIGGER_ACTIONS.UPDATE_TRIGGER)
Expand Down
2 changes: 1 addition & 1 deletion public/components/Breadcrumbs/Breadcrumbs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('getBreadcrumb', () => {
httpClientMock.get.mockResolvedValue({ ok: true, resp: { name: 'random_name' } });
expect(
await getBreadcrumb(
`${monitorId}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`,
`${monitorId}?action=${MONITOR_ACTIONS.EDIT_MONITOR}`,
{},
httpClientMock
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Array [
},
Object {
"href": "/",
"text": "Update monitor",
"text": "Edit monitor",
},
]
`;
Expand Down
2 changes: 1 addition & 1 deletion public/components/ContentPanel/ContentPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ContentPanel = ({
children,
panelOptions = {},
}) => (
<EuiPanel style={{ paddingLeft: '0px', paddingRight: '0px', ...panelStyles }}>
<EuiPanel style={{ padding: '16px', ...panelStyles }}>
<EuiFlexGroup style={{ padding: '0px 10px' }} justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem>
<EuiText size={titleSize}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`ContentPanel renders 1`] = `
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left:0px;padding-right:0px"
style="padding:16px"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const DataSourceAlertsCard: React.FC<DataSourceAlertsCardProps> = ({ get

useEffect(() => {
setLoading(true);
getClient().get('../api/alerting/alerts', {
getClient().get('../api/alerting/alerts', {
query: {
size: 25,
sortField: 'start_time',
dataSourceId: dataSource?.id || '',
sortDirection: 'desc'
}
}
}).then(res => {
if (res.ok) {
setAlerts(res.alerts);
Expand All @@ -53,7 +53,7 @@ export const DataSourceAlertsCard: React.FC<DataSourceAlertsCardProps> = ({ get
const createAlertDetailsHeader = useCallback((alert) => {
const severityColor = getSeverityColor(alert.severity);
const triggerName = alert.trigger_name ?? DEFAULT_EMPTY_DATA;

return (
<EuiFlexGroup gutterSize="s" justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false}>
Expand Down Expand Up @@ -147,9 +147,9 @@ export const DataSourceAlertsCard: React.FC<DataSourceAlertsCardProps> = ({ get
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiLink href={getApplication().getUrlForApp(ALERTS_NAV_ID, { path: '#/dashboard' })} target="_blank"><EuiText size="s" className="eui-displayInline">View all</EuiText></EuiLink>
<EuiLink href={getApplication().getUrlForApp(ALERTS_NAV_ID, { path: '#/dashboard' })}><EuiText size="s" className="eui-displayInline">View all</EuiText></EuiLink>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
)
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ export default class AlertsDashboardFlyoutComponent extends Component {
onPageChange={this.onPageClick}
isAlertsFlyout={true}
monitorType={monitorType}
panelStyles={{ padding: '8px 0px 16px' }}
/>
<EuiHorizontalRule margin="xs" />
<EuiBasicTable
items={loading ? [] : trimmedAlerts}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ exports[`AlertsDashboardFlyoutComponent renders 1`] = `
onSearchChange={[Function]}
onStateChange={[Function]}
pageCount={1}
panelStyles={
Object {
"padding": "8px 0px 16px",
}
}
search=""
severity="ALL"
state="ALL"
/>
<EuiHorizontalRule
margin="xs"
/>
<EuiBasicTable
columns={
Array [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`QueryPerformance renders 1`] = `
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left:10px;padding-right:10px"
style="padding:16px;padding-left:10px;padding-right:10px"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`VisualGraph renders 1`] = `
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left:10px;padding-right:0px"
style="padding:16px;padding-left:10px"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
Expand Down Expand Up @@ -544,7 +544,7 @@ exports[`VisualGraph renders 1`] = `
exports[`VisualGraph renders with bucket level monitor 1`] = `
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left:10px;padding-right:0px"
style="padding:16px;padding-left:10px"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class CreateMonitor extends Component {
} = this.props;
const { createModalOpen, initialValues, plugins } = this.state;
return (
<div style={{ padding: '25px 50px' }}>
<div style={{ padding: '16px' }}>
<Formik
initialValues={initialValues}
onSubmit={this.evaluateSubmission}
Expand Down Expand Up @@ -268,7 +268,7 @@ export default class CreateMonitor extends Component {
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton fill onClick={handleSubmit} isLoading={isSubmitting}>
{edit ? 'Update' : 'Create'}
{edit ? 'Save' : 'Create'}
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`CreateMonitor renders 1`] = `
<div
style={
Object {
"padding": "25px 50px",
"padding": "16px",
}
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class DataSource extends Component {
<ContentPanel
title="Select data"
titleSize="s"
panelStyles={{ paddingLeft: '10px', paddingRight: '10px' }}
bodyStyles={{ padding: 'initial' }}
>
{monitorIndexDisplay}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ exports[`DataSource renders 1`] = `
"padding": "initial",
}
}
panelStyles={
Object {
"paddingLeft": "10px",
"paddingRight": "10px",
}
}
title="Select data"
titleSize="s"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,6 @@ class DefineMonitor extends Component {
<PanelComponent
title="Query"
titleSize="s"
panelStyles={{
paddingLeft: '10px',
paddingRight: '10px',
}}
bodyStyles={{ padding: 'initial' }}
actions={monitorContent.actions}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ exports[`DefineMonitor renders 1`] = `
"padding": "initial",
}
}
panelStyles={
Object {
"paddingLeft": "10px",
"paddingRight": "10px",
}
}
title="Query"
titleSize="s"
>
Expand Down Expand Up @@ -144,12 +138,6 @@ exports[`DefineMonitor should show warning in case of Ad monitor and plugin is n
"padding": "initial",
}
}
panelStyles={
Object {
"paddingLeft": "10px",
"paddingRight": "10px",
}
}
title="Query"
titleSize="s"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ const MonitorDetails = ({
<Container
title="Monitor details"
titleSize="s"
panelStyles={{
paddingBottom: '20px',
paddingLeft: '10px',
paddingRight: '10px',
paddingTop: '20px',
}}
panelStyles={{ padding: '16px' }}
actions={anomalyDetectorContent.actions}
>
{!flyoutMode && <EuiSpacer size="s" />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`WorkflowDetails renders 1`] = `
<div
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left:10px;padding-right:10px;padding-bottom:20px;padding-top:20px"
style="padding:16px;padding-bottom:20px;padding-left:10px;padding-right:10px;padding-top:20px"
>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class ConfigureTriggers extends React.Component {
? 'Triggers define the conditions that determine when a composite monitor should generate its own alert.'
: undefined
}
panelStyles={{ paddingBottom: '0px', paddingLeft: '20px', paddingRight: '20px' }}
panelStyles={{ padding: '16px' }}
bodyStyles={{ paddingLeft: '0px', padding: '10px' }}
horizontalRuleClassName={'accordion-horizontal-rule'}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default class AcknowledgeAlertsModal extends Component {
onCreateTrigger = () => {
const { history, monitorId, onClose } = this.props;
onClose();
history.push(`/monitors/${monitorId}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`);
history.push(`/monitors/${monitorId}?action=${MONITOR_ACTIONS.EDIT_MONITOR}`);
};

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const DashboardControls = ({
isAlertsFlyout = false,
monitorType,
alertActions = [],
panelStyles = {},
}) => {
let supportedStateOptions = stateOptions;
switch (monitorType) {
Expand All @@ -56,7 +57,7 @@ const DashboardControls = ({
break;
}
return (
<EuiFlexGroup style={{ padding: '0px 5px' }} gutterSize="s">
<EuiFlexGroup style={{ padding: '0px 0px 16px', ...panelStyles }} gutterSize="s">
<EuiFlexItem>
<EuiCompressedFieldSearch
fullWidth={true}
Expand Down Expand Up @@ -87,9 +88,6 @@ const DashboardControls = ({
{alertActions.map((action, idx) => (
<EuiFlexItem grow={false}>{action}</EuiFlexItem>
))}
<EuiFlexItem grow={false} style={{ justifyContent: 'center' }}>
<EuiPagination pageCount={pageCount} activePage={activePage} onPageClick={onPageChange} />
amsiglan marked this conversation as resolved.
Show resolved Hide resolved
</EuiFlexItem>
</EuiFlexGroup>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`DashboardControls renders 1`] = `
<div
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--directionRow euiFlexGroup--responsive"
style="padding:0px 5px"
style="padding:0px 0px 16px"
>
<div
class="euiFlexItem"
Expand Down Expand Up @@ -151,81 +151,5 @@ exports[`DashboardControls renders 1`] = `
</div>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="justify-content:center"
>
<nav
class="euiPagination"
>
<button
aria-label="Previous page, 1"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
data-test-subj="pagination-button-previous"
type="button"
>
<div>
EuiIconMock
</div>
</button>
<ul
class="euiPagination__list"
>
<li
class="euiPagination__item"
>
<button
aria-label="Page 1 of 2"
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiPaginationButton euiPaginationButton--hideOnMobile"
data-test-subj="pagination-button-0"
type="button"
>
<span
class="euiButtonContent euiButtonEmpty__content"
>
<span
class="euiButtonEmpty__text"
>
1
</span>
</span>
</button>
</li>
<li
class="euiPagination__item"
>
<button
aria-current="true"
aria-label="Page 2 of 2"
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiButtonEmpty-isDisabled euiPaginationButton euiPaginationButton-isActive euiPaginationButton--hideOnMobile"
data-test-subj="pagination-button-1"
disabled=""
type="button"
>
<span
class="euiButtonContent euiButtonEmpty__content"
>
<span
class="euiButtonEmpty__text"
>
2
</span>
</span>
</button>
</li>
</ul>
<button
aria-label="Next page"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
data-test-subj="pagination-button-next"
disabled=""
type="button"
>
<div>
EuiIconMock
</div>
</button>
</nav>
</div>
</div>
`;
Loading
Loading