Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Jun 16, 2021
1 parent ec40e56 commit ad7aaf0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 39 deletions.
7 changes: 0 additions & 7 deletions x-pack/plugins/rollup/public/crud_app/_crud_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,3 @@
align-items: flex-end; /* 1 */
}

/**
* 1. Ensure panel fills width of parent when search input yields no matching rollup jobs.
*/
.rollupJobsListPanel {
// sass-lint:disable-block no-important
flex-grow: 1 !important; /* 1 */
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class DetailPanel extends Component {
<EuiTextColor color="subdued">
<FormattedMessage
id="xpack.rollupJobs.detailPanel.loadingLabel"
defaultMessage="Loading rollup job..."
defaultMessage="Loading rollup job"
/>
</EuiTextColor>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('<DetailPanel />', () => {
({ component, find, exists } = initTestBed({ isLoading: true }));
const loading = find('rollupJobDetailLoading');
expect(loading.length).toBeTruthy();
expect(loading.text()).toEqual('Loading rollup job...');
expect(loading.text()).toEqual('Loading rollup job');

// Make sure the title and the tabs are visible
expect(exists('detailPanelTabSelected')).toBeTruthy();
Expand Down
34 changes: 17 additions & 17 deletions x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
EuiLoadingSpinner,
EuiPageContent,
EuiSpacer,
EuiCallOut,
} from '@elastic/eui';

import { withKibana } from '../../../../../../../src/plugins/kibana_react/public';
Expand Down Expand Up @@ -89,21 +88,21 @@ export class JobListUi extends Component {
defaultMessage: 'Permission error',
});
return (
<Fragment>
{this.getHeaderSection()}
<EuiSpacer size="m" />
<EuiCallOut
data-test-subj="jobListNoPermission"
title={title}
color="warning"
iconType="help"
>
<FormattedMessage
id="xpack.rollupJobs.jobList.noPermissionText"
defaultMessage="You do not have permission to view or add rollup jobs."
/>
</EuiCallOut>
</Fragment>
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiEmptyPrompt
data-test-subj="jobListError"
iconType="alert"
title={<h1>{title}</h1>}
body={
<p>
<FormattedMessage
id="xpack.rollupJobs.jobList.noPermissionText"
defaultMessage="You do not have permission to view or add rollup jobs."
/>
</p>
}
/>
</EuiPageContent>
);
}

Expand All @@ -120,7 +119,8 @@ export class JobListUi extends Component {
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiEmptyPrompt
data-test-subj="jobListError"
title={<h2>{title}</h2>}
iconType="alert"
title={<h1>{title}</h1>}
body={
<p>
{statusCode} {errorString}
Expand Down
13 changes: 2 additions & 11 deletions x-pack/plugins/rollup/public/crud_app/store/actions/load_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
* 2.0.
*/

import { i18n } from '@kbn/i18n';

import { loadJobs as sendLoadJobsRequest, deserializeJobs, showApiError } from '../../services';
import { loadJobs as sendLoadJobsRequest, deserializeJobs } from '../../services';
import { LOAD_JOBS_START, LOAD_JOBS_SUCCESS, LOAD_JOBS_FAILURE } from '../action_types';

export const loadJobs = () => async (dispatch) => {
Expand All @@ -19,17 +17,10 @@ export const loadJobs = () => async (dispatch) => {
try {
jobs = await sendLoadJobsRequest();
} catch (error) {
dispatch({
return dispatch({
type: LOAD_JOBS_FAILURE,
payload: { error },
});

return showApiError(
error,
i18n.translate('xpack.rollupJobs.loadAction.errorTitle', {
defaultMessage: 'Error loading rollup jobs',
})
);
}

dispatch({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import { getRouter, setHttp } from '../../crud_app/services';
import { getRouter, setHttp, init as initDocumentation } from '../../crud_app/services';
import { mockHttpRequest, pageHelpers, nextTick } from './helpers';
import { JOBS } from './helpers/constants';
import { coreMock } from '../../../../../../src/core/public/mocks';
import { coreMock, docLinksServiceMock } from '../../../../../../src/core/public/mocks';

jest.mock('../../crud_app/services', () => {
const services = jest.requireActual('../../crud_app/services');
Expand Down Expand Up @@ -38,6 +38,7 @@ describe('<JobList />', () => {
beforeAll(() => {
startMock = coreMock.createStart();
setHttp(startMock.http);
initDocumentation(docLinksServiceMock.createStartContract());
});

beforeEach(async () => {
Expand Down

0 comments on commit ad7aaf0

Please sign in to comment.