4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 * Created by kkashalk on 11/10/15.
23 // NOTE: THIS FILE HAS BEEN DEPRECATED AND WILL BE REMOVED
27 import utils
from '../libraries/utils'
28 import React
from 'react'
29 import ClassNames
from 'classnames'
30 import PureRenderMixin
from 'react-addons-pure-render-mixin'
31 import RiftHeaderActions
from '../actions/RiftHeaderActions'
32 import RiftHeaderStore
from '../stores/RiftHeaderStore'
34 import '../styles/RiftHeader.scss'
36 const uiTransientState
= {
40 const RiftHeader
= React
.createClass({
41 mixins
: [PureRenderMixin
],
43 return RiftHeaderStore
.getState();
47 componentWillMount() {
50 RiftHeaderStore
.listen(this.onChange
);
51 RiftHeaderStore
.requestLaunchpadConfig();
53 componentDidUpdate() {
55 componentWillUnmount() {
56 if (uiTransientState
.timeoutId
) {
57 clearTimeout(uiTransientState
.timeoutId
);
59 RiftHeaderStore
.unlisten(this.onChange
);
65 onClickOpenDashboard() {
66 RiftHeaderStore
.unlisten(this.onChange
);
67 window
.location
.href
= '//' + window
.location
.hostname
+ ':8000/index.html?api_server=' + utils
.getSearchParams(window
.location
).api_server
+ '#/launchpad/' + utils
.getSearchParams(window
.location
).mgmt_domain_name
;
69 onClickOpenAccounts() {
70 if (uiTransientState
.timeoutId
) {
71 clearTimeout(uiTransientState
.timeoutId
);
73 RiftHeaderStore
.unlisten(this.onChange
);
74 window
.location
.href
= '//' + window
.location
.hostname
+ ':8000/index.html?api_server=' + utils
.getSearchParams(window
.location
).api_server
+ '#/launchpad/' + utils
.getSearchParams(window
.location
).mgmt_domain_name
+ '/cloud-account/dashboard';
78 <header className
="header-app">
79 <h1
>{this.state
.headerTitle
}</h1
>
80 <nav className
="header-nav"> </nav
>
90 export default RiftHeader
;