-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Removing old angular directives #48382
Merged
jgowdyelastic
merged 5 commits into
elastic:master
from
jgowdyelastic:removing-old-angular-directives
Oct 16, 2019
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1cfca0b
[ML] Removing old angular directives
jgowdyelastic 021f209
reverts small change
jgowdyelastic b0d7e69
typescriptifying access denied page
jgowdyelastic d0741bd
changing access denied text
jgowdyelastic 8ca1264
updating translations
jgowdyelastic 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import uiRoutes from 'ui/routes'; | ||
import { I18nContext } from 'ui/i18n'; | ||
// @ts-ignore | ||
import { uiModules } from 'ui/modules'; | ||
import { AccessDeniedPage } from './page'; | ||
|
||
const module = uiModules.get('apps/ml', ['react']); | ||
|
||
const template = `<access-denied />`; | ||
|
||
uiRoutes.when('/access-denied', { | ||
template, | ||
}); | ||
|
||
module.directive('accessDenied', function() { | ||
return { | ||
scope: {}, | ||
restrict: 'E', | ||
link: async (scope: ng.IScope, element: ng.IAugmentedJQuery) => { | ||
ReactDOM.render( | ||
<I18nContext>{React.createElement(AccessDeniedPage)}</I18nContext>, | ||
element[0] | ||
); | ||
|
||
element.on('$destroy', () => { | ||
ReactDOM.unmountComponentAtNode(element[0]); | ||
scope.$destroy(); | ||
}); | ||
}, | ||
}; | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* 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 React, { Fragment } from 'react'; | ||
|
||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { | ||
EuiCallOut, | ||
EuiPage, | ||
EuiPageBody, | ||
EuiPageContentBody, | ||
EuiPageContentHeader, | ||
EuiPageContentHeaderSection, | ||
EuiSpacer, | ||
EuiText, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { NavigationMenu } from '../components/navigation_menu'; | ||
|
||
export const AccessDeniedPage = () => ( | ||
<Fragment> | ||
<NavigationMenu tabId="access-denied" /> | ||
<EuiPage> | ||
<EuiPageBody> | ||
<EuiPageContentHeader> | ||
<EuiPageContentHeaderSection> | ||
<EuiTitle> | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.ml.management.jobsList.accessDeniedTitle" | ||
defaultMessage="Access denied" | ||
/> | ||
</h1> | ||
</EuiTitle> | ||
</EuiPageContentHeaderSection> | ||
</EuiPageContentHeader> | ||
<EuiPageContentBody> | ||
<EuiSpacer size="m" /> | ||
<EuiCallOut | ||
title={i18n.translate('xpack.ml.accessDenied.label', { | ||
defaultMessage: 'You need permission to the Ml plugin', | ||
})} | ||
color="danger" | ||
iconType="cross" | ||
> | ||
<EuiText size="s"> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.ml.accessDenied.description" | ||
defaultMessage="You don’t have permission to access the ML plugin" | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiCallOut> | ||
</EuiPageContentBody> | ||
</EuiPageBody> | ||
</EuiPage> | ||
</Fragment> | ||
); |
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
17 changes: 0 additions & 17 deletions
17
x-pack/legacy/plugins/ml/public/components/data_recognizer/data_recognizer_directive.js
This file was deleted.
Oops, something went wrong.
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
44 changes: 0 additions & 44 deletions
44
x-pack/legacy/plugins/ml/public/components/field_title_bar/field_title_bar_directive.js
This file was deleted.
Oops, something went wrong.
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
46 changes: 0 additions & 46 deletions
46
x-pack/legacy/plugins/ml/public/components/field_type_icon/field_type_icon_directive.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,7 +5,4 @@ | |
*/ | ||
|
||
|
||
|
||
import './field_type_icon_directive'; | ||
|
||
export { FieldTypeIcon } from './field_type_icon'; |
58 changes: 0 additions & 58 deletions
58
...ugins/ml/public/components/full_time_range_selector/full_time_range_selector_directive.js
This file was deleted.
Oops, something went wrong.
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.
Should be
ML
rather thanMl
to be consistent with message below.Also title doesn't quite make sense -
You need permission to use the ML plugin
or maybeInsufficient permissions
?