Skip to content

Commit f398e8f

Browse files
committed
Merge branch 'kertal-pr-2019-11-22-np-saved-object' into kertal-pr-2019-12-09-np-saved-object-graph
2 parents 0910a52 + eb72d95 commit f398e8f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/legacy/core_plugins/kibana/public/discover/saved_searches/_saved_search.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export function createSavedSearchClass(services: SavedObjectKibanaServices) {
3232
sort: 'keyword',
3333
version: 'integer',
3434
};
35+
// Order these fields to the top, the rest are alphabetical
36+
public static fieldOrder = ['title', 'description'];
37+
public static searchSource = true;
38+
39+
public id: string;
3540
public showInRecentlyAccessed: boolean;
3641

3742
constructor(id: string) {

src/legacy/ui/public/saved_objects/saved_object.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,14 @@ export function createSavedObjectClass(services: SavedObjectKibanaServices) {
4242
* @param {*} config
4343
*/
4444
class SavedObjectClass {
45-
public static fieldOrder = ['title', 'description'];
46-
public static searchSource = true;
47-
public id?: string;
48-
public title: string = '';
49-
public getFullPath?: () => string;
50-
5145
constructor(config: SavedObjectConfig = {}) {
5246
// @ts-ignore
5347
const self: SavedObject = this;
5448
buildSavedObject(self, config, services);
5549
}
5650
}
5751

58-
return SavedObjectClass;
52+
return SavedObjectClass as new (config: SavedObjectConfig) => SavedObject;
5953
}
6054
// the old angular way, should be removed once no longer used
6155
export function SavedObjectProvider() {

src/legacy/ui/public/saved_objects/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919
import { ChromeStart, OverlayStart, SavedObjectsClientContract } from 'kibana/public';
20-
import { SearchSourceContract } from 'ui/courier';
20+
import { SearchSource, SearchSourceContract } from 'ui/courier';
2121
import { SavedObjectAttributes, SavedObjectReference } from 'kibana/server';
2222
import { IndexPatternsContract } from '../../../../plugins/data/public';
2323
import { IndexPattern } from '../../../core_plugins/data/public';
@@ -83,7 +83,7 @@ export interface SavedObjectConfig {
8383
mapping?: any;
8484
migrationVersion?: Record<string, any>;
8585
path?: string;
86-
searchSource?: SearchSourceContract | boolean;
86+
searchSource?: SearchSource | boolean;
8787
type?: string;
8888
}
8989

0 commit comments

Comments
 (0)