-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Migrate internal urls to non-hash paths #76735
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
5ff3100
[ML] Update internal links
qn895 df33079
[ML] Update internal links
qn895 8c3adc1
[ML] Update links to datavisualizer results page
qn895 0333310
[ML] Update links to datavisualizer results page
qn895 65de961
[ML] Update links to filter list
qn895 4ec96fd
[ML] Update browser doc title whenever tab changes
qn895 49d0e7d
[ML] Update manageCalendarsHref
qn895 6827517
[ML] Update jobList and data frame list
qn895 6f86f70
[ML] Remove get_selected_ids_url
qn895 7f8decf
[ML] Update globalState to appropriate url states & retain only _g st…
qn895 ce2f3ec
[ML] Update link for register feature
qn895 6fbb599
[ML] Add i18n to main tabs
qn895 195929f
[ML] Add link to DFA list, remove commented preserve search, move aro…
qn895 f175d27
[ML] Update import for const ANALYSIS_CONFIG_TYPE
qn895 8ffd123
[ML] Revert change to APM
qn895 a30ec90
[ML] Fix broken Start trial link in data visualizer
qn895 0e9915b
[ML] Redirect to main job page if _g for global for dfa exploration i…
qn895 5b8c82e
[ML] Inject basepath to preConfiguredJobRedirect
qn895 7742303
[ML] Inject basepath to preConfiguredJobRedirect + update mock for Ti…
qn895 f56525c
[ML] Change to useNavigateToPath instead of href to avoid full page r…
qn895 25272ca
[ML] Update links within settings
qn895 adc1047
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 5d0c800
[ML] Fix eslint
qn895 c62a924
[ML] Change to using `docTitle.change`
qn895 ac70ed2
[ML] Update RecognizedResult
qn895 ad88c4e
[ML] Update redirectToTab to only retain refreshInterval + tab name c…
qn895 fb40acb
[ML] Only retain refresh interval for now
qn895 738f0b7
[ML] Update onClick to href with react-router Link
qn895 2d317c1
[ML] Update links for AD View Results, Recognize redirects, DFAnalyti…
qn895 df40e5f
[ML] Update links for recognize to also honor user's advanced setting…
qn895 a10374a
[ML] Remove # in fallback
qn895 4ee28a9
[ML] Replace usage of getResultsUrl
qn895 0e2ed56
[ML] Update links to group of AD jobs after Add sample data & create …
qn895 bb8230c
[ML] Update viewResults when AD job wizard finishes
qn895 7176749
[ML] Navigate to path /jobs as fallback
qn895 f561cf4
[ML] Preserve refreshInterval state even after navigating to settings…
qn895 ffa623a
[ML] Add refresh inerval to new job button
qn895 9272d37
[ML] Update mocks for jest tests
qn895 dd3517b
[ML] Refactor ANALYSIS_CONFIG_TYPE from enum -> const
qn895 4a50f1f
[ML] Fix issues with mlFilterListsTable
qn895 5eda3bf
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 fe633ae
[ML] Update returnToFiltersList
qn895 6461407
[ML] Add ANOMALY_DETECTION_CREATE_JOB
qn895 cf3edb7
[ML] Replace checkGetJobsCapabilitiesResolver
qn895 787bade
[ML] Update calendar & filter lists
qn895 de7c268
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 d0e20a4
[ML] Update broken DFA imports
qn895 853d5a3
[ML] Fix unnecessary links in MainTabs & add keys
qn895 662c756
[ML] Speed up DFA links from overview & extend MlUrlGen with exclude…
qn895 b530216
[ML] Improve breadcrumbs for settings page, introduce another level
qn895 a58a477
[ML] Fix broken navigation breadcrumbs
qn895 b76adb0
[ML] Fix jest tests
qn895 13abdba
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 dc3ba76
[ML] Update tst subjects, data frame, recently accessed, double elastic
qn895 40f8845
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 733e9fa
[ML] Fix i18n
qn895 1fa7026
[ML] Fix mlFilterListsRow
qn895 68e7519
[ML] Move ML_APP_NAME to constants ML_APP_NAME
qn895 3439383
[ML] Dima's feedback
qn895 cea397e
[ML] Misc fixes
qn895 0c29605
Merge branch 'ml-replace-internal-urls' of https://github.com/qn895/k…
qn895 e224267
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 f85413f
[ML] Update registerManagementSection, test for explorer_no_jobs_found
qn895 1efaed2
[ML] Update imports from discover plugins and fix i18n duplicate
qn895 29d8674
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 d3edff7
[ML] Rename DataFrameAnalyticsType -> DataFrameAnalysisConfigType
qn895 42313ae
[ML] Update useMlLink
qn895 f762277
[ML] Change redirectToMlAccessDeniedPage to using deps
qn895 ba56a81
[ML] Fix recently_accessed not working from non-ml pages
qn895 0d83eac
[ML] Add message
qn895 cc8f5dd
[ML] Use getAnalysisType, reorder import Link, rename AdJobLink
qn895 92dad64
[ML] Update clearSelectedJobIdFromUrl, update forecast tables linking…
qn895 0a4a559
[ML] Update links inside annotations_table
qn895 efe49ea
[ML] Update links in ExplorerChartContainerUI
qn895 abe0ce6
[ML] Rename single metric viewer links
qn895 b7f9be7
[ML] Update switch link btw SMV and AE
qn895 5dd7373
[ML] Update tests
qn895 0a0436b
Merge remote-tracking branch 'upstream/master' into ml-replace-intern…
qn895 75352f9
[ML] Fix model list linking
qn895 ee507b4
[ML] Update linking in AE Anomalies table
qn895 a39face
Merge branch 'master' into ml-replace-internal-urls
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,12 @@ export function checkGetManagementMlJobsResolver() { | |
}); | ||
} | ||
|
||
export function checkGetJobsCapabilitiesResolver(): Promise<MlCapabilities> { | ||
export function checkGetJobsCapabilitiesResolver( | ||
redirectToMlAccessDeniedPage: () => Promise<void> | ||
): Promise<MlCapabilities> { | ||
return new Promise((resolve, reject) => { | ||
getCapabilities() | ||
.then(({ capabilities, isPlatinumOrTrialLicense }) => { | ||
.then(async ({ capabilities, isPlatinumOrTrialLicense }) => { | ||
Comment on lines
+38
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need to wrap in Promise, just an async function with |
||
_capabilities = capabilities; | ||
// the minimum privilege for using ML with a platinum or trial license is being able to get the transforms list. | ||
// all other functionality is controlled by the return capabilities object. | ||
|
@@ -46,21 +48,23 @@ export function checkGetJobsCapabilitiesResolver(): Promise<MlCapabilities> { | |
if (_capabilities.canGetJobs || isPlatinumOrTrialLicense === false) { | ||
return resolve(_capabilities); | ||
} else { | ||
window.location.href = '#/access-denied'; | ||
await redirectToMlAccessDeniedPage(); | ||
return reject(); | ||
} | ||
}) | ||
.catch((e) => { | ||
window.location.href = '#/access-denied'; | ||
.catch(async (e) => { | ||
await redirectToMlAccessDeniedPage(); | ||
return reject(); | ||
}); | ||
}); | ||
} | ||
|
||
export function checkCreateJobsCapabilitiesResolver(): Promise<MlCapabilities> { | ||
export function checkCreateJobsCapabilitiesResolver( | ||
redirectToJobsManagementPage: () => Promise<void> | ||
): Promise<MlCapabilities> { | ||
return new Promise((resolve, reject) => { | ||
getCapabilities() | ||
.then(({ capabilities, isPlatinumOrTrialLicense }) => { | ||
.then(async ({ capabilities, isPlatinumOrTrialLicense }) => { | ||
_capabilities = capabilities; | ||
// if the license is basic (isPlatinumOrTrialLicense === false) then do not redirect, | ||
// allow the promise to resolve as the separate license check will redirect then user to | ||
|
@@ -69,34 +73,36 @@ export function checkCreateJobsCapabilitiesResolver(): Promise<MlCapabilities> { | |
return resolve(_capabilities); | ||
} else { | ||
// if the user has no permission to create a job, | ||
// redirect them back to the Transforms Management page | ||
window.location.href = '#/jobs'; | ||
// redirect them back to the Anomaly Detection Management page | ||
await redirectToJobsManagementPage(); | ||
return reject(); | ||
} | ||
}) | ||
.catch((e) => { | ||
window.location.href = '#/jobs'; | ||
.catch(async (e) => { | ||
await redirectToJobsManagementPage(); | ||
return reject(); | ||
}); | ||
}); | ||
} | ||
|
||
export function checkFindFileStructurePrivilegeResolver(): Promise<MlCapabilities> { | ||
export function checkFindFileStructurePrivilegeResolver( | ||
redirectToMlAccessDeniedPage: () => Promise<void> | ||
): Promise<MlCapabilities> { | ||
return new Promise((resolve, reject) => { | ||
getCapabilities() | ||
.then(({ capabilities }) => { | ||
.then(async ({ capabilities }) => { | ||
_capabilities = capabilities; | ||
// the minimum privilege for using ML with a basic license is being able to use the datavisualizer. | ||
// all other functionality is controlled by the return _capabilities object | ||
if (_capabilities.canFindFileStructure) { | ||
return resolve(_capabilities); | ||
} else { | ||
window.location.href = '#/access-denied'; | ||
await redirectToMlAccessDeniedPage(); | ||
return reject(); | ||
} | ||
}) | ||
.catch((e) => { | ||
window.location.href = '#/access-denied'; | ||
.catch(async (e) => { | ||
await redirectToMlAccessDeniedPage(); | ||
return reject(); | ||
}); | ||
}); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the same as an
enum
already inplugins/ml/public/application/data_frame_analytics/common/analytics.ts
. This one using theconst
approach as well as the location here LGTM so suggest to try to get rid of the on mentioned in this comment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through and updated the usage of
enum ANALYSIS_CONFIG_TYPE
toconst ANALYSIS_CONFIG_TYPE
here dd3517b