• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geosolutions-it / MapStore2 / 19710972030

26 Nov 2025 03:38PM UTC coverage: 76.665% (-0.3%) from 76.929%
19710972030

Pull #11119

github

web-flow
Fix maven publish (#11739)
Pull Request #11119: Layer Selection Plugin on ArcGIS, WFS & WMS layers

32272 of 50209 branches covered (64.28%)

3 of 3 new or added lines in 2 files covered. (100.0%)

3018 existing lines in 249 files now uncovered.

40157 of 52380 relevant lines covered (76.66%)

37.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.35
/web/client/components/app/StandardContainer.jsx
1
/*
2
 * Copyright 2018, GeoSolutions Sas.
3
 * All rights reserved.
4
 *
5
 * This source code is licensed under the BSD-style license found in the
6
 * LICENSE file in the root directory of this source tree.
7
*/
8

9
import PropTypes from 'prop-types';
10
import React from 'react';
11
import { connect } from 'react-redux';
12

13
import Debug from '../development/Debug';
14
import Localized from '../I18N/Localized';
15
import ThemeComp from '../theme/Theme';
16

17
const Theme = connect((state) => ({
16✔
18
    theme: state.theme && state.theme.selectedTheme && state.theme.selectedTheme.id
30!
19
}), {}, (stateProps, dispatchProps, ownProps) => {
20
    return Object.assign({}, stateProps, dispatchProps, ownProps);
7✔
21
})(ThemeComp);
22

23
class StandardContainer extends React.Component {
24
    static propTypes = {
1✔
25
        plugins: PropTypes.object,
26
        locale: PropTypes.object,
27
        componentConfig: PropTypes.object,
28
        className: PropTypes.string,
29
        themeCfg: PropTypes.object,
30
        version: PropTypes.string,
31
        loadAfterTheme: PropTypes.bool
32
    };
33

34
    static defaultProps = {
1✔
35
        plugins: {},
36
        locale: {messages: {}, current: 'en-US'},
37
        className: "fill",
38
        themeCfg: {
39
            path: 'dist/themes'
40
        },
41
        loadAfterTheme: false
42
    };
43
    state = {
5✔
44
        themeLoaded: false
45
    }
46
    renderComponent = () => {
5✔
47
        const {componentConfig} = this.props;
12✔
48
        if (!componentConfig) {
12!
UNCOV
49
            return null;
×
50
        }
51
        const Component = componentConfig.component;
12✔
52
        const config = componentConfig.config || {};
12✔
53
        return (<Component {...config} plugins={this.props.plugins}/>);
12✔
54
    };
55

56
    renderAfterTheme() {
UNCOV
57
        return (
×
58
            <div className={this.props.className}>
59
                <Theme {...this.props.themeCfg} version={this.props.version} onLoad={this.themeLoaded}>
60
                    {this.state.themeLoaded ? (<Localized messages={this.props.locale.messages} locale={this.props.locale.current} loadingError={this.props.locale.localeError}>
×
61
                        {this.renderComponent()}
62
                    </Localized>) :
63
                        (<span><div className="_ms2_init_spinner _ms2_init_center"><div></div></div>
64
                            <div className="_ms2_init_text _ms2_init_center">Loading MapStore</div></span>)}
65
                </Theme>
66
                <Debug/>
67
            </div>
68
        );
69
    }
70
    renderWithTheme() {
71
        return (
12✔
72
            <div className={this.props.className}>
73
                <Theme {...this.props.themeCfg} version={this.props.version}/>
74
                <Localized messages={this.props.locale.messages} locale={this.props.locale.current} loadingError={this.props.locale.localeError}>
75
                    {this.renderComponent()}
76
                </Localized>
77
                <Debug/>
78
            </div>);
79
    }
80
    render() {
81
        return this.props.loadAfterTheme ? this.renderAfterTheme() : this.renderWithTheme();
12!
82
    }
83
    themeLoaded = () => {
5✔
UNCOV
84
        this.setState({
×
85
            themeLoaded: true
86
        });
87
    }
88
}
89

90
export default StandardContainer;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc