@spotify/backstage-plugin-soundcheck 0.19.5 → 0.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @spotify/backstage-plugin-soundcheck
2
2
 
3
+ ## 0.19.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed an issue where collectors page would error if there are incorrectly formatted values.
8
+
3
9
  ## 0.19.5
4
10
 
5
11
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- import{jsxs as n,jsx as e}from"react/jsx-runtime";import{Content as $,LinkButton as O}from"@backstage/core-components";import{useRouteRef as b}from"@backstage/core-plugin-api";import{usePermission as F}from"@backstage/plugin-permission-react";import{makeStyles as W,Box as r,Button as x,Typography as l,Card as q,CardHeader as z,CardContent as Y,Tooltip as _,CardActions as J}from"@material-ui/core";import{Alert as K}from"@material-ui/lab";import{soundcheckCollectorReadPermission as Q,soundcheckCollectorUpdatePermission as X,parseFactRef as M,asArray as Z}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as U,uniq as ee}from"lodash";import{useMemo as N,useCallback as te,useEffect as oe}from"react";import{useParams as ie,useNavigate as re}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as ne}from"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useGetCollectors as ae}from"../../hooks/collectors/useGetCollectors.esm.js";import{useDeleteCollectorConfig as ce}from"../../hooks/collectors/useDeleteCollectorConfig.esm.js";import{useLCPReporting as se}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as de}from"../../hooks/useLoadTimeReporting.esm.js";import{integrationEditRouteRef as le,integrationsPageRouteRef as me,checkDetailsRouteRef as pe}from"../../routes.esm.js";import{mapRuleToExpression as fe}from"../CheckForm/utils/checkFormUtils.esm.js";import{ConfigurableCollectorIds as he}from"../CollectorsPage/CollectorListPage/CollectorListPageDeprecated.esm.js";import"@material-ui/icons/Search";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../FactExplorer/FactExplorer.esm.js";import{FactExplorerProvider as ge}from"../FactExplorer/FactExplorerContext.esm.js";import{LoadingIndicator as ue}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as Ce}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as ye}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContentDeprecated as ve}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{CollectorFactTable as Re}from"./CollectorFactTable.esm.js";const ke=W(d=>({card:{width:360},cardDescription:{"& p":{marginTop:d.spacing(.5),marginBottom:d.spacing(.5)}},cardContent:{flexGrow:1}})),Ie=({id:d,title:g,description:u,rules:t,integrationId:m,hasSchedule:C})=>{const p=ke(),k=b(pe),y=N(()=>{const c=[],v=s=>{for(const a of s.conditions??[])c.push(a.factRef),typeof a.value=="object"&&Object.hasOwn(a.value,"factRef")&&c.push(a.value.factRef);for(const a of s.expressions??[])v(a)};return t&&v(t),ee(c).filter(s=>{try{return M(s).source===m}catch{return!1}})},[m,t]);return n(q,{className:p.card,children:[e(z,{title:g}),n(Y,{className:p.cardContent,children:[u&&e(r,{overflow:"auto",maxHeight:200,children:e(ve,{className:p.cardDescription,content:u})}),!U(y)&&n(r,{marginTop:1,overflow:"auto",maxHeight:120,children:[e(l,{variant:"subtitle2",children:"Used Fact Refs"}),y.map(c=>e(r,{children:c},"factRef"))]}),C&&e(r,{marginTop:1,children:e(_,{title:"Configure this integration's collection schedule instead.",children:e(K,{severity:"warning",children:"Check Schedule Detected"})})})]}),e(J,{children:e(O,{variant:"outlined",to:k({checkId:d}),target:"_blank",children:"View"})})]})},we=({id:d,integrations:g})=>{const u=ie(),t=d??u.integrationId,m=N(()=>({routeName:"soundcheck-integration-details",additionalAttributes:{integrationId:t||""}}),[t]),{reportContentLoaded:C}=de(m),{reporter:p}=se(m),{data:k,isLoading:y}=ae([t??""]),{loading:c,allowed:v}=F({permission:Q}),{loading:s,allowed:a}=F({permission:X}),{showModal:P}=ne(),{mutate:B,isPending:I}=ce(t??""),G=te(async()=>{!await P({title:"Are you sure you want to delete stored UI config?",message:"This action cannot be undone and will remove any stored configs for this integration from the database."})||I||B()},[B,I,P]),o=k?.[0],f=y||s||c,S=g?.map(i=>i.integrationId)??he,T=g?.find(i=>i.integrationId===t)?.routePath,A=!s&&a&&o?.isEditable&&o?.isConfigurable&&S.includes(t??""),w=re(),D=b(le),L=b(me),H=o?.hasUIConfig,j=N(()=>n(r,{display:"flex",gridGap:12,children:[e(x,{variant:"contained",color:"primary",onClick:()=>{w(L())},children:"All Integrations"}),t&&A&&e(x,{variant:"contained",color:"primary",onClick:()=>{w(T??D({integrationId:t}))},children:"Edit Integration"})]}),[L,T,D,t,A,w]);ye({title:o?.name??t,description:o?o.description??"":"",docLink:o?`https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/fact-collectors/3p-integrations/${o.id}`:"",sectionRight:j});const E=p?.getLCPValue();return oe(()=>{f||C({lcp:E})},[f,C,E]),e(ge,{hidePath:!0,children:n($,{children:[f&&e(ue,{}),e(Ce,{entityName:"Integration",entityId:t,showNotFound:!f&&!o,showCannotView:!f&&!v}),o&&n(r,{children:[n(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Facts"}),e(r,{marginBottom:2,children:e(Re,{facts:o.factNames.map(i=>{const R=(h=>{try{return M(h).name}catch{return h}})(i),V=Z(o.config?.collects).find(h=>h?.type===R||h?.factName===R);return{factRef:`${t}:default/${R}`,factName:R,config:V,uiConfig:!!o.hasUIConfig,parentConfig:o.config}})})})]}),n(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Dependant Checks"}),U(o.dependentChecks)?e(l,{variant:"body2",children:"No dependant checks"}):e(r,{display:"flex",gridGap:12,flexWrap:"wrap",children:o.dependentChecks.map(i=>e(Ie,{id:i.id,title:i.name??i.id,description:i.description??void 0,rules:fe(i.rule),integrationId:t,hasSchedule:i.schedule},i.id))})]}),a&&H&&n(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Admin Actions"}),o.hasUIConfig&&n(r,{marginTop:1,display:"flex",alignItems:"center",gridGap:16,children:[e(x,{disabled:I,size:"small",variant:"contained",color:"secondary",onClick:G,children:"Remove Config"}),e(l,{variant:"body2",color:"textSecondary",children:"Revert to using YAML to config this integration by deleting the stored UI config from the database."})]})]})]})]})})};export{we as CollectorDetailsPageDeprecated};
1
+ import{jsxs as a,jsx as e}from"react/jsx-runtime";import{Content as $,LinkButton as O}from"@backstage/core-components";import{useRouteRef as b}from"@backstage/core-plugin-api";import{usePermission as F}from"@backstage/plugin-permission-react";import{makeStyles as W,Box as r,Button as x,Typography as l,Card as q,CardHeader as z,CardContent as Y,Tooltip as _,CardActions as J}from"@material-ui/core";import{Alert as K}from"@material-ui/lab";import{soundcheckCollectorReadPermission as Q,soundcheckCollectorUpdatePermission as X,parseFactRef as M,asArray as Z}from"@spotify/backstage-plugin-soundcheck-common";import{isEmpty as U,uniq as ee}from"lodash";import{useMemo as N,useCallback as te,useEffect as oe}from"react";import{useParams as ie,useNavigate as re}from"react-router-dom";import"@backstage/catalog-model";import"@tanstack/react-query";import"../../api.esm.js";import"../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as ne}from"../../hooks/useConfirmationModal.esm.js";import"react-use/lib/useLocalStorage";import{useGetCollectors as ae}from"../../hooks/collectors/useGetCollectors.esm.js";import{useDeleteCollectorConfig as ce}from"../../hooks/collectors/useDeleteCollectorConfig.esm.js";import{useLCPReporting as se}from"../../hooks/useLCPReporting.esm.js";import{useLoadTimeReporting as de}from"../../hooks/useLoadTimeReporting.esm.js";import{integrationEditRouteRef as le,integrationsPageRouteRef as me,checkDetailsRouteRef as pe}from"../../routes.esm.js";import{mapRuleToExpression as fe}from"../CheckForm/utils/checkFormUtils.esm.js";import{ConfigurableCollectorIds as he}from"../CollectorsPage/CollectorListPage/CollectorListPageDeprecated.esm.js";import"@material-ui/icons/Search";import"../SoundcheckDialog/SoundcheckDialog.esm.js";import"../FactExplorer/FactExplorer.esm.js";import{FactExplorerProvider as ge}from"../FactExplorer/FactExplorerContext.esm.js";import{LoadingIndicator as ue}from"../LoadingIndicator/LoadingIndicator.esm.js";import{PageWarningMessage as Ce}from"../PageWarningMessage/PageWarningMessage.esm.js";import"../SoundcheckHeader/SoundcheckHeader.esm.js";import"../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as ye}from"../SoundcheckHeader/useHeader.esm.js";import{SoundcheckMarkdownContentDeprecated as ve}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"react-markdown";import"rehype-raw";import"remark-gfm";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";import{CollectorFactTable as Re}from"./CollectorFactTable.esm.js";const ke=W(d=>({card:{width:360},cardDescription:{"& p":{marginTop:d.spacing(.5),marginBottom:d.spacing(.5)}},cardContent:{flexGrow:1}})),Ie=({id:d,title:g,description:u,rules:t,integrationId:m,hasSchedule:C})=>{const p=ke(),k=b(pe),y=N(()=>{const c=[],v=s=>{for(const n of s.conditions??[])c.push(n.factRef),n.value&&typeof n.value=="object"&&Object.hasOwn(n.value,"factRef")&&c.push(n.value.factRef);for(const n of s.expressions??[])v(n)};return t&&v(t),ee(c).filter(s=>{try{return M(s).source===m}catch{return!1}})},[m,t]);return a(q,{className:p.card,children:[e(z,{title:g}),a(Y,{className:p.cardContent,children:[u&&e(r,{overflow:"auto",maxHeight:200,children:e(ve,{className:p.cardDescription,content:u})}),!U(y)&&a(r,{marginTop:1,overflow:"auto",maxHeight:120,children:[e(l,{variant:"subtitle2",children:"Used Fact Refs"}),y.map(c=>e(r,{children:c},"factRef"))]}),C&&e(r,{marginTop:1,children:e(_,{title:"Configure this integration's collection schedule instead.",children:e(K,{severity:"warning",children:"Check Schedule Detected"})})})]}),e(J,{children:e(O,{variant:"outlined",to:k({checkId:d}),target:"_blank",children:"View"})})]})},we=({id:d,integrations:g})=>{const u=ie(),t=d??u.integrationId,m=N(()=>({routeName:"soundcheck-integration-details",additionalAttributes:{integrationId:t||""}}),[t]),{reportContentLoaded:C}=de(m),{reporter:p}=se(m),{data:k,isLoading:y}=ae([t??""]),{loading:c,allowed:v}=F({permission:Q}),{loading:s,allowed:n}=F({permission:X}),{showModal:P}=ne(),{mutate:T,isPending:I}=ce(t??""),G=te(async()=>{!await P({title:"Are you sure you want to delete stored UI config?",message:"This action cannot be undone and will remove any stored configs for this integration from the database."})||I||T()},[T,I,P]),o=k?.[0],f=y||s||c,S=g?.map(i=>i.integrationId)??he,A=g?.find(i=>i.integrationId===t)?.routePath,B=!s&&n&&o?.isEditable&&o?.isConfigurable&&S.includes(t??""),w=re(),D=b(le),L=b(me),H=o?.hasUIConfig,j=N(()=>a(r,{display:"flex",gridGap:12,children:[e(x,{variant:"contained",color:"primary",onClick:()=>{w(L())},children:"All Integrations"}),t&&B&&e(x,{variant:"contained",color:"primary",onClick:()=>{w(A??D({integrationId:t}))},children:"Edit Integration"})]}),[L,A,D,t,B,w]);ye({title:o?.name??t,description:o?o.description??"":"",docLink:o?`https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/fact-collectors/3p-integrations/${o.id}`:"",sectionRight:j});const E=p?.getLCPValue();return oe(()=>{f||C({lcp:E})},[f,C,E]),e(ge,{hidePath:!0,children:a($,{children:[f&&e(ue,{}),e(Ce,{entityName:"Integration",entityId:t,showNotFound:!f&&!o,showCannotView:!f&&!v}),o&&a(r,{children:[a(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Facts"}),e(r,{marginBottom:2,children:e(Re,{facts:o.factNames.map(i=>{const R=(h=>{try{return M(h).name}catch{return h}})(i),V=Z(o.config?.collects).find(h=>h?.type===R||h?.factName===R);return{factRef:`${t}:default/${R}`,factName:R,config:V,uiConfig:!!o.hasUIConfig,parentConfig:o.config}})})})]}),a(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Dependant Checks"}),U(o.dependentChecks)?e(l,{variant:"body2",children:"No dependant checks"}):e(r,{display:"flex",gridGap:12,flexWrap:"wrap",children:o.dependentChecks.map(i=>e(Ie,{id:i.id,title:i.name??i.id,description:i.description??void 0,rules:fe(i.rule),integrationId:t,hasSchedule:i.schedule},i.id))})]}),n&&H&&a(r,{marginBottom:2,children:[e(l,{variant:"h6",children:"Admin Actions"}),o.hasUIConfig&&a(r,{marginTop:1,display:"flex",alignItems:"center",gridGap:16,children:[e(x,{disabled:I,size:"small",variant:"contained",color:"secondary",onClick:G,children:"Remove Config"}),e(l,{variant:"body2",color:"textSecondary",children:"Revert to using YAML to config this integration by deleting the stored UI config from the database."})]})]})]})]})})};export{we as CollectorDetailsPageDeprecated};
2
2
  //# sourceMappingURL=CollectorDetailsPageDeprecated.esm.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRouteRef as g}from"@backstage/core-plugin-api";import{Card as x,CardHeader as y,CardBody as C,Box as o,Text as v,Button as R,Tooltip as k,CardFooter as b,ButtonLink as w}from"@backstage/ui";import{makeStyles as B}from"@material-ui/core";import{Alert as D}from"@material-ui/lab";import{parseFactRef as T}from"@spotify/backstage-plugin-soundcheck-common";import{uniq as j,isEmpty as S}from"lodash";import{useMemo as F}from"react";import{TooltipTrigger as H}from"react-aria-components";import{checkDetailsRouteRef as I}from"../../routes.esm.js";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SoundcheckMarkdownContentBUI as L}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";const M=B(()=>({cardDescription:{"& p":{marginTop:"var(--bui-space-0)",marginBottom:"var(--bui-space-0)"}},cardContent:{flexGrow:1},container:{padding:"0 var(--bui-space-5)"}})),N=({id:p,title:f,description:a,rules:c,integrationId:s,hasSchedule:h})=>{const d=M(),u=g(I),l=F(()=>{const r=[],m=i=>{for(const t of i.conditions??[])r.push(t.factRef),typeof t.value=="object"&&Object.hasOwn(t.value,"factRef")&&r.push(t.value.factRef);for(const t of i.expressions??[])m(t)};return c&&m(c),j(r).filter(i=>{try{return T(i).source===s}catch{return!1}})},[s,c]);return n(x,{children:[e(y,{title:f}),n(C,{className:d.cardContent,children:[a&&e(o,{style:{maxHeight:"200px",overflow:"auto"},children:e(L,{className:d.cardDescription,content:a})}),!S(l)&&n(o,{mt:"6",style:{maxHeight:"120px",overflow:"auto"},children:[e(v,{style:{fontWeight:"bold"},children:"Used Fact Refs"}),l.map(r=>e(o,{children:r},"factRef"))]}),h&&e(o,{mt:"6",children:n(H,{children:[e(R,{variant:"tertiary",style:{padding:0,height:"auto"},children:e(D,{severity:"warning",children:"Check Schedule Detected"})}),e(k,{children:"Configure this integration's collection schedule instead."})]})})]}),e(b,{children:e(o,{mt:"6",children:e(w,{href:u({checkId:p}),target:"_blank",children:"View"})})})]})};export{N as DependantCheckCard};
1
+ import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useRouteRef as g}from"@backstage/core-plugin-api";import{Card as v,CardHeader as x,CardBody as y,Box as o,Text as C,Button as R,Tooltip as k,CardFooter as b,ButtonLink as w}from"@backstage/ui";import{makeStyles as B}from"@material-ui/core";import{Alert as D}from"@material-ui/lab";import{parseFactRef as T}from"@spotify/backstage-plugin-soundcheck-common";import{uniq as j,isEmpty as S}from"lodash";import{useMemo as F}from"react";import{TooltipTrigger as H}from"react-aria-components";import{checkDetailsRouteRef as I}from"../../routes.esm.js";import"../SoundcheckMarkdownContent/SoundcheckMarkdownContentDeprecated.esm.js";import"@backstage/core-components";import"react-markdown";import"rehype-raw";import"remark-gfm";import{SoundcheckMarkdownContentBUI as L}from"../SoundcheckMarkdownContent/SoundcheckMarkdownContentBUI.esm.js";const M=B(()=>({cardDescription:{"& p":{marginTop:"var(--bui-space-0)",marginBottom:"var(--bui-space-0)"}},cardContent:{flexGrow:1},container:{padding:"0 var(--bui-space-5)"}})),N=({id:p,title:f,description:a,rules:c,integrationId:s,hasSchedule:h})=>{const d=M(),u=g(I),l=F(()=>{const r=[],m=i=>{for(const t of i.conditions??[])r.push(t.factRef),t.value&&typeof t.value=="object"&&Object.hasOwn(t.value,"factRef")&&r.push(t.value.factRef);for(const t of i.expressions??[])m(t)};return c&&m(c),j(r).filter(i=>{try{return T(i).source===s}catch{return!1}})},[s,c]);return n(v,{children:[e(x,{title:f}),n(y,{className:d.cardContent,children:[a&&e(o,{style:{maxHeight:"200px",overflow:"auto"},children:e(L,{className:d.cardDescription,content:a})}),!S(l)&&n(o,{mt:"6",style:{maxHeight:"120px",overflow:"auto"},children:[e(C,{style:{fontWeight:"bold"},children:"Used Fact Refs"}),l.map(r=>e(o,{children:r},"factRef"))]}),h&&e(o,{mt:"6",children:n(H,{children:[e(R,{variant:"tertiary",style:{padding:0,height:"auto"},children:e(D,{severity:"warning",children:"Check Schedule Detected"})}),e(k,{children:"Configure this integration's collection schedule instead."})]})})]}),e(b,{children:e(o,{mt:"6",children:e(w,{href:u({checkId:p}),target:"_blank",children:"View"})})})]})};export{N as DependantCheckCard};
2
2
  //# sourceMappingURL=DependantCheckCard.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.19.5",
4
+ "version": "0.19.6",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://backstage.spotify.com",
7
7
  "main": "./dist/index.esm.js",