Skip to content

Commit

Permalink
Extend generic noDataStateBody translation to handle add & import ver…
Browse files Browse the repository at this point in the history
…biage

Signed-off-by: Ian Bolton <[email protected]>
  • Loading branch information
ibolton336 committed Apr 4, 2024
1 parent 03dfed6 commit 04e1487
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 16 deletions.
4 changes: 3 additions & 1 deletion client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"error": "{{what}} error",
"manage": "Manage {{what}}",
"manageDependenciesFor": "Manage dependencies for {{what}}",
"noDataStateBody": "Create a new {{what}} to start seeing data here.",
"noDataStateBody": "{{how}} a new {{what}} to start seeing data here.",
"noDataStateTitle": "No {{what}} available",
"Nquestions": "{{n}} questions",
"ofTotalApplications": "Of {{count}} application",
Expand Down Expand Up @@ -269,6 +269,7 @@
"applicationName": "Application name",
"archetypeName": "Archetype name",
"applicationInformation": "Application information",
"applicationFile": "Application file",
"archetype": "Archetype",
"archetypes": "Archetypes",
"archetypes_plural": "Archetypes",
Expand Down Expand Up @@ -301,6 +302,7 @@
"connected": "Connected",
"contributors": "Contributors",
"controls": "Controls",
"create": "Create",
"createdBy": "Created By",
"credential": "Credential",
"credentials": "Credentials",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ export const ApplicationsTable: React.FC = () => {
what: t("terms.applications").toLowerCase(),
})}
description={t("composed.noDataStateBody", {
how: t("terms.create"),
what: t("terms.application").toLowerCase(),
})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ export const ManageImports: React.FC = () => {
</Title>
<EmptyStateBody>
{t("composed.noDataStateBody", {
what: t("terms.importSummary").toLowerCase(),
how: t("actions.import"),
what: t("terms.applicationFile").toLowerCase(),
})}
</EmptyStateBody>
</EmptyState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export const JobFunctions: React.FC = () => {
})}
// t('terms.jobFunction')
description={t("composed.noDataStateBody", {
how: t("terms.create"),
what: t("terms.jobFunction").toLowerCase(),
})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export const StakeholderGroups: React.FC = () => {
</Title>
<EmptyStateBody>
{t("composed.noDataStateBody", {
how: t("terms.add"),
what: t("terms.stakeholderGroup").toLowerCase(),
})}
</EmptyStateBody>
Expand All @@ -254,6 +255,7 @@ export const StakeholderGroups: React.FC = () => {
numRenderedColumns={numRenderedColumns}
>
{currentPageItems?.map((stakeholderGroup, rowIndex) => {
const hasStakeholders = stakeholderGroup.stakeholders?.length;
return (
<Tbody
key={stakeholderGroup.id}
Expand Down Expand Up @@ -297,20 +299,37 @@ export const StakeholderGroups: React.FC = () => {
className={spacing.pyLg}
>
<ExpandableRowContent>
<DescriptionList>
<DescriptionListGroup>
<DescriptionListTerm>
{t("terms.member(s)")}
</DescriptionListTerm>
{!!stakeholderGroup.stakeholders?.length && (
<DescriptionListDescription>
{stakeholderGroup.stakeholders
?.map((f) => f.name)
.join(", ")}
</DescriptionListDescription>
)}
</DescriptionListGroup>
</DescriptionList>
{hasStakeholders ? (
<DescriptionList>
<DescriptionListGroup>
<DescriptionListTerm>
{t("terms.member(s)")}
</DescriptionListTerm>
{!!stakeholderGroup.stakeholders?.length && (
<DescriptionListDescription>
{stakeholderGroup.stakeholders
?.map((f) => f.name)
.join(", ")}
</DescriptionListDescription>
)}
</DescriptionListGroup>
</DescriptionList>
) : (
<EmptyState variant="sm">
<EmptyStateIcon icon={CubesIcon} />
<Title headingLevel="h2" size="lg">
{t("composed.noDataStateTitle", {
what: t("terms.stakeholder").toLowerCase(),
})}
</Title>
<EmptyStateBody>
{t("composed.noDataStateBody", {
how: t("terms.add"),
what: t("terms.stakeholder").toLowerCase(),
})}
</EmptyStateBody>
</EmptyState>
)}
</ExpandableRowContent>
</Td>
</Tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export const Stakeholders: React.FC = () => {
</Title>
<EmptyStateBody>
{t("composed.noDataStateBody", {
how: t("terms.add"),
what: t(
"terms.stakeholderGroup"
).toLowerCase(),
Expand Down
1 change: 1 addition & 0 deletions client/src/app/pages/controls/tags/tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export const Tags: React.FC = () => {
})}
// t('terms.stakeholderGroup')
description={t("composed.noDataStateBody", {
how: t("terms.create"),
what: t("terms.tagCategory").toLowerCase(),
})}
/>
Expand Down
1 change: 1 addition & 0 deletions client/src/app/pages/external/jira/trackers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export const JiraTrackers: React.FC = () => {
</Title>
<EmptyStateBody>
{t("composed.noDataStateBody", {
how: t("actions.create"),
what: t("terms.jiraConfig").toLowerCase(),
})}
</EmptyStateBody>
Expand Down
1 change: 1 addition & 0 deletions client/src/app/pages/identities/identities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export const Identities: React.FC = () => {
what: "credentials",
})}
description={t("composed.noDataStateBody", {
how: t("terms.create"),
what: "credential",
})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export const ManageApplicationsForm: React.FC<ManageApplicationsFormProps> = ({
what: t("terms.applications").toLowerCase(),
})}
description={t("composed.noDataStateBody", {
how: t("terms.add"),
what: t("terms.application").toLowerCase(),
})}
/>
Expand Down

0 comments on commit 04e1487

Please sign in to comment.