-
Notifications
You must be signed in to change notification settings - Fork 944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CCI] Fix type errors in Saved Object Management #3987
Changes from all commits
9a2073f
7109ac1
f5b6f43
67ea995
db883c8
b3730a4
754d764
07e9773
fd0ffb3
025d6e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -55,6 +55,7 @@ import { | |||
SavedObjectsManagementActionServiceStart, | ||||
SavedObjectsManagementAction, | ||||
SavedObjectsManagementColumnServiceStart, | ||||
SavedObjectsManagementNamespaceServiceStart, | ||||
} from '../../../services'; | ||||
|
||||
export interface TableProps { | ||||
|
@@ -77,12 +78,12 @@ export interface TableProps { | |||
items: SavedObjectWithMetadata[]; | ||||
itemId: string | (() => string); | ||||
totalItemCount: number; | ||||
onQueryChange: (query: any, filterFields: string[]) => void; | ||||
onQueryChange: (query: any, filterFields?: string[]) => void; | ||||
onTableChange: (table: any) => void; | ||||
isSearching: boolean; | ||||
onShowRelationships: (object: SavedObjectWithMetadata) => void; | ||||
canGoInApp: (obj: SavedObjectWithMetadata) => boolean; | ||||
dateFormat: string; | ||||
dateFormat?: string; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about the optional
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think making it optional is probably fine - moment will accept Line 164 in 07e9773
|
||||
} | ||||
|
||||
interface TableState { | ||||
|
@@ -175,7 +176,6 @@ export class Table extends PureComponent<TableProps, TableState> { | |||
basePath, | ||||
actionRegistry, | ||||
columnRegistry, | ||||
namespaceRegistry, | ||||
dateFormat, | ||||
} = this.props; | ||||
|
||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -161,6 +161,7 @@ describe('SavedObjectsTable', () => { | |||
goInspectObject: () => {}, | ||||
canGoInApp: () => true, | ||||
search, | ||||
dateFormat: 'YYYY-MM-DD', | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you tell me what value the dateFormat should take? In
the value is const dateFormat = coreStart.uiSettings.get<string>('dateFormat'); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question. It's a little hard to tell, but to be consistent with the ui_settings test, I'd use
|
||||
}; | ||||
|
||||
findObjectsMock.mockImplementation(() => ({ | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ export interface SavedObjectsManagementNamespaceServiceStart { | |
|
||
export class SavedObjectsManagementNamespaceService { | ||
private readonly namespaces = new Map<string, SavedObjectsManagementNamespace<unknown>>(); | ||
private readonly alias; | ||
private alias: string = ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the behavior a bit. Is there any error cases or edge case handling that needs to be changed to handle |
||
|
||
setup(): SavedObjectsManagementNamespaceServiceSetup { | ||
return { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - in general, prefer
unknown
toany
.