orc-shared 5.7.0-dev.13 → 5.7.0-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/actions/requestsApi.js +743 -140
  2. package/dist/actions/scopes.js +25 -1
  3. package/dist/buildStore.js +2 -0
  4. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +7 -3
  5. package/dist/components/MaterialUI/Inputs/InputBase.js +6 -1
  6. package/dist/components/Provision.js +2 -1
  7. package/dist/components/ScopeExtendedConfigurationLoader.js +83 -0
  8. package/dist/content/icons/orckestra-icon.svg +11 -5
  9. package/dist/reducers/scopesExtendedConfiguration.js +68 -0
  10. package/dist/selectors/scopeExtendedConfiguration.js +56 -0
  11. package/package.json +1 -1
  12. package/src/actions/requestsApi.js +511 -89
  13. package/src/actions/scopes.js +25 -1
  14. package/src/actions/scopes.test.js +34 -0
  15. package/src/buildStore.js +2 -0
  16. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +9 -3
  17. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +29 -0
  18. package/src/components/MaterialUI/Inputs/InputBase.js +8 -5
  19. package/src/components/MaterialUI/Inputs/InputBase.test.js +160 -110
  20. package/src/components/Provision.js +2 -0
  21. package/src/components/Provision.test.js +7 -0
  22. package/src/components/ScopeExtendedConfigurationLoader.js +22 -0
  23. package/src/components/ScopeExtendedConfigurationLoader.test.js +71 -0
  24. package/src/content/icons/orckestra-icon.svg +11 -5
  25. package/src/reducers/scopesExtendedConfiguration.js +16 -0
  26. package/src/reducers/scopesExtendedConfiguration.test.js +31 -0
  27. package/src/selectors/scopeExtendedConfiguration.js +9 -0
  28. package/src/selectors/scopeExtendedConfiguration.test.js +45 -0
@@ -0,0 +1,9 @@
1
+ import { createSelector } from "reselect";
2
+
3
+ const scopesExtendedConfigurationData = state => state.get("scopesExtendedConfiguration");
4
+
5
+ export const doesScopeHaveGeolocationProviderSelector = scopeId => {
6
+ return createSelector(scopesExtendedConfigurationData, scopesCfg => {
7
+ return scopesCfg?.get(scopeId)?.get("hasGeolocationProvider") ?? false;
8
+ });
9
+ };
@@ -0,0 +1,45 @@
1
+ import Immutable from "immutable";
2
+ import { doesScopeHaveGeolocationProviderSelector } from "./scopeExtendedConfiguration";
3
+
4
+ let state;
5
+ beforeEach(() => {
6
+ state = Immutable.fromJS({
7
+ navigation: {
8
+ route: { location: {}, match: { params: { scope: "SecondChild" } } },
9
+ },
10
+ locale: {
11
+ locale: "fr",
12
+ supportedLocales: ["en", "fr"],
13
+ },
14
+ scopesExtendedConfiguration: {
15
+ theScope: { hasGeolocationProvider: true },
16
+ },
17
+ settings: {
18
+ defaultScope: "FirstChild",
19
+ },
20
+ });
21
+ });
22
+
23
+ describe("doesScopeHaveGeolocationProviderSelector", () => {
24
+ it("gets an unknown scope", () =>
25
+ expect(
26
+ doesScopeHaveGeolocationProviderSelector,
27
+ "when called with",
28
+ ["Unknown"],
29
+ "called with",
30
+ [state],
31
+ "to be",
32
+ false,
33
+ ));
34
+
35
+ it("gets a known scope", () =>
36
+ expect(
37
+ doesScopeHaveGeolocationProviderSelector,
38
+ "when called with",
39
+ ["theScope"],
40
+ "called with",
41
+ [state],
42
+ "to be",
43
+ true,
44
+ ));
45
+ });