Skip to content

Commit

Permalink
Merge pull request #11898 from divyanshiGupta/Bug#2107469
Browse files Browse the repository at this point in the history
Bug 2107469: Fix service-binding modal sub-title text when the target is available
  • Loading branch information
openshift-ci[bot] authored Aug 5, 2022
2 parents c3c903b + 8feed8f commit 48991b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/packages/console-app/locales/en/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"No bindable services available": "No bindable services available",
"To create a Service binding, first create a bindable service.": "To create a Service binding, first create a bindable service.",
"Select Service": "Select Service",
"Connect <1>{{sourceName}}</1> to service <3>{{targetName}}</3>.": "Connect <1>{{sourceName}}</1> to service <3>{{targetName}}</3>.",
"Select a service to connect to.": "Select a service to connect to.",
"Create": "Create",
"Required": "Required",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { TextInputTypes, Title } from '@patternfly/react-core';
import { FormikProps, FormikValues } from 'formik';
import * as _ from 'lodash';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import FormSection from '@console/dev-console/src/components/import/section/FormSection';
import {
ModalTitle,
Expand Down Expand Up @@ -30,12 +30,24 @@ const CreateServiceBindingForm: React.FC<FormikProps<FormikValues> &
errors,
}) => {
const { t } = useTranslation();

const sourceName = source.metadata.name;
const targetName = target?.metadata?.name;

const title = target ? (
<Trans t={t} ns="console-app">
Connect <b>{{ sourceName }}</b> to service <b>{{ targetName }}</b>.
</Trans>
) : (
t('console-app~Select a service to connect to.')
);

return (
<form onSubmit={handleSubmit} className="modal-content">
<ModalTitle>{t('console-app~Create Service Binding')}</ModalTitle>
<ModalBody>
<Title headingLevel="h2" size="md" className="co-m-form-row">
{t('console-app~Select a service to connect to.')}
{title}
</Title>
<FormSection fullWidth>
<InputField
Expand Down

0 comments on commit 48991b5

Please sign in to comment.