Skip to content

Commit

Permalink
fix: ci / wordpress
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredrethman committed Nov 25, 2024
1 parent bd5aff5 commit 1f959a7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/wizards/newspack/components/site-statuses/site-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const defaultStatuses = {
error: __( 'Disconnected', 'newspack-plugin' ),
'error-dependencies': undefined,
'error-preflight': undefined,
/* translators: %s is the HTTP status code */
'error-request': __( 'Request failed - %s', 'newspack-plugin' ),
};

Expand All @@ -34,7 +35,10 @@ const SiteStatus = ( {
configLink,
then,
}: Status ) => {
const parsedStatusLabels = { ...defaultStatuses, ...statuses };
const parsedStatusLabels: Record< StatusLabels, string > = {
...defaultStatuses,
...statuses,
};

const [ requestCode, setRequestCode ] = useState( 200 );

Expand Down Expand Up @@ -184,10 +188,12 @@ const SiteStatus = ( {
<div className={ classes }>
{ label }:{ ' ' }
<span>
{ sprintf(
parsedStatusLabels[ requestStatus ],
requestCode
) }
{ requestStatus === 'error-request'
? sprintf(
parsedStatusLabels[ requestStatus ],
requestCode
)
: parsedStatusLabels[ requestStatus ] }
</span>
</div>
) }
Expand Down

0 comments on commit 1f959a7

Please sign in to comment.