Skip to content

Commit

Permalink
fix spotlight operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Nov 17, 2023
1 parent e6febcc commit c26853d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/js/core/spotlight-operations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import m from 'mithril';
import { openDataSourceCreateModal } from 'js/ui/components/modals/create-source';

export type SpotlightOperation = {
name: string;
Expand Down Expand Up @@ -29,7 +30,8 @@ export const Operations: SpotlightOperation[] = [
description: 'Create a new source',
icon: 'add',
onExecute: () => {
m.route.set('/sources/create');
m.route.set('/data-source');
setTimeout(() => openDataSourceCreateModal(), 300);
},
},
{
Expand Down Expand Up @@ -77,7 +79,7 @@ export const Operations: SpotlightOperation[] = [
description: 'Open the data sources',
icon: 'analytics',
onExecute: () => {
m.route.set('/sources');
m.route.set('/data-source');
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/js/ui/components/portal/spotlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default (): m.Component => {
const openItem = (item: FuseResult<FuseSearch>) => {
if (item.item.type === 'operation') {
item.item.operation?.onExecute();
} else if (item.item.type === 'source') {
m.route.set('/data-source/' + item.item.id);
} else {
m.route.set('/' + item.item.type + '/' + item.item.id);
}
Expand Down

0 comments on commit c26853d

Please sign in to comment.