n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 7.79 kB
JavaScript
(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.16.1`}}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]=`f13ba122-d87f-475f-a86f-789933bce623`,e._sentryDebugIdIdentifier=`sentry-dbid-f13ba122-d87f-475f-a86f-789933bce623`)})()}catch{}import{o as e}from"./chunk-CACdhNlC.js";import{$ as t,A as n,C as r,E as i,Ft as a,N as o,S as s,Sn as c,T as l,Wt as u,_ as d,_n as f,c as p,it as m,j as h,rt as g,w as _,yt as v}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{at as y,s as b}from"./core-Bz5WjPxS.js";import{Di as x,E as S,Qi as C,Xi as w,Zi as T,jt as E,tt as D}from"./src-XqE2yCpG.js";import{t as O}from"./_plugin-vue_export-helper-CIL7EULb.js";import{Qo as k}from"./constants-DuQbSl-q.js";import{t as A}from"./useRootStore-XEREVjMN.js";import{t as j}from"./orderBy-VGkL3AGm.js";import{i as M,n as N,t as P}from"./SeverityTag-BeRFBnDk.js";var F=e(j(),1),I=O(o({__name:`EmptyTab`,setup(e){return(e,n)=>(t(),i(`div`,{class:f(e.$style.NoIssuesContainer)},[h(u(w),{tag:`h3`,size:`large`,color:`text-base`,class:`mb-2xs`},{default:v(()=>[m(e.$slots,`title`)]),_:3}),h(u(w),{tag:`p`,size:`medium`,color:`text-light`,class:`mb-2xl`},{default:v(()=>[m(e.$slots,`description`)]),_:3})],2))}}),[[`__cssModules`,{$style:{NoIssuesContainer:`_NoIssuesContainer_1o8ra_2`}}]]),L={style:{"max-width":`700px`,margin:`0 auto`,"padding-bottom":`40px`}},R=O(o({__name:`MigrationRules`,setup(e){let o=p(),m=A(),O=y(),j=a(`workflow-issues`),R=a(!1),{state:z,isLoading:B,execute:V}=b(async(e=!1)=>{if(e){let e=await M(m.restApiContext,void 0);return e.report.workflowResults.length===0&&e.report.instanceResults.length>0&&(j.value=`instance-issues`),R.value=e.shouldCache,e}let t=await N(m.restApiContext,void 0);return R.value=t.shouldCache,t},void 0);async function H(){await V(0,!0)}let U=s(()=>[{label:O.baseText(`settings.migrationReport.tabs.workflowIssues`),value:`workflow-issues`,tag:z.value?.report.workflowResults.length?String(z.value.report.workflowResults.length):void 0},{label:O.baseText(`settings.migrationReport.tabs.instanceIssues`),value:`instance-issues`,tag:z.value?.report.instanceResults.length?String(z.value.report.instanceResults.length):void 0}]),W=s(()=>({critical:O.baseText(`settings.migrationReport.workflowTooltip.critical`),medium:O.baseText(`settings.migrationReport.workflowTooltip.medium`),low:O.baseText(`settings.migrationReport.workflowTooltip.low`)})),G=s(()=>({critical:O.baseText(`settings.migrationReport.instanceTooltip.critical`),medium:O.baseText(`settings.migrationReport.instanceTooltip.medium`),low:O.baseText(`settings.migrationReport.instanceTooltip.low`)})),K=s(()=>z.value?z.value.totalWorkflows-z.value.report.workflowResults.reduce((e,t)=>e+t.nbAffectedWorkflows,0):0),q={critical:0,medium:1,low:2},J=s(()=>z.value?.report.workflowResults?(0,F.default)(z.value.report.workflowResults,[e=>q[e.ruleSeverity]],[`asc`]):[]),Y=s(()=>z.value?.report.instanceResults?(0,F.default)(z.value.report.instanceResults,[e=>q[e.ruleSeverity]],[`asc`]):[]);return(e,a)=>(t(),i(`div`,L,[h(u(w),{tag:`h2`,size:`xlarge`,color:`text-dark`,class:`mb-2xs`},{default:v(()=>[n(c(u(O).baseText(`settings.migrationReport.title`)),1)]),_:1}),h(u(w),{tag:`p`,color:`text-base`,class:`mb-2xl`},{default:v(()=>[n(c(u(O).baseText(`settings.migrationReport.description`,{interpolate:{compatibleCount:String(K.value),totalCount:String(u(z)?.totalWorkflows??0)}}))+` `,1),h(u(D),{theme:`text`,href:`https://docs.n8n.io/2-0-breaking-changes/`,target:`_blank`,rel:`noopener noreferrer`},{default:v(()=>[r(`span`,{class:f(u(o).UnderlinedText)},c(u(O).baseText(`settings.migrationReport.documentationLink`)),3),a[1]||=n(` ↗ `,-1)]),_:1})]),_:1}),r(`div`,{class:f(u(o).ActionBar)},[h(u(S),{modelValue:j.value,"onUpdate:modelValue":a[0]||=e=>j.value=e,options:U.value,variant:`modern`},null,8,[`modelValue`,`options`]),R.value?(t(),_(u(T),{key:0,variant:`subtle`,label:u(O).baseText(`settings.migrationReport.refreshButton`),icon:`refresh-cw`,loading:u(B),disabled:u(B),onClick:H},null,8,[`label`,`loading`,`disabled`])):l(``,!0)],2),u(B)?(t(),i(`div`,{key:0,class:f(u(o).CardContainer)},[(t(),i(d,null,g(4,e=>r(`div`,{key:e,class:f(u(o).Card)},[r(`div`,null,[h(u(E),{variant:`p`,rows:3,class:f(u(o).PLoading)},null,8,[`class`])]),h(u(E),{variant:`button`})],2)),64))],2)):j.value===`workflow-issues`?(t(),i(d,{key:1},[u(z)?.report.workflowResults.length===0?(t(),_(I,{key:0},{title:v(()=>[n(c(u(O).baseText(`settings.migrationReport.emptyWorkflowIssues.title`)),1)]),description:v(()=>[n(c(u(O).baseText(`settings.migrationReport.emptyWorkflowIssues.description`)),1)]),_:1})):(t(),i(`div`,{key:1,class:f(u(o).CardContainer)},[(t(!0),i(d,null,g(J.value,e=>(t(),i(`div`,{key:e.ruleId,class:f(u(o).Card)},[r(`div`,null,[r(`div`,{class:f(u(o).CardTitleContainer)},[h(u(w),{tag:`h3`,size:`medium`,color:`text-dark`},{default:v(()=>[n(c(e.ruleTitle),1)]),_:2},1024),h(u(x),{content:W.value[e.ruleSeverity],placement:`top`,enterable:!1},{default:v(()=>[h(P,{severity:e.ruleSeverity},null,8,[`severity`])]),_:2},1032,[`content`])],2),h(u(w),{tag:`p`,color:`text-base`},{default:v(()=>[n(c(e.ruleDescription)+c(e.ruleDescription.endsWith(`.`)?``:`.`)+` `,1),e.ruleDocumentationUrl?(t(),_(u(D),{key:0,theme:`text`,href:e.ruleDocumentationUrl,target:`_blank`,rel:`noopener noreferrer`,class:f(u(o).NoLineBreak)},{default:v(()=>[r(`span`,{class:f(u(o).UnderlinedText)},c(u(O).baseText(`settings.migrationReport.documentation`)),3),a[2]||=n(` ↗ `,-1)]),_:1},8,[`href`,`class`])):l(``,!0)]),_:2},1024)]),h(u(D),{class:f(u(o).NoLineBreak),theme:`text`,to:{name:u(k).MIGRATION_RULE_REPORT,params:{migrationRuleId:e.ruleId}}},{default:v(()=>[r(`span`,{class:f(u(o).NoLineBreak)},[n(c(u(O).baseText(`settings.migrationReport.workflowsCount`,{interpolate:{count:e.nbAffectedWorkflows}}))+` `,1),h(u(C),{icon:`chevron-right`,size:24})],2)]),_:2},1032,[`class`,`to`])],2))),128))],2))],64)):j.value===`instance-issues`?(t(),i(d,{key:2},[u(z)?.report.instanceResults.length===0?(t(),_(I,{key:0},{title:v(()=>[n(c(u(O).baseText(`settings.migrationReport.emptyInstanceIssues.title`)),1)]),description:v(()=>[n(c(u(O).baseText(`settings.migrationReport.emptyInstanceIssues.description`)),1)]),_:1})):(t(),i(`div`,{key:1,class:f(u(o).CardContainer)},[(t(!0),i(d,null,g(Y.value,e=>(t(),i(`div`,{key:e.ruleId,class:f(u(o).Card)},[r(`div`,null,[r(`div`,{class:f(u(o).CardTitleContainer)},[h(u(w),{tag:`h3`},{default:v(()=>[n(c(e.ruleTitle),1)]),_:2},1024),h(u(x),{content:G.value[e.ruleSeverity],placement:`top`,enterable:!1},{default:v(()=>[h(P,{severity:e.ruleSeverity},null,8,[`severity`])]),_:2},1032,[`content`])],2),h(u(w),{tag:`p`,color:`text-base`},{default:v(()=>[n(c(e.ruleDescription)+c(e.ruleDescription.endsWith(`.`)?``:`.`)+` `,1),e.ruleDocumentationUrl?(t(),_(u(D),{key:0,theme:`text`,href:e.ruleDocumentationUrl,target:`_blank`,rel:`noopener noreferrer`,class:f(u(o).NoLineBreak)},{default:v(()=>[r(`span`,{class:f(u(o).UnderlinedText)},c(u(O).baseText(`settings.migrationReport.documentation`)),3),a[3]||=n(` ↗ `,-1)]),_:1},8,[`href`,`class`])):l(``,!0)]),_:2},1024)])],2))),128))],2))],64)):l(``,!0)]))}}),[[`__cssModules`,{$style:{CardContainer:`_CardContainer_i8nk0_2`,Card:`_Card_i8nk0_2`,CardTitleContainer:`_CardTitleContainer_i8nk0_32`,NoLineBreak:`_NoLineBreak_i8nk0_39`,ActionBar:`_ActionBar_i8nk0_46`,NoIssuesContainer:`_NoIssuesContainer_i8nk0_53`,PLoading:`_PLoading_i8nk0_62`,UnderlinedText:`_UnderlinedText_i8nk0_68`}}]]);export{R as default};
//# sourceMappingURL=MigrationRules-Dz9qkK_8.js.map