selectors.ts 637 B

12345678910111213141516171819
  1. export const getDataSources = state => {
  2. const regex = new RegExp(state.searchQuery, 'i');
  3. return state.dataSources.filter(dataSource => {
  4. return regex.test(dataSource.name) || regex.test(dataSource.database);
  5. });
  6. };
  7. export const getDataSourceTypes = state => {
  8. const regex = new RegExp(state.dataSourceTypeSearchQuery, 'i');
  9. return state.dataSourceTypes.filter(type => {
  10. return regex.test(type.name);
  11. });
  12. };
  13. export const getDataSourcesSearchQuery = state => state.searchQuery;
  14. export const getDataSourcesLayoutMode = state => state.layoutMode;
  15. export const getDataSourcesCount = state => state.dataSourcesCount;