mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Source default login logo from static files
This commit is contained in:
parent
a28c44e509
commit
c81bc60a33
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@ -7,7 +7,7 @@ import { LoginForm, LoginPage as PFLoginPage } from '@patternfly/react-core';
|
||||
import { RootAPI } from '../../api';
|
||||
import { BrandName } from '../../variables';
|
||||
|
||||
import brandLogo from './brand-logo.svg';
|
||||
const loginLogoSrc = '/static/media/logo-login.svg';
|
||||
|
||||
const LoginPage = styled(PFLoginPage)`
|
||||
& .pf-c-brand {
|
||||
@ -46,11 +46,13 @@ class AWXLogin extends Component {
|
||||
const {
|
||||
data: { custom_logo, custom_login_info },
|
||||
} = await RootAPI.read();
|
||||
const logo = custom_logo ? `data:image/jpeg;${custom_logo}` : brandLogo;
|
||||
const logo = custom_logo
|
||||
? `data:image/jpeg;${custom_logo}`
|
||||
: loginLogoSrc;
|
||||
|
||||
this.setState({ logo, loginInfo: custom_login_info });
|
||||
} catch (err) {
|
||||
this.setState({ logo: brandLogo });
|
||||
this.setState({ logo: loginLogoSrc });
|
||||
} finally {
|
||||
this.setState({ isLoading: false });
|
||||
}
|
||||
|
||||
@ -98,7 +98,8 @@ describe('<Login />', () => {
|
||||
);
|
||||
const { loginHeaderLogo } = await findChildren(loginWrapper);
|
||||
const { alt, src } = loginHeaderLogo.props();
|
||||
expect([alt, src]).toEqual(['AWX', 'brand-logo.svg']);
|
||||
expect(alt).toEqual('AWX');
|
||||
expect(src).toContain('logo-login.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
@ -109,7 +110,8 @@ describe('<Login />', () => {
|
||||
);
|
||||
const { loginHeaderLogo } = await findChildren(loginWrapper);
|
||||
const { alt, src } = loginHeaderLogo.props();
|
||||
expect([alt, src]).toEqual(['AWX', 'brand-logo.svg']);
|
||||
expect(alt).toEqual('AWX');
|
||||
expect(src).toContain('logo-login.svg');
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user