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

Move Spaces, Security and EncryptedSavedObjects plugins to separate TS projects #88365

Merged
merged 2 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions x-pack/plugins/encrypted_saved_objects/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["server/**/*"],
"references": [
{ "path": "../security/tsconfig.json" },
]
}
2 changes: 1 addition & 1 deletion x-pack/plugins/security/common/model/authenticated_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { AuthenticationProvider, User } from '.';

const REALMS_ELIGIBLE_FOR_PASSWORD_CHANGE = ['reserved', 'native'];

interface UserRealm {
export interface UserRealm {
name: string;
type: string;
}
Expand Down
24 changes: 24 additions & 0 deletions x-pack/plugins/security/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*", "server/**/*"],
"references": [
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for taking the time to sort these alphabetically 🏅

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 must admit it becomes an obsession for me 🙈

{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
{ "path": "../task_manager/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../../../src/plugins/security_oss/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@

export { ConfirmDeleteModal } from './confirm_delete_modal';
export { UnauthorizedPrompt } from './unauthorized_prompt';
export { SecureSpaceMessage } from './secure_space_message';

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: ['feature-1', 'feature-2'],
}}
securityEnabled={true}
onChange={jest.fn()}
getUrlForApp={getUrlForApp}
/>
Expand All @@ -61,7 +60,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: ['feature-1', 'feature-2'],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down Expand Up @@ -96,7 +94,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: [],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down Expand Up @@ -134,7 +131,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: [],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down Expand Up @@ -165,7 +161,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: ['feature-1', 'feature-2'],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down Expand Up @@ -194,7 +189,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: ['feature-1'],
}}
securityEnabled={true}
onChange={jest.fn()}
getUrlForApp={getUrlForApp}
/>
Expand All @@ -214,7 +208,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: [],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down Expand Up @@ -243,7 +236,6 @@ describe('EnabledFeatures', () => {
name: 'my space',
disabledFeatures: [],
}}
securityEnabled={true}
onChange={changeHandler}
getUrlForApp={getUrlForApp}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component, Fragment, ReactNode } from 'react';
Expand All @@ -18,7 +18,6 @@ import { FeatureTable } from './feature_table';
interface Props {
space: Partial<Space>;
features: KibanaFeatureConfig[];
securityEnabled: boolean;
onChange: (space: Partial<Space>) => void;
getUrlForApp: ApplicationStart['getUrlForApp'];
}
Expand Down Expand Up @@ -129,27 +128,6 @@ export class EnabledFeatures extends Component<Props, {}> {
defaultMessage="The feature is hidden in the UI, but is not disabled."
/>
</p>
{this.props.securityEnabled && (
<p>
<FormattedMessage
id="xpack.spaces.management.enabledSpaceFeatures.goToRolesLink"
defaultMessage="If you wish to secure access to features, please {manageSecurityRoles}."
values={{
manageSecurityRoles: (
<EuiLink
data-test-subj="goToRoles"
href={this.props.getUrlForApp('management', { path: 'security/roles' })}
>
<FormattedMessage
id="xpack.spaces.management.enabledSpaceFeatures.rolesLinkText"
defaultMessage="manage security roles"
/>
</EuiLink>
),
}}
/>
</p>
)}
</EuiText>
</Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('ManageSpacePage', () => {
spacesManager={(spacesManager as unknown) as SpacesManager}
getFeatures={featuresStart.getFeatures}
notifications={notificationServiceMock.createStartContract()}
securityEnabled={true}
getUrlForApp={getUrlForApp}
history={history}
capabilities={{
Expand Down Expand Up @@ -120,7 +119,6 @@ describe('ManageSpacePage', () => {
onLoadSpace={onLoadSpace}
getFeatures={featuresStart.getFeatures}
notifications={notificationServiceMock.createStartContract()}
securityEnabled={true}
getUrlForApp={getUrlForApp}
history={history}
capabilities={{
Expand Down Expand Up @@ -173,7 +171,6 @@ describe('ManageSpacePage', () => {
spacesManager={(spacesManager as unknown) as SpacesManager}
getFeatures={() => Promise.reject(error)}
notifications={notifications}
securityEnabled={true}
getUrlForApp={getUrlForApp}
history={history}
capabilities={{
Expand Down Expand Up @@ -211,7 +208,6 @@ describe('ManageSpacePage', () => {
spacesManager={(spacesManager as unknown) as SpacesManager}
getFeatures={featuresStart.getFeatures}
notifications={notificationServiceMock.createStartContract()}
securityEnabled={true}
getUrlForApp={getUrlForApp}
history={history}
capabilities={{
Expand Down Expand Up @@ -273,7 +269,6 @@ describe('ManageSpacePage', () => {
spacesManager={(spacesManager as unknown) as SpacesManager}
getFeatures={featuresStart.getFeatures}
notifications={notificationServiceMock.createStartContract()}
securityEnabled={true}
getUrlForApp={getUrlForApp}
history={history}
capabilities={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Space } from '../../../../../../src/plugins/spaces_oss/common';
import { KibanaFeature, FeaturesPluginStart } from '../../../../features/public';
import { isReservedSpace } from '../../../common';
import { SpacesManager } from '../../spaces_manager';
import { SecureSpaceMessage, UnauthorizedPrompt } from '../components';
import { UnauthorizedPrompt } from '../components';
import { toSpaceIdentifier } from '../lib';
import { SpaceValidator } from '../lib/validate_space';
import { ConfirmAlterActiveSpaceModal } from './confirm_alter_active_space_modal';
Expand All @@ -39,7 +39,6 @@ interface Props {
spaceId?: string;
onLoadSpace?: (space: Space) => void;
capabilities: Capabilities;
securityEnabled: boolean;
history: ScopedHistory;
getUrlForApp: ApplicationStart['getUrlForApp'];
}
Expand Down Expand Up @@ -107,7 +106,6 @@ export class ManageSpacePage extends Component<Props, State> {
return (
<Fragment>
<EuiPageContentBody>{content}</EuiPageContentBody>
{this.maybeGetSecureSpacesMessage()}
</Fragment>
);
}
Expand Down Expand Up @@ -157,7 +155,6 @@ export class ManageSpacePage extends Component<Props, State> {
features={this.state.features}
onChange={this.onSpaceChange}
getUrlForApp={this.props.getUrlForApp}
securityEnabled={this.props.securityEnabled}
/>

<EuiSpacer />
Expand Down Expand Up @@ -201,13 +198,6 @@ export class ManageSpacePage extends Component<Props, State> {
);
};

public maybeGetSecureSpacesMessage = () => {
if (this.editingExistingSpace() && this.props.securityEnabled) {
return <SecureSpaceMessage getUrlForApp={this.props.getUrlForApp} />;
}
return null;
};

public getFormButtons = () => {
const createSpaceText = i18n.translate(
'xpack.spaces.management.manageSpacePage.createSpaceButton',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import { StartServicesAccessor } from 'src/core/public';
import { ManagementSetup, ManagementApp } from '../../../../../src/plugins/management/public';
import { SecurityLicense } from '../../../security/public';
import { SpacesManager } from '../spaces_manager';
import { PluginsStart } from '../plugin';
import { spacesManagementApp } from './spaces_management_app';
Expand All @@ -15,15 +14,14 @@ interface SetupDeps {
management: ManagementSetup;
getStartServices: StartServicesAccessor<PluginsStart>;
spacesManager: SpacesManager;
securityLicense?: SecurityLicense;
}

export class ManagementService {
private registeredSpacesManagementApp?: ManagementApp;

public setup({ getStartServices, management, spacesManager, securityLicense }: SetupDeps) {
public setup({ getStartServices, management, spacesManager }: SetupDeps) {
this.registeredSpacesManagementApp = management.sections.section.kibana.registerApp(
spacesManagementApp.create({ getStartServices, spacesManager, securityLicense })
spacesManagementApp.create({ getStartServices, spacesManager })
);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading