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

[ML] Add linking to dataframe from job management tab #65778

Merged
merged 11 commits into from
May 15, 2020

Conversation

qn895
Copy link
Member

@qn895 qn895 commented May 7, 2020

Summary

This PR adds action links from Analytics jobs in Management app for viewing job config and exploration while still maintaining sortability
dfa_links

The job id column within the ML tab will stay the same without being hyperlinked

2020-05-07 at 4 24 PM

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@@ -191,12 +201,14 @@ export const getColumns = (
'data-test-subj': 'mlAnalyticsTableRowDetailsToggle',
},
{
field: DataFrameAnalyticsListColumn.id,
// field: DataFrameAnalyticsListColumn.id,
Copy link
Contributor

@peteharverson peteharverson May 11, 2020

Choose a reason for hiding this comment

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

Is this commented out line needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix that. Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is now cleaned up in 1ec4fde

@qn895
Copy link
Member Author

qn895 commented May 14, 2020

@elasticmachine merge upstream

@qn895
Copy link
Member Author

qn895 commented May 14, 2020

I have updated the PR to now redirect to the DFA search page with the job_id filter.

dfa_links

Some thoughts for consideration:

  1. I have refactored getJobIdUrl to take in the tab idea (e.g. jobs or data_frame_analytics). The function is is currently located in x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js. Would it be better to move this utility function to a common file?

  2. After the user navigates to the link with the job id, should we clear the window link to the default generic link for that tab?

So the URL at first would look something like
ml#/data_frame_analytics?mlManagement=(jobId:bank_classification_1)
would turn into
ml#/${data_frame_analytics}?_g=${urlParams._g}

@@ -135,6 +138,10 @@ export const progressColumn = {
'data-test-subj': 'mlAnalyticsTableColumnProgress',
};

export const getDFAnalyticsJobIdLink = (item: DataFrameAnalyticsListRow) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this could be implicit return

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed this to implicit return in f3c8367#diff-5c7fbd428261fc2fd9567311e2e7046cL141.

@@ -367,7 +367,7 @@ function jobProperty(job, prop) {
return job[propMap[prop]];
}

export function getJobIdUrl(jobId) {
export function getJobIdUrl(tabId, jobId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be moved to a common directory since it's shared (maybe public/application/util?).

Could just create a new ts file with the name of the function with only that function in that file (like job_selection_change.ts, has_matching_points.ts). Then you wouldn't have to worry about jobs_list/components/utils.js not being in ts yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved this getJobIdUrl function to x-pack/plugins/ml/public/application/util/get_job_id_url.ts in f3c8367. Much cleaner 😄 !

@@ -408,3 +408,15 @@ export function clearSelectedJobIdFromUrl(url) {
}
}
}

export function resetMlJobUrl(tabId, url) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this being used anywhere. Unless I'm missing something.

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally did this in case we want to reset the window's url after navigating to the page, but since it's not needed, I have deleted this in f3c8367.

@alvarezmelissa87
Copy link
Contributor

Tested and functionality looks right. Looks good overall. Just a couple of suggestions around shared function placement. 😄

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM.
The way you implemented it to leave the URL as e.g. ml#/data_frame_analytics?mlManagement=(jobId:bank_classification_1) looks good.
I think the screen capture in the PR description needs editing to show navigation to the jobs list.

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Latest edits LGTM ⚡

@qn895
Copy link
Member Author

qn895 commented May 15, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@qn895 qn895 merged commit ae663eb into elastic:master May 15, 2020
jloleysens added a commit that referenced this pull request May 18, 2020
…ine-editor

* 'master' of github.com:elastic/kibana: (157 commits)
  [ML] fix url assertion (#66850)
  Skip failing lens test(s). #66779
  [SOM] Preserve saved object references when saving the object (#66584)
  Use ES API from start contract (#66157)
  Reorganize Management apps into Ingest, Data, Alerts and Insights, Security, Kibana, and Stack groups (#65796)
  [Uptime] Fix flaky navigation to certs page in tests (#66806)
  [Maps] Do not check count for blended layers when layer is not visible (#66460)
  [SIEM] Fixes glob patterns from directory changes recently for GraphQL
  chore(NA): bump static-fs to 1.0.2 (#66775)
  [Maps] Handle cross cluster index _settings resp (#66797)
  [SIEM][Lists] Adds 90% of the REST API and client API for exception lists and exception items
  allow any type for customResponseHeaders config (#66689)
  [APM] Disable map layout animation (#66763)
  [ML] Add linking to dataframe from job management tab (#65778)
  [Maps] Get number of categories from palette (#66454)
  move oss features registration to KP (#66524)
  [kbn/plugin-helpers] typescript-ify (#66513)
  Add kibana-operations as codeowners for .ci/es-snapshots and vars/ (#66746)
  FTR: move basic services under common folder (#66563)
  Migrate Beats Management UI to KP (#65791)
  ...

# Conflicts:
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 18, 2020
* master:
  [ML] fix url assertion (elastic#66850)
  Skip failing lens test(s). elastic#66779
  [SOM] Preserve saved object references when saving the object (elastic#66584)
  Use ES API from start contract (elastic#66157)
  Reorganize Management apps into Ingest, Data, Alerts and Insights, Security, Kibana, and Stack groups (elastic#65796)
  [Uptime] Fix flaky navigation to certs page in tests (elastic#66806)
  [Maps] Do not check count for blended layers when layer is not visible (elastic#66460)
  [SIEM] Fixes glob patterns from directory changes recently for GraphQL
  chore(NA): bump static-fs to 1.0.2 (elastic#66775)
  [Maps] Handle cross cluster index _settings resp (elastic#66797)
  [SIEM][Lists] Adds 90% of the REST API and client API for exception lists and exception items
  allow any type for customResponseHeaders config (elastic#66689)
  [APM] Disable map layout animation (elastic#66763)
  [ML] Add linking to dataframe from job management tab (elastic#65778)
qn895 added a commit to qn895/kibana that referenced this pull request May 18, 2020
* [ML] Add linking to dataframe from job management tab

* [ML] Add linking to df analytics job list from management tab

* [ML] Add ability to query text/job id from url for DFA page

* [ML] Add linking to dataframe from job management tab

* [ML] Add linking to df analytics job list from management tab

* [ML] Add ability to query text/job id from url for DFA page

* [ML] Refactor get_job_id_url util function & clean up

* [ML] Add declaration file for job_list's utils

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
qn895 added a commit that referenced this pull request May 18, 2020
* [ML] Add linking to dataframe from job management tab

* [ML] Add linking to df analytics job list from management tab

* [ML] Add ability to query text/job id from url for DFA page

* [ML] Add linking to dataframe from job management tab

* [ML] Add linking to df analytics job list from management tab

* [ML] Add ability to query text/job id from url for DFA page

* [ML] Refactor get_job_id_url util function & clean up

* [ML] Add declaration file for job_list's utils

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@qn895 qn895 deleted the add-df-links-to-management-list branch June 11, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants