Changed post to create in api.js. Removed capitalize text component in favor of css solution. Updates to empty list contents. Fixes padding on notifications list

This commit is contained in:
mabashian
2019-01-21 15:44:09 -05:00
parent 4f929c7052
commit 2c19a5a1d7
7 changed files with 25 additions and 40 deletions

View File

@@ -1,14 +0,0 @@
import React from 'react';
class CapitalizeText extends React.Component {
upperCaseFirstLetter = (string) => (typeof string === 'string' ? string.charAt(0).toUpperCase() + string.slice(1) : '');
render () {
const { text } = this.props;
return (
this.upperCaseFirstLetter(text)
);
}
}
export default CapitalizeText;

View File

@@ -8,7 +8,6 @@ import {
Badge,
Switch
} from '@patternfly/react-core';
import CapitalizeText from '../CapitalizeText';
class NotificationListItem extends React.Component {
constructor (props) {
@@ -38,6 +37,10 @@ class NotificationListItem extends React.Component {
errorTurnedOn
} = this.props;
const capText = {
textTransform: 'capitalize'
};
return (
<I18n>
{({ i18n }) => (
@@ -54,12 +57,11 @@ class NotificationListItem extends React.Component {
</Link>
</div>
<Badge
style={capText}
className="pf-u-display-inline-flex"
isRead
>
{' '}
<CapitalizeText text={notificationType} />
{' '}
{notificationType}
</Badge>
</div>
<div className="pf-c-data-list__cell" />

View File

@@ -2,7 +2,7 @@ import React, {
Component,
Fragment
} from 'react';
import { Title, EmptyState, EmptyStateIcon } from '@patternfly/react-core';
import { Title, EmptyState, EmptyStateIcon, EmptyStateBody } from '@patternfly/react-core';
import { CubesIcon } from '@patternfly/react-icons';
import { I18n, i18nMark } from '@lingui/react';
import { Trans, t } from '@lingui/macro';
@@ -289,8 +289,11 @@ class Notifications extends Component {
<EmptyState>
<EmptyStateIcon icon={CubesIcon} />
<Title size="lg">
<Trans>NO NOTIFICATIONS HAVE BEEN CREATED</Trans>
<Trans>No Notifictions Found</Trans>
</Title>
<EmptyStateBody>
<Trans>Please add a notification template to populate this list</Trans>
</EmptyStateBody>
</EmptyState>
)}
<Fragment>