Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import classNames from 'classnames';

const DashboardCardTitle: React.FC<DashboardCardTitleProps> = React.memo(
({ className, children }) => (
<h2 className={classNames('co-dashboard-card__title', className)}>{children}</h2>
<h2
data-test="dashboard-card-title"
className={classNames('co-dashboard-card__title', className)}
>
{children}
</h2>
),
);

Expand Down
8 changes: 6 additions & 2 deletions frontend/packages/integration-tests-cypress/support/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ Cypress.Commands.add(
prevSubject: true,
},
(subject) => {
const text = subject.text();
expect(text).to.match(/\[[^a-zA-Z]+\]/);
cy.wrap(subject).each(($el) => {
const text = $el.text();
if (text.length > 0) {
expect(text).to.match(/\[[^a-zA-Z]+\]/);
}
});
Comment on lines +51 to +56
Copy link
Contributor

@yapei yapei Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested this change locally, nice!

},
);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ describe('Localization', () => {
cy.log('test masthead');
cy.visit('/dashboards?pseudolocalization=true&lng=en');
masthead.clickMastheadLink('help-dropdown-toggle');
cy.byTestID('application-launcher-item').isPseudoLocalized();
// wait for both console help menu items and additionalHelpActions items to load
// additionalHelpActions come from ConsoleLinks 'HelpMenu' yaml and are not translated
cy.get('.pf-c-app-launcher__group').should('have.length', 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should open a Bugzilla for the menu items not translated. I think it would be better to move this into console so they can be translated instead of leaving them as ConsoleLink resources, although it will require some operator changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// only test console help items which are translated
cy.get('.pf-c-app-launcher__group')
.first()
.within(() => {
cy.get('[role="menuitem"]').isPseudoLocalized();
});
});

it('pseudolocalizes navigation', () => {
Expand All @@ -42,7 +50,10 @@ describe('Localization', () => {
it('pseudolocalizes utilization card', () => {
cy.log('test utilization card components');
cy.visit('/dashboards?pseudolocalization=true&lng=en');
cy.byTestID('utilization-card-item-text').isPseudoLocalized();
cy.byLegacyTestID('utilization-card').within(() => {
cy.byTestID('dashboard-card-title').isPseudoLocalized();
cy.byTestID('utilization-card-item-text').isPseudoLocalized();
});
});

it('pseudolocalizes monitoring pages', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const listPage = {
},
filter: {
byName: (name: string) => {
cy.byLegacyTestID('item-filter').type(name);
cy.byTestID('name-filter-input').type(name);
},
numberOfActiveFiltersShouldBe: (numFilters: number) => {
cy.get("[class='pf-c-toolbar__item pf-m-chip-group']").should('have.length', numFilters);
Expand Down
1 change: 1 addition & 0 deletions frontend/public/components/filter-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ const FilterToolbar_: React.FC<FilterToolbarProps & RouteComponentProps> = (prop
/>
) : (
<TextFilter
data-test="name-filter-input"
value={nameInputText}
onChange={(value: string) => {
setNameInputText(value);
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/masthead-toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class MastheadToolbarContents_ extends React.Component {
_helpActions(additionalHelpActions) {
const { flags, cv, t, fireTelemetryEvent } = this.props;
const helpActions = [];
const reportBugLink = cv && cv.data ? getReportBugLink(cv.data) : null;
const reportBugLink = cv && cv.data ? getReportBugLink(cv.data, t) : null;

helpActions.push({
name: '',
Expand Down
2 changes: 2 additions & 0 deletions frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,8 @@
"VolumeSnapshotContents": "VolumeSnapshotContents",
"ConsolePlugin": "ConsolePlugin",
"ConsolePlugins": "ConsolePlugins",
"Open Support Case with Red Hat": "Open Support Case with Red Hat",
"Report Bug to Red Hat": "Report Bug to Red Hat",
"Loading {{title}} status": "Loading {{title}} status",
"Unsupported": "Unsupported",
"Disable": "Disable",
Expand Down
5 changes: 3 additions & 2 deletions frontend/public/module/k8s/cluster-settings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as _ from 'lodash-es';
import * as semver from 'semver';
import i18next from 'i18next';

import { ClusterVersionModel } from '../../models';
import { referenceForModel } from './k8s';
Expand Down Expand Up @@ -209,11 +210,11 @@ Browser: ${window.navigator.userAgent}
`);
return _.isEmpty(prerelease)
? {
label: 'Open Support Case with Red Hat',
label: i18next.t('public~Open Support Case with Red Hat'),
href: `https://access.redhat.com/support/cases/#/case/new?product=OpenShift%20Container%20Platform&version=${major}.${minor}&clusterId=${cv.spec.clusterID}`,
}
: {
label: 'Report Bug to Red Hat',
label: i18next.t('public~Report Bug to Red Hat'),
href: `https://bugzilla.redhat.com/enter_bug.cgi?product=OpenShift%20Container%20Platform&version=${bugzillaVersion}&cf_environment=${environment}`,
};
};
Expand Down