Skip to content

Commit

Permalink
quick fix - add a prop for empty resource names
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Madigan <[email protected]>
  • Loading branch information
jasonmadigan committed Oct 18, 2024
1 parent 24fbebd commit f49ca5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions locales/en/plugin__kuadrant-console-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Failure Threshold": "Failure Threshold",
"Feature Highlights": "Feature Highlights",
"Form View": "Form View",
"found": "found",
"Gateway API Target Reference": "Gateway API Target Reference",
"Gateway: Reference to a Kubernetes resource that the policy attaches to. To create an additional gateway go to": "Gateway: Reference to a Kubernetes resource that the policy attaches to. To create an additional gateway go to",
"Gateways": "Gateways",
Expand All @@ -68,8 +69,8 @@
"Loading..": "Loading..",
"Name": "Name",
"Namespace": "Namespace",
"No": "No",
"No limits configured yet": "No limits configured yet",
"No policies found": "No policies found",
"OK": "OK",
"Overview": "Overview",
"Policies": "Policies",
Expand All @@ -95,9 +96,10 @@
"Select Issuer": "Select Issuer",
"Status": "Status",
"Targets Gateway API networking resources Gateways to provide TLS for gateway listeners by managing the lifecycle of TLS certificates using cert-manager": "Targets Gateway API networking resources Gateways to provide TLS for gateway listeners by managing the lifecycle of TLS certificates using cert-manager",
"There are no policies to display - please create some.": "There are no policies to display - please create some.",
"There are no": "There are no",
"TLS": "TLS",
"TLSPolicy": "TLSPolicy",
"to display - please create some.": "to display - please create some.",
"Type": "Type",
"Unique name of the DNS Policy": "Unique name of the DNS Policy",
"Unique name of the TLSPolicy.": "Unique name of the TLSPolicy.",
Expand Down
2 changes: 2 additions & 0 deletions src/components/KuadrantOverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ const KuadrantOverviewPage: React.FC = () => {
resources={[resourceGVKMapping['Gateway']]}
columns={columns}
namespace="#ALL_NS#"
emtpyResourceName="Gateways"
/>
</CardBody>
</Card>
Expand All @@ -330,6 +331,7 @@ const KuadrantOverviewPage: React.FC = () => {
resources={[resourceGVKMapping['HTTPRoute']]}
columns={columns}
namespace="#ALL_NS#"
emtpyResourceName="HTTPRoutes"
/>
</CardBody>
</Card>
Expand Down
8 changes: 4 additions & 4 deletions src/components/ResourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ type ResourceListProps = {
kind: string;
}>;
namespace?: string;
emtpyResourceName?: string;
paginationLimit?: number;
columns?: TableColumn<K8sResourceCommon>[];
};
Expand All @@ -178,6 +179,7 @@ const ResourceList: React.FC<ResourceListProps> = ({
namespace = '#ALL_NS#',
paginationLimit = 10,
columns,
emtpyResourceName = 'Policies',
}) => {
const { t } = useTranslation('plugin__kuadrant-console-plugin');

Expand Down Expand Up @@ -357,12 +359,10 @@ const ResourceList: React.FC<ResourceListProps> = ({
<EmptyState>
<EmptyStateIcon icon={SearchIcon} />
<Title headingLevel="h4" size="lg">
{t('plugin__kuadrant-console-plugin~No policies found')}
{t('No')} {emtpyResourceName} {t('found')}
</Title>
<EmptyStateBody>
{t(
'plugin__kuadrant-console-plugin~There are no policies to display - please create some.',
)}
{t('There are no')} {emtpyResourceName} {t('to display - please create some.')}
</EmptyStateBody>
</EmptyState>
) : (
Expand Down

0 comments on commit f49ca5d

Please sign in to comment.