MCPcopy
hub / github.com/brimdata/zui / submit

Method submit

apps/zui/src/views/export-modal/controller.ts:17–39  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

15 constructor(private onClose: () => void, private state: ExportModalState) {}
16
17 async submit(e) {
18 e.preventDefault()
19 const data = getFormData(e)
20 switch (data.submit) {
21 case "toPool":
22 exportToPool(data)
23 this.close()
24 return
25 case "toFile":
26 if (await exportToFile(data.format)) this.close()
27 return
28 case "toClipboard":
29 this.state.setIsCopying(true)
30 try {
31 await exportToClipboard(data.format)
32 } catch (e) {
33 if (isAbortError(e)) return
34 } finally {
35 this.state.setIsCopying(false)
36 }
37 return
38 }
39 }
40
41 close() {
42 this.onClose()

Callers 5

ExportModalFunction · 0.95
submitFunction · 0.80
form.test.tsFile · 0.80
PoolItemFunction · 0.80
QueryItemFunction · 0.80

Calls 3

closeMethod · 0.95
getFormDataFunction · 0.90
isAbortErrorFunction · 0.90

Tested by

no test coverage detected