diff --git a/.gitignore b/.gitignore index d8bc7d3be2..9b67eadfb0 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,6 @@ dist/ # edx .env.private temp/ +src/i18n/transifex_input.json src/i18n/messages diff --git a/src/components/Admin/AIAnalyticsSummary.jsx b/src/components/Admin/AIAnalyticsSummary.jsx index c662c1fe37..818d4277ad 100644 --- a/src/components/Admin/AIAnalyticsSummary.jsx +++ b/src/components/Admin/AIAnalyticsSummary.jsx @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import { Button, Card, Stack, Badge, useToggle, } from '@edx/paragon'; -import { FormattedMessage } from '@edx/frontend-platform/i18n'; +import { FormattedMessage, defineMessages } from '@edx/frontend-platform/i18n'; import { AutoFixHigh, Groups } from '@edx/paragon/icons'; import { sendEnterpriseTrackEvent } from '@edx/frontend-enterprise-utils'; import useAIAnalyticsSummary from '../AIAnalyticsSummary/data/hooks'; @@ -15,33 +15,48 @@ const AnalyticsDetailCard = ({ isLoading, error, data, -}) => ( - - - - - - -

- { + const messages = defineMessages({ + errorMessage: { + id: 'adminPortal.analyticsCardText.errorMessage', + defaultMessage: 'An error occurred: {error_message}', + description: 'Message shown to the user in case of error returned byt analytics API.', + values: { error_message: error?.message }, + }, + noContentErrorMessage: { + id: 'adminPortal.analyticsCardText.noContentErrorMessage', + defaultMessage: 'Analytics not found.', + description: 'Message shown to the user in case of empty response returned byt analytics API.', + }, + }); + + return ( + + + + + + +

+ ${ + error ? ( + + ) : ( + data || + ) } - /> -

- -
- -
-
-); +

+ + + + + + ); +}; AnalyticsDetailCard.propTypes = { onClose: PropTypes.func.isRequired, diff --git a/src/components/learner-credit-management/search/CatalogSearch.jsx b/src/components/learner-credit-management/search/CatalogSearch.jsx index f7174d2cc4..8be6bb4dba 100644 --- a/src/components/learner-credit-management/search/CatalogSearch.jsx +++ b/src/components/learner-credit-management/search/CatalogSearch.jsx @@ -17,16 +17,27 @@ const CatalogSearch = () => { data: subsidyAccessPolicy, } = useSubsidyAccessPolicy(subsidyAccessPolicyId); const searchFilters = `enterprise_catalog_uuids:${ENABLE_TESTING(subsidyAccessPolicy.catalogUuid)} AND content_type:course`; - const displayName = subsidyAccessPolicy.displayName ? `${subsidyAccessPolicy.displayName} catalog` : 'Overview'; return (
- + {( + subsidyAccessPolicy.displayName ? ( + + ) : ( + + ) + )}