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

[Rollup] Metrics multiple selection #42927

Merged
merged 23 commits into from
Aug 15, 2019

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Aug 8, 2019

Summary

Addresses this issue.

Screenshots

Demo (first iteration)

Aug-09-2019 15-43-47

Demo (latest iteration)

Aug-13-2019 11-17-32

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jloleysens jloleysens requested a review from cjcenizal August 9, 2019 13:45
@jloleysens jloleysens marked this pull request as ready for review August 9, 2019 13:45
@elasticmachine
Copy link
Contributor

💔 Build Failed

…p-metrics-selectall

* 'master' of github.com:elastic/kibana: (306 commits)
  [ML] Adding job overrides to the module setup endpoint (elastic#42946)
  [APM] Fix missing RUM url (elastic#42940)
  close socket timeouts without message (elastic#42456)
  Upgrade elastic/charts to 8.1.6 (elastic#42518)
  [ML] Delete old AngularJS data visualizer and refactor folders (elastic#42962)
  Add custom formatting for Date Nanos Format (elastic#42445)
  [Vega] Shim new platform - vega_fn.js -> vega_fn.js , use ExpressionFunction (elastic#42582)
  add socket.getPeerCertificate to KibanaRequest (elastic#42929)
  [Automation] ISTANBUL PRESET PATH is not working fine with constructor(private foo) (elastic#42683)
  [ML] Data frames: Updated stats structure. (elastic#42923)
  [Code] fixed the issue that the repository can not be deleted in some cases. (elastic#42841)
  [kbn-es] Support for passing regex value to ES (elastic#42651)
  Connect to Elasticsearch via SSL when starting kibana with `--ssl` (elastic#42840)
  Add Elasticsearch SSL support for integration tests (elastic#41765)
  Fix duplicate fetch in Visualize (elastic#41204)
  [DOCS] TSVB and Timelion clean up (elastic#42953)
  [Maps] [File upload] Fix maps geojson upload hanging on index step (elastic#42623)
  [APM] Use rounded bucket sizes for transaction distribution (elastic#42830)
  [yarn.lock] consistent resolve domain (elastic#42969)
  [Uptime] [Test] Repurpose unit test assertions to avoid flakiness (elastic#40650)
  ...
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jloleysens jloleysens added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Aug 12, 2019
…p-metrics-selectall

* 'master' of github.com:elastic/kibana: (22 commits)
  [Code]: downgrade the log level of error message from subprocess (elastic#42925)
  [Code] Cancel clone/update job in the middle if disk space over the watermark (elastic#42890)
  Add Kibana App specific URL to the help menu (elastic#34739) (elastic#42580)
  [Maps] refactor createShapeFilterWithMeta to support more than just polygons (elastic#43042)
  Skip flaky es_ui_shared/request tests.
  Pass uiSettings to all data plugin services (elastic#42159)
  [SIEM] Upgrades react-redux and utilize React.memo for performance gains  (elastic#43029)
  [skip-ci][Maps] add maki icon sheet to docs (elastic#43063)
  Adding "style-src 'unsafe-inline' 'self'" to default CSP rules (elastic#41305)
  Update dependency commander to v3 (elastic#43041)
  Update dependency @percy/agent to ^0.10.0 (elastic#40517)
  [Maps] only show top hits checkbox if index has date fields (elastic#43056)
  run chained_controls on Firefox to catch regression (elastic#43044)
  fixing issue with dashboard csv download (elastic#42964)
  Expose task manager as plugin instead of server argument (elastic#42966)
  Expose createRouter from HttpService, prepare handlers for context introduction (elastic#42686)
  [Code] disk watermark supports percentage and absolute modes (elastic#42987)
  [apps/dashboard] skip part of filtering tests on FF (elastic#43047)
  [ML] Kibana management jobs list (elastic#42570)
  [ML] Fix check for watcher being enabled (elastic#43025)
  ...
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal cjcenizal added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more and removed Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more enhancement New value added to drive a business result labels Aug 12, 2019
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looks great! I checked out the UX locally. You might want to get someone else to review the code because I didn't look very closely.

Originally I was thinking of something like this:

image

But I think the location you chose is better. However, there's no label which isn't so great for screen-readers. The space gets a bit cramped, too. I think you might want to reimplement your dropdown solution in the location where your checkboxes are, using a button that says "Select metrics" which would address the accessibility issue. Feel free to check in with the design team and get some guidance from them. I don't consider this a blocker though.

await addFieldToList('date');
});

const getFieldListTableRows = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move these helpers into helpers/job_create.helpers.js? That would deflate this file a bit and make them more reusable.

let fieldChooserColumn = getFieldChooserColumnForRow(0);
expectAllFieldChooserInputs(fieldChooserColumn, true);


Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra newline


rows.forEach((row, idx) => {
const [, metricTypeCol ] = row.columns;
if (metricTypeCol.value !== 'numeric') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use filter here instead?

        rows.filter((row) => {
          const [, metricTypeCol ] = row.columns;
          return metricTypeCol.value === 'numeric';
        }).forEach((row, idx) => {
          const fieldChooser = getFieldChooserColumnForRow(idx);
          fieldChooser.reactWrapper.find('input').forEach(input => {
            const props = input.props();
            if (props['data-test-subj'].endsWith('avg')) {
              expect(props.checked).toBe(true);
            } else {
              expect(props.checked).toBe(false);
            }
          });
        });

<EuiFlexGroup justifyContent={'flexStart'} alignItems={'center'}>
<EuiFlexItem grow={false}>
<FieldChooser
key={'stepMetricsFieldChooser'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: this can be a string "stepMetricsFieldChooser" without the enclosing braces. This comment applies to a few other places too.

@jloleysens jloleysens requested a review from sebelga August 13, 2019 08:02
- Refactor test helpers for metric step
- Cleanup some JS style nits
- Make popover button disabled if all metric checkboxes are disabled
@elasticmachine
Copy link
Contributor

💔 Build Failed

@jloleysens
Copy link
Contributor Author

Retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

…p-metrics-selectall

* 'master' of github.com:elastic/kibana: (27 commits)
  [ML] Data Frames: Analytics job creation. (elastic#43102)
  [Vis Default editor] Fix issue with Rollup (elastic#42430)
  [Vis: Default editor] EUIficate Markdown tab (elastic#42677)
  [New Platform Migration Phase I]: update dateHisogramInterval & parseEsInterval imports (elastic#42917)
  [Infra UI] Add AWS metrics to node detail page (elastic#42153)
  update apm index pattern (elastic#43106)
  [SIEM] Toggle Column / Code Coverage and Cypress (elastic#42766)
  skip failing test (elastic#43163)
  [code] Add option to turn the go dependency download on/off. (elastic#43096)
  disable visual regression jobs
  Removed dead code (elastic#42774)
  fixes csv export of saved searches that have _source field (elastic#43123)
  Export missing Context types (elastic#43051)
  Update dependency supports-color to v7 (elastic#43064)
  switch to icon type string instead of node (elastic#43111)
  [Maps] Enable borders for icon symbols (elastic#43066)
  [ftr] enable visualRegression jobs (elastic#42989)
  [ML] Converting single to multi metric job (elastic#42532)
  fix(NA): dont clean dll module if it is a package json file (elastic#42904)
  [Logs UI] Add link from the sample web logs to the Logs UI (elastic#42635)
  ...
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jloleysens jloleysens requested review from alisonelizabeth and removed request for sebelga August 14, 2019 09:39
Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

@jloleysens nice work! Tested locally and works great. Left a couple comments in the code.

it('should deselect all of the metric types across rows (column-wise)', () => {
const selectAllAvgCheckbox = find('rollupJobMetricsSelectAllCheckbox-avg');
selectAllAvgCheckbox.last().simulate('change', { checked: true });
selectAllAvgCheckbox.last().simulate('change', { checked: false });
Copy link
Contributor

Choose a reason for hiding this comment

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

can you explain why both of these lines are needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!


it('should correctly select across rows and columns', async () => {
/**
* Tricky test case where we want to determine that the column-wise and row-wise
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for adding these comments!

// Select All
selectAllCheckbox.simulate('change', { checked: true });
// Deselect All
selectAllCheckbox.simulate('change', { checked: false });
Copy link
Contributor

Choose a reason for hiding this comment

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

similar question as above - are these two steps needed? by default, will the checkboxes not be unselected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case we want to see that selecting some checkboxes column wise, then selecting the row-wise and then de-selecting them row-wise doesn't leave us in a weird state where some checkboxes (esp. All) are still selected for that row. Will add comment though :).

const metricTypesConfig = (function () {
return [
{
type: 'avg',
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if these types should belong in a constants file - that way they could be reused in the tests too. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a plan! Not exactly sure where I'd use them in my spec - will take a look-see.

Copy link
Contributor

Choose a reason for hiding this comment

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

i thought i saw use of avg, max, etc., in the tests, so was just wondering if it would be useful to extract.

static chooserColumns = [
{
field: 'name',
name: 'Field',
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n?

},
{
field: 'type',
name: 'Type',
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n?


/**
* Look at all the metric configs and include the special "All" checkbox which adds the ability
* to select a all the checkboxes across columns and rows.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: select a all --> select all

id={`${idx}-select-all-checkbox`}
data-test-subj={`rollupJobMetricsSelectAllCheckbox-${metricType}`}
disabled={isDisabled}
label={<span style={{ whiteSpace: 'nowrap' }}>{label}</span>}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add this to a .scss file rather than having an inline style here?


getMetricsSelectAllMenu() {
const {
jsxElements: checkboxElements,
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to rename jsxElements to checkboxElements in renderMetricsSelectAllCheckboxes()?

- Removed unnecessary styling
- Fixed typos
- Updated comments
- i18n
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

…p-metrics-selectall

* 'master' of github.com:elastic/kibana: (50 commits)
  [Uptime] update monitor list configs for mobile view (elastic#43218)
  [APM] Local UI filters (elastic#41588)
  [Code] Upgrade ctags langserver (elastic#43252)
  [Code] show multiple definition results in panel (elastic#43249)
  Adds Metric Type to full screen launch tracking (elastic#42692)
  [Canvas] Convert Autocomplete to Typescript (elastic#42502)
  [telemetry] add spacesEnabled config back to xpack_main (elastic#43312)
  [ML] Adds DF Transform Analytics list to Kibana management (elastic#43151)
  Add TLS client authentication support. (elastic#43090)
  [csp] Telemetry for csp configuration (elastic#43223)
  [SIEM] Run Cypress Tests Against Elastic Cloud & Cypress Command Line / Reporting (elastic#42804)
  docs: add tip on agent config in a dt (elastic#43301)
  [ML] Adding bucket span estimator to new wizards (elastic#43288)
  disable flaky tests (elastic#43017)
  Fix percy target branch for PRs (elastic#43160)
  [ML] Adding post create job options (elastic#43205)
  Restore discover histogram selection triggering fetch (elastic#43097)
  Per panel time range (elastic#43153)
  [Infra UI] Add APM to Metadata Endpoint (elastic#42197)
  Sentence case copy changes (elastic#43215)
  ...
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for making the changes @jloleysens!

@jloleysens jloleysens merged commit bd8984b into elastic:master Aug 15, 2019
@jloleysens jloleysens deleted the feature/rollup-metrics-selectall branch August 15, 2019 14:46
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 15, 2019
* remove duplicate columns declaration

* First iteration of select all menu working

* A lot of bugfixes and started on row-level selection using flatMap

* Wip on row selection

* Fix formatting

* More bug fixes and and first iteration of row selection and column selection working

* Minor refactors, cleaned up logging. Still has nasty UX bug on Popover menu

* Added translations and empty tests

* Tests are WiP

* Move checkboxes out of popover

* Implemented first iteration of select all functionality

* Move row select all into checkbox area

* Remove unused code and simplify select all if-else

* First iteration of tests

* fix tests and update name data-test-subj name

* Move checkboxes into popover with button

* - Fix tests
- Refactor test helpers for metric step
- Cleanup some JS style nits
- Make popover button disabled if all metric checkboxes are disabled

* Remove extra newline

* - Moved constants from metrics to own file so that it's more re-usable
- Removed unnecessary styling
- Fixed typos
- Updated comments
- i18n
jloleysens added a commit that referenced this pull request Aug 16, 2019
* remove duplicate columns declaration

* First iteration of select all menu working

* A lot of bugfixes and started on row-level selection using flatMap

* Wip on row selection

* Fix formatting

* More bug fixes and and first iteration of row selection and column selection working

* Minor refactors, cleaned up logging. Still has nasty UX bug on Popover menu

* Added translations and empty tests

* Tests are WiP

* Move checkboxes out of popover

* Implemented first iteration of select all functionality

* Move row select all into checkbox area

* Remove unused code and simplify select all if-else

* First iteration of tests

* fix tests and update name data-test-subj name

* Move checkboxes into popover with button

* - Fix tests
- Refactor test helpers for metric step
- Cleanup some JS style nits
- Make popover button disabled if all metric checkboxes are disabled

* Remove extra newline

* - Moved constants from metrics to own file so that it's more re-usable
- Removed unnecessary styling
- Fixed typos
- Updated comments
- i18n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Rollups release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants