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

[Endpoint] Policy List UI route and initial view #56918

Merged
merged 39 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7b91e2f
Initial Policy List view
paul-tavares Feb 4, 2020
4822fd2
Add `userNavigatedFromPage` action.ts
paul-tavares Feb 5, 2020
91db958
Policy List store setup
paul-tavares Feb 5, 2020
9e29674
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 5, 2020
9a45a8c
Added Formatted dates + temp type for policy data
paul-tavares Feb 7, 2020
5cc2f9d
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 7, 2020
ad57e4c
Fix TS error on EuiBasicTable
paul-tavares Feb 7, 2020
515099e
Fix Type definition for `renderDate` method
paul-tavares Feb 7, 2020
c2f1769
Policy List Functional Tests
paul-tavares Feb 7, 2020
ab82e1d
Added `serverReturnedPolicyListData` dispatch in middleware
paul-tavares Feb 7, 2020
e656b0c
Added store Middleware wrapper + adjusted MiddlwareFactory type
paul-tavares Feb 10, 2020
e3675c1
Adjust Functional test that checks Policy list is loaded
paul-tavares Feb 10, 2020
01a5e2e
Unit Tests for Policy List store concerns
paul-tavares Feb 10, 2020
8c66c60
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 10, 2020
a735e16
Functional tests: add beforeEach, move navigateToUrlWithBrowserHistor…
paul-tavares Feb 10, 2020
c04f61f
Functional test to validate table headers
paul-tavares Feb 10, 2020
1cb9d2c
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 11, 2020
8e18b5a
Adjust font sizes for page title/total + fix time display string
paul-tavares Feb 11, 2020
0492ff9
Added text truncate to table column that don't have a render() method
paul-tavares Feb 11, 2020
f296fd5
Added common `TruncateText` component. Added usage of it to policy list
paul-tavares Feb 11, 2020
ee6aa46
Added tooltip to Date fields
paul-tavares Feb 11, 2020
438cb77
Initial implementation of showing relative duration on date fields
paul-tavares Feb 12, 2020
5d09b57
added fake data for Policy list
paul-tavares Feb 13, 2020
da416d4
Rename type (remove leading `T`)
paul-tavares Feb 13, 2020
d7c9ea4
Remove unnecessary type casting
paul-tavares Feb 13, 2020
a1b5a77
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 13, 2020
cd5488d
Merge branch 'master' into task/EMT141-Policy-UI-Route
elasticmachine Feb 13, 2020
5d276d1
Fix test failure issue
paul-tavares Feb 13, 2020
78bc8b4
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 13, 2020
8812f32
Merge remote-tracking branch 'origin/task/EMT141-Policy-UI-Route' int…
paul-tavares Feb 13, 2020
31676c0
Added `width` to some table columns
paul-tavares Feb 13, 2020
13920fd
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 13, 2020
2d58030
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 14, 2020
546a193
Rename input arg of `renderDate`
paul-tavares Feb 14, 2020
b14f88a
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 14, 2020
15193b1
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 14, 2020
1fc8d65
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 14, 2020
04974e1
Remove extra `<EuiTitle`
paul-tavares Feb 14, 2020
adfa203
Merge remote-tracking branch 'upstream/master' into task/EMT141-Polic…
paul-tavares Feb 14, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const PolicyList = React.memo(() => {
</h2>
</EuiTitle>
<h3>
<EuiTextColor color="subdued">
<EuiTextColor color="subdued" data-test-subj="policyTotalCount">
<FormattedMessage
id="xpack.endpoint.policyList.viewTitleTotalCount"
defaultMessage="{totalItemCount} Policies"
Expand All @@ -172,6 +172,7 @@ export const PolicyList = React.memo(() => {
loading={loading}
pagination={paginationSetup}
onChange={handleTableChange}
data-test-subj="policyTable"
/>
</EuiPageContentBody>
</EuiPageContent>
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/endpoint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default function({ loadTestFile }: FtrProviderContext) {
this.tags('ciGroup7');

loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./policy_list'));
});
}
30 changes: 30 additions & 0 deletions x-pack/test/functional/apps/endpoint/policy_list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function({ getPageObjects, getService }: FtrProviderContext) {
const pageObjects = getPageObjects(['common']);
const testSubjects = getService('testSubjects');

describe('Endpoint Policy List', () => {
Copy link
Contributor

@charlie-pichette charlie-pichette Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good for an initial set of tests. We will want to leverage the actual page object file and its capabilities in a future PR. After my PR is merged it will be easier to refactor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
I might still another test to validate the expected table columns headers are present and display the correct label. Will wait to see again how to use that Table service 😃

it('Loads the Policy List Page', async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy');
await testSubjects.existOrFail('policyViewTitle');
const policyTitle = await testSubjects.getVisibleText('policyViewTitle');
expect(policyTitle).to.equal('Policies');
});
it('shows policy count total', async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy');
const policyTotal = await testSubjects.getVisibleText('policyTotalCount');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how we look at table values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinlog no. @aisantos showed us a different service that we need to load which has a method that will retrieve all the data in the table and then you can check each value for the cells

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

expect(policyTotal).to.equal('0 Policies');
});
it('includes policy list table', async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy');
await testSubjects.existOrFail('policyTable');
});
});
}