update language and stylign for all warning/danger modals

This commit is contained in:
John Mitchell
2019-04-08 14:10:06 -04:00
parent fa232a94bd
commit 81267c7212
4 changed files with 40 additions and 14 deletions

View File

@@ -4,6 +4,8 @@ import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import { i18nMark } from '@lingui/react';
import { withRootDialog } from './RootDialog';
import APIClient from '../api';
@@ -37,7 +39,7 @@ class prov extends Component {
}
history.replace('/login');
setRootDialogMessage({
bodyText: 'You have been logged out.',
bodyText: i18nMark('You have been logged out.')
});
}
@@ -49,8 +51,8 @@ class prov extends Component {
}
history.replace('/home');
setRootDialogMessage({
title: '404',
bodyText: 'Cannot find resource.',
title: i18nMark('404'),
bodyText: i18nMark('Cannot find resource.'),
variant: 'warning'
});
}

View File

@@ -1,6 +1,7 @@
import React, { Component, Fragment } from 'react';
import { Route, withRouter, Switch } from 'react-router-dom';
import { i18nMark } from '@lingui/react';
import { Trans } from '@lingui/macro';
import { NetworkProvider } from '../../contexts/Network';
import { withRootDialog } from '../../contexts/RootDialog';
@@ -62,7 +63,13 @@ class Organizations extends Component {
history.replace('/organizations');
setRootDialogMessage({
title: '404',
bodyText: `Cannot find organization with ID ${newRouteMatch.params.id}.`,
bodyText: (
<Trans>
Cannot find organization with ID
<strong>{` ${newRouteMatch.params.id}`}</strong>
.
</Trans>
),
variant: 'warning'
});
}}

View File

@@ -7,7 +7,7 @@ import {
} from '@patternfly/react-core';
import { I18n, i18nMark } from '@lingui/react';
import { t } from '@lingui/macro';
import { t, Trans } from '@lingui/macro';
import {
Link
@@ -257,16 +257,33 @@ class OrganizationAccessList extends React.Component {
let warningMsg;
if (type === 'users') {
warningTitle = i18nMark('User Access Removal');
warningMsg = i18nMark(`Please confirm that you would like to remove ${roleName}
access from ${resourceName}.`);
warningTitle = i18nMark('Remove User Access');
warningMsg = (
<Trans>
Are you sure you want to remove
<b>{` ${roleName} `}</b>
access from
<strong>{` ${resourceName}`}</strong>
?
</Trans>
);
}
if (type === 'teams') {
warningTitle = i18nMark('Team Access Removal');
warningMsg = i18nMark(`Please confirm that you would like to remove ${roleName}
access from the team ${resourceName}. This will affect all
members of the team. If you would like to only remove access
for this particular user, please remove them from the team.`);
warningTitle = i18nMark('Remove Team Access');
warningMsg = (
<Trans>
Are you sure you want to remove
<b>{` ${roleName} `}</b>
access from
<b>{` ${resourceName}`}</b>
? Doing so affects all members of the team.
<br />
<br />
If you
<b><i> only </i></b>
want to remove access for this particular user, please remove them from the team.
</Trans>
);
}
this.setState({

View File

@@ -153,7 +153,7 @@ class OrganizationsList extends Component {
handleOpenOrgDeleteModal () {
const { results, selected } = this.state;
const warningTitle = i18nMark('Delete Organization');
const warningTitle = i18nMark(`Delete Organization${selected.length > 1 ? 's' : ''}`);
const warningMsg = i18nMark('Are you sure you want to delete:');
const orgsToDelete = [];