Skip to content

Commit 7751c92

Browse files
aerbsvc-squareup-copybara
authored andcommitted
Misk Admin: 1) Re-open endpoint selection even with focus. 2)
Disable auto triggering completion dropdown on endpoint selection GitOrigin-RevId: 500253480fb29006391f96c912a28eabf401aba0
1 parent 0f17a37 commit 7751c92

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

Diff for: misk-admin-web-actions/src/web-actions/completion/CompletionProvider.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ export default class CompletionProvider {
178178

179179
async getCompletions(args: CompletionArgs): Promise<Completion[]> {
180180
const topLevel = parseDocument(args.text, args.cursor.index);
181-
const callables = this.selection?.callables ?? [];
182-
183-
topLevel.applyTypes(callables[0] ?? null);
181+
topLevel.applyTypes(this.selection);
184182

185183
const cursorNode = topLevel.findCursor();
186184

Diff for: misk-admin-web-actions/src/web-actions/ui/EndpointSelection.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default class EndpointSelection extends React.Component<Props, State> {
136136
onMenuClose={() => this.setMenuOpen(false)}
137137
onInputChange={this.handleInputChange}
138138
onChange={this.handleChange}
139+
onMenuOpen={() => this.setMenuOpen(true)}
139140
options={this.state.filteredOptions}
140141
components={{ Option }}
141142
styles={

Diff for: misk-admin-web-actions/src/web-actions/ui/RequestEditor.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { Box, IconButton, Spinner } from '@chakra-ui/react';
77
import { CopyIcon } from '@chakra-ui/icons';
88
import { parseDocument } from '@web-actions/parsing/CommandParser';
99
import {
10-
MiskWebActionDefinition,
1110
MiskFieldDefinition,
1211
ActionGroup,
1312
} from '@web-actions/api/responseTypes';
14-
import { triggerCompletionDialog } from '@web-actions/ui/AceEditor';
1513
import { appEvents, APP_EVENTS } from '@web-actions/events/appEvents';
1614

1715
interface Props {
@@ -193,8 +191,6 @@ export default class RequestEditor extends React.Component<Props, State> {
193191
this.editor?.gotoLine(lines - 1, 2, false);
194192
}
195193
this.editor?.focus();
196-
197-
triggerCompletionDialog(this.editor);
198194
}
199195
}
200196

0 commit comments

Comments
 (0)