-
Notifications
You must be signed in to change notification settings - Fork 923
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
Update Observability Data Sources with Type and Redirection #8492
Changes from 9 commits
5d242f9
f5a7109
d439950
e94032f
b5b90af
833ebb1
76b02cd
f81c9dd
e616392
4af3fdf
8be2f8e
4bb86fd
1d2e635
f9fb6a9
911f22d
d2197e8
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Updated DataSource Management to redirect to Discover as well as display the type of the DataSource ([#8492](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8492)) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,49 +43,38 @@ | |
); | ||
}; | ||
|
||
export const redirectToExplorerWithDataSrc = ( | ||
export const redirectToDiscoverWithDataSrc = ( | ||
datasourceName: string, | ||
datasourceType: string, | ||
datasourceMDSId: string | undefined, | ||
databaseName: string, | ||
tableName: string, | ||
application: ApplicationStart | ||
) => { | ||
const queryIndex = `${datasourceName}.${databaseName}.${tableName}`; | ||
redirectToExplorerWithQuery(datasourceName, datasourceType, queryIndex, application); | ||
}; | ||
|
||
export const redirectToExplorerOSIdx = (indexName: string, application: ApplicationStart) => { | ||
redirectToExplorerWithQuery( | ||
DEFAULT_DATA_SOURCE_NAME, | ||
DEFAULT_DATA_SOURCE_TYPE, | ||
indexName, | ||
application | ||
); | ||
}; | ||
|
||
export const redirectToExplorerS3 = (datasourceName: string, application: ApplicationStart) => { | ||
application.navigateToApp(observabilityLogsID, { | ||
path: `#/explorer`, | ||
state: { | ||
datasourceName, | ||
datasourceType: DATA_SOURCE_TYPES.S3Glue, | ||
}, | ||
application.navigateToApp('data-explorer', { | ||
Check warning on line 53 in src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx Codecov / codecov/patchsrc/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx#L53
|
||
path: `discover#?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_q=(filters:!(),query:(dataset:(dataSource:(id:'${ | ||
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. nit: Feel like these two functions have a lot of duplicate code, could be worth a try to either combine them or wrap the actual path in another function. 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. Originally when it was just the 'state' being redirected to explorer through navigateToApp, that made a lot of sense. However, since Discover's url redirection has different forms between redirecting to a flint index vs an index pattern, the differences i would need to put in between both strings would be too much for it to be worth it, as I think it would greatly reduce readability. |
||
datasourceMDSId ?? '' | ||
}',meta:(name:${datasourceName},type:CUSTOM),title:'',type:DATA_SOURCE),id:'${ | ||
datasourceMDSId ?? '' | ||
}::${datasourceName}.${databaseName}.${tableName}',title:${datasourceName}.${databaseName}.${tableName},type:S3),language:SQL,query:'SELECT%20*%20FROM%20${datasourceName}.${databaseName}.${tableName}%20LIMIT%2010'))`, | ||
paulstn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
}; | ||
|
||
const redirectToExplorerWithQuery = ( | ||
datasourceName: string, | ||
datasourceType: string, | ||
queriedIndex: string, | ||
export const redirectToDiscoverOSIdx = ( | ||
paulstn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
indexName: string, | ||
datasourceMDSId: string | undefined, | ||
application: ApplicationStart | ||
) => { | ||
// navigate to explorer | ||
application.navigateToApp(observabilityLogsID, { | ||
path: `#/explorer`, | ||
state: { | ||
datasourceName, | ||
datasourceType, | ||
queryToRun: `source = ${queriedIndex} | head 10`, | ||
}, | ||
application.navigateToApp('data-explorer', { | ||
Check warning on line 67 in src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx Codecov / codecov/patchsrc/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx#L67
|
||
path: `discover#?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_q=(filters:!(),query:(dataset:(dataSource:(id:${ | ||
datasourceMDSId ?? '' | ||
},title:'',type:DATA_SOURCE),id:'${ | ||
datasourceMDSId ?? '' | ||
}::${indexName}',title:${indexName},type:INDEXES),language:SQL,query:'SELECT%20*%20FROM%20${indexName}%20LIMIT%2010'))`, | ||
}); | ||
}; | ||
|
||
export const redirectToDiscover = (application: ApplicationStart) => { | ||
application.navigateToApp('data-explorer', { | ||
Check warning on line 77 in src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx Codecov / codecov/patchsrc/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/utils/associated_objects_tab_utils.tsx#L77
|
||
path: `discover#`, | ||
}); | ||
}; |
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.
Just FYI, the release notes generator requires the
CHANGELOG
description to be under 100 characters. Not sure if it counts the PR number, but the description itself is at 99 characters.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.
Oh yeah my original description was over 100 characters and when I shortened it the changelog was accepted so I'd assume that the changebot checking the character count would be consistent with the release notes generator. That's just an assumption though.