Skip to content

Commit 00f03b8

Browse files
committed
Put "Copy Log Event" button into the "Copy" group.
1 parent b0e722c commit 00f03b8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/Editor/MonacoInstance/actions.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const setupCustomActions = (
155155
actions: EditorAction[],
156156
onCustomAction: CustomActionCallback
157157
) => {
158-
actions.forEach(({actionName, label, keyBindings, contextMenuGroupId}) => {
158+
actions.forEach(({actionName, label, keyBindings, contextMenuGroupId, contextMenuOrder}) => {
159159
if (null === actionName) {
160160
return;
161161
}
@@ -168,9 +168,12 @@ const setupCustomActions = (
168168
},
169169
};
170170

171-
if ("undefined" !== typeof contextMenuGroupId) {
171+
if (null !== contextMenuGroupId) {
172172
descriptor.contextMenuGroupId = contextMenuGroupId;
173173
}
174+
if (null !== contextMenuOrder) {
175+
descriptor.contextMenuOrder = contextMenuOrder;
176+
}
174177
editor.addAction(descriptor);
175178
});
176179
};

src/utils/actions.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ enum ACTION_NAME {
1717

1818
interface EditorAction {
1919
actionName: Nullable<ACTION_NAME>;
20+
contextMenuGroupId: Nullable<string>;
21+
contextMenuOrder: Nullable<number>;
2022
label: string;
2123
keyBindings: monaco.KeyCode[];
22-
contextMenuGroupId?: string;
2324
}
2425

2526
/**
@@ -64,9 +65,10 @@ const EDITOR_ACTIONS : EditorAction[] = [
6465
},
6566
{
6667
actionName: ACTION_NAME.COPY_LOG_EVENT,
67-
label: "Copy log event",
68+
contextMenuGroupId: "9_cutcopypaste",
69+
contextMenuOrder: 2,
6870
keyBindings: [monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KeyC],
69-
contextMenuGroupId: "copy_log_event",
71+
label: "Copy Log Event",
7072
},
7173
];
7274

0 commit comments

Comments
 (0)