UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.18 kB
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.13.4`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`db0b7227-7bf4-41f3-9a4b-9bda10a8bdf1`,e._sentryDebugIdIdentifier=`sentry-dbid-db0b7227-7bf4-41f3-9a4b-9bda10a8bdf1`)})()}catch{}import{$ as e,C as t,E as n,Ft as r,N as i,S as a,Wt as o,_n as s,j as c,w as l,yt as u}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{bt as d}from"./_MapCache-CUJwh2qp.js";import{Qi as f,Rt as p,yt as m}from"./src-wni2AGA3.js";import{t as h}from"./_plugin-vue_export-helper-Dm3nT7Ps.js";import{Tr as g,en as _,jr as v,r as y}from"./users.store-BHWXXawf.js";import{Ir as b,Kr as x,Ps as S}from"./constants-CIP7tKq1.js";import{t as C}from"./dataTable.store-DzRmkvR8.js";import{t as w}from"./Modal-CfEU2AWh.js";var T=h(i({__name:`DownloadDataTableModal`,props:{modalName:{},dataTableName:{}},emits:[`confirm`,`close`],setup(n,{emit:i}){let a=n,p=i,h=d(),g=r(!1),_=()=>{p(`confirm`,g.value)};return(n,r)=>(e(),l(w,{name:a.modalName,title:o(h).baseText(`dataTable.download.modal.title`),center:!0,width:`460px`,"event-bus":void 0,onEnter:_},{content:u(()=>[t(`div`,{class:s(n.$style.content)},[c(o(m),{modelValue:g.value,"onUpdate:modelValue":r[0]||=e=>g.value=e,label:o(h).baseText(`dataTable.download.modal.includeSystemColumns`),"data-test-id":`download-include-system-columns`},null,8,[`modelValue`,`label`])],2)]),footer:u(()=>[t(`div`,{class:s(n.$style.footer)},[c(o(f),{type:`secondary`,size:`large`,label:o(h).baseText(`dataTable.download.modal.cancel`),"data-test-id":`download-modal-cancel`,onClick:r[1]||=()=>n.$emit(`close`)},null,8,[`label`]),c(o(f),{size:`large`,label:o(h).baseText(`dataTable.download.modal.confirm`),"data-test-id":`download-modal-confirm`,onClick:_},null,8,[`label`])],2)]),_:1},8,[`name`,`title`]))}}),[[`__cssModules`,{$style:{content:`_content_10b6w_125`,footer:`_footer_10b6w_129`}}]]),E=i({__name:`DataTableActions`,props:{dataTable:{},isReadOnly:{type:Boolean,default:!1},location:{}},emits:[`rename`,`onDeleted`],setup(t,{emit:r}){let i=t,s=r,l=C(),u=y(),f=d(),m=v(),h=g(),S=_(),w=a(()=>`${x}-${i.dataTable.id}`),E=a(()=>{let e=[{label:f.baseText(`dataTable.download.csv`),value:b.DOWNLOAD_CSV,disabled:!1},{label:f.baseText(`generic.delete`),value:b.DELETE,disabled:!l.projectPermissions.dataTable.delete||i.isReadOnly}];return i.location===`breadcrumbs`&&e.unshift({label:f.baseText(`generic.rename`),value:b.RENAME,disabled:!l.projectPermissions.dataTable.update||i.isReadOnly}),e}),D=async e=>{switch(e){case b.RENAME:s(`rename`,{dataTable:i.dataTable,action:`rename`});break;case b.DOWNLOAD_CSV:u.openModal(w.value);break;case b.DELETE:await m.confirm(f.baseText(`dataTable.delete.confirm.message`,{interpolate:{name:i.dataTable.name}}),f.baseText(`dataTable.delete.confirm.title`),{confirmButtonText:f.baseText(`generic.delete`),cancelButtonText:f.baseText(`generic.cancel`)})===`confirm`&&await k();break}},O=async e=>{try{u.closeModal(w.value),await l.downloadDataTableCsv(i.dataTable.id,i.dataTable.projectId,e),S.track(`User downloaded data table CSV`,{data_table_id:i.dataTable.id,data_table_project_id:i.dataTable.projectId,include_system_columns:e})}catch(e){h.showError(e,f.baseText(`dataTable.download.error`))}},k=async()=>{try{if(!await l.deleteDataTable(i.dataTable.id,i.dataTable.projectId))throw Error(f.baseText(`generic.unknownError`));s(`onDeleted`),S.track(`User deleted data table`,{data_table_id:i.dataTable.id,data_table_project_id:i.dataTable.projectId})}catch(e){h.showError(e,f.baseText(`dataTable.delete.error`))}};return(r,i)=>(e(),n(`div`,null,[c(o(p),{actions:E.value,theme:`dark`,"data-test-id":`data-table-card-actions`,onAction:D},null,8,[`actions`]),c(T,{"modal-name":w.value,"data-table-name":t.dataTable.name,onConfirm:O,onClose:i[0]||=()=>o(u).closeModal(w.value)},null,8,[`modal-name`,`data-table-name`])]))}});export{E as t}; //# sourceMappingURL=DataTableActions-C7d9sXDl.js.map