Browse Source

SONAR-12829 Fix error message when encountering a license issue

tags/8.2.0.32929
Wouter Admiraal 4 years ago
parent
commit
bb62fc4a72

+ 6
- 2
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavLicenseNotif.tsx View File

import * as React from 'react'; import * as React from 'react';
import { Link } from 'react-router'; import { Link } from 'react-router';
import { Alert } from 'sonar-ui-common/components/ui/Alert'; import { Alert } from 'sonar-ui-common/components/ui/Alert';
import { translate } from 'sonar-ui-common/helpers/l10n';
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { isValidLicense } from '../../../../api/marketplace'; import { isValidLicense } from '../../../../api/marketplace';
import { withAppState } from '../../../../components/hoc/withAppState'; import { withAppState } from '../../../../components/hoc/withAppState';
import { ComponentQualifier } from '../../../../types/component';


interface Props { interface Props {
appState: Pick<T.AppState, 'canAdmin'>; appState: Pick<T.AppState, 'canAdmin'>;
if (isValidLicense && currentTask.errorType !== 'LICENSING_LOC') { if (isValidLicense && currentTask.errorType !== 'LICENSING_LOC') {
return ( return (
<Alert display="banner" variant="error"> <Alert display="banner" variant="error">
{translate('component_navigation.status.last_blocked_due_to_bad_license')}
{translateWithParameters(
'component_navigation.status.last_blocked_due_to_bad_license_X',
translate('qualifier', currentTask.componentQualifier || ComponentQualifier.Project)
)}
</Alert> </Alert>
); );
} }

+ 1
- 1
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavLicenseNotif-test.tsx.snap View File

display="banner" display="banner"
variant="error" variant="error"
> >
component_navigation.status.last_blocked_due_to_bad_license
component_navigation.status.last_blocked_due_to_bad_license_X.qualifier.TRK
</Alert> </Alert>
`; `;



+ 1
- 1
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

component_navigation.status.in_progress_X=The {type} is in progress. component_navigation.status.in_progress_X=The {type} is in progress.
component_navigation.status.in_progress.admin=A background task is in progress. More details available on the {url} page. component_navigation.status.in_progress.admin=A background task is in progress. More details available on the {url} page.
component_navigation.status.in_progress_X.admin=The {type} is in progress. More details available on the {url} page. component_navigation.status.in_progress_X.admin=The {type} is in progress. More details available on the {url} page.
component_navigation.status.last_blocked_due_to_bad_license=Last analysis blocked due to an invalid license, which has since been corrected. Please reanalyze this project.
component_navigation.status.last_blocked_due_to_bad_license_X=Last analysis blocked due to an invalid license, which has since been corrected. Please reanalyze this {0}.


component_navigation.last_analysis_had_warnings=Last analysis had {warnings} component_navigation.last_analysis_had_warnings=Last analysis had {warnings}
component_navigation.x_warnings={warningsCount} {warningsCount, plural, one {warning} other {warnings}} component_navigation.x_warnings={warningsCount} {warningsCount, plural, one {warning} other {warnings}}

Loading…
Cancel
Save