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

Design tweaks for Dashboard 'pending changes' callout #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 11 additions & 3 deletions src/plugins/dashboard/public/application/_dashboard_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@
text-align: center;
}

.dshUnsavedListingItemTitle {
.dshUnsavedListingItem {
margin-top: $euiSizeM;
}

.dshUnsavedListingItem__icon {
margin-right: $euiSizeM;
}

.dshUnsavedListingItem__title {
margin-bottom: 0 !important;
}

.dshUnsavedListingButtons {
margin-left: 15px;
.dshUnsavedListingItem__actions {
margin-left: $euiSizeL + $euiSizeXS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,28 @@ const DashboardUnsavedItem = ({
onDiscardClick: () => void;
}) => {
return (
<>
<EuiTitle size="xxs" className="dshUnsavedListingItemTitle">
<h3 className="dshUnsavedListingItemTitle">
<EuiIcon type="pencil" /> {dashboard?.title ?? getNewDashboardTitle()}
</h3>
</EuiTitle>
<EuiFlexGroup gutterSize="s" alignItems="flexStart" className="dshUnsavedListingButtons">
<div className="dshUnsavedListingItem">
<EuiFlexGroup alignItems="center" gutterSize="none">
<EuiFlexItem grow={false}>
<EuiIcon color="text" className="dshUnsavedListingItem__icon" type="dashboardApp" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiTitle size="xxs">
<h4 className="dshUnsavedListingItem__title">
{dashboard?.title ?? getNewDashboardTitle()}
</h4>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexGroup
gutterSize="none"
alignItems="flexStart"
className="dshUnsavedListingItem__actions"
>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
flush="left"
size="xs"
size="s"
color="primary"
onClick={onOpenClick}
data-test-subj={`edit-unsaved-${dashboard?.id ?? DASHBOARD_PANELS_UNSAVED_ID}`}
Expand All @@ -65,7 +76,7 @@ const DashboardUnsavedItem = ({
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="xs"
size="s"
color="danger"
onClick={onDiscardClick}
data-test-subj={`discard-unsaved-${dashboard?.id ?? DASHBOARD_PANELS_UNSAVED_ID}`}
Expand All @@ -74,7 +85,7 @@ const DashboardUnsavedItem = ({
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</>
</div>
);
};

Expand Down Expand Up @@ -146,7 +157,10 @@ export const DashboardUnsavedListing = ({ redirectTo }: { redirectTo: DashboardR

return items.length === 0 ? null : (
<>
<EuiCallOut title={dashboardUnsavedListingStrings.getUnsavedChangesTitle(items.length > 1)}>
<EuiCallOut
heading="h3"
title={dashboardUnsavedListingStrings.getUnsavedChangesTitle(items.length > 1)}
>
{items}
</EuiCallOut>
<EuiSpacer size="m" />
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/dashboard_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export const dashboardListingTable = {
export const dashboardUnsavedListingStrings = {
getUnsavedChangesTitle: (plural = false) =>
i18n.translate('dashboard.listing.unsaved.unsavedChangesTitle', {
defaultMessage: 'You have unsaved changes in the following {dash}',
defaultMessage: 'You have unsaved changes in the following {dash}.',
values: {
dash: plural
? dashboardListingTable.getEntityNamePlural()
Expand Down