Skip to content

Commit

Permalink
Fix CI types error
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila committed Nov 2, 2022
1 parent 091eb74 commit d6e46f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/

import type { IUnsecuredActionsClient } from '@kbn/actions-plugin/server';
import type { RelatedSavedObjects } from '@kbn/actions-plugin/server/lib/related_saved_objects';
import type { EmailService, PlainTextEmail, RelatedSavedObject } from './types';
import type { EmailService, PlainTextEmail } from './types';

export class ConnectorsEmailService implements EmailService {
constructor(
Expand All @@ -25,13 +24,11 @@ export class ConnectorsEmailService implements EmailService {
message: params.message,
},
...(params.context?.relatedObjects?.length && {
relatedSavedObjects: this._getRelatedSavedObjects(params.context!.relatedObjects!),
relatedSavedObjects: params.context!.relatedObjects!.map(
({ id, type, spaceId: namespace }) => ({ id, type, namespace })
),
}),
}));
return await this.actionsClient.bulkEnqueueExecution(this.requesterId, actions);
}

private _getRelatedSavedObjects(relatedObjects: RelatedSavedObject[]): RelatedSavedObjects {
return relatedObjects.map(({ id, type, spaceId: namespace }) => ({ id, type, namespace }));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { Subject } from 'rxjs';
import { licenseMock } from '@kbn/licensing-plugin/common/licensing.mock';
import { licensingMock } from '@kbn/licensing-plugin/server/mocks';
import { loggerMock } from '@kbn/logging-mocks';
import { LicensedEmailService } from './licensed_email_service';
import type { ILicense } from '@kbn/licensing-plugin/server';
Expand All @@ -18,8 +18,8 @@ const emailServiceMock: EmailService = {
sendPlainTextEmail: jest.fn(),
};

const validLicense = licenseMock.createLicenseMock();
const invalidLicense = licenseMock.createLicenseMock();
const validLicense = licensingMock.createLicenseMock();
const invalidLicense = licensingMock.createLicenseMock();
invalidLicense.type = 'basic';
invalidLicense.check = jest.fn(() => ({
state: 'invalid',
Expand Down
6 changes: 4 additions & 2 deletions x-pack/plugins/notifications/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"public/**/*",
"common/**/*"
],
"references": [
{ "path": "../actions/tsconfig.json" }
"kbn_references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../actions/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" }
]
}

0 comments on commit d6e46f5

Please sign in to comment.