unleash-server 5.2.4 → 5.2.6
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.
- package/dist/lib/routes/admin-api/project/api-token.js +1 -2
- package/dist/lib/routes/admin-api/project/api-token.js.map +1 -1
- package/dist/lib/routes/admin-api/project/project-features.d.ts +5 -3
- package/dist/lib/routes/admin-api/project/project-features.js +23 -1
- package/dist/lib/routes/admin-api/project/project-features.js.map +1 -1
- package/dist/lib/routes/admin-api/tag.d.ts +0 -2
- package/dist/lib/routes/admin-api/tag.js +1 -21
- package/dist/lib/routes/admin-api/tag.js.map +1 -1
- package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js +43 -0
- package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js.map +1 -1
- package/dist/test/e2e/api/admin/tags.e2e.test.js +3 -3
- package/dist/test/e2e/api/admin/tags.e2e.test.js.map +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{AdvancedPlayground-b8d00f81.js → AdvancedPlayground-fa382438.js} +1 -1
- package/frontend/build/static/{CreateProject-fe1d0f0f.js → CreateProject-33102f1d.js} +1 -1
- package/frontend/build/static/{Error-6550f020.js → Error-cf795e47.js} +1 -1
- package/frontend/build/static/{FeatureArchiveDialog-42d2cf92.js → FeatureArchiveDialog-7c45ad83.js} +4 -4
- package/frontend/build/static/{FeatureMetricsChart-70a6747e.js → FeatureMetricsChart-098be7ad.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-60874e5e.js → FeatureViewLazyExport-c74a2e4d.js} +2 -2
- package/frontend/build/static/{LazyAdminExport-c5eec10c.js → LazyAdminExport-c83e066d.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-7f66ff80.js → LazyProjectExport-0e097671.js} +1 -1
- package/frontend/build/static/{NetworkOverview-b82ebe0c.js → NetworkOverview-d29a2982.js} +2 -2
- package/frontend/build/static/{NetworkTraffic-51a825ea.js → NetworkTraffic-75dedea1.js} +1 -1
- package/frontend/build/static/{Playground-2b482aeb.js → Playground-2547cabf.js} +1 -1
- package/frontend/build/static/{PlaygroundGuidancePopper-5673aca8.js → PlaygroundGuidancePopper-de0c6f7c.js} +1 -1
- package/frontend/build/static/RoleCell-86b02c95.js +1 -0
- package/frontend/build/static/{StrategyItemContainer-7b356e23.js → StrategyItemContainer-cada0ab5.js} +1 -1
- package/frontend/build/static/{chartjs-adapter-date-fns.esm-04fda623.js → chartjs-adapter-date-fns.esm-d78073b7.js} +1 -1
- package/frontend/build/static/{flowchart-elk-definition-170a3958-68f1625d.js → flowchart-elk-definition-170a3958-3edd9f6d.js} +1 -1
- package/frontend/build/static/{index-b74e9af8.js → index-1023a005.js} +1 -1
- package/frontend/build/static/{index-545ad556.js → index-4f1029d3.js} +1 -1
- package/frontend/build/static/{index-78d048a4.js → index-6d9a536e.js} +2 -2
- package/frontend/build/static/{is_dark-77b9ee14.js → is_dark-4cf688db.js} +1 -1
- package/frontend/build/static/{mindmap-definition-44684416-4cca63a5.js → mindmap-definition-44684416-d564c247.js} +1 -1
- package/frontend/build/static/{timeline-definition-8e5a9bc6-31dad151.js → timeline-definition-8e5a9bc6-d80977bf.js} +1 -1
- package/frontend/build/static/{unknownify-53fb2d5d.js → unknownify-e541f268.js} +1 -1
- package/package.json +1 -1
- package/frontend/build/static/RoleCell-c9b26e7a.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as k,ar as R,a6 as w,as as O,z as U,at as D,au as J,j as e,av as b,aw as x,ax as B,ay as F,az as L,n as z,aA as K}from"./index-
|
|
1
|
+
import{m as k,ar as R,a6 as w,as as O,z as U,at as D,au as J,j as e,av as b,aw as x,ax as B,ay as F,az as L,n as z,aA as K}from"./index-6d9a536e.js";const $="CREATE_PROJECT_BTN",H=()=>{const{setToastData:n,setToastApiError:i}=k(),{refetchUser:d}=R(),{uiConfig:l}=w(),t=O(),{trackEvent:u}=U(),{projectId:a,projectName:j,projectMode:p,projectDesc:m,setProjectId:P,setProjectName:C,setProjectDesc:T,getProjectPayload:o,clearErrors:r,validateProjectId:s,validateName:h,setProjectStickiness:E,setProjectMode:f,projectStickiness:c,errors:g}=D(),{createProject:A,loading:_}=J();return e(b,{loading:_,title:"Create project",description:"Projects allows you to group feature toggles together in the management UI.",documentationLink:"https://docs.getunleash.io/reference/projects",documentationLinkLabel:"Projects documentation",formatApiCode:()=>`curl --location --request POST '${l.unleashUrl}/api/admin/projects' \\
|
|
2
2
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
3
3
|
--header 'Content-Type: application/json' \\
|
|
4
4
|
--data-raw '${JSON.stringify(o(),void 0,2)}'`,children:e(x,{errors:g,handleSubmit:async N=>{N.preventDefault(),r();const v=h(),y=await s();if(v&&y){const S=o();try{await A(S),d(),t(`/projects/${a}`),n({title:"Project created",text:"Now you can add toggles to this project",confetti:!0,type:"success"}),c!==L&&u("project_stickiness_set")}catch(I){i(z(I))}}},handleCancel:()=>{t(K)},projectId:a,setProjectId:P,projectName:j,projectMode:p,projectStickiness:c,setProjectStickiness:E,setProjectMode:f,setProjectName:C,projectDesc:m,setProjectDesc:T,mode:"Create",clearErrors:r,validateProjectId:s,children:e(B,{name:"project",permission:F,"data-testid":$})})})};export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as r,j as o}from"./index-
|
|
1
|
+
import{E as r,j as o}from"./index-6d9a536e.js";const a=r(o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");export{a as E};
|
package/frontend/build/static/{FeatureArchiveDialog-42d2cf92.js → FeatureArchiveDialog-7c45ad83.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{E as ie,j as r,b as ce,aI as Y,a_ as Z,h as C,bb as W,C as U,A as we,T as O,ca as Ae,t as j,fx as xe,bh as Re,fy as X,as as J,a6 as ee,fz as ke,fA as Fe,fB as De,fC as Pe,bv as G,fD as $e,ai as Oe,fE as Be,fF as N,cl as le,r as w,au as ue,m as z,fG as de,z as ge,fH as he,av as fe,a$ as pe,br as qe,fI as _e,n as B,dp as Le,b0 as Ue,aZ as me,aJ as Q,b2 as ye,fJ as je,fK as Ve,fL as Ie,fM as ze,fN as Ye,fO as We,b3 as be,bc as He,fP as Me,F as K,aN as ne,B as Ge,v as Je,bR as te,fQ as Ke,ej as Ne,fR as Qe,fS as Ze,fT as Xe,be as et,bf as tt,bg as at,am as Se,al as ve,bU as st,cc as nt,df as rt,$ as ot,fU as it,de as ct,a8 as lt,bP as ut,aU as dt,aS as gt,aT as ht}from"./index-
|
|
1
|
+
import{E as ie,j as r,b as ce,aI as Y,a_ as Z,h as C,bb as W,C as U,A as we,T as O,ca as Ae,t as j,fx as xe,bh as Re,fy as X,as as J,a6 as ee,fz as ke,fA as Fe,fB as De,fC as Pe,bv as G,fD as $e,ai as Oe,fE as Be,fF as N,cl as le,r as w,au as ue,m as z,fG as de,z as ge,fH as he,av as fe,a$ as pe,br as qe,fI as _e,n as B,dp as Le,b0 as Ue,aZ as me,aJ as Q,b2 as ye,fJ as je,fK as Ve,fL as Ie,fM as ze,fN as Ye,fO as We,b3 as be,bc as He,fP as Me,F as K,aN as ne,B as Ge,v as Je,bR as te,fQ as Ke,ej as Ne,fR as Qe,fS as Ze,fT as Xe,be as et,bf as tt,bg as at,am as Se,al as ve,bU as st,cc as nt,df as rt,$ as ot,fU as it,de as ct,a8 as lt,bP as ut,aU as dt,aS as gt,aT as ht}from"./index-6d9a536e.js";const ft=ie(r("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud"),zt=ie(r("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z"}),"WatchLater"),Yt=({enabled:e,className:s})=>{const t=ce(),i=e?"Environment enabled":"Environment disabled",a={backgroundColor:e?t.palette.primary.light:t.palette.neutral.border,borderRadius:"50%",width:"28px",height:"28px",minWidth:"28px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:t.spacing(1)},n={fill:t.palette.common.white,width:"16px",height:"16px"};return r("div",{style:a,className:s,children:r(ft,{style:n,titleAccess:i})})},pt=({isOpen:e,onConfirm:s,onClose:t,showBanner:i,environment:a,messageComponent:n})=>{const o=Y("projectId"),{data:u}=Z(o),{changeRequestInReviewOrApproved:f,alert:g}=Ae(u),l=f(a||"");return C(W,{open:e,primaryButtonText:l?"Add to existing change request":"Add suggestion to draft",secondaryButtonText:"Cancel",onClick:s,onClose:t,title:"Request changes",fullWidth:!0,children:[r(U,{condition:l,show:g}),r(U,{condition:!!i,show:C(we,{severity:"info",sx:{mb:2},children:["Change requests feature is enabled for ",a,". Your changes need to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]})}),r(O,{variant:"body2",color:"text.secondary",children:"Your suggestion:"}),n]})},mt=(e,s)=>{const t={};return s.parameters.forEach(i=>{t[i.name]=yt(e,i)}),{name:s.name,constraints:[],parameters:t}},yt=(e,s)=>s.name==="rollout"||s.name==="percentage"||s.type==="percentage"?"50":s.name==="stickiness"?"":s.name==="groupId"?e:s.type==="boolean"?"false":"",bt=j("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),re=j("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),St=j("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),vt=({projectId:e,environmentId:s,permission:t,onSubmit:i,onCancel:a,loading:n,strategy:o,setStrategy:u,segments:f,setSegments:g,errors:l})=>{const S=xe(o.constraints),c=Re(t,e,s),{strategyDefinition:d}=X(o==null?void 0:o.name),m=J(),{uiConfig:h,error:v,loading:x}=ee();if(v)throw v;if(x||!d)return null;const D=p=>d.parameters.find(E=>E.name===p),A=(p,E)=>{const F=D(p);if(p!=="groupId"){const T=Be(F,E);return T?(l.setFormError(p,T),!1):(l.removeFormError(p),!0)}return!0},y=()=>d.parameters.map(p=>p.name).map(p=>{var E;return A(p,(E=o.parameters)==null?void 0:E[p])}).every(Boolean),q=()=>{m(`/projects/${e}/settings/default-strategy`)};return C(bt,{onSubmit:async p=>{if(p.preventDefault(),y())i();else return},children:[r(ke,{title:o.title||"",setTitle:p=>{u(E=>({...E,title:p}))}}),r(U,{condition:!!h.flags.SE,show:r(Fe,{segments:f,setSegments:g,projectId:e})}),r(De,{projectId:e,environmentId:s,strategy:o,setStrategy:u}),r(re,{}),r(Pe,{strategy:o,strategyDefinition:d,setStrategy:u,validateParameter:A,errors:l,hasAccess:c}),r(re,{}),C(St,{children:[r(G,{permission:t,projectId:e,environmentId:s,variant:"contained",color:"primary",type:"submit",disabled:n||!S||l.hasFormErrors(),"data-testid":$e,children:"Save strategy"}),r(Oe,{type:"button",color:"primary",onClick:a||q,disabled:n,children:"Cancel"})]})]})},Te={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:"default",groupId:""}},Wt=()=>{var F;const e=Y("projectId"),s=N("environmentId"),{project:t,refetch:i}=le(e),a=(F=t.environments.find(T=>T.environment===s))==null?void 0:F.defaultStrategy,[n,o]=w.useState(a||Te),[u,f]=w.useState([]),{updateDefaultStrategy:g,loading:l}=ue(),{strategyDefinition:S}=X(n==null?void 0:n.name),{setToastData:c,setToastApiError:d}=z(),m=de(),{uiConfig:h}=ee(),{unleashUrl:v}=h,x=J(),{trackEvent:D}=ge(),{segments:A,refetchSegments:y}=he();w.useEffect(()=>{if(A&&(a!=null&&a.segments)){const T=[];for(const P of a==null?void 0:a.segments)T.push(...A.filter(V=>V.id===P));f(T)}},[JSON.stringify(A),JSON.stringify(a==null?void 0:a.segments)]);const q=h!=null&&h.flags.SE?u:[],k=Tt(n,q),p=async T=>{await g(e,s,T),D("default_strategy",{props:{action:"edit",hasTitle:!!T.title}}),await y(),c({title:"Default Strategy updated",type:"success",confetti:!0})},E=async()=>{const T=`/projects/${e}/settings/default-strategy`;try{await p(k),await i(),x(T)}catch(P){d(B(P))}};return!S||!n?null:r(fe,{modal:!0,title:pe((n==null?void 0:n.name)??""),description:Et,documentationLink:wt,documentationLinkLabel:At,formatApiCode:()=>Ct(e,s,k,S,v),children:r(vt,{projectId:e,strategy:n,setStrategy:o,segments:u,setSegments:f,environmentId:s,onSubmit:E,loading:l,permission:qe,errors:m,isChangeRequest:!1})})},Tt=(e,s)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},segments:s.map(t=>t.id),disabled:e.disabled??!1}),Ct=(e,s,t,i,a)=>{if(!a)return"";const n={...t,parameters:_e(t.parameters??{},i)},o=`${a}/api/admin/projects/${e}/environments/${s}/default-strategy}`,u=JSON.stringify(n,void 0,2);return`curl --location --request PUT '${o}' \\
|
|
2
2
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
3
3
|
--header 'Content-Type: application/json' \\
|
|
4
|
-
--data-raw '${
|
|
4
|
+
--data-raw '${u}'`},Et=`
|
|
5
5
|
An activation strategy will only run when a feature toggle is enabled and provides a way to control who will get access to the feature.
|
|
6
6
|
If any of a feature toggle's activation strategies returns true, the user will get access.
|
|
7
|
-
`,wt="https://docs.getunleash.io/reference/activation-strategies",At="Default strategy documentation",Ht=()=>{var se;const e=Y("projectId"),s=Y("featureId"),t=N("environmentId"),i=N("strategyName"),a=JSON.parse(Le().get("defaultStrategy")||"false"),{project:n}=le(e),o=(se=n.environments.find(R=>R.environment===t))==null?void 0:se.defaultStrategy,{segments:
|
|
7
|
+
`,wt="https://docs.getunleash.io/reference/activation-strategies",At="Default strategy documentation",Ht=()=>{var se;const e=Y("projectId"),s=Y("featureId"),t=N("environmentId"),i=N("strategyName"),a=JSON.parse(Le().get("defaultStrategy")||"false"),{project:n}=le(e),o=(se=n.environments.find(R=>R.environment===t))==null?void 0:se.defaultStrategy,{segments:u}=he(),f=(u||[]).filter(R=>{var L;return(L=o==null?void 0:o.segments)==null?void 0:L.includes(R.id)}),[g,l]=w.useState({}),[S,c]=w.useState(a?f:[]),{strategyDefinition:d}=X(i),m=de(),{addStrategyToFeature:h,loading:v}=Ue(),{addChange:x}=me(),{setToastData:D,setToastApiError:A}=z(),{uiConfig:y}=ee(),{unleashUrl:q}=y,k=J(),{feature:p,refetchFeature:E}=Q(e,s),F=w.useRef(p),{isChangeRequestConfigured:T}=ye(e),{refetch:P}=Z(e),{trackEvent:V}=ge(),{data:I,staleDataNotification:b,forceRefreshCache:$}=je({unleashGetter:Q,params:[e,s],dataKey:"feature",refetchFunctionKey:"refetchFeature",options:{}},p,{afterSubmitAction:E},Me);w.useEffect(()=>{F.current.name===""&&p.name&&($(p),F.current=p)},[p.name]),w.useEffect(()=>{var R;if(a){const L=o||Te;((R=L.parameters)==null?void 0:R.groupId)===""&&s?l({...L,parameters:{...L.parameters,groupId:s}}):l(L)}else d&&l(mt(s,d))},[s,JSON.stringify(d),a]);const H=async R=>{await h(e,s,t,R),D({title:"Strategy created",type:"success",confetti:!0})},M=async R=>{await x(e,t,{action:"addStrategy",feature:s,payload:R}),D({title:"Strategy added to draft",type:"success",confetti:!0}),P()},_=Ve(g,S),Ee=async()=>{V("strategyTitle",{props:{hasTitle:!!g.title,on:"create"}});try{T(t)?await M(_):await H(_),E(),k(He(e,s))}catch(R){A(B(R))}};return!I||!I.project?null:C(fe,{modal:!0,title:pe(i),description:Ie,documentationLink:ze,documentationLinkLabel:Ye,formatApiCode:()=>Rt(e,s,t,_,q),children:[r(We,{projectId:e,feature:I,strategy:g,setStrategy:l,segments:S,setSegments:c,environmentId:t,onSubmit:Ee,loading:v,permission:be,errors:m,isChangeRequest:T(t)}),b]})},xt=(e,s,t,i,a=!1)=>{const n=new URLSearchParams({environmentId:t,strategyName:i,defaultStrategy:String(a)});return`/projects/${e}/features/${s}/strategies/create?${n}`},Rt=(e,s,t,i,a)=>{if(!a)return"";const n=`${a}/api/admin/projects/${e}/features/${s}/environments/${t}/strategies`,o=JSON.stringify(i,void 0,2);return`curl --location --request POST '${n}' \\
|
|
8
8
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
9
9
|
--header 'Content-Type: application/json' \\
|
|
10
|
-
--data-raw '${o}'`},oe=j("p")(({theme:e})=>({marginBottom:e.spacing(.5),fontSize:e.fontSizes.bodySize})),Mt=({open:e,environmentName:s,featureId:t,projectId:i,onClose:a})=>{const n=J(),o=xt(i,t,s,"default");return C(W,{open:e,maxWidth:"sm",onClose:()=>a(),title:"You need to add a strategy to your toggle",primaryButtonText:"Take me directly to add strategy",permissionButton:r(G,{type:"button",permission:be,projectId:i,environmentId:s,onClick:()=>{a(),n(o)},children:"Take me directly to add strategy"}),secondaryButtonText:"Cancel",children:[r(oe,{children:"Before you can enable the toggle in the environment, you need to add an activation strategy."}),r(oe,{children:"You can add the activation strategy by selecting the toggle, open the environment accordion and add the activation strategy."})]})},kt="You can not enable the environment before it has strategies",Ft=e=>{const{setToastData:s,setToastApiError:t}=z(),{addChange:i}=me(),{refetch:a}=Z(e),[n,o]=w.useState({isOpen:!1}),d=w.useCallback((l,S,c,u)=>{o({featureName:l,environment:S,enabled:c,shouldActivateDisabledStrategies:u,isOpen:!0})},[]),f=w.useCallback(()=>{o(l=>({...l,isOpen:!1}))},[]),h=w.useCallback(async()=>{try{await i(e,n.environment,{feature:n.featureName,action:"updateEnabled",payload:{enabled:!!n.enabled,shouldActivateDisabledStrategies:!!n.shouldActivateDisabledStrategies}}),a(),o(l=>({...l,isOpen:!1})),s({type:"success",title:"Changes added to the draft!"})}catch(l){t(B(l)),o(S=>({...S,isOpen:!1}))}},[i]);return{onChangeRequestToggle:d,onChangeRequestToggleClose:f,onChangeRequestToggleConfirm:h,changeRequestDialogDetails:n}},Dt=({isOpen:e,onAddDefaultStrategy:s,onActivateDisabledStrategies:t,onClose:i,environment:a,disabledStrategiesCount:n=0})=>{const o=Y("projectId");return C(W,{open:e,secondaryButtonText:"Cancel",permissionButton:C(K,{children:[r(G,{type:"button",permission:ne,projectId:o,environmentId:a,onClick:s,children:"Add default strategy"}),r(G,{type:"button",variant:"text",permission:ne,projectId:o,environmentId:a,onClick:t,children:"Enable all strategies"})]}),onClose:i,title:"Enable feature toggle",fullWidth:!0,children:[C(O,{variant:"body1",color:"text.primary",sx:{mb:d=>d.spacing(2)},children:["The feature toggle has ",n," disabled",n===1?" strategy":" strategies","."]}),r(O,{variant:"body1",color:"text.primary",children:"You can choose to enable all the disabled strategies or you can add the default strategy to enable this feature toggle."})]})},Pt=({enabled:e,featureName:s,environment:t})=>C(O,{"data-testid":"update-enabled-message",children:[r("strong",{children:e?"Enable":"Disable"})," feature toggle"," ",r("strong",{children:s})," in ",r("strong",{children:t})]}),$t=j(Ge)(()=>({mx:"auto",...Je})),Gt=({projectId:e,featureId:s,environmentName:t,value:i,onToggle:a,onError:n})=>{var I;const{toggleFeatureEnvironmentOn:o,toggleFeatureEnvironmentOff:d}=te(),{setToastData:f,setToastApiError:h}=z(),{isChangeRequestConfigured:l}=ye(e),{onChangeRequestToggle:S,onChangeRequestToggleClose:c,onChangeRequestToggleConfirm:u,changeRequestDialogDetails:m}=Ft(e),[g,v,x]=Ke(i),[D,A]=w.useState(!1),{feature:y}=Q(e,s),q=((I=y==null?void 0:y.environments.find(b=>b.name===t))==null?void 0:I.strategies.filter(b=>b.disabled).length)??0,k=async(b=!1)=>{try{v(!g),await o(e,y.name,t,b),f({type:"success",title:`Available in ${t}`,text:`${y.name} is now available in ${t} based on its defined strategies.`}),a==null||a(e,y.name,t,!g)}catch($){$ instanceof Error&&$.message===kt?n==null||n():h(B($)),x()}},p=async()=>{try{v(!g),await d(e,y.name,t),f({type:"success",title:`Unavailable in ${t}`,text:`${y.name} is unavailable in ${t} and its strategies will no longer have any effect.`}),a==null||a(e,y.name,t,!g)}catch(b){h(B(b)),x()}},E=async b=>{if(l(t)){b.preventDefault(),P()?A(!0):S(y.name,t,!g,!1);return}if(g){await p();return}P()?A(!0):await k()},F=async()=>{l(t)?S(y.name,t,!g,!0):await k(!0),A(!1)},T=async()=>{l(t)?S(y.name,t,!g,!1):await k(),A(!1)},P=()=>{var $,H,M;const b=($=y==null?void 0:y.environments)==null?void 0:$.find(_=>_.name===t);return(b==null?void 0:b.strategies)&&((H=b==null?void 0:b.strategies)==null?void 0:H.length)>0&&((M=b==null?void 0:b.strategies)==null?void 0:M.every(_=>_.disabled))},V=`${y.name}-${t}`;return C(K,{children:[r($t,{"data-testid":`TOGGLE-${V}`,children:r(Ne,{tooltip:g?`Disable feature in ${t}`:`Enable feature in ${t}`,checked:g,environmentId:t,projectId:e,permission:Qe,inputProps:{"aria-label":t},onClick:E})},V),r(Dt,{isOpen:D,onClose:()=>A(!1),environment:t,disabledStrategiesCount:q,onActivateDisabledStrategies:F,onAddDefaultStrategy:T}),r(pt,{isOpen:m.isOpen,onClose:c,environment:m==null?void 0:m.environment,onConfirm:u,messageComponent:r(Pt,{enabled:m==null?void 0:m.enabled,featureName:m==null?void 0:m.featureName,environment:m.environment})})]})},Ot=j(Ze)(({theme:e})=>({color:e.palette.warning.main,fontSize:e.fontSizes.bodySize})),Jt=()=>r(Xe,{arrow:!0,title:C(K,{children:["This environment has no variants enabled. If you check this feature's variants in this environment, you will get the"," ",r("a",{href:"https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant",target:"_blank",rel:"noreferrer",children:"disabled variant"}),"."]}),children:r(Ot,{})});var ae={},Bt=tt;Object.defineProperty(ae,"__esModule",{value:!0});var Ce=ae.default=void 0,qt=Bt(et()),_t=at,Lt=(0,qt.default)((0,_t.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");Ce=ae.default=Lt;const Ut=it(),Kt=({options:e,selectedOptions:s,indeterminateOptions:t,tagType:i,existingTags:a,disabled:n=!1,onChange:o})=>{const d=r(ct,{fontSize:"small"});return r(Se,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:c=>c.spacing(2),width:500},disableCloseOnSelect:!0,placeholder:"Select Values",options:e,value:s,renderTags:(c,u)=>c.map((m,g)=>a.some(x=>x.value===m.title&&x.type===i.name)&&t===void 0?null:r(ot,{...u({index:g}),label:m.title})),isOptionEqualToValue:(c,u)=>u.inputValue&&u.inputValue!==""?c.title===u.inputValue:c.title===u.title,getOptionLabel:c=>c.inputValue?c.inputValue:c.title,renderOption:(c,u,{selected:m})=>{const g=(t==null?void 0:t.some(v=>v.title===u.title))??!1;return C("li",{...c,children:[r(U,{condition:!!u.inputValue,show:r(st,{sx:{mr:v=>v.spacing(.5)}}),elseShow:r(nt,{icon:d,checkedIcon:r(rt,{fontSize:"small"}),indeterminateIcon:r(Ce,{fontSize:"small"}),sx:{mr:v=>v.spacing(.5)},checked:m&&!g,indeterminate:g})}),u.title]})},filterOptions:(c,u)=>{const m=Ut(c,u),{inputValue:g}=u,v=c.some(x=>g===x.title);return g!==""&&!v&&m.push({inputValue:g,title:`Create new value "${g}"`}),m},ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:o,renderInput:c=>r(ve,{...c,label:"Select values",placeholder:"Select values"}),disabled:n})},jt=j("li")({flexDirection:"column"}),Nt=({options:e,value:s,disabled:t=!1,onChange:i})=>{const a=ce();return r(Se,{disablePortal:!0,disabled:t,id:"tag-type-select",sx:{marginTop:n=>n.spacing(2),width:500},options:e,disableClearable:!0,value:s,getOptionLabel:n=>n.name,renderOption:(n,o)=>C(jt,{...n,style:{alignItems:"flex-start",gap:a.spacing(.5)},children:[r(O,{variant:"body1",children:o.name}),r(O,{variant:"caption",children:o.description})]}),renderInput:n=>r(ve,{...n,label:"Tag type",value:s}),onChange:i,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Qt=()=>{const{makeRequest:e,createRequest:s,errors:t,loading:i}=lt({propagateErrors:!0});return{createTag:async o=>{const f=s("api/admin/tags",{method:"POST",body:JSON.stringify(o)});try{return await e(f.caller,f.id)}catch(h){throw h}},bulkUpdateTags:async o=>{const f=s("api/admin/tags/features",{method:"PUT",body:JSON.stringify(o)});try{return await e(f.caller,f.id)}catch(h){throw h}},errors:t,loading:i}},Zt=(e,s={})=>{const t=async()=>{const h=gt(`api/admin/tags/${e}`);return(await fetch(h,{method:"GET"}).then(ht("Tags"))).json()},i=`api/admin/tags/${e}`,{data:a,error:n}=ut(!!e,{tags:[]},i,t,s),[o,d]=w.useState(!n&&!a),f=()=>{dt(i)};return w.useEffect(()=>{d(!n&&!a)},[a,n]),{tags:(a==null?void 0:a.tags)||[],error:n,loading:o,refetch:f}},Xt=({isStale:e,isOpen:s,projectId:t,featureId:i,onClose:a})=>{const{setToastData:n,setToastApiError:o}=z(),{patchFeatureToggle:d}=te(),f=r(O,{children:"Setting a toggle to stale marks it for cleanup"}),h=r(O,{children:"Setting a toggle to active marks it as in active use"}),l=e?"active":"stale",S=async c=>{c.stopPropagation();try{await d(t,i,[{op:"replace",path:"/stale",value:!e}]),a()}catch(u){o(B(u))}n(e?{type:"success",title:"And we're back!",text:"The toggle is no longer marked as stale."}:{type:"success",title:"A job well done.",text:"The toggle has been marked as stale."})};return r(W,{open:s,secondaryButtonText:"Cancel",primaryButtonText:`Flip to ${l}`,title:`Set feature state to ${l}`,onClick:S,onClose:a,children:r(U,{condition:e,show:h,elseShow:f})})},ea=({isOpen:e,onClose:s,onConfirm:t,projectId:i,featureIds:a})=>{const{archiveFeatureToggle:n}=te(),{archiveFeatures:o}=ue(),{setToastData:d,setToastApiError:f}=z(),h=(a==null?void 0:a.length)>1;return r(W,{onClick:h?async()=>{try{await o(i,a),d({text:"Selected feature toggles have been archived",type:"success",title:"Feature toggles archived"}),t(),s()}catch(c){f(B(c)),s()}}:async()=>{try{await n(i,a[0]),d({text:"Your feature toggle has been archived",type:"success",title:"Feature archived"}),t(),s()}catch(c){f(B(c)),s()}},open:e,onClose:s,primaryButtonText:h?"Archive toggles":"Archive toggle",secondaryButtonText:"Cancel",title:h?"Archive feature toggles":"Archive feature toggle",children:r(U,{condition:h,show:C(K,{children:[C("p",{children:["Are you sure you want to archive"," ",r("strong",{children:a==null?void 0:a.length})," feature toggles?"]}),r(U,{condition:(a==null?void 0:a.length)<=5,show:r("ul",{children:a==null?void 0:a.map(c=>r("li",{children:c},c))})})]}),elseShow:r("p",{children:"Are you sure you want to archive these feature toggles?"})})})};export{pt as C,Yt as E,Gt as F,Nt as T,Pt as U,Jt as V,zt as W,Mt as a,Zt as b,Kt as c,Ht as d,ea as e,xt as f,Xt as g,Ft as h,Wt as i,Qt as u};
|
|
10
|
+
--data-raw '${o}'`},oe=j("p")(({theme:e})=>({marginBottom:e.spacing(.5),fontSize:e.fontSizes.bodySize})),Mt=({open:e,environmentName:s,featureId:t,projectId:i,onClose:a})=>{const n=J(),o=xt(i,t,s,"default");return C(W,{open:e,maxWidth:"sm",onClose:()=>a(),title:"You need to add a strategy to your toggle",primaryButtonText:"Take me directly to add strategy",permissionButton:r(G,{type:"button",permission:be,projectId:i,environmentId:s,onClick:()=>{a(),n(o)},children:"Take me directly to add strategy"}),secondaryButtonText:"Cancel",children:[r(oe,{children:"Before you can enable the toggle in the environment, you need to add an activation strategy."}),r(oe,{children:"You can add the activation strategy by selecting the toggle, open the environment accordion and add the activation strategy."})]})},kt="You can not enable the environment before it has strategies",Ft=e=>{const{setToastData:s,setToastApiError:t}=z(),{addChange:i}=me(),{refetch:a}=Z(e),[n,o]=w.useState({isOpen:!1}),u=w.useCallback((l,S,c,d)=>{o({featureName:l,environment:S,enabled:c,shouldActivateDisabledStrategies:d,isOpen:!0})},[]),f=w.useCallback(()=>{o(l=>({...l,isOpen:!1}))},[]),g=w.useCallback(async()=>{try{await i(e,n.environment,{feature:n.featureName,action:"updateEnabled",payload:{enabled:!!n.enabled,shouldActivateDisabledStrategies:!!n.shouldActivateDisabledStrategies}}),a(),o(l=>({...l,isOpen:!1})),s({type:"success",title:"Changes added to the draft!"})}catch(l){t(B(l)),o(S=>({...S,isOpen:!1}))}},[i]);return{onChangeRequestToggle:u,onChangeRequestToggleClose:f,onChangeRequestToggleConfirm:g,changeRequestDialogDetails:n}},Dt=({isOpen:e,onAddDefaultStrategy:s,onActivateDisabledStrategies:t,onClose:i,environment:a,disabledStrategiesCount:n=0})=>{const o=Y("projectId");return C(W,{open:e,secondaryButtonText:"Cancel",permissionButton:C(K,{children:[r(G,{type:"button",permission:ne,projectId:o,environmentId:a,onClick:s,children:"Add default strategy"}),r(G,{type:"button",variant:"text",permission:ne,projectId:o,environmentId:a,onClick:t,children:"Enable all strategies"})]}),onClose:i,title:"Enable feature toggle",fullWidth:!0,children:[C(O,{variant:"body1",color:"text.primary",sx:{mb:u=>u.spacing(2)},children:["The feature toggle has ",n," disabled",n===1?" strategy":" strategies","."]}),r(O,{variant:"body1",color:"text.primary",children:"You can choose to enable all the disabled strategies or you can add the default strategy to enable this feature toggle."})]})},Pt=({enabled:e,featureName:s,environment:t})=>C(O,{"data-testid":"update-enabled-message",children:[r("strong",{children:e?"Enable":"Disable"})," feature toggle"," ",r("strong",{children:s})," in ",r("strong",{children:t})]}),$t=j(Ge)(()=>({mx:"auto",...Je})),Gt=({projectId:e,featureId:s,environmentName:t,value:i,onToggle:a,onError:n})=>{var I;const{toggleFeatureEnvironmentOn:o,toggleFeatureEnvironmentOff:u}=te(),{setToastData:f,setToastApiError:g}=z(),{isChangeRequestConfigured:l}=ye(e),{onChangeRequestToggle:S,onChangeRequestToggleClose:c,onChangeRequestToggleConfirm:d,changeRequestDialogDetails:m}=Ft(e),[h,v,x]=Ke(i),[D,A]=w.useState(!1),{feature:y}=Q(e,s),q=((I=y==null?void 0:y.environments.find(b=>b.name===t))==null?void 0:I.strategies.filter(b=>b.disabled).length)??0,k=async(b=!1)=>{try{v(!h),await o(e,y.name,t,b),f({type:"success",title:`Available in ${t}`,text:`${y.name} is now available in ${t} based on its defined strategies.`}),a==null||a(e,y.name,t,!h)}catch($){$ instanceof Error&&$.message===kt?n==null||n():g(B($)),x()}},p=async()=>{try{v(!h),await u(e,y.name,t),f({type:"success",title:`Unavailable in ${t}`,text:`${y.name} is unavailable in ${t} and its strategies will no longer have any effect.`}),a==null||a(e,y.name,t,!h)}catch(b){g(B(b)),x()}},E=async b=>{if(l(t)){b.preventDefault(),P()?A(!0):S(y.name,t,!h,!1);return}if(h){await p();return}P()?A(!0):await k()},F=async()=>{l(t)?S(y.name,t,!h,!0):await k(!0),A(!1)},T=async()=>{l(t)?S(y.name,t,!h,!1):await k(),A(!1)},P=()=>{var $,H,M;const b=($=y==null?void 0:y.environments)==null?void 0:$.find(_=>_.name===t);return(b==null?void 0:b.strategies)&&((H=b==null?void 0:b.strategies)==null?void 0:H.length)>0&&((M=b==null?void 0:b.strategies)==null?void 0:M.every(_=>_.disabled))},V=`${y.name}-${t}`;return C(K,{children:[r($t,{"data-testid":`TOGGLE-${V}`,children:r(Ne,{tooltip:h?`Disable feature in ${t}`:`Enable feature in ${t}`,checked:h,environmentId:t,projectId:e,permission:Qe,inputProps:{"aria-label":t},onClick:E})},V),r(Dt,{isOpen:D,onClose:()=>A(!1),environment:t,disabledStrategiesCount:q,onActivateDisabledStrategies:F,onAddDefaultStrategy:T}),r(pt,{isOpen:m.isOpen,onClose:c,environment:m==null?void 0:m.environment,onConfirm:d,messageComponent:r(Pt,{enabled:m==null?void 0:m.enabled,featureName:m==null?void 0:m.featureName,environment:m.environment})})]})},Ot=j(Ze)(({theme:e})=>({color:e.palette.warning.main,fontSize:e.fontSizes.bodySize})),Jt=()=>r(Xe,{arrow:!0,title:C(K,{children:["This environment has no variants enabled. If you check this feature's variants in this environment, you will get the"," ",r("a",{href:"https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant",target:"_blank",rel:"noreferrer",children:"disabled variant"}),"."]}),children:r(Ot,{})});var ae={},Bt=tt;Object.defineProperty(ae,"__esModule",{value:!0});var Ce=ae.default=void 0,qt=Bt(et()),_t=at,Lt=(0,qt.default)((0,_t.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");Ce=ae.default=Lt;const Ut=it(),Kt=({options:e,selectedOptions:s,indeterminateOptions:t,tagType:i,existingTags:a,disabled:n=!1,onChange:o})=>{const u=r(ct,{fontSize:"small"});return r(Se,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:c=>c.spacing(2),width:500},disableCloseOnSelect:!0,placeholder:"Select Values",options:e,value:s,renderTags:(c,d)=>c.map((m,h)=>a.some(x=>x.value===m.title&&x.type===i.name)&&t===void 0?null:r(ot,{...d({index:h}),label:m.title})),isOptionEqualToValue:(c,d)=>d.inputValue&&d.inputValue!==""?c.title===d.inputValue:c.title===d.title,getOptionLabel:c=>c.inputValue?c.inputValue:c.title,renderOption:(c,d,{selected:m})=>{const h=(t==null?void 0:t.some(v=>v.title===d.title))??!1;return C("li",{...c,children:[r(U,{condition:!!d.inputValue,show:r(st,{sx:{mr:v=>v.spacing(.5)}}),elseShow:r(nt,{icon:u,checkedIcon:r(rt,{fontSize:"small"}),indeterminateIcon:r(Ce,{fontSize:"small"}),sx:{mr:v=>v.spacing(.5)},checked:m&&!h,indeterminate:h})}),d.title]})},filterOptions:(c,d)=>{const m=Ut(c,d),{inputValue:h}=d,v=c.some(x=>h===x.title);return h!==""&&!v&&m.push({inputValue:h,title:`Create new value "${h}"`}),m},ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:o,renderInput:c=>r(ve,{...c,label:"Select values",placeholder:"Select values"}),disabled:n})},jt=j("li")({flexDirection:"column"}),Nt=({options:e,value:s,disabled:t=!1,onChange:i})=>{const a=ce();return r(Se,{disablePortal:!0,disabled:t,id:"tag-type-select",sx:{marginTop:n=>n.spacing(2),width:500},options:e,disableClearable:!0,value:s,getOptionLabel:n=>n.name,renderOption:(n,o)=>C(jt,{...n,style:{alignItems:"flex-start",gap:a.spacing(.5)},children:[r(O,{variant:"body1",children:o.name}),r(O,{variant:"caption",children:o.description})]}),renderInput:n=>r(ve,{...n,label:"Tag type",value:s}),onChange:i,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Qt=()=>{const{makeRequest:e,createRequest:s,errors:t,loading:i}=lt({propagateErrors:!0});return{createTag:async o=>{const f=s("api/admin/tags",{method:"POST",body:JSON.stringify(o)});try{return await e(f.caller,f.id)}catch(g){throw g}},bulkUpdateTags:async(o,u)=>{const f=`api/admin/projects/${u}/tags`,g=s(f,{method:"PUT",body:JSON.stringify(o)});try{return await e(g.caller,g.id)}catch(l){throw l}},errors:t,loading:i}},Zt=(e,s={})=>{const t=async()=>{const g=gt(`api/admin/tags/${e}`);return(await fetch(g,{method:"GET"}).then(ht("Tags"))).json()},i=`api/admin/tags/${e}`,{data:a,error:n}=ut(!!e,{tags:[]},i,t,s),[o,u]=w.useState(!n&&!a),f=()=>{dt(i)};return w.useEffect(()=>{u(!n&&!a)},[a,n]),{tags:(a==null?void 0:a.tags)||[],error:n,loading:o,refetch:f}},Xt=({isStale:e,isOpen:s,projectId:t,featureId:i,onClose:a})=>{const{setToastData:n,setToastApiError:o}=z(),{patchFeatureToggle:u}=te(),f=r(O,{children:"Setting a toggle to stale marks it for cleanup"}),g=r(O,{children:"Setting a toggle to active marks it as in active use"}),l=e?"active":"stale",S=async c=>{c.stopPropagation();try{await u(t,i,[{op:"replace",path:"/stale",value:!e}]),a()}catch(d){o(B(d))}n(e?{type:"success",title:"And we're back!",text:"The toggle is no longer marked as stale."}:{type:"success",title:"A job well done.",text:"The toggle has been marked as stale."})};return r(W,{open:s,secondaryButtonText:"Cancel",primaryButtonText:`Flip to ${l}`,title:`Set feature state to ${l}`,onClick:S,onClose:a,children:r(U,{condition:e,show:g,elseShow:f})})},ea=({isOpen:e,onClose:s,onConfirm:t,projectId:i,featureIds:a})=>{const{archiveFeatureToggle:n}=te(),{archiveFeatures:o}=ue(),{setToastData:u,setToastApiError:f}=z(),g=(a==null?void 0:a.length)>1;return r(W,{onClick:g?async()=>{try{await o(i,a),u({text:"Selected feature toggles have been archived",type:"success",title:"Feature toggles archived"}),t(),s()}catch(c){f(B(c)),s()}}:async()=>{try{await n(i,a[0]),u({text:"Your feature toggle has been archived",type:"success",title:"Feature archived"}),t(),s()}catch(c){f(B(c)),s()}},open:e,onClose:s,primaryButtonText:g?"Archive toggles":"Archive toggle",secondaryButtonText:"Cancel",title:g?"Archive feature toggles":"Archive feature toggle",children:r(U,{condition:g,show:C(K,{children:[C("p",{children:["Are you sure you want to archive"," ",r("strong",{children:a==null?void 0:a.length})," feature toggles?"]}),r(U,{condition:(a==null?void 0:a.length)<=5,show:r("ul",{children:a==null?void 0:a.map(c=>r("li",{children:c},c))})})]}),elseShow:r("p",{children:"Are you sure you want to archive these feature toggles?"})})})};export{pt as C,Yt as E,Gt as F,Nt as T,Pt as U,Jt as V,zt as W,Mt as a,Zt as b,Kt as c,Ht as d,ea as e,xt as f,Xt as g,Ft as h,Wt as i,Qt as u};
|
package/frontend/build/static/{FeatureMetricsChart-70a6747e.js → FeatureMetricsChart-098be7ad.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f_ as c,b as m,bK as g,r as d,j as u}from"./index-
|
|
1
|
+
import{f_ as c,b as m,bK as g,r as d,j as u}from"./index-6d9a536e.js";import{d as b,L as x,C as f,a as C,b as v,P as S,c as h,T as q,p as k,e as M,f as L}from"./chartjs-adapter-date-fns.esm-d78073b7.js";import"./index-1023a005.js";import"./index-4f1029d3.js";const $=(e,s,n)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(s,n,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(s,n,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(s,n,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,s,n)=>e.map(a=>({x:a.timestamp,y:n(a),variants:a.variants})),E=(e,s)=>{if(s===0)return"";const[n,a]=e,t=Math.floor(Number(a)/s*100);return`${a} (${t}%) - ${n}`},P=(e,s,n,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],l=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return l-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...l}=r.variants;return Object.entries(l).map(i=>E(i,r.y)).join(`
|
|
2
2
|
`)},title:t=>`Time: ${c(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:T(n),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests",color:e.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:e.palette.text.secondary},grid:{color:e.palette.divider,borderColor:e.palette.divider}},x:{type:"time",time:{unit:"hour"},grid:{display:!1},ticks:{callback:(t,r,o)=>c(o[r].value,a.locale),color:e.palette.text.secondary}}}}),T=e=>e===1?"Requests in the last hour":`Requests in the last ${e} hours`;b.font={...b.font,family:"Sen",size:13,weight:"400"};const R=({metrics:e,hoursBack:s,statsSectionId:n})=>{const a=m(),{locationSettings:t}=g(),r=d.useMemo(()=>[...e].sort((i,y)=>i.timestamp.localeCompare(y.timestamp)),[e]),o=d.useMemo(()=>P(a,r,s,t),[a,r,s,t]),l=d.useMemo(()=>$(a,r,t),[a,r,t]);return u("div",{style:{height:400},children:u(x,{options:o,data:l,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":n})})};f.register(C,v,S,h,q,k,M,L);export{R as FeatureMetricsChart,R as default};
|