Skip to content

Commit

Permalink
address PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuellr committed Jul 14, 2020
1 parent 3e53625 commit b47704b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class ClusterClientAdapter {

public async queryEventsBySavedObject(
index: string,
namespace: string | undefined, // TODO - add term clause for namespace
namespace: string | undefined,
type: string,
id: string,
{ page, per_page: perPage, start, end, sort_field, sort_order }: FindOptionsType
Expand Down
7 changes: 2 additions & 5 deletions x-pack/plugins/event_log/server/es/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { createEsContext } from './context';
import { LegacyClusterClient, Logger } from 'src/core/server';
import { elasticsearchServiceMock, loggingSystemMock } from 'src/core/server/mocks';

import { createEsContext } from './context';
jest.mock('../lib/../../../../package.json', () => ({
version: '1.2.3',
}));
jest.mock('../lib/../../../../package.json', () => ({ version: '1.2.3' }));
type EsClusterClient = Pick<jest.Mocked<LegacyClusterClient>, 'callAsInternalUser' | 'asScoped'>;

let logger: Logger;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/event_log/server/event_log_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class EventLogClient implements IEventLogClient {
const findOptions = findOptionsSchema.validate(options ?? {});

const space = await this.spacesService?.getActiveSpace(this.request);
const namespace = space?.id === 'default' ? undefined : space?.id;
const namespace = space && this.spacesService?.spaceIdToNamespace(space.id);

// verify the user has the required permissions to view this saved object
await this.savedObjectsClient.get(type, id);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/event_log/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ACTIONS = {
};

interface PluginSetupDeps {
spaces: SpacesPluginSetup;
spaces?: SpacesPluginSetup;
}

export class Plugin implements CorePlugin<IEventLogService, IEventLogClientService> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default function eventLogTests({ getService }: FtrProviderContext) {
actions: ['execute', 'execute-action', 'new-instance', 'resolved-instance'],
});
});
// console.log(JSON.stringify(events, null, 4));

// make sure the counts of the # of events per type are as expected
const executeEvents = getEventsByAction(events, 'execute');
Expand Down

0 comments on commit b47704b

Please sign in to comment.