Skip to content

Commit 5c5eec9

Browse files
committed
fix editing asks
Issue: AAH-2172
1 parent fa0122d commit 5c5eec9

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/containers/landing/landing-page.tsx

+19-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import {
99
closeAlertMixin,
1010
} from 'src/components';
1111
import { AppContext } from 'src/loaders/app-context';
12+
import { Paths, formatPath } from 'src/paths';
1213
import { RouteProps, withRouter } from 'src/utilities';
1314
import './landing-page.scss';
1415

1516
interface IState {
1617
alerts: AlertType[];
18+
redirect: boolean;
1719
}
1820

1921
export class LandingPage extends React.Component<RouteProps, IState> {
@@ -22,11 +24,24 @@ export class LandingPage extends React.Component<RouteProps, IState> {
2224

2325
this.state = {
2426
alerts: [],
27+
redirect: false,
2528
};
2629
}
2730

31+
componentDidMount() {
32+
const { ai_deny_index } = this.context.featureFlags;
33+
if (!ai_deny_index) {
34+
this.setState({ redirect: true });
35+
}
36+
}
37+
2838
render() {
29-
const { alerts } = this.state;
39+
const { alerts, redirect } = this.state;
40+
41+
if (redirect) {
42+
setTimeout(() => this.props.navigate(formatPath(Paths.collections)));
43+
return null;
44+
}
3045

3146
return (
3247
<React.Fragment>
@@ -66,7 +81,8 @@ export class LandingPage extends React.Component<RouteProps, IState> {
6681
your Ansible host using{' '}
6782
<a
6883
href='https://docs.ansible.com/ansible/latest/reference_appendices/galaxy.html#the-command-line-tool'
69-
target='_blanck'
84+
target='_blank'
85+
rel='noreferrer'
7086
>
7187
ansible-galaxy
7288
</a>
@@ -94,7 +110,7 @@ export class LandingPage extends React.Component<RouteProps, IState> {
94110
target='_blank'
95111
rel='noopener noreferrer'
96112
>
97-
Project Wisdom
113+
Ansible Lightspeed
98114
</a>{' '}
99115
to help other automators build Ansible content. Your roles
100116
and collections may be used as training data for a machine

0 commit comments

Comments
 (0)