Removes unnecessary fragment elements. Fixes vertical alignment on notif row item. Bind notification list functions to constructor

This commit is contained in:
mabashian
2019-01-23 14:13:51 -05:00
parent c97dfeb725
commit 6c19d6ae4e
3 changed files with 74 additions and 65 deletions

View File

@@ -44,7 +44,7 @@ class NotificationListItem extends React.Component {
return (
<I18n>
{({ i18n }) => (
<li key={itemId} className="pf-c-data-list__item">
<li key={itemId} className="pf-c-data-list__item pf-u-flex-row pf-u-align-items-center">
<div className="pf-c-data-list__cell pf-u-flex-row">
<div className="pf-u-display-inline-flex">
<Link

View File

@@ -49,6 +49,19 @@ class Notifications extends Component {
successTemplateIds: [],
errorTemplateIds: []
};
this.onSearch = this.onSearch.bind(this);
this.getQueryParams = this.getQueryParams.bind(this);
this.onSort = this.onSort.bind(this);
this.onSetPage = this.onSetPage.bind(this);
this.onSelectAll = this.onSelectAll.bind(this);
this.onSelect = this.onSelect.bind(this);
this.toggleError = this.toggleError.bind(this);
this.toggleSuccess = this.toggleSuccess.bind(this);
this.updateUrl = this.updateUrl.bind(this);
this.postToError = this.postToError.bind(this);
this.postToSuccess = this.postToSuccess.bind(this);
this.fetchNotifications = this.fetchNotifications.bind(this);
}
componentDidMount () {
@@ -296,7 +309,6 @@ class Notifications extends Component {
</EmptyStateBody>
</EmptyState>
)}
<Fragment>
{(
typeof noInitialResults !== 'undefined'
&& !noInitialResults
@@ -348,7 +360,6 @@ class Notifications extends Component {
{loading ? <div>loading...</div> : ''}
{error ? <div>error</div> : ''}
</Fragment>
</Fragment>
);
}
}

View File

@@ -54,7 +54,6 @@ const OrganizationDetail = ({
switch (currentTab) {
case 'notifications':
relatedTemplate = (
<Fragment>
<NotificationsList
getNotifications={(id, reqParams) => api.getOrganizationNotifications(id, reqParams)}
getSuccess={(id, reqParams) => api.getOrganizationNotificationSuccess(id, reqParams)}
@@ -65,7 +64,6 @@ const OrganizationDetail = ({
location={location}
history={history}
/>
</Fragment>
);
break;
default: