Skip to content

Commit

Permalink
Updated Fit and Finish guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldong51 committed Sep 5, 2024
1 parent 9645673 commit 5666496
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 60 deletions.
14 changes: 7 additions & 7 deletions public/components/ContentPanel/ContentPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
EuiFlexItem,
EuiHorizontalRule,
EuiPanel,
EuiTitle,
EuiText,
} from '@elastic/eui';
import React from 'react';

interface ContentPanelProps {
title?: string;
titleSize?: 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l';
titleSize?: 'xs' | 's' | 'm';
total?: number;
bodyStyles?: object;
panelStyles?: object;
Expand All @@ -25,7 +25,7 @@ interface ContentPanelProps {

const ContentPanel: React.SFC<ContentPanelProps> = ({
title = '',
titleSize = 'l',
titleSize = 's',
total = undefined,
bodyStyles = {},
panelStyles = {},
Expand All @@ -40,16 +40,16 @@ const ContentPanel: React.SFC<ContentPanelProps> = ({
alignItems="center"
>
<EuiFlexItem>
<EuiTitle size={titleSize}>
<h3>
<EuiText size={titleSize}>
<h2>
{title}
{total !== undefined ? (
<span
style={{ color: '#9f9f9f', fontWeight: 300 }}
>{` (${total})`}</span>
) : null}
</h3>
</EuiTitle>
</h2>
</EuiText>
</EuiFlexItem>
{actions ? (
<EuiFlexItem grow={false}>
Expand Down
9 changes: 5 additions & 4 deletions public/pages/Channels/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiTableSortingType,
EuiTitle,
SortDirection,
EuiText,
} from '@elastic/eui';
import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table';
import { Pagination } from '@elastic/eui/src/components/basic_table/pagination_bar';
Expand Down Expand Up @@ -257,8 +258,8 @@ export class Channels extends MDSEnabledComponent<ChannelsProps, ChannelsState>
isSelectable={true}
selection={selection}
noItemsMessage={<EuiEmptyPrompt
title={<h2>No channels to display</h2>}
body="To send or receive notifications, you will need to create a notification channel."
title={<EuiText size="s"><h2>No channels to display</h2></EuiText>}
body={<EuiText size="s">"To send or receive notifications, you will need to create a notification channel."</EuiText>}
actions={<EuiSmallButton href={`#${ROUTES.CREATE_CHANNEL}`}>
Create channel
</EuiSmallButton>} />}
Expand Down Expand Up @@ -309,7 +310,7 @@ export class Channels extends MDSEnabledComponent<ChannelsProps, ChannelsState>
}
bodyStyles={{ padding: 'initial' }}
title="Channels"
titleSize="m"
titleSize="s"
total={this.state.total}
>
{channelControlsComponent}
Expand All @@ -318,7 +319,7 @@ export class Channels extends MDSEnabledComponent<ChannelsProps, ChannelsState>
</ContentPanel>
)}
</>

);
}
};
Expand Down
1 change: 1 addition & 0 deletions public/pages/Channels/components/ChannelActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function ChannelActions(props: ChannelActionsProps) {
<EuiContextMenuItem
key={params.label}
disabled={params.disabled}
size="s"
onClick={() => {
setIsPopoverOpen(false);
if (params.modal) {
Expand Down
5 changes: 2 additions & 3 deletions public/pages/Channels/components/details/ChannelDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EuiSmallButton,
EuiSpacer,
EuiText,
EuiTitle,
} from '@elastic/eui';
import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
import React, { useContext, useEffect, useState } from 'react';
Expand Down Expand Up @@ -231,9 +230,9 @@ export function ChannelDetails(props: ChannelDetailsProps) {
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="m" alignItems="flexEnd">
<EuiFlexItem grow={false}>
<EuiTitle size="l">
<EuiText size="s">
<h1>{channel?.name ?? '-'}</h1>
</EuiTitle>
</EuiText>
</EuiFlexItem>
{badgeComponent}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function ChannelDetailsActions(props: ChannelDetailsActionsProps) {
<EuiContextMenuItem
key={params.label}
disabled={params.disabled}
size="s"
onClick={() => {
setIsPopoverOpen(false);
if (params.modal) {
Expand Down
11 changes: 8 additions & 3 deletions public/pages/Channels/components/modals/DeleteChannelModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,30 @@ export const DeleteChannelModal = (props: DeleteChannelModalProps) => {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} maxWidth={500}>
<EuiModalHeader>
<EuiModalHeaderTitle>{`Delete ${name}?`}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>{`Delete ${name}?`}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiText>{message}</EuiText>
<EuiText size="s">{message}</EuiText>
{num >= 2 && (
<>
<EuiSpacer />
{props.selected.map((channel, i) => (
<EuiText
key={`channel-list-item-${i}`}
style={{ marginLeft: 20 }}
size="s"
>
<li>{channel.name}</li>
</EuiText>
))}
</>
)}
<EuiSpacer />
<EuiText>
<EuiText size="s">
To confirm delete, type <i>delete</i> in the field.
</EuiText>
<EuiCompressedFieldText
Expand Down
7 changes: 6 additions & 1 deletion public/pages/Channels/components/modals/DetailsListModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiModalHeaderTitle,
EuiOverlayMask,
EuiTitle,
EuiText,
} from '@elastic/eui';
import React from 'react';
import { ModalRootProps } from '../../../../components/Modal/ModalRoot';
Expand All @@ -30,7 +31,11 @@ export function DetailsListModal(props: DetailsListModalProps) {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} maxWidth={800}>
<EuiModalHeader>
<EuiModalHeaderTitle>{props.header}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>{props.header}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiTitle size="xxs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiModalHeaderTitle,
EuiOverlayMask,
EuiTableFieldDataColumnType,
EuiText,
} from '@elastic/eui';
import React from 'react';
import { ModalRootProps } from '../../../../components/Modal/ModalRoot';
Expand Down Expand Up @@ -49,7 +50,11 @@ export function DetailsTableModal(props: DetailsTableModalProps) {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} maxWidth={800}>
<EuiModalHeader>
<EuiModalHeaderTitle>{props.header}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>{props.header}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiInMemoryTable items={props.items} columns={columns} />
Expand Down
8 changes: 6 additions & 2 deletions public/pages/Channels/components/modals/MuteChannelModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ export const MuteChannelModal = (props: MuteChannelModalProps) => {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} maxWidth={500}>
<EuiModalHeader>
<EuiModalHeaderTitle>{`Mute ${props.selected[0].name}?`}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>{`Mute ${props.selected[0].name}?`}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>
<EuiModalBody>
<EuiText>
<EuiText size="s">
This channel will stop sending notifications to its recipients.
However, the channel will remain available for selection.
</EuiText>
Expand Down
5 changes: 2 additions & 3 deletions public/pages/CreateChannel/CreateChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
EuiCompressedSuperSelect,
EuiSuperSelectOption,
EuiText,
EuiTitle,
} from '@elastic/eui';
import queryString from 'query-string';
import React, { createContext, useContext, useEffect, useState } from 'react';
Expand Down Expand Up @@ -365,9 +364,9 @@ export function CreateChannel(props: CreateChannelsProps) {
value={{ edit: props.edit, inputErrors, setInputErrors }}
>
{!getUseUpdatedUx() && (
<EuiTitle size="l">
<EuiText size="s">
<h1>{`${props.edit ? 'Edit' : 'Create'} channel`}</h1>
</EuiTitle>
</EuiText>
)}

<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiOverlayMask,
EuiText,
} from '@elastic/eui';
import React, { useContext, useState } from 'react';
import { CoreServicesContext } from '../../../../components/coreServices';
Expand Down Expand Up @@ -66,7 +67,11 @@ export function CreateRecipientGroupModal(
<EuiOverlayMask>
<EuiModal onClose={props.onClose} style={{ width: 650 }}>
<EuiModalHeader>
<EuiModalHeaderTitle>Create recipient group</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>Create recipient group</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiOverlayMask,
EuiText,
} from '@elastic/eui';
import React, { useContext, useState } from 'react';
import { CoreServicesContext } from '../../../../components/coreServices';
Expand Down Expand Up @@ -70,7 +71,11 @@ export function CreateSESSenderModal(props: CreateSESSenderModalProps) {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} style={{ width: 750 }}>
<EuiModalHeader>
<EuiModalHeaderTitle>Create SES sender</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>Create SES sender</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiOverlayMask,
EuiText,
} from '@elastic/eui';
import React, { useContext, useState } from 'react';
import { CoreServicesContext } from '../../../../components/coreServices';
Expand Down Expand Up @@ -68,7 +69,11 @@ export function CreateSenderModal(props: CreateSenderModalProps) {
<EuiOverlayMask>
<EuiModal onClose={props.onClose} style={{ width: 750 }}>
<EuiModalHeader>
<EuiModalHeaderTitle>Create SMTP sender</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>Create SMTP sender</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Emails/CreateRecipientGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
EuiTitle,
EuiText,
} from '@elastic/eui';
import React, { useContext, useEffect, useState } from 'react';
import { RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -105,9 +105,9 @@ export function CreateRecipientGroup(props: CreateRecipientGroupProps) {
return (
<>
{!getUseUpdatedUx() && (
<EuiTitle size="l">
<EuiText size="s">
<h1>{`${props.edit ? 'Edit' : 'Create'} recipient group`}</h1>
</EuiTitle>
</EuiText>
)}

<EuiSpacer />
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Emails/CreateSESSender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
EuiTitle,
EuiText,
} from '@elastic/eui';
import React, { useContext, useEffect, useState } from 'react';
import { RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -102,9 +102,9 @@ export function CreateSESSender(props: CreateSESSenderProps) {
return (
<>
{!getUseUpdatedUx() && (
<EuiTitle size="l">
<EuiText size="s">
<h1>{`${props.edit ? 'Edit' : 'Create'} SES sender`}</h1>
</EuiTitle>
</EuiText>
)}

<EuiSpacer />
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Emails/CreateSender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
EuiTitle,
EuiText,
} from '@elastic/eui';
import React, { useContext, useEffect, useState } from 'react';
import { RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -99,9 +99,9 @@ export function CreateSender(props: CreateSenderProps) {
return (
<>
{!getUseUpdatedUx() && (
<EuiTitle size="l">
<EuiText size="s">
<h1>{`${props.edit ? 'Edit' : 'Create'} SMTP sender`}</h1>
</EuiTitle>
</EuiText>
)}

<EuiSpacer />
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Emails/EmailGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiSpacer, EuiText } from '@elastic/eui';
import React, { useContext, useEffect } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import { CoreServicesContext } from '../../components/coreServices';
Expand All @@ -29,9 +29,9 @@ export function EmailGroups(props: EmailGroupsProps) {
return (
<>
{!getUseUpdatedUx() && (
<EuiTitle size="l">
<EuiText size="s">
<h1>Email recipient groups</h1>
</EuiTitle>
</EuiText>
)}

<EuiSpacer />
Expand Down
Loading

0 comments on commit 5666496

Please sign in to comment.