2 * ============LICENSE_START========================================================================
\r
3 * ONAP : ccsdk feature sdnr wt odlux
\r
4 * =================================================================================================
\r
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
\r
6 * =================================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
\r
8 * in compliance with the License. You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
\r
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
\r
14 * or implied. See the License for the specific language governing permissions and limitations under
\r
16 * ============LICENSE_END==========================================================================
\r
18 /******************************************************************************
\r
19 * Copyright 2018 highstreet technologies GmbH
\r
21 * Licensed under the Apache License, Version 2.0 (the "License");
\r
22 * you may not use this file except in compliance with the License.
\r
23 * You may obtain a copy of the License at
\r
25 * http://www.apache.org/licenses/LICENSE-2.0
\r
27 * Unless required by applicable law or agreed to in writing, software
\r
28 * distributed under the License is distributed on an "AS IS" BASIS,
\r
29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
30 * See the License for the specific language governing permissions and
\r
31 * limitations under the License.
\r
32 *****************************************************************************/
\r
34 import * as React from 'react';
\r
35 import * as ReactDOM from 'react-dom';
\r
37 import { MuiThemeProvider } from '@material-ui/core/styles';
\r
39 import { Frame } from './views/frame';
\r
41 import { AddErrorInfoAction } from './actions/errorActions';
\r
43 import { applicationStoreCreator } from './store/applicationStore';
\r
44 import { ApplicationStoreProvider } from './flux/connect';
\r
46 import { startHistoryListener } from './middleware/navigation';
\r
47 import { startRestService } from './services/restService';
\r
50 import theme from './design/default';
\r
51 import '!style-loader!css-loader!./app.css';
\r
52 import { ReplaceAction } from './actions/navigationActions';
\r
53 import { startForceLogoutService } from './services/forceLogoutService';
\r
54 import { startNotificationService } from './services/notificationService';
\r
56 declare module '@material-ui/core/styles/createMuiTheme' {
\r
61 url: string, // image url of a company logo, which will be presented in the ui header
\r
62 height: number, // image height [px] as delivered by the url
\r
63 width: number, // image width [px] as delivered by the url
\r
64 logoHeight: number // height in [px] of the logo (see url) within the ui header
\r
70 interface ThemeOptions {
\r
75 export const runApplication = () => {
\r
76 const applicationStore = applicationStoreCreator();
\r
78 window.onerror = function (msg: string, url: string, line: number, col: number, error: Error) {
\r
79 // Note that col & error are new to the HTML 5 spec and may not be
\r
80 // supported in every browser. It worked for me in Chrome.
\r
81 var extra = !col ? '' : '\ncolumn: ' + col;
\r
82 extra += !error ? '' : '\nerror: ' + error;
\r
84 // You can view the information in an alert to see things working like this:
\r
85 applicationStore.dispatch(new AddErrorInfoAction({ error, message: msg, url, line, col, info: { extra } }));
\r
87 var suppressErrorAlert = true;
\r
88 // If you return true, then error alerts (like in older versions of
\r
89 // Internet Explorer) will be suppressed.
\r
90 return suppressErrorAlert;
\r
93 startRestService(applicationStore);
\r
94 startHistoryListener(applicationStore);
\r
95 startForceLogoutService(applicationStore);
\r
96 startNotificationService(applicationStore);
\r
98 const App = (): JSX.Element => (
\r
99 <ApplicationStoreProvider applicationStore={applicationStore} >
\r
100 <MuiThemeProvider theme={theme}>
\r
102 </MuiThemeProvider>
\r
103 </ApplicationStoreProvider>
\r
106 ReactDOM.render(<App />, document.getElementById('app'));
\r