Skip to content

Commit

Permalink
chore(strings): string fixes for 2.3 (#1015)
Browse files Browse the repository at this point in the history
* string fixes

Signed-off-by: Max Cao <macao@redhat.com>

* rephrase

Signed-off-by: Max Cao <macao@redhat.com>

* fix spaces

Signed-off-by: Max Cao <macao@redhat.com>

---------

Signed-off-by: Max Cao <macao@redhat.com>
  • Loading branch information
maxcao13 authored May 4, 2023
1 parent 96ec510 commit 00e311e
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 74 deletions.
12 changes: 6 additions & 6 deletions locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
"DashboardLayoutCreateModal": {
"CREATE_LAYOUT": "Create Dashboard Layout",
"ERROR": {
"NAME_INVALID": "Name must be alphanumeric and may contain underscores, dashes, and periods.",
"NAME_REQUIRED": "Name is required.",
"NAME_TAKEN": "Name is already in use.",
"NAME_INVALID": "Name must be alphanumeric and can contain underscores, dashes, and periods.",
"NAME_REQUIRED": "Layout name is a mandatory field.",
"NAME_TAKEN": "Specified layout name already exists.",
"NAME_TOO_LONG": "Name must be 20 characters or less."
},
"LABEL": "Create a new dashboard layout",
Expand Down Expand Up @@ -228,7 +228,7 @@
},
"ERROR_BOUNDARY": {
"ERROR_MESSAGE": "Reason: {{message}}",
"RESOLVE_MESSAGE": "Reload the page and try again. If the error still persists, checkout out <issue>{{knownIssue}}</issue> or <report>{{fileReport}}</report>."
"RESOLVE_MESSAGE": "Reload the page and try again. If the error still persists, see the list of <issue>{{knownIssue}}</issue> or <report>{{fileReport}}</report>."
},
"JvmDetailsCard": {
"CARD_DESCRIPTION": "Display details about the selected target JVM.",
Expand Down Expand Up @@ -275,8 +275,8 @@
}
},
"RecordingLabelFields": {
"INVALID_UPLOADS_one": "The following file did not contain valid recording metadata:",
"INVALID_UPLOADS_other": "The following files did not contain valid recording metadata:"
"INVALID_UPLOADS_one": "The file does not contain valid recording metadata:",
"INVALID_UPLOADS_other": "These files do not contain valid recording metadata:"
},
"SETTINGS": {
"AUTO_REFRESH": {
Expand Down
2 changes: 1 addition & 1 deletion src/app/Agent/AgentLiveProbes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
return (
<ErrorView
title={'Error retrieving active probes'}
message={`${errorMessage}. Note: This is commonly caused by the agent not being loaded/active, check that the target was started with the agent (-javaagent:/path/to/agent.jar).`}
message={`${errorMessage}. Note: This error is generally caused when the agent is not loaded or is not active. Check that the target was started with the agent (-javaagent:/path/to/agent.jar).`}
retry={isAuthFail(errorMessage) ? authRetry : undefined}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/Agent/AgentProbeTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
return (
<ErrorView
title={'Error retrieving probe templates'}
message={`${errorMessage}. Note: This is commonly caused by the agent not being loaded/active. Check that the target was started with the agent (-javaagent:/path/to/agent.jar).`}
message={`${errorMessage}. Note: This error is generally caused when the agent is not loaded or is not active. Check that the target was started with the agent (-javaagent:/path/to/agent.jar).`}
/>
);
} else if (isLoading) {
Expand Down
16 changes: 8 additions & 8 deletions src/app/CreateRecording/CustomRecordingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export const CustomRecordingForm: React.FC<CustomRecordingFormProps> = ({ prefil
setRecordingOptions(recordingOptions);
},
error: (error) => {
setErrorMessage(isTargetAgentHttp(target) ? 'Unsupported operation: Create Recordings' : error.message); // If both throw, first error will be shown
setErrorMessage(isTargetAgentHttp(target) ? 'Unsupported operation: Create recordings' : error.message); // If both throw, first error will be shown
setTemplates([]);
setTemplate({});
setRecordingOptions({});
Expand Down Expand Up @@ -406,15 +406,15 @@ export const CustomRecordingForm: React.FC<CustomRecordingFormProps> = ({ prefil
<>
<Text component={TextVariants.small}>
JDK Flight Recordings are compact records of events which have occurred within the target JVM. Many event types
are built-in to the JVM itself, while others are user-defined.
are built in to the JVM itself, while others are user defined.
</Text>
<Form isHorizontal>
<FormGroup
label="Name"
isRequired
fieldId="recording-name"
helperText="Enter a recording name. This will be unique within the target JVM"
helperTextInvalid="A recording name may only contain letters, numbers, and underscores"
helperText="Enter a recording name. This will be unique within the target JVM."
helperTextInvalid="A recording name can contain only letters, numbers, and underscores."
validated={nameValid}
>
<TextInput
Expand Down Expand Up @@ -445,12 +445,12 @@ export const CustomRecordingForm: React.FC<CustomRecordingFormProps> = ({ prefil
validated={durationValid}
helperText={
continuous
? 'A continuous recording will never be automatically stopped'
? 'A continuous recording will never be automatically stopped.'
: archiveOnStop
? 'Time before the recording is automatically stopped and copied to archive'
: 'Time before the recording is automatically stopped'
? 'Time before the recording is automatically stopped and copied to archive.'
: 'Time before the recording is automatically stopped.'
}
helperTextInvalid="A recording may only have a positive integer duration"
helperTextInvalid="The recording duration must be a positive integer."
data-quickstart-id="crf-duration"
>
<Split hasGutter>
Expand Down
2 changes: 1 addition & 1 deletion src/app/ErrorView/ErrorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { Button, EmptyState, EmptyStateBody, EmptyStateIcon, Title, StackItem, S
import { ExclamationCircleIcon } from '@patternfly/react-icons';
import * as React from 'react';

export const authFailMessage = 'Auth failure';
export const authFailMessage = 'Authentication failure';

export const missingSSLMessage = 'Bad Gateway';

Expand Down
2 changes: 1 addition & 1 deletion src/app/Login/ConnectionError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ConnectionError = () => (
<EmptyState>
<EmptyStateIcon variant="container" component={ExclamationCircleIcon} />
<Title size="lg" headingLevel="h4">
Unable to connect
Unable to connect to the server
</Title>
<EmptyStateBody>Check your connection and reload the page.</EmptyStateBody>
</EmptyState>
Expand Down
4 changes: 2 additions & 2 deletions src/app/Login/OpenShiftPlaceholderAuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ export const OpenShiftPlaceholderAuthForm: React.FunctionComponent<FormProps> =
<EmptyState>
<EmptyStateIcon variant="container" component={LockIcon} />
<Title size="lg" headingLevel="h4">
Access Permissions Needed
Access permissions required
</Title>
<EmptyStateBody>
<Text>
{`To continue, add permissions to your current account or login with a
different account. For more info, see the User Authentication section of the `}
different account. For more information, see the User Authentication section of the `}
</Text>
<Text
component={TextVariants.a}
Expand Down
44 changes: 22 additions & 22 deletions src/app/Modal/DeleteWarningUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,89 +59,89 @@ export interface DeleteOrDisableWarning {

export const DeleteActiveRecordings: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteActiveRecordings,
title: 'Permanently delete Active Recording?',
title: 'Permanently delete your JFR recording?',
label: 'Delete Active Recording',
description: `Recording and report data will be lost.`,
description: `If you click delete, recording and report data will be lost.`,
ariaLabel: 'Recording delete warning',
};

export const DeleteArchivedRecordings: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteArchivedRecordings,
title: 'Permanently delete Archived Recording?',
title: 'Permanently delete your archived JFR recording?',
label: 'Delete Archived Recording',
description: `Recording and report data will be lost.`,
description: `If you click delete, recording and report data will be lost.`,
ariaLabel: 'Recording delete warning',
};

export const DeleteAutomatedRules: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteAutomatedRules,
title: 'Permanently delete Automated Rule?',
title: 'Permanently delete your Automated Rule?',
label: 'Delete Automated Rule',
description: `Rule data will be lost.`,
description: `If you click delete, rule data will be lost.`,
ariaLabel: 'Automated rule delete warning',
};

export const DisableAutomatedRules: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DisableAutomatedRules,
title: 'Disable Automated Rule?',
title: 'Disable your Automated Rule?',
label: 'Disable Automated Rule',
description: `Rule will be disabled.`,
description: `If you click delete, the rule will be disabled.`,
ariaLabel: 'Automated rule disable warning',
};

export const DeleteEventTemplates: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteEventTemplates,
title: 'Permanently delete Event Template?',
title: 'Permanently delete your Event Template?',
label: 'Delete Event Template',
description: `Custom event template data will be lost.`,
description: `If you click delete, custom event template data will be lost.`,
ariaLabel: 'Event template delete warning',
};

export const DeleteProbeTemplates: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteProbeTemplates,
title: 'Permanently delete Probe Template?',
title: 'Permanently delete your Probe Template?',
label: 'Delete Probe Template',
description: `Custom probe template data will be lost.`,
description: `If you click delete, custom probe template data will be lost.`,
ariaLabel: 'Probe template delete warning',
};

export const DeleteActiveProbes: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteActiveProbes,
title: 'Permanently remove Active Probes from the target?',
title: 'Permanently remove your Active Probes from the target?',
label: 'Remove Active Probes',
description: `Active probes will be removed from the target.`,
description: `If you click delete, active probes will be removed from the target.`,
ariaLabel: 'Active Probes remove warning',
};

export const DeleteCredentials: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteCredentials,
title: 'Permanently delete Credentials?',
title: 'Permanently delete your Credentials?',
label: 'Delete Credentials',
description: `Credential data for this target will be lost.`,
description: `If you click delete, credential data for this target will be lost.`,
ariaLabel: 'Credentials delete warning',
};

export const DeleteCustomTargets: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteCustomTargets,
title: 'Permanently delete Custom Target?',
title: 'Permanently delete your Custom Target?',
label: 'Delete Custom Targets',
description: `Custom target information will be lost.`,
description: `If you click delete, custom target information will be lost.`,
ariaLabel: 'Custom Targets delete warning',
};

export const DeleteDashboardLayout: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteDashboardLayout,
title: 'Permanently delete Dashboard Layout?',
title: 'Permanently delete your Dashboard Layout?',
label: 'Delete Dashboard Layouts',
description: `Dashboard layout configuration data will be lost.`,
description: `If you click delete, dashboard layout configuration data will be lost.`,
ariaLabel: 'Dashboard Layout delete warning',
};

export const DeleteLayoutTemplate: DeleteOrDisableWarning = {
id: DeleteOrDisableWarningType.DeleteLayoutTemplate,
title: 'Permanently delete Layout Template?',
title: 'Permanently delete your Layout Template?',
label: 'Delete Layout Template',
description: `Layout template configuration data will be lost.`,
description: `If you click delete, layout template configuration data will be lost.`,
ariaLabel: 'Layout Template delete warning',
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/RecordingMetadata/RecordingLabelFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const RecordingLabelFields: React.FunctionComponent<RecordingLabelFieldsP
>
<HelperText id="label-error-text">
<HelperTextItem variant="error">
Keys must be unique. Labels should not contain whitespace.
Keys must be unique. Labels should not contain empty spaces.
</HelperTextItem>
</HelperText>
</FormHelperText>
Expand Down
6 changes: 3 additions & 3 deletions src/app/Rules/CreateRule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const CreateRuleForm: React.FC<CreateRuleFormProps> = ({ ...props }) => {
if (typeof res === 'boolean') {
return res;
}
throw new Error('Invalid match expression');
throw new Error('The expression matching failed.');
});
validation = matches.length ? ValidatedOptions.success : ValidatedOptions.warning;
} catch (err) {
Expand Down Expand Up @@ -337,7 +337,7 @@ const CreateRuleForm: React.FC<CreateRuleFormProps> = ({ ...props }) => {
isRequired
fieldId="rule-name"
helperText="Enter a rule name."
helperTextInvalid="A rule name may only contain letters, numbers, and underscores."
helperTextInvalid="A rule name can contain only letters, numbers, and underscores."
validated={nameValid}
data-quickstart-id="rule-name"
>
Expand Down Expand Up @@ -403,7 +403,7 @@ const CreateRuleForm: React.FC<CreateRuleFormProps> = ({ ...props }) => {
Enter a match expression. This is a Java-like code snippet that is evaluated against each target
application to determine whether the rule should be applied.`
}
helperTextInvalid="Invalid Match Expression."
helperTextInvalid="The expression matching failed."
validated={matchExpressionValid}
data-quickstart-id="rule-matchexpr"
>
Expand Down
4 changes: 2 additions & 2 deletions src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const AuthForm: React.FC<AuthFormProps> = ({ onDismiss, onPropsSave, prog
if (typeof res === 'boolean') {
return res;
}
throw new Error('Invalid match expression');
throw new Error('The expression matching failed.');
});
validation = atLeastOne ? ValidatedOptions.success : ValidatedOptions.warning;
} catch (err) {
Expand Down Expand Up @@ -248,7 +248,7 @@ export const AuthForm: React.FC<AuthFormProps> = ({ onDismiss, onPropsSave, prog
Enter a match expression. This is a Java-like code snippet that is evaluated against each target
application to determine whether the rule should be applied.`
}
helperTextInvalid="Invalid Match Expression."
helperTextInvalid="IThe expression matching failed."
validated={matchExpressionValid}
>
<TextArea
Expand Down
1 change: 0 additions & 1 deletion src/app/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import {
TabTitleText,
Title,
} from '@patternfly/react-core';
import { css } from '@patternfly/react-styles';
import * as React from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { useHistory, useLocation } from 'react-router-dom';
Expand Down
4 changes: 2 additions & 2 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export class ApiService {
if (resp.status == 202) {
this.notifications.warning(
'Snapshot Failed to Create',
'The resultant recording was unreadable for some reason, likely due to a lack of Active, non-Snapshot source recordings to take event data from'
'The recording is not readable for reasons, such as, unavailability of active and non-snapshot source recordings from where the event data is read.'
);
}
}),
Expand Down Expand Up @@ -1219,7 +1219,7 @@ export class ApiService {
return { error: new Error('Invalid username or password.'), severeLevel: ValidatedOptions.error };
case 'NA':
return {
error: new Error('This target does not have authentication enabled.'),
error: new Error('The target does not have authentication enabled.'),
severeLevel: ValidatedOptions.warning,
};
case 'SUCCESS':
Expand Down
8 changes: 4 additions & 4 deletions src/app/Shared/Services/Report.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ export enum AutomatedAnalysisScore {
RED_SCORE_THRESHOLD = 75,
}

export const FAILED_REPORT_MESSAGE = 'Failed to load report from recording. Request entity too large.';
export const NO_RECORDINGS_MESSAGE =
'No active or archived recordings available. Please create a recording for analysis.';
export const FAILED_REPORT_MESSAGE =
'Failed to load the report from recording because the requested entity is too large.';
export const NO_RECORDINGS_MESSAGE = 'No active or archived recordings available. Create a new recording for analysis.';
export const RECORDING_FAILURE_MESSAGE = 'Failed to start recording for analysis.';
export const TEMPLATE_UNSUPPORTED_MESSAGE = 'Template type unsupported on this JVM.';
export const TEMPLATE_UNSUPPORTED_MESSAGE = 'The template type used in this recording is not supported on this JVM.';
2 changes: 1 addition & 1 deletion src/app/Topology/Actions/CreateTarget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export const SampleNodeDonut: React.FC<SampleNodeDonutProps> = ({
{validation.option === ValidatedOptions.error && (
<FormAlert>
<Alert aria-live="polite" isInline title={validation.errorMessage} variant="danger">
{'Please check if the Connection URL is valid. Provide any credentials if needed.'}
{'Check if the connection URL is valid. Specify the correct credentials in case of authentication failure.'}
</Alert>
</FormAlert>
)}
Expand Down
7 changes: 4 additions & 3 deletions src/app/Topology/Shared/TopologyExceedLimitState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ export const TopologyExceedLimitState: React.FC<TopologyExceedLimitStateProps> =
<Bullseye {...props}>
<EmptyState>
<EmptyStateIcon variant="container" component={TopologyIcon} />
<Title headingLevel="h4">Loading is taking longer than expected</Title>
<Title headingLevel="h4">Loading of application topology is taking longer than expected</Title>
<EmptyStateBody>
We noticed that it is taking a long time to visualize your application Topology. You can use filters to select
a smaller subset of target or click Continue to keep waiting.
We are working on loading the topology of your applications. Since the data to be displayed is large, the
rendering is taking more time. To see a smaller subset of your applications, use the filters to select the
parameters or click Continue to keep waiting.
</EmptyStateBody>
<EmptyStateSecondaryActions>
<Button variant="link" onClick={onShowTopologyAnyway}>
Expand Down
3 changes: 2 additions & 1 deletion src/test/CreateRecording/CustomRecordingForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* SOFTWARE.
*/
import { CustomRecordingForm } from '@app/CreateRecording/CustomRecordingForm';
import { authFailMessage } from '@app/ErrorView/ErrorView';
import { NotificationsContext, NotificationsInstance } from '@app/Notifications/Notifications';
import { EventTemplate, RecordingAttributes, RecordingOptions } from '@app/Shared/Services/Api.service';
import { ServiceContext, Services, defaultServices } from '@app/Shared/Services/Services';
Expand Down Expand Up @@ -186,7 +187,7 @@ describe('<CustomRecordingForm />', () => {
expect(failTitle).toBeInTheDocument();
expect(failTitle).toBeVisible();

const authFailText = screen.getByText('Auth failure');
const authFailText = screen.getByText(authFailMessage);
expect(authFailText).toBeInTheDocument();
expect(authFailText).toBeVisible();

Expand Down
3 changes: 2 additions & 1 deletion src/test/CreateRecording/SnapshotRecordingForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*/

import { SnapshotRecordingForm } from '@app/CreateRecording/SnapshotRecordingForm';
import { authFailMessage } from '@app/ErrorView/ErrorView';
import { NotificationsContext, NotificationsInstance } from '@app/Notifications/Notifications';
import { ServiceContext, Services, defaultServices } from '@app/Shared/Services/Services';
import { TargetService } from '@app/Shared/Services/Target.service';
Expand Down Expand Up @@ -116,7 +117,7 @@ describe('<SnapshotRecordingForm />', () => {
expect(failTitle).toBeInTheDocument();
expect(failTitle).toBeVisible();

const authFailText = screen.getByText('Auth failure');
const authFailText = screen.getByText(authFailMessage);
expect(authFailText).toBeInTheDocument();
expect(authFailText).toBeVisible();

Expand Down
Loading

0 comments on commit 00e311e

Please sign in to comment.