-
Notifications
You must be signed in to change notification settings - Fork 59
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
[BUG] Updated cache for the sub tree in Workbench #2351
Changes from all commits
e063f07
5d8a228
f8262c2
3f561a6
bab33ae
5b3e9ad
f227c2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,16 +37,25 @@ export interface AccelerationDetailsFlyoutProps { | |
dataSourceMDSId?: string; | ||
} | ||
|
||
const getMappings = (index: string): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
return coreRefs.dslService?.fetchFields(index); | ||
const getMappings = ( | ||
index: string, | ||
dataSourceMDSId?: string | ||
): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
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. return Promise or undefined? is it supposed to be Promise<OpenSearchDashboardsResponse | undefined>? |
||
return coreRefs.dslService?.fetchFields(index, dataSourceMDSId); | ||
}; | ||
|
||
const getSettings = (index: string): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
return coreRefs.dslService?.fetchSettings(index); | ||
const getSettings = ( | ||
index: string, | ||
dataSourceMDSId?: string | ||
): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
return coreRefs.dslService?.fetchSettings(index, dataSourceMDSId); | ||
}; | ||
|
||
const getIndexInfo = (index: string): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
return coreRefs.dslService?.fetchIndices(index); | ||
const getIndexInfo = ( | ||
index: string, | ||
dataSourceMDSId?: string | ||
): Promise<OpenSearchDashboardsResponse> | undefined => { | ||
return coreRefs.dslService?.fetchIndices(index, dataSourceMDSId); | ||
}; | ||
|
||
const handleDetailsFetchingPromise = ( | ||
|
@@ -59,7 +68,7 @@ const handleDetailsFetchingPromise = ( | |
}; | ||
|
||
export const AccelerationDetailsFlyout = (props: AccelerationDetailsFlyoutProps) => { | ||
const { dataSourceName, acceleration, resetFlyout, handleRefresh } = props; | ||
const { dataSourceName, acceleration, resetFlyout, handleRefresh, dataSourceMDSId } = props; | ||
const { flintIndexName } = acceleration; | ||
const [selectedTab, setSelectedTab] = useState('details'); | ||
const tabsMap: { [key: string]: any } = { | ||
|
@@ -113,9 +122,9 @@ export const AccelerationDetailsFlyout = (props: AccelerationDetailsFlyoutProps) | |
|
||
const getAccDetail = (selectedIndex: string) => { | ||
Promise.all([ | ||
handleDetailsFetchingPromise(getMappings(selectedIndex), 'getMappings'), | ||
handleDetailsFetchingPromise(getSettings(selectedIndex), 'getSettings'), | ||
handleDetailsFetchingPromise(getIndexInfo(selectedIndex), 'getIndexInfo'), | ||
handleDetailsFetchingPromise(getMappings(selectedIndex, dataSourceMDSId), 'getMappings'), | ||
handleDetailsFetchingPromise(getSettings(selectedIndex, dataSourceMDSId), 'getSettings'), | ||
handleDetailsFetchingPromise(getIndexInfo(selectedIndex, dataSourceMDSId), 'getIndexInfo'), | ||
]) | ||
.then((results) => { | ||
updateMapping(results[0]); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,9 @@ export default class DSLService { | |
.catch((error) => console.error(error)); | ||
}; | ||
|
||
fetchIndices = async (index: string = '') => { | ||
fetchIndices = async (index: string = '', dataSourceMDSId?: 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. not sure how this is handled when MDS is diabled. should we have a default value here? 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. have tested it, works when is the id is empty as well 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. will update it to '' when MDS is disabled 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. is there a place that when mds is disabled we set mds id to 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. |
||
return this.http | ||
.get(`${DSL_BASE}${DSL_CAT}`, { | ||
.get(`${DSL_BASE}${DSL_CAT}/dataSourceMDSId=${dataSourceMDSId}`, { | ||
query: { | ||
format: 'json', | ||
index, | ||
|
@@ -39,16 +39,16 @@ export default class DSLService { | |
.catch((error) => console.error(error)); | ||
}; | ||
|
||
fetchFields = async (index: string) => { | ||
return this.http.get(`${DSL_BASE}${DSL_MAPPING}`, { | ||
fetchFields = async (index: string, dataSourceMDSId?: string) => { | ||
return this.http.get(`${DSL_BASE}${DSL_MAPPING}/dataSourceMDSId=${dataSourceMDSId}`, { | ||
query: { | ||
index, | ||
}, | ||
}); | ||
}; | ||
|
||
fetchSettings = async (index: string) => { | ||
return this.http.get(`${DSL_BASE}${DSL_SETTINGS}`, { | ||
fetchSettings = async (index: string, dataSourceMDSId?: string) => { | ||
return this.http.get(`${DSL_BASE}${DSL_SETTINGS}/dataSourceMDSId=${dataSourceMDSId}`, { | ||
query: { | ||
index, | ||
}, | ||
|
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.
May be add test cases with MDS enabled as well?
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.
okay sure
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.
test added