@spotify/backstage-plugin-soundcheck 0.15.0 → 0.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @spotify/backstage-plugin-soundcheck
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Enables filtering by system, type, lifecycle, and owner on the Check Insights page.
8
+
3
9
  ## 0.15.0
4
10
 
5
11
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- import{parseEntityRef as T}from"@backstage/catalog-model";import{useApi as D,configApiRef as P}from"@backstage/core-plugin-api";import{EntityDisplayName as B}from"@backstage/plugin-catalog-react";import{makeStyles as G,Checkbox as f,Box as W,Typography as _}from"@material-ui/core";import j from"@material-ui/icons/Category";import z from"@material-ui/icons/Class";import K from"@material-ui/icons/Group";import M from"@material-ui/icons/Loop";import Q from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as d}from"react";import{useGetEntityFacets as s}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as U}from"../../../hooks/groups/useGroupOptions.esm.js";import{CheckIcon as V}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function X(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const y=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(B,{entityRef:t,hideIcon:!0})),$=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(f,{value:t,checked:r,color:"primary"}),e.createElement(V,{result:t}),e.createElement(W,{mr:1}),e.createElement(_,null,X(t))),q=G(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),H=({filter:t,states:r,setStates:u,owners:E,setOwners:g,lifecycles:h,setLifecycles:L,types:b,setTypes:A,systems:F,setSystems:k})=>{const O=q(),n=D(P).getOptionalStringArray("soundcheck.flags")?.includes("enable-check-insights"),{options:i,isLoading:w}=U(),S=d(()=>i.map(o=>o.ref),[i]),{data:a,isLoading:C}=s("spec.lifecycle",t,n),{data:m,isLoading:R}=s("spec.type",t,n),{data:c,isLoading:x}=s("relations.partOf",t,n),p=d(()=>c?.filter(o=>{try{return T(o).kind.toLowerCase()==="system"}catch{return!1}}),[c]),I=(a||[]).length<=1,N=(m||[]).length<=1,v=(p||[]).length<=1;return e.createElement("div",{className:O.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(Q,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:u,customRenderOption:$}),n&&e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(j,null),filters:F,setFilters:k,options:p??[],disabled:x||v,customRenderOption:y}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(K,null),filters:E,setFilters:g,options:S??[],disabled:w,customRenderOption:y}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(z,null),filters:b,setFilters:A,options:m??[],disabled:R||N}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(M,null),filters:h,setFilters:L,options:a??[],disabled:C||I})))};export{H as FilterBar};
1
+ import{parseEntityRef as x}from"@backstage/catalog-model";import{EntityDisplayName as T}from"@backstage/plugin-catalog-react";import{makeStyles as D,Checkbox as p,Box as P,Typography as B}from"@material-ui/core";import G from"@material-ui/icons/Category";import j from"@material-ui/icons/Class";import W from"@material-ui/icons/Group";import _ from"@material-ui/icons/Loop";import z from"@material-ui/icons/PlaylistAddCheckRounded";import e,{useMemo as f}from"react";import{useGetEntityFacets as o}from"../../../hooks/catalog/useGetEntityFacets.esm.js";import{useGroupOptions as H}from"../../../hooks/groups/useGroupOptions.esm.js";import{CheckIcon as J}from"../../CheckIcon/CheckIcon.esm.js";import l from"../../MultiSelectFilter/MultiSelectFilter.esm.js";function M(t){return t.toLowerCase().split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}const d=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(p,{value:t,checked:r,color:"primary"}),e.createElement(T,{entityRef:t,hideIcon:!0})),Q=(t,{selected:r})=>e.createElement(e.Fragment,null,e.createElement(p,{value:t,checked:r,color:"primary"}),e.createElement(J,{result:t}),e.createElement(P,{mr:1}),e.createElement(B,null,M(t))),U=D(t=>({root:{display:"flex",flexDirection:"row",alignItems:"center",gap:t.spacing(2)}})),$=({filter:t,states:r,setStates:y,owners:E,setOwners:u,lifecycles:g,setLifecycles:L,types:h,setTypes:b,systems:F,setSystems:w})=>{const O=U(),{options:s,isLoading:k}=H(),A=f(()=>s.map(n=>n.ref),[s]),{data:i,isLoading:C}=o("spec.lifecycle",t),{data:a,isLoading:I}=o("spec.type",t),{data:m,isLoading:S}=o("relations.partOf",t),c=f(()=>m?.filter(n=>{try{return x(n).kind.toLowerCase()==="system"}catch{return!1}}),[m]),N=(i||[]).length<=1,R=(a||[]).length<=1,v=(c||[]).length<=1;return e.createElement("div",{className:O.root},e.createElement(l,{name:"state",label:"State",icon:e.createElement(z,null),options:["PASSED","FAILED","WARNING","NOT_APPLICABLE"],filters:r,setFilters:y,customRenderOption:Q}),e.createElement("div",null,e.createElement(l,{name:"system",label:"System",icon:e.createElement(G,null),filters:F,setFilters:w,options:c??[],disabled:S||v,customRenderOption:d}),e.createElement(l,{name:"owner",label:"Owner",icon:e.createElement(W,null),filters:E,setFilters:u,options:A??[],disabled:k,customRenderOption:d}),e.createElement(l,{name:"type",label:"Type",icon:e.createElement(j,null),filters:h,setFilters:b,options:a??[],disabled:I||R}),e.createElement(l,{name:"lifecycle",label:"Lifecycle",icon:e.createElement(_,null),filters:g,setFilters:L,options:i??[],disabled:C||N})))};export{$ as FilterBar};
2
2
  //# sourceMappingURL=FilterBar.esm.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotify/backstage-plugin-soundcheck",
3
3
  "description": "Ensure quality, reliability and alignment of software development with codified checks and guidance.",
4
- "version": "0.15.0",
4
+ "version": "0.15.1",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://backstage.spotify.com",
7
7
  "main": "./dist/index.esm.js",
@@ -124,7 +124,7 @@
124
124
  "@playwright/test": "^1.32.3",
125
125
  "@sp4b-dev/test-utils": "^0.0.11",
126
126
  "@spotify/backstage-plugin-core-common": "^0.6.5",
127
- "@spotify/backstage-plugin-soundcheck-node": "^0.9.0",
127
+ "@spotify/backstage-plugin-soundcheck-node": "^0.9.2",
128
128
  "@testing-library/jest-dom": "^6.0.0",
129
129
  "@testing-library/react": "^14.0.0",
130
130
  "@testing-library/user-event": "^14.0.0",