-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Removing old angular directives (#48382)
* [ML] Removing old angular directives * reverts small change * typescriptifying access denied page * changing access denied text * updating translations
- Loading branch information
1 parent
03a1ee1
commit 5b16546
Showing
62 changed files
with
222 additions
and
620 deletions.
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: 'Insufficient permissions', | ||
})} | ||
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.