Skip to content

Commit

Permalink
refactor(editor): Add types to ndv event bus (no-changelog) (#10451)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomi authored Aug 19, 2024
1 parent aea82cb commit ab9faf1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/editor-ui/src/components/NodeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,6 @@ export default defineComponent({
if (this.node) {
this.historyStore.pushCommandToUndo(new RenameNodeCommand(this.node.name, name));
}
// @ts-ignore
this.valueChanged({
value: name,
name: 'name',
Expand Down
20 changes: 19 additions & 1 deletion packages/editor-ui/src/event-bus/ndv.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
import type { IUpdateInformation } from '@/Interface';
import { createEventBus } from 'n8n-design-system/utils';

export const ndvEventBus = createEventBus();
export type Position = 'minLeft' | 'maxRight' | 'initial';

export type CreateNewCredentialOpts = {
type: string;
showAuthOptions: boolean;
};

export interface NdvEventBusEvents {
/** Command to let the user create a new credential by opening the credentials modal */
'credential.createNew': CreateNewCredentialOpts;

/** Command to set the NDV panels' (input, output, main) positions based on the given value */
setPositionByName: Position;

updateParameterValue: IUpdateInformation;
}

export const ndvEventBus = createEventBus<NdvEventBusEvents>();

0 comments on commit ab9faf1

Please sign in to comment.