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

geosolutions-it / MapStore2 / 19668982994

25 Nov 2025 12:08PM UTC coverage: 76.663% (-0.1%) from 76.758%
19668982994

Pull #11725

github

web-flow
Merge b651fa3a4 into 15cf36181
Pull Request #11725: Disable tests that randomly fail on jenkins CI

32265 of 50209 branches covered (64.26%)

40156 of 52380 relevant lines covered (76.66%)

37.95 hits per line

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

90.0
/web/client/components/resources/modals/enhancers/handlePermission.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 { branch, compose, mapPropsStream, withStateHandlers } from 'recompose';
10
import Rx from 'rxjs';
11

12
import GeoStoreDAO from '../../../../api/GeoStoreDAO';
13

14
/**
15
 * retrieves groups for permission handling and returns as props
16
 * @deprecated
17
 * @param {Object} API the API to use
18
 */
19
const retrieveGroups = (API) =>
1✔
20
    mapPropsStream(props$ =>
4✔
21
        props$.combineLatest(
3✔
22
            props$
23
                .take(1)
24
                .switchMap(({ user }) =>
25
                    Rx.Observable.defer(() => API.getAvailableGroups(user))
3✔
26
                        .map(availableGroups => ({ availableGroups }))
2✔
27
                        .startWith({ loading: true })
28
                )
29
                .startWith({})
30
                .catch( () => Rx.Observable.of({})),
×
31
            (props, overrides) => ({
9✔
32
                ...props,
33
                ...overrides
34
            })
35
        )
36
    );
37

38
/**
39
 * retrieves permission for the resource
40
 * @deprecated
41
 * @param {object} API the API to use
42
 */
43
const retrievePermission = (API) =>
1✔
44
    mapPropsStream(props$ =>
4✔
45
        props$.combineLatest(
3✔
46
            props$
47
            // trigger when resource changes
48
                .distinctUntilKeyChanged('resource')
49
                .pluck('resource')
50
                .filter(resource => resource.id)
4✔
51
                .pluck('id')
52
                .distinctUntilChanged()
53
                .switchMap(id =>
54
                    Rx.Observable.defer(() => API.getResourcePermissions(id))
1✔
55
                        .map(rules => ({ rules }))
1✔
56
                        .startWith({ loading: true })
57
                )
58
                .startWith({})
59
                .catch(() => Rx.Observable.of({})),
1✔
60
            (props, overrides) => ({
9✔
61
                ...props,
62
                ...overrides
63
            })
64
        )
65
    );
66
const manageLocalPermissionChanges = withStateHandlers(
1✔
67
    () => ({}),
3✔
68
    {
69
        onUpdateRules: () => (rules) => ({
×
70
            rules: rules
71
        })
72
    }
73
);
74
/**
75
 * @deprecated
76
 */
77
export default ( API = GeoStoreDAO ) => branch(
4✔
78
    ({ disablePermission }) => !disablePermission,
5✔
79
    compose(
80
        retrieveGroups(API),
81
        retrievePermission(API),
82
        manageLocalPermissionChanges
83
    )
84
);
85

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