unleash-server 4.22.0-beta.6 → 4.22.0-beta.7
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/variants.js +29 -0
- package/dist/lib/routes/admin-api/project/variants.js.map +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{CreateProject-ca648018.js → CreateProject-d6351944.js} +1 -1
- package/frontend/build/static/{Error-e0c241b7.js → Error-c548838a.js} +1 -1
- package/frontend/build/static/{ExpandMore-f34bbc97.js → ExpandMore-ba4b3b7a.js} +1 -1
- package/frontend/build/static/{FeatureArchiveDialog-52c2ffc6.js → FeatureArchiveDialog-8c9a7d04.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-86fa4af3.js → FeatureMetricsChart-91566cbd.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-29e4a5d4.js → FeatureViewLazyExport-589d7782.js} +2 -2
- package/frontend/build/static/{LazyAdminExport-83dd64eb.js → LazyAdminExport-498677e4.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-437b2521.js → LazyProjectExport-b26de160.js} +1 -1
- package/frontend/build/static/{NetworkOverview-e4ab3ad0.js → NetworkOverview-6430727d.js} +1 -1
- package/frontend/build/static/{NetworkTraffic-bb582cb8.js → NetworkTraffic-83d36f67.js} +1 -1
- package/frontend/build/static/{Playground-b92ad7f0.js → Playground-2e892877.js} +1 -1
- package/frontend/build/static/{StrategyItemContainer-76a5c7b3.js → StrategyItemContainer-9e726fab.js} +1 -1
- package/frontend/build/static/{chartjs-adapter-date-fns.esm-4dc257e6.js → chartjs-adapter-date-fns.esm-b2675703.js} +1 -1
- package/frontend/build/static/{index-47b2f93e.js → index-183c14cc.js} +77 -77
- package/frontend/build/static/{index-eaadb5f1.js → index-8ee3a757.js} +1 -1
- package/frontend/build/static/{index-309b2fdf.js → index-a9ee5a80.js} +1 -1
- package/frontend/build/static/{unknownify-69077f7b.js → unknownify-c5a4e0ff.js} +1 -1
- package/frontend/build/static/{useProjectRole-994bf8e8.js → useProjectRole-6ff9444e.js} +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,9 @@ class VariantsController extends controller_1.default {
|
|
|
25
25
|
handler: this.getVariants,
|
|
26
26
|
middleware: [
|
|
27
27
|
openApiService.validPath({
|
|
28
|
+
summary: 'Retrieve variants for a feature (deprecated) ',
|
|
29
|
+
description: '(deprecated from 4.21) Retrieve the variants for the specified feature. From Unleash 4.21 onwards, this endpoint will attempt to choose a [production-type environment](https://docs.getunleash.io/reference/environments) as the source of truth. If more than one production environment is found, the first one will be used.',
|
|
30
|
+
deprecated: true,
|
|
28
31
|
tags: ['Features'],
|
|
29
32
|
operationId: 'getFeatureVariants',
|
|
30
33
|
responses: {
|
|
@@ -40,6 +43,10 @@ class VariantsController extends controller_1.default {
|
|
|
40
43
|
handler: this.patchVariants,
|
|
41
44
|
middleware: [
|
|
42
45
|
openApiService.validPath({
|
|
46
|
+
summary: "Apply a patch to a feature's variants (in all environments).",
|
|
47
|
+
description: `Apply a list of patches patch to the specified feature's variants. The patch objects should conform to the [JSON-patch format (RFC 6902)](https://www.rfc-editor.org/rfc/rfc6902).
|
|
48
|
+
|
|
49
|
+
⚠️ **Warning**: This method is not atomic. If something fails in the middle of applying the patch, you can be left with a half-applied patch. We recommend that you instead [patch variants on a per-environment basis](/docs/reference/api/unleash/patch-environments-feature-variants.api.mdx), which **is** an atomic operation.`,
|
|
43
50
|
tags: ['Features'],
|
|
44
51
|
operationId: 'patchFeatureVariants',
|
|
45
52
|
requestBody: (0, create_request_schema_1.createRequestSchema)('patchesSchema'),
|
|
@@ -56,6 +63,15 @@ class VariantsController extends controller_1.default {
|
|
|
56
63
|
handler: this.overwriteVariants,
|
|
57
64
|
middleware: [
|
|
58
65
|
openApiService.validPath({
|
|
66
|
+
summary: 'Create (overwrite) variants for a feature toggle in all environments',
|
|
67
|
+
description: `This overwrites the current variants for the feature specified in the :featureName parameter in all environments.
|
|
68
|
+
|
|
69
|
+
The backend will validate the input for the following invariants
|
|
70
|
+
|
|
71
|
+
* If there are variants, there needs to be at least one variant with \`weightType: variable\`
|
|
72
|
+
* The sum of the weights of variants with \`weightType: fix\` must be strictly less than 1000 (< 1000)
|
|
73
|
+
|
|
74
|
+
The backend will also distribute remaining weight up to 1000 after adding the variants with \`weightType: fix\` together amongst the variants of \`weightType: variable\``,
|
|
59
75
|
tags: ['Features'],
|
|
60
76
|
operationId: 'overwriteFeatureVariants',
|
|
61
77
|
requestBody: (0, create_request_schema_1.createRequestSchema)('variantsSchema'),
|
|
@@ -72,6 +88,8 @@ class VariantsController extends controller_1.default {
|
|
|
72
88
|
handler: this.getVariantsOnEnv,
|
|
73
89
|
middleware: [
|
|
74
90
|
openApiService.validPath({
|
|
91
|
+
summary: 'Get variants for a feature in an environment',
|
|
92
|
+
description: `Returns the variants for a feature in a specific environment. If the feature has no variants it will return an empty array of variants`,
|
|
75
93
|
tags: ['Features'],
|
|
76
94
|
operationId: 'getEnvironmentFeatureVariants',
|
|
77
95
|
responses: {
|
|
@@ -87,6 +105,8 @@ class VariantsController extends controller_1.default {
|
|
|
87
105
|
handler: this.patchVariantsOnEnv,
|
|
88
106
|
middleware: [
|
|
89
107
|
openApiService.validPath({
|
|
108
|
+
summary: "Patch a feature's variants in an environment",
|
|
109
|
+
description: `Apply a list of patches to the features environments in the specified environment. The patch objects should conform to the [JSON-patch format (RFC 6902)](https://www.rfc-editor.org/rfc/rfc6902).`,
|
|
90
110
|
tags: ['Features'],
|
|
91
111
|
operationId: 'patchEnvironmentsFeatureVariants',
|
|
92
112
|
requestBody: (0, create_request_schema_1.createRequestSchema)('patchesSchema'),
|
|
@@ -103,6 +123,15 @@ class VariantsController extends controller_1.default {
|
|
|
103
123
|
handler: this.overwriteVariantsOnEnv,
|
|
104
124
|
middleware: [
|
|
105
125
|
openApiService.validPath({
|
|
126
|
+
summary: 'Create (overwrite) variants for a feature in an environment',
|
|
127
|
+
description: `This overwrites the current variants for the feature toggle in the :featureName parameter for the :environment parameter.
|
|
128
|
+
|
|
129
|
+
The backend will validate the input for the following invariants:
|
|
130
|
+
|
|
131
|
+
* If there are variants, there needs to be at least one variant with \`weightType: variable\`
|
|
132
|
+
* The sum of the weights of variants with \`weightType: fix\` must be strictly less than 1000 (< 1000)
|
|
133
|
+
|
|
134
|
+
The backend will also distribute remaining weight up to 1000 after adding the variants with \`weightType: fix\` together amongst the variants of \`weightType: variable\``,
|
|
106
135
|
tags: ['Features'],
|
|
107
136
|
operationId: 'overwriteEnvironmentFeatureVariants',
|
|
108
137
|
requestBody: (0, create_request_schema_1.createRequestSchema)('variantsSchema'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../../../src/lib/routes/admin-api/project/variants.ts"],"names":[],"mappings":";;;;;AAEA,kEAA0C;AAK1C,4DAIoC;AACpC,gDAA4D;AAC5D,6DAA6D;AAG7D,uFAAkF;AAClF,yFAAoF;AAEpF,iDAAoE;AAIpE,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAC5D,MAAM,UAAU,GACZ,sEAAsE,CAAC;AAa3E,MAAqB,kBAAmB,SAAQ,oBAAU;IAOtD,YACI,MAAsB,EACtB,EACI,oBAAoB,EACpB,cAAc,EACd,aAAa,GAIhB;QAED,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;QAChE,IAAI,CAAC,cAAc,GAAG,oBAAoB,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC;YACP,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,kBAAI;YAChB,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,UAAU,EAAE;gBACR,cAAc,CAAC,SAAS,CAAC;oBACrB,IAAI,EAAE,CAAC,UAAU,CAAC;oBA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C,IAAI,CACX,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,QAAQ;SACrB,CAAC,CAAC;IACP,CAAC;CACJ;
|
|
1
|
+
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../../../src/lib/routes/admin-api/project/variants.ts"],"names":[],"mappings":";;;;;AAEA,kEAA0C;AAK1C,4DAIoC;AACpC,gDAA4D;AAC5D,6DAA6D;AAG7D,uFAAkF;AAClF,yFAAoF;AAEpF,iDAAoE;AAIpE,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAC5D,MAAM,UAAU,GACZ,sEAAsE,CAAC;AAa3E,MAAqB,kBAAmB,SAAQ,oBAAU;IAOtD,YACI,MAAsB,EACtB,EACI,oBAAoB,EACpB,cAAc,EACd,aAAa,GAIhB;QAED,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;QAChE,IAAI,CAAC,cAAc,GAAG,oBAAoB,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC;YACP,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,kBAAI;YAChB,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,UAAU,EAAE;gBACR,cAAc,CAAC,SAAS,CAAC;oBACrB,OAAO,EAAE,+CAA+C;oBACxD,WAAW,EACP,kUAAkU;oBACtU,UAAU,EAAE,IAAI;oBAChB,IAAI,EAAE,CAAC,UAAU,CAAC;oBAClB,WAAW,EAAE,oBAAoB;oBACjC,SAAS,EAAE;wBACP,GAAG,EAAE,IAAA,6CAAoB,EAAC,uBAAuB,CAAC;qBACrD;iBACJ,CAAC;aACL;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC;YACP,MAAM,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AAG,MAAM,IAAI,CAAC,cAAc,CAAC,4BAA4B,CACnE,SAAS,EACT,WAAW,EACX,WAAW,EACX,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,IAAI,CACX,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,QAAQ;SACrB,CAAC,CAAC;IACP,CAAC;CACJ;AAzUD,qCAyUC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
href="https://fonts.googleapis.com/css2?family=Sen:wght@400;700;800&display=swap"
|
|
17
17
|
rel="stylesheet"
|
|
18
18
|
/>
|
|
19
|
-
<script type="module" crossorigin src="/static/index-
|
|
19
|
+
<script type="module" crossorigin src="/static/index-183c14cc.js"></script>
|
|
20
20
|
<link rel="stylesheet" href="/static/index-1fa04e71.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as E,aq as N,H as w,ar as I,as as U,at as S,j as e,au as x,av as D,aw as O,ax as _,a4 as b,ay as k}from"./index-
|
|
1
|
+
import{a2 as E,aq as N,H as w,ar as I,as as U,at as S,j as e,au as x,av as D,aw as O,ax as _,a4 as b,ay as k}from"./index-183c14cc.js";const q=()=>{const{setToastData:c,setToastApiError:n}=E(),{refetchUser:i}=N(),{uiConfig:d}=w(),t=I(),{projectId:a,projectName:l,projectDesc:u,setProjectId:p,setProjectName:j,setProjectDesc:m,getProjectPayload:o,clearErrors:r,validateProjectId:s,validateName:h,errors:P}=U(),{createProject:g,loading:f}=S();return e(x,{loading:f,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 '${d.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(D,{errors:P,handleSubmit:async C=>{C.preventDefault(),r();const y=h(),v=await s();if(y&&v){const A=o();try{await g(A),i(),t(`/projects/${a}`),c({title:"Project created",text:"Now you can add toggles to this project",confetti:!0,type:"success"})}catch(T){n(b(T))}}},handleCancel:()=>{t(k)},projectId:a,setProjectId:p,projectName:l,setProjectName:j,projectDesc:u,setProjectDesc:m,mode:"Create",clearErrors:r,validateProjectId:s,children:e(O,{name:"project",permission:_})})})};export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,j as o}from"./index-
|
|
1
|
+
import{c as r,j as o}from"./index-183c14cc.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,j as o}from"./index-
|
|
1
|
+
import{c as a,j as o}from"./index-183c14cc.js";const e=a(o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");export{e as E};
|
package/frontend/build/static/{FeatureArchiveDialog-52c2ffc6.js → FeatureArchiveDialog-8c9a7d04.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as A,a$ as E,f as p,aY as C,j as o,C as w,A as M,T as b,c0 as J,cr as x,r as d,cs as Q,ct as X,aZ as Z,a_ as I,a2 as S,H as ee,ar as P,aH as D,aT as te,cu as ae,au as ne,ap as se,cv as re,cw as oe,cx as ie,cy as ce,b6 as $,cz as ue,b0 as le,a4 as v,cA as ge,s as j,aX as de,cB as he,cC as ye,F as fe,bz as N}from"./index-
|
|
1
|
+
import{aG as A,a$ as E,f as p,aY as C,j as o,C as w,A as M,T as b,c0 as J,cr as x,r as d,cs as Q,ct as X,aZ as Z,a_ as I,a2 as S,H as ee,ar as P,aH as D,aT as te,cu as ae,au as ne,ap as se,cv as re,cw as oe,cx as ie,cy as ce,b6 as $,cz as ue,b0 as le,a4 as v,cA as ge,s as j,aX as de,cB as he,cC as ye,F as fe,bz as N}from"./index-183c14cc.js";const Re=({isOpen:e,onConfirm:t,onClose:a,showBanner:n,environment:s,messageComponent:r})=>{const i=A("projectId"),{data:l}=E(i),{changeRequestInReviewOrApproved:u,alert:g}=J(l),c=u(s||"");return p(C,{open:e,primaryButtonText:c?"Add to existing change request":"Add suggestion to draft",secondaryButtonText:"Cancel",onClick:t,onClose:a,title:"Request changes",fullWidth:!0,children:[o(w,{condition:c,show:g}),o(w,{condition:Boolean(n),show:p(M,{severity:"info",sx:{mb:2},children:["Change requests feature is enabled for ",s,". 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."]})}),o(b,{variant:"body2",color:"text.secondary",children:"Your suggestion:"}),r]})},pe=(e,t)=>{const a={};return t.parameters.forEach(n=>{a[n.name]=me(e,n)}),{name:t.name,constraints:[],parameters:a}},me=(e,t)=>t.name==="rollout"||t.name==="percentage"||t.type==="percentage"?"50":t.name==="stickiness"?"default":t.name==="groupId"?e:t.type==="boolean"?"false":"",Ae=()=>{const e=A("projectId"),t=A("featureId"),a=x("environmentId"),n=x("strategyName"),[s,r]=d.useState({}),[i,l]=d.useState([]),{strategyDefinition:u}=Q(n),g=X(),{addStrategyToFeature:c,loading:h}=Z(),{addChange:m}=I(),{setToastData:T,setToastApiError:O}=S(),{uiConfig:Y}=ee(),{unleashUrl:z}=Y,_=P(),{feature:y,refetchFeature:F}=D(e,t),q=d.useRef(y),{isChangeRequestConfigured:k}=te(e),{refetch:L}=E(e),{data:R,staleDataNotification:U,forceRefreshCache:W}=ae({unleashGetter:D,params:[e,t],dataKey:"feature",refetchFunctionKey:"refetchFeature",options:{}},y,{afterSubmitAction:F},ge);d.useEffect(()=>{q.current.name===""&&y.name&&(W(y),q.current=y)},[y]),d.useEffect(()=>{u&&r(pe(t,u))},[t,u]);const G=async f=>{await c(e,t,a,f),T({title:"Strategy created",type:"success",confetti:!0})},H=async f=>{await m(e,a,{action:"addStrategy",feature:t,payload:f}),T({title:"Strategy added to draft",type:"success",confetti:!0}),L()},V=async()=>{const f=ue(s,i);try{k(a)?await H(f):await G(f),F(),_(le(e,t))}catch(K){O(v(K))}};return!R||!R.project?null:p(ne,{modal:!0,title:se(n),description:re,documentationLink:oe,documentationLinkLabel:ie,formatApiCode:()=>be(e,t,a,s,z),children:[o(ce,{projectId:e,feature:R,strategy:s,setStrategy:r,segments:i,setSegments:l,environmentId:a,onSubmit:V,loading:h,permission:$,errors:g,isChangeRequest:k(a)}),U]})},Te=(e,t,a,n)=>{const s=new URLSearchParams({environmentId:a,strategyName:n});return`/projects/${e}/features/${t}/strategies/create?${s}`},be=(e,t,a,n,s)=>{if(!s)return"";const r=`${s}/api/admin/projects/${e}/features/${t}/environments/${a}/strategies`,i=JSON.stringify(n,void 0,2);return`curl --location --request POST '${r}' \\
|
|
2
2
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
3
3
|
--header 'Content-Type: application/json' \\
|
|
4
4
|
--data-raw '${i}'`},B=j("p")(({theme:e})=>({marginBottom:e.spacing(.5),fontSize:e.fontSizes.bodySize})),we=({open:e,environmentName:t,featureId:a,projectId:n,onClose:s})=>{const r=P(),i=Te(n,a,t,"default");return p(C,{open:e,maxWidth:"sm",onClose:()=>s(),title:"You need to add a strategy to your toggle",primaryButtonText:"Take me directly to add strategy",permissionButton:o(de,{type:"button",permission:$,projectId:n,environmentId:t,onClick:()=>{s(),r(i)},children:"Take me directly to add strategy"}),secondaryButtonText:"Cancel",children:[o(B,{children:"Before you can enable the toggle in the environment, you need to add an activation strategy."}),o(B,{children:"You can add the activation strategy by selecting the toggle, open the environment accordion and add the activation strategy."})]})},Ee="You can not enable the environment before it has strategies",Fe=e=>{const{setToastData:t,setToastApiError:a}=S(),{addChange:n}=I(),{refetch:s}=E(e),[r,i]=d.useState({isOpen:!1}),l=d.useCallback((c,h,m)=>{i({featureName:c,environment:h,enabled:m,isOpen:!0})},[]),u=d.useCallback(()=>{i(c=>({...c,isOpen:!1}))},[]),g=d.useCallback(async()=>{try{await n(e,r.environment,{feature:r.featureName,action:"updateEnabled",payload:{enabled:Boolean(r.enabled)}}),s(),i(c=>({...c,isOpen:!1})),t({type:"success",title:"Changes added to the draft!"})}catch(c){a(v(c)),i(h=>({...h,isOpen:!1}))}},[n]);return{onChangeRequestToggle:l,onChangeRequestToggleClose:u,onChangeRequestToggleConfirm:g,changeRequestDialogDetails:r}},qe=({enabled:e,featureName:t,environment:a})=>p(b,{"data-testid":"update-enabled-message",children:[o("strong",{children:e?"Enable":"Disable"})," feature toggle"," ",o("strong",{children:t})," in ",o("strong",{children:a})]}),Ce=j(he)(({theme:e})=>({color:e.palette.warning.main,fontSize:e.fontSizes.bodySize})),ke=()=>o(ye,{arrow:!0,title:p(fe,{children:["This environment has no variants enabled. If you check this feature's variants in this environment, you will get the"," ",o("a",{href:"https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant",target:"_blank",rel:"noreferrer",children:"disabled variant"}),"."]}),children:o(Ce,{})}),xe=({isStale:e,isOpen:t,projectId:a,featureId:n,onClose:s})=>{const{setToastData:r,setToastApiError:i}=S(),{patchFeatureToggle:l}=N(),u=o(b,{children:"Setting a toggle to stale marks it for cleanup"}),g=o(b,{children:"Setting a toggle to active marks it as in active use"}),c=e?"active":"stale",h=async m=>{m.stopPropagation();try{await l(a,n,[{op:"replace",path:"/stale",value:!e}]),s()}catch(T){i(v(T))}r(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 o(C,{open:t,secondaryButtonText:"Cancel",primaryButtonText:`Flip to ${c}`,title:`Set feature state to ${c}`,onClick:h,onClose:s,children:o(w,{condition:e,show:g,elseShow:u})})},De=({isOpen:e,onClose:t,onConfirm:a,projectId:n,featureId:s})=>{const{archiveFeatureToggle:r}=N(),{setToastData:i,setToastApiError:l}=S(),u=async()=>{try{await r(n,s),i({text:"Your feature toggle has been archived",type:"success",title:"Feature archived"}),a(),t()}catch(g){l(v(g)),t()}};return o(C,{onClick:()=>u(),open:e,onClose:t,primaryButtonText:"Archive toggle",secondaryButtonText:"Cancel",title:"Archive feature toggle",children:"Are you sure you want to archive this feature toggle?"})};export{Re as C,Ee as E,Ae as F,qe as U,ke as V,we as a,De as b,xe as c,Te as f,Fe as u};
|
package/frontend/build/static/{FeatureMetricsChart-86fa4af3.js → FeatureMetricsChart-91566cbd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c7 as i,eZ as p,bu as y,r as l,j as u}from"./index-
|
|
1
|
+
import{c7 as i,eZ as p,bu as y,r as l,j as u}from"./index-183c14cc.js";import{d,L as g,C as h,a as C,b as f,P as x,c as S,T as q,p as M,e as k,f as L}from"./chartjs-adapter-date-fns.esm-b2675703.js";import"./index-a9ee5a80.js";import"./index-8ee3a757.js";const P=(t,s)=>{const o={label:"total requests",borderColor:i.palette.primary.main,backgroundColor:i.palette.primary.main,data:n(t,s,r=>r.yes+r.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},e={label:"exposed",borderColor:i.palette.success.main,backgroundColor:i.palette.success.main,data:n(t,s,r=>r.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},a={label:"not exposed",borderColor:i.palette.error.main,backgroundColor:i.palette.error.main,data:n(t,s,r=>r.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[e,a,o]}},n=(t,s,o)=>t.map(e=>({x:e.timestamp,y:o(e)})),v=(t,s,o)=>({locale:o.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{tooltip:{backgroundColor:"white",bodyColor:i.palette.text.primary,titleColor:i.palette.grey[700],borderColor:i.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,callbacks:{title:e=>p(e[0].parsed.x,o.locale)},itemSort:(e,a)=>a.parsed.y-e.parsed.y},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:w(s),position:"top",align:"start",display:!0,font:{size:16,weight:"400"}}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests"},suggestedMin:0,ticks:{precision:0}},x:{type:"time",time:{unit:"hour"},grid:{display:!1},ticks:{callback:(e,a,r)=>p(r[a].value,o.locale)}}}}),w=t=>t===1?"Requests in the last hour":`Requests in the last ${t} hours`;d.font={...d.font,family:"Sen",size:13,weight:"400"};const j=({metrics:t,hoursBack:s,statsSectionId:o})=>{const{locationSettings:e}=y(),a=l.useMemo(()=>[...t].sort((m,b)=>m.timestamp.localeCompare(b.timestamp)),[t]),r=l.useMemo(()=>v(a,s,e),[a,s,e]),c=l.useMemo(()=>P(a,e),[a,e]);return u("div",{style:{height:400},children:u(g,{options:r,data:c,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":o})})};h.register(C,f,x,S,q,M,k,L);export{j as FeatureMetricsChart,j as default};
|