|
|
@@ -7,8 +7,8 @@ import { getNavModel } from 'app/core/selectors/navModel';
|
|
|
import { getApiKeys, getApiKeysCount } from './state/selectors';
|
|
|
import { loadApiKeys, deleteApiKey, setSearchQuery, addApiKey } from './state/actions';
|
|
|
import PageHeader from 'app/core/components/PageHeader/PageHeader';
|
|
|
-import SlideDown from 'app/core/components/Animations/SlideDown';
|
|
|
import PageLoader from 'app/core/components/PageLoader/PageLoader';
|
|
|
+import SlideDown, { defaultStyle as slideDownDefaultStyle } from 'app/core/components/Animations/SlideDown';
|
|
|
import ApiKeysAddedModal from './ApiKeysAddedModal';
|
|
|
import config from 'app/core/config';
|
|
|
import appEvents from 'app/core/app_events';
|
|
|
@@ -105,21 +105,24 @@ export class ApiKeysPage extends PureComponent<Props, any> {
|
|
|
};
|
|
|
|
|
|
renderEmptyList() {
|
|
|
+ const { isAdding } = this.state;
|
|
|
return (
|
|
|
<div className="page-container page-body">
|
|
|
- <EmptyListCTA
|
|
|
- model={{
|
|
|
- title: "You haven't added any API Keys yet.",
|
|
|
- buttonIcon: 'fa fa-plus',
|
|
|
- buttonLink: '#',
|
|
|
- onClick: this.onToggleAdding,
|
|
|
- buttonTitle: ' New API Key',
|
|
|
- proTip: 'Remember you can provide view-only API access to other applications.',
|
|
|
- proTipLink: '',
|
|
|
- proTipLinkTitle: '',
|
|
|
- proTipTarget: '_blank',
|
|
|
- }}
|
|
|
- />
|
|
|
+ {!isAdding && (
|
|
|
+ <EmptyListCTA
|
|
|
+ model={{
|
|
|
+ title: "You haven't added any API Keys yet.",
|
|
|
+ buttonIcon: 'fa fa-plus',
|
|
|
+ buttonLink: '#',
|
|
|
+ onClick: this.onToggleAdding,
|
|
|
+ buttonTitle: ' New API Key',
|
|
|
+ proTip: 'Remember you can provide view-only API access to other applications.',
|
|
|
+ proTipLink: '',
|
|
|
+ proTipLinkTitle: '',
|
|
|
+ proTipTarget: '_blank',
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{this.renderAddApiKeyForm()}
|
|
|
</div>
|
|
|
);
|
|
|
@@ -127,9 +130,10 @@ export class ApiKeysPage extends PureComponent<Props, any> {
|
|
|
|
|
|
renderAddApiKeyForm() {
|
|
|
const { newApiKey, isAdding } = this.state;
|
|
|
+ const slideDownStyle = isAdding ? slideDownDefaultStyle : { ...slideDownDefaultStyle, transition: 'unset' };
|
|
|
|
|
|
return (
|
|
|
- <SlideDown in={isAdding}>
|
|
|
+ <SlideDown in={isAdding} style={slideDownStyle}>
|
|
|
<div className="cta-form">
|
|
|
<button className="cta-form__close btn btn-transparent" onClick={this.onToggleAdding}>
|
|
|
<i className="fa fa-close" />
|