directus-extension-flow-manager 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -0
  2. package/package.json +1 -1
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{useStores as e,useApi as t,defineModule as n}from"@directus/extensions-sdk";import{defineComponent as o,ref as i,unref as a,resolveComponent as l,openBlock as s,createBlock as r,withCtx as c,createVNode as u,createCommentVNode as d,normalizeClass as p,createTextVNode as v,toDisplayString as f}from"vue";var m=o({setup(){const{useFlowsStore:n,useNotificationsStore:o}=e(),l=n(),s=o(),r=t(),c=i(l.flows);return{headers:i([{text:"",value:"icon",width:50,sortable:!1},{text:"Status",value:"status"},{text:"Name",value:"name",width:400}]),flows:c,duplicate:async function(e){try{let t=function(t){const o={};function i(e){return t.find((t=>t.id===e))}function a(e){if(!e)return null;return{name:e.name,position_x:e.position_x,position_y:e.position_y,key:e.key,type:e.type,options:e.options,flow:n.data.data.id,resolve:a(i(e.resolve)),reject:a(i(e.reject))}}const l=i(e.operation);return o.name=null==l?void 0:l.name,o.position_x=null==l?void 0:l.position_x,o.position_y=null==l?void 0:l.position_y,o.key=null==l?void 0:l.key,o.type=null==l?void 0:l.type,o.options=null==l?void 0:l.options,o.flow=n.data.data.id,o.resolve=a(i((null==l?void 0:l.resolve)||null)),o.reject=a(i((null==l?void 0:l.reject)||null)),o};const n=await r.post("/flows",{name:`${e.name} - Copy`,status:"inactive",icon:e.icon,accountability:e.accountability,description:e.description,trigger:e.trigger,options:e.options}),o=t(e.operations);await r.patch(`/flows/${n.data.data.id}`,{operation:e.operation?o:null}),await l.hydrate(),c.value=a(l.flows),s.add({type:"success",text:"Flow duplicated successfully",closeable:!0})}catch(e){console.log(e)}}}}});var y=[],h=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,o=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,a="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var l=y.indexOf(a);-1===l&&(l=y.push(a)-1,h[l]={}),n=h[l]&&h[l][o]?h[l][o]:h[l][o]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var l="prepend"===o?"afterbegin":"beforeend";return a.insertAdjacentElement(l,e),e}}(".active-chip[data-v-b52a34f6] {\n background-color: var(--primary);\n}\n.inactive-chip[data-v-b52a34f6] {\n background-color: var(--foreground-subdued);\n}",{}),m.render=function(e,t,n,o,i,a){const m=l("v-icon"),y=l("v-chip"),h=l("v-list-item-icon"),b=l("v-list-item-content"),g=l("v-list-item"),_=l("v-list"),w=l("v-menu"),x=l("v-table"),k=l("private-view");return s(),r(k,{title:"Flow Manager"},{default:c((()=>[u(x,{items:e.flows,headers:e.headers,"onUpdate:headers":t[0]||(t[0]=t=>e.headers=t)},{"item.icon":c((({item:e})=>[e.icon?(s(),r(m,{key:0,name:e.icon},null,8,["name"])):d("v-if",!0)])),"item.status":c((({item:e})=>[u(y,{rounded:"",class:p("active"===e.status?"active-chip":"inactive-chip")},{default:c((()=>[v(f(e.status),1)])),_:2},1032,["class"])])),"item-append":c((({item:t})=>[u(w,{placement:"bottom-end","show-arrow":"","close-on-content-click":!0},{activator:c((({toggle:e})=>[u(m,{name:"more_vert",class:"ctx-toggle",onClick:e},null,8,["onClick"])])),default:c((()=>[u(_,null,{default:c((()=>[u(g,{clickable:"",onClick:n=>e.duplicate(t)},{default:c((()=>[u(h,null,{default:c((()=>[u(m,{name:"content_copy"})])),_:1}),u(b,null,{default:c((()=>[v(" Duplicate ")])),_:1})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)])),_:2},1032,["items","headers"])])),_:1})},m.__scopeId="data-v-b52a34f6",m.__file="src/module.vue";var b=n({id:"flow-manager",name:"Flow Manager",icon:"box",routes:[{path:"",component:m}]});export{b as default};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "directus-extension-flow-manager",
3
3
  "description": "This is a custom module for managing Flow",
4
4
  "icon": "extension",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "author": "Bagus Andreanto<andreanto.bagus@gmail.com>",
7
7
  "keywords": [
8
8
  "directus",