3 * Copyright 2016 RIFT.IO Inc
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 * Created by kkashalk on 11/10/15.
22 // NOTE: THIS FILE HAS BEEN DEPRECATED AND WILL BE REMOVED
26 import alt
from '../alt'
27 import React
from 'react'
28 import utils
from '../libraries/utils'
29 import RiftHeaderActions
from '../actions/RiftHeaderActions'
30 import RiftHeaderSource
from '../sources/RiftHeaderSource'
31 import CatalogDataSource
from '../sources/CatalogDataSource'
32 import CatalogDataSourceActions
from '../actions/CatalogDataSourceActions'
34 class RiftHeaderStore
{
37 let mgmt_domain_name
= unescape(utils
.getSearchParams(window
.location
).mgmt_domain_name
);
38 if(mgmt_domain_name
.toUpperCase() == 'DASHBOARD' || mgmt_domain_name
.toUpperCase() == 'UNDEFINED') {
39 mgmt_domain_name
= '';
41 mgmt_domain_name
= ' : ' + mgmt_domain_name
;
43 this.headerTitle
= 'Launchpad' + mgmt_domain_name
;
45 this.isStandAlone
= false;
46 this.registerAsync(CatalogDataSource
);
47 this.registerAsync(RiftHeaderSource
);
48 this.bindAction(CatalogDataSourceActions
.LOAD_CATALOGS_SUCCESS
, this.loadCatalogsSuccess
);
49 this.bindActions(RiftHeaderActions
);
51 requestLaunchpadConfigSuccess(data
) {
54 headerTitle
: 'Launchpad'
57 loadCatalogsSuccess(data
) {
59 let descriptorCount
= 0;
60 data
.data
.forEach((catalog
) => {
61 descriptorCount
+= catalog
.descriptors
.length
;
65 descriptorCount
: descriptorCount
70 export default alt
.createStore(RiftHeaderStore
, 'RiftHeaderStore');