Skip to content

Commit bd13122

Browse files
Merge branch 'master' into support-bazel-packages-on-kbn-pm
2 parents 51f4e2a + 87e8386 commit bd13122

95 files changed

Lines changed: 818 additions & 288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-kibana\_utils-public-state\_sync](./kibana-plugin-plugins-kibana_utils-public-state_sync.md) &gt; [IKbnUrlStateStorage](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.md) &gt; [cancel](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.cancel.md)
4+
5+
## IKbnUrlStateStorage.cancel property
6+
7+
Cancels any pending url updates
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
cancel: () => void;
13+
```

docs/development/plugins/kibana_utils/public/state_sync/kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface IKbnUrlStateStorage extends IStateStorage
2020
2121
| Property | Type | Description |
2222
| --- | --- | --- |
23+
| [cancel](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.cancel.md) | <code>() =&gt; void</code> | Cancels any pending url updates |
2324
| [change$](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.change_.md) | <code>&lt;State = unknown&gt;(key: string) =&gt; Observable&lt;State &#124; null&gt;</code> | |
2425
| [get](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.get.md) | <code>&lt;State = unknown&gt;(key: string) =&gt; State &#124; null</code> | |
2526
| [kbnUrlControls](./kibana-plugin-plugins-kibana_utils-public-state_sync.ikbnurlstatestorage.kbnurlcontrols.md) | <code>IKbnUrlControls</code> | Lower level wrapper around history library that handles batching multiple URL updates into one history change |

packages/kbn-es/src/cluster.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ exports.Cluster = class Cluster {
246246
this._log.info(chalk.bold('Starting'));
247247
this._log.indent(4);
248248

249-
const esArgs = options.esArgs || [];
249+
const esArgs = ['action.destructive_requires_name=true', ...(options.esArgs || [])];
250250

251251
// Add to esArgs if ssl is enabled
252252
if (this._ssl) {

packages/kbn-es/src/integration_tests/cluster.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ describe('#start(installPath)', () => {
264264
expect(extractConfigFiles.mock.calls).toMatchInlineSnapshot(`
265265
Array [
266266
Array [
267-
Array [],
267+
Array [
268+
"action.destructive_requires_name=true",
269+
],
268270
undefined,
269271
Object {
270272
"log": <ToolingLog>,
@@ -340,7 +342,9 @@ describe('#run()', () => {
340342
expect(extractConfigFiles.mock.calls).toMatchInlineSnapshot(`
341343
Array [
342344
Array [
343-
Array [],
345+
Array [
346+
"action.destructive_requires_name=true",
347+
],
344348
undefined,
345349
Object {
346350
"log": <ToolingLog>,

src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.tsx.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/kibana_utils/public/state_sync/public.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const createSessionStorageStateStorage: (storage?: Storage) => ISessionSt
2222

2323
// @public
2424
export interface IKbnUrlStateStorage extends IStateStorage {
25+
cancel: () => void;
2526
// (undocumented)
2627
change$: <State = unknown>(key: string) => Observable<State | null>;
2728
// (undocumented)

src/plugins/kibana_utils/public/state_sync/state_sync.test.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ describe('state_sync', () => {
290290
expect(history.length).toBe(startHistoryLength);
291291
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
292292

293-
urlSyncStrategy.kbnUrlControls.cancel();
293+
urlSyncStrategy.cancel();
294294

295295
expect(history.length).toBe(startHistoryLength);
296296
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
@@ -303,6 +303,32 @@ describe('state_sync', () => {
303303
stop();
304304
});
305305

306+
it('cancels pending URL updates when sync stops', async () => {
307+
const { stop, start } = syncStates([
308+
{
309+
stateContainer: withDefaultState(container, defaultState),
310+
storageKey: key,
311+
stateStorage: urlSyncStrategy,
312+
},
313+
]);
314+
start();
315+
316+
const startHistoryLength = history.length;
317+
container.transitions.add({ id: 2, text: '2', completed: false });
318+
container.transitions.add({ id: 3, text: '3', completed: false });
319+
container.transitions.completeAll();
320+
321+
expect(history.length).toBe(startHistoryLength);
322+
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
323+
324+
stop();
325+
326+
await tick();
327+
328+
expect(history.length).toBe(startHistoryLength);
329+
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
330+
});
331+
306332
it("should preserve reference to unchanged state slices if them didn't change", async () => {
307333
const otherUnchangedSlice = { a: 'test' };
308334
const oldState = {

src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('KbnUrlStateStorage', () => {
5151
const key = '_s';
5252
const pr = urlStateStorage.set(key, state);
5353
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
54-
urlStateStorage.kbnUrlControls.cancel();
54+
urlStateStorage.cancel();
5555
await pr;
5656
expect(getCurrentUrl()).toMatchInlineSnapshot(`"/"`);
5757
expect(urlStateStorage.get(key)).toEqual(null);

src/plugins/kibana_utils/public/state_sync/state_sync_state_storage/create_kbn_url_state_storage.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export interface IKbnUrlStateStorage extends IStateStorage {
3939
get: <State = unknown>(key: string) => State | null;
4040
change$: <State = unknown>(key: string) => Observable<State | null>;
4141

42+
/**
43+
* Cancels any pending url updates
44+
*/
45+
cancel: () => void;
46+
4247
/**
4348
* Lower level wrapper around history library that handles batching multiple URL updates into one history change
4449
*/
@@ -108,6 +113,9 @@ export const createKbnUrlStateStorage = (
108113
}),
109114
share()
110115
),
116+
cancel() {
117+
url.cancel();
118+
},
111119
kbnUrlControls: url,
112120
};
113121
};

test/api_integration/apis/saved_objects/bulk_create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
1212

1313
export default function ({ getService }: FtrProviderContext) {
1414
const supertest = getService('supertest');
15-
const es = getService('es');
1615
const esArchiver = getService('esArchiver');
16+
const esDeleteAllIndices = getService('esDeleteAllIndices');
1717

1818
const BULK_REQUESTS = [
1919
{
@@ -97,7 +97,7 @@ export default function ({ getService }: FtrProviderContext) {
9797
before(
9898
async () =>
9999
// just in case the kibana server has recreated it
100-
await es.indices.delete({ index: '.kibana' }, { ignore: [404] })
100+
await esDeleteAllIndices('.kibana')
101101
);
102102

103103
it('should return 200 with individual responses', async () =>

0 commit comments

Comments
 (0)