Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattapperson committed Nov 17, 2019
1 parent c7aa2ed commit 536d9f1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
8 changes: 3 additions & 5 deletions x-pack/legacy/plugins/fleet/public/components/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ function useSuggestions(fieldPrefix: string, search: string) {

const fetchSuggestions = async () => {
try {
const esSuggestions = (await elasticsearch.getSuggestions(
debouncedSearch,
debouncedSearch.length,
fieldPrefix
)).map(suggestion => ({
const esSuggestions = (
await elasticsearch.getSuggestions(debouncedSearch, debouncedSearch.length, fieldPrefix)
).map(suggestion => ({
label: suggestion.text,
description: suggestion.description || '',
type: transformSuggestionType(suggestion.type),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export class RestAgentAdapter extends AgentAdapter {

public async getWithToken(enrollmentToken: string): Promise<Agent | null> {
try {
return (await this.REST.get<ReturnTypeGet<Agent>>(
`/api/fleet/agent/unknown/${enrollmentToken}`
)).item;
return (
await this.REST.get<ReturnTypeGet<Agent>>(`/api/fleet/agent/unknown/${enrollmentToken}`)
).item;
} catch (e) {
return null;
}
Expand Down
6 changes: 5 additions & 1 deletion x-pack/legacy/plugins/fleet/public/lib/compose/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ import { FrontendLibs } from '../types';

export function compose(basePath: string): FrontendLibs {
const api = new NodeAxiosAPIAdapter('elastic', 'changeme', basePath);
const esAdapter = new MemoryElasticsearchAdapter(() => true, () => '', []);
const esAdapter = new MemoryElasticsearchAdapter(
() => true,
() => '',
[]
);
const elasticsearchLib = new ElasticsearchLib(esAdapter);

const agents = new AgentsLib(new RestAgentAdapter(api));
Expand Down
12 changes: 7 additions & 5 deletions x-pack/legacy/plugins/fleet/server/libs/agent.contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ describe('Agent lib', () => {
const agentIds: string[] = [];
for (const agent of agents) {
agentIds.push(
(await soAdapter.create(getUser(), 'agents', {
...agent,
local_metadata: JSON.stringify(agent.local_metadata || {}),
user_provided_metadata: JSON.stringify(agent.user_provided_metadata || {}),
})).id
(
await soAdapter.create(getUser(), 'agents', {
...agent,
local_metadata: JSON.stringify(agent.local_metadata || {}),
user_provided_metadata: JSON.stringify(agent.user_provided_metadata || {}),
})
).id
);
}
return agentIds;
Expand Down
5 changes: 4 additions & 1 deletion x-pack/legacy/plugins/fleet/server/libs/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ export class AgentLib {
if (agents.length === 0) {
hasMore = false;
}
await this.unenroll(user, agents.map(a => a.id));
await this.unenroll(
user,
agents.map(a => a.id)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ export class PolicyAdapter {
page: number = 1,
perPage: number = 25
): Promise<PolicyFile[]> {
const policys = (await this.so.find<any>({
type: 'policies',
search: sharedID,
searchFields: ['shared_id'],
page,
perPage,
})).saved_objects;
const policys = (
await this.so.find<any>({
type: 'policies',
search: sharedID,
searchFields: ['shared_id'],
page,
perPage,
})
).saved_objects;

if (!activeOnly) {
const backupPolicies = await this.so.find<BackupPolicyFile>({
Expand Down

0 comments on commit 536d9f1

Please sign in to comment.