@dhis2/app-service-offline 3.16.0 → 3.17.0-beta.2
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.
- package/build/cjs/__tests__/integration.test.js +19 -29
- package/build/cjs/lib/__tests__/cacheable-section-state.test.js +5 -8
- package/build/cjs/lib/__tests__/clear-sensitive-caches.test.js +1 -4
- package/build/cjs/lib/__tests__/network-status.test.js +13 -34
- package/build/cjs/lib/__tests__/offline-provider.test.js +2 -5
- package/build/cjs/lib/__tests__/use-cacheable-section.test.js +38 -65
- package/build/cjs/lib/__tests__/use-online-status-message.test.js +5 -8
- package/build/cjs/lib/cacheable-section-state.js +11 -15
- package/build/cjs/lib/cacheable-section.js +11 -13
- package/build/cjs/lib/clear-sensitive-caches.js +4 -8
- package/build/cjs/lib/dhis2-connection-status/dev-debug-log.js +2 -2
- package/build/cjs/lib/dhis2-connection-status/dhis2-connection-status.js +9 -11
- package/build/cjs/lib/dhis2-connection-status/dhis2-connection-status.test.js +83 -107
- package/build/cjs/lib/dhis2-connection-status/smart-interval.js +7 -8
- package/build/cjs/lib/global-state-service.js +10 -15
- package/build/cjs/lib/network-status.js +4 -6
- package/build/cjs/lib/offline-interface.js +4 -5
- package/build/cjs/lib/offline-provider.js +4 -5
- package/build/cjs/lib/online-status-message.js +3 -4
- package/build/cjs/utils/render-counter.js +4 -5
- package/build/cjs/utils/test-mocks.js +8 -10
- package/build/es/__tests__/integration.test.js +19 -29
- package/build/es/lib/__tests__/cacheable-section-state.test.js +5 -8
- package/build/es/lib/__tests__/clear-sensitive-caches.test.js +1 -4
- package/build/es/lib/__tests__/network-status.test.js +13 -34
- package/build/es/lib/__tests__/offline-provider.test.js +2 -5
- package/build/es/lib/__tests__/use-cacheable-section.test.js +38 -65
- package/build/es/lib/__tests__/use-online-status-message.test.js +5 -8
- package/build/es/lib/cacheable-section-state.js +11 -15
- package/build/es/lib/cacheable-section.js +11 -13
- package/build/es/lib/clear-sensitive-caches.js +4 -8
- package/build/es/lib/dhis2-connection-status/dev-debug-log.js +2 -2
- package/build/es/lib/dhis2-connection-status/dhis2-connection-status.js +9 -11
- package/build/es/lib/dhis2-connection-status/dhis2-connection-status.test.js +83 -107
- package/build/es/lib/dhis2-connection-status/smart-interval.js +7 -8
- package/build/es/lib/global-state-service.js +10 -15
- package/build/es/lib/network-status.js +4 -6
- package/build/es/lib/offline-interface.js +4 -5
- package/build/es/lib/offline-provider.js +4 -5
- package/build/es/lib/online-status-message.js +3 -4
- package/build/es/utils/render-counter.js +4 -5
- package/build/es/utils/test-mocks.js +8 -10
- package/package.json +3 -3
- package/build/cjs/locales/en/translations.json +0 -4
- package/build/cjs/locales/index.js +0 -21
- package/build/es/locales/en/translations.json +0 -4
- package/build/es/locales/index.js +0 -13
|
@@ -28,26 +28,23 @@ const FOURTH_INTERVAL_MS = THIRD_INTERVAL_MS * DEFAULT_INCREMENT_FACTOR;
|
|
|
28
28
|
// N >= (ln (maxDelay / initialDelay) / ln (incrementFactor)) + 1
|
|
29
29
|
// => then use Math.ceil to handle the 'greater than' effect
|
|
30
30
|
const INTERVALS_TO_REACH_MAX_DELAY = Math.ceil(Math.log(DEFAULT_MAX_DELAY_MS / DEFAULT_INITIAL_DELAY_MS) / Math.log(DEFAULT_INCREMENT_FACTOR) + 1);
|
|
31
|
-
const wrapper =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
patch: 0,
|
|
44
|
-
full: 'n/a'
|
|
45
|
-
}
|
|
31
|
+
const wrapper = ({
|
|
32
|
+
children
|
|
33
|
+
}) => /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
34
|
+
config: {
|
|
35
|
+
baseUrl: '..',
|
|
36
|
+
apiVersion: 42,
|
|
37
|
+
// ensure this is a server version where pings are enabled
|
|
38
|
+
serverVersion: {
|
|
39
|
+
major: 2,
|
|
40
|
+
minor: 40,
|
|
41
|
+
patch: 0,
|
|
42
|
+
full: 'n/a'
|
|
46
43
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
46
|
+
offlineInterface: mockOfflineInterface
|
|
47
|
+
}, children));
|
|
51
48
|
|
|
52
49
|
/**
|
|
53
50
|
* Assert on the delay of the last time setTimeoutSpy was called with
|
|
@@ -102,14 +99,11 @@ describe('initialization to the right values based on offline interface', () =>
|
|
|
102
99
|
...mockOfflineInterface,
|
|
103
100
|
latestIsConnected: false
|
|
104
101
|
};
|
|
105
|
-
const customWrapper =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
offlineInterface: customMockOfflineInterface
|
|
111
|
-
}, children);
|
|
112
|
-
};
|
|
102
|
+
const customWrapper = ({
|
|
103
|
+
children
|
|
104
|
+
}) => /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
105
|
+
offlineInterface: customMockOfflineInterface
|
|
106
|
+
}, children);
|
|
113
107
|
const {
|
|
114
108
|
result
|
|
115
109
|
} = renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -134,14 +128,11 @@ describe('initialization to the right values based on offline interface', () =>
|
|
|
134
128
|
...mockOfflineInterface,
|
|
135
129
|
latestIsConnected: null
|
|
136
130
|
};
|
|
137
|
-
const customWrapper =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
offlineInterface: customMockOfflineInterface
|
|
143
|
-
}, children);
|
|
144
|
-
};
|
|
131
|
+
const customWrapper = ({
|
|
132
|
+
children
|
|
133
|
+
}) => /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
134
|
+
offlineInterface: customMockOfflineInterface
|
|
135
|
+
}, children);
|
|
145
136
|
const {
|
|
146
137
|
result
|
|
147
138
|
} = renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -686,14 +677,11 @@ describe('lastConnected status', () => {
|
|
|
686
677
|
...mockOfflineInterface,
|
|
687
678
|
latestIsConnected: false
|
|
688
679
|
};
|
|
689
|
-
const customWrapper =
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
offlineInterface: customMockOfflineInterface
|
|
695
|
-
}, children);
|
|
696
|
-
};
|
|
680
|
+
const customWrapper = ({
|
|
681
|
+
children
|
|
682
|
+
}) => /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
683
|
+
offlineInterface: customMockOfflineInterface
|
|
684
|
+
}, children);
|
|
697
685
|
|
|
698
686
|
// render hook with custom wrapper
|
|
699
687
|
renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -713,14 +701,11 @@ describe('lastConnected status', () => {
|
|
|
713
701
|
...mockOfflineInterface,
|
|
714
702
|
latestIsConnected: false
|
|
715
703
|
};
|
|
716
|
-
const customWrapper =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
offlineInterface: customMockOfflineInterface
|
|
722
|
-
}, children);
|
|
723
|
-
};
|
|
704
|
+
const customWrapper = ({
|
|
705
|
+
children
|
|
706
|
+
}) => /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
707
|
+
offlineInterface: customMockOfflineInterface
|
|
708
|
+
}, children);
|
|
724
709
|
const {
|
|
725
710
|
result
|
|
726
711
|
} = renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -744,25 +729,22 @@ describe('lastConnected status', () => {
|
|
|
744
729
|
...mockOfflineInterface,
|
|
745
730
|
latestIsConnected: false
|
|
746
731
|
};
|
|
747
|
-
const customWrapper =
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
patch: 0,
|
|
759
|
-
full: 'n/a'
|
|
760
|
-
}
|
|
732
|
+
const customWrapper = ({
|
|
733
|
+
children
|
|
734
|
+
}) => /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
735
|
+
config: {
|
|
736
|
+
baseUrl: '..',
|
|
737
|
+
apiVersion: 42,
|
|
738
|
+
serverVersion: {
|
|
739
|
+
major: 2,
|
|
740
|
+
minor: 40,
|
|
741
|
+
patch: 0,
|
|
742
|
+
full: 'n/a'
|
|
761
743
|
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
};
|
|
744
|
+
}
|
|
745
|
+
}, /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
746
|
+
offlineInterface: customMockOfflineInterface
|
|
747
|
+
}, children));
|
|
766
748
|
const {
|
|
767
749
|
result
|
|
768
750
|
} = renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -810,26 +792,23 @@ describe('lastConnected status', () => {
|
|
|
810
792
|
...mockOfflineInterface,
|
|
811
793
|
latestIsConnected: false
|
|
812
794
|
};
|
|
813
|
-
const customWrapper =
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
patch: 0,
|
|
826
|
-
full: 'n/a'
|
|
827
|
-
}
|
|
795
|
+
const customWrapper = ({
|
|
796
|
+
children
|
|
797
|
+
}) => /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
798
|
+
config: {
|
|
799
|
+
baseUrl: '..',
|
|
800
|
+
apiVersion: 42,
|
|
801
|
+
appName: testAppName,
|
|
802
|
+
serverVersion: {
|
|
803
|
+
major: 2,
|
|
804
|
+
minor: 40,
|
|
805
|
+
patch: 0,
|
|
806
|
+
full: 'n/a'
|
|
828
807
|
}
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
};
|
|
808
|
+
}
|
|
809
|
+
}, /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
810
|
+
offlineInterface: customMockOfflineInterface
|
|
811
|
+
}, children));
|
|
833
812
|
const {
|
|
834
813
|
result
|
|
835
814
|
} = renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -859,26 +838,23 @@ describe('lastConnected status', () => {
|
|
|
859
838
|
});
|
|
860
839
|
});
|
|
861
840
|
describe("when the /api/ping endpoint isn't supported", () => {
|
|
862
|
-
const customWrapper =
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
patch: 0,
|
|
875
|
-
full: 'n/a'
|
|
876
|
-
}
|
|
841
|
+
const customWrapper = ({
|
|
842
|
+
children
|
|
843
|
+
}) => /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
844
|
+
config: {
|
|
845
|
+
baseUrl: '..',
|
|
846
|
+
apiVersion: 42,
|
|
847
|
+
// an unsupported version:
|
|
848
|
+
serverVersion: {
|
|
849
|
+
major: 2,
|
|
850
|
+
minor: 39,
|
|
851
|
+
patch: 0,
|
|
852
|
+
full: 'n/a'
|
|
877
853
|
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
};
|
|
854
|
+
}
|
|
855
|
+
}, /*#__PURE__*/React.createElement(OfflineProvider, {
|
|
856
|
+
offlineInterface: mockOfflineInterface
|
|
857
|
+
}, children));
|
|
882
858
|
test("pings aren't sent", async () => {
|
|
883
859
|
const setTimeoutSpy = jest.spyOn(window, 'setTimeout');
|
|
884
860
|
renderHook(() => useDhis2ConnectionStatus(), {
|
|
@@ -7,14 +7,13 @@ export const DEFAULT_INCREMENT_FACTOR = 1.5;
|
|
|
7
7
|
const throwErrorIfNoCallbackIsProvided = () => {
|
|
8
8
|
throw new Error('Provide a callback');
|
|
9
9
|
};
|
|
10
|
-
export default function createSmartInterval(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
+
export default function createSmartInterval({
|
|
11
|
+
initialDelay = DEFAULT_INITIAL_DELAY_MS,
|
|
12
|
+
maxDelay = DEFAULT_MAX_DELAY_MS,
|
|
13
|
+
delayIncrementFactor = DEFAULT_INCREMENT_FACTOR,
|
|
14
|
+
initialPauseValue = false,
|
|
15
|
+
callback = throwErrorIfNoCallbackIsProvided
|
|
16
|
+
} = {}) {
|
|
18
17
|
const state = {
|
|
19
18
|
paused: initialPauseValue,
|
|
20
19
|
delay: initialDelay,
|
|
@@ -6,8 +6,7 @@ import React, { useEffect, useCallback, useContext, useState, useMemo } from 're
|
|
|
6
6
|
// See more at https://github.com/amcgee/state-service-poc
|
|
7
7
|
|
|
8
8
|
const identity = state => state;
|
|
9
|
-
export const createStore =
|
|
10
|
-
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
+
export const createStore = (initialState = {}) => {
|
|
11
10
|
const subscriptions = new Set();
|
|
12
11
|
let state = initialState;
|
|
13
12
|
return {
|
|
@@ -28,21 +27,17 @@ export const createStore = function () {
|
|
|
28
27
|
};
|
|
29
28
|
const GlobalStateContext = /*#__PURE__*/React.createContext(createStore());
|
|
30
29
|
const useGlobalStateStore = () => useContext(GlobalStateContext);
|
|
31
|
-
export const GlobalStateProvider =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
value: store
|
|
38
|
-
}, children);
|
|
39
|
-
};
|
|
30
|
+
export const GlobalStateProvider = ({
|
|
31
|
+
store,
|
|
32
|
+
children
|
|
33
|
+
}) => /*#__PURE__*/React.createElement(GlobalStateContext.Provider, {
|
|
34
|
+
value: store
|
|
35
|
+
}, children);
|
|
40
36
|
GlobalStateProvider.propTypes = {
|
|
41
37
|
children: PropTypes.node,
|
|
42
38
|
store: PropTypes.shape({})
|
|
43
39
|
};
|
|
44
|
-
export const useGlobalState =
|
|
45
|
-
let selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : identity;
|
|
40
|
+
export const useGlobalState = (selector = identity) => {
|
|
46
41
|
const store = useGlobalStateStore();
|
|
47
42
|
const [selectedState, setSelectedState] = useState(selector(store.getState()));
|
|
48
43
|
useEffect(() => {
|
|
@@ -68,7 +63,7 @@ export const useGlobalState = function () {
|
|
|
68
63
|
};
|
|
69
64
|
export function useGlobalStateMutation(mutationCreator) {
|
|
70
65
|
const store = useGlobalStateStore();
|
|
71
|
-
return useCallback(
|
|
72
|
-
store.mutate(mutationCreator(...
|
|
66
|
+
return useCallback((...args) => {
|
|
67
|
+
store.mutate(mutationCreator(...args));
|
|
73
68
|
}, [mutationCreator, store]);
|
|
74
69
|
}
|
|
@@ -19,17 +19,15 @@ const lastOnlineKey = 'dhis2.lastOnline';
|
|
|
19
19
|
* @param {Number} [options.debounceDelay] - Timeout delay to debounce updates, in ms
|
|
20
20
|
* @returns {Object} `{ online: boolean, offline: boolean, lastOnline: Date | null }`
|
|
21
21
|
*/
|
|
22
|
-
export function useNetworkStatus() {
|
|
22
|
+
export function useNetworkStatus(options = {}) {
|
|
23
23
|
var _options$debounceDela;
|
|
24
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
24
|
// initialize state to `navigator.onLine` value
|
|
26
25
|
const [online, setOnline] = useState(navigator.onLine);
|
|
27
26
|
|
|
28
27
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
-
const updateState = useCallback(debounce(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
28
|
+
const updateState = useCallback(debounce(({
|
|
29
|
+
type
|
|
30
|
+
}) => {
|
|
33
31
|
if (type === 'online') {
|
|
34
32
|
setOnline(true);
|
|
35
33
|
} else if (type === 'offline') {
|
|
@@ -18,11 +18,10 @@ const OfflineInterfaceContext = /*#__PURE__*/createContext(noopOfflineInterface)
|
|
|
18
18
|
* checks for service worker updates and, if updates are ready, prompts the
|
|
19
19
|
* user with an alert to skip waiting and reload the page to use new content.
|
|
20
20
|
*/
|
|
21
|
-
export function OfflineInterfaceProvider(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
21
|
+
export function OfflineInterfaceProvider({
|
|
22
|
+
offlineInterface,
|
|
23
|
+
children
|
|
24
|
+
}) {
|
|
26
25
|
return /*#__PURE__*/React.createElement(OfflineInterfaceContext.Provider, {
|
|
27
26
|
value: offlineInterface
|
|
28
27
|
}, children);
|
|
@@ -5,11 +5,10 @@ import { Dhis2ConnectionStatusProvider } from './dhis2-connection-status';
|
|
|
5
5
|
import { OfflineInterfaceProvider } from './offline-interface';
|
|
6
6
|
import { OnlineStatusMessageProvider } from './online-status-message';
|
|
7
7
|
/** A context provider for all the relevant offline contexts */
|
|
8
|
-
export function OfflineProvider(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
8
|
+
export function OfflineProvider({
|
|
9
|
+
offlineInterface,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
13
12
|
// If an offline interface is not provided, or if one is provided and PWA
|
|
14
13
|
// is not enabled, skip adding context providers
|
|
15
14
|
if (!offlineInterface || !offlineInterface.pwaEnabled) {
|
|
@@ -3,10 +3,9 @@ import React, { useContext, useState } from 'react';
|
|
|
3
3
|
// actually need the value don't have to rerender when the value changes:
|
|
4
4
|
const OnlineStatusMessageValueContext = /*#__PURE__*/React.createContext(undefined);
|
|
5
5
|
const SetOnlineStatusMessageContext = /*#__PURE__*/React.createContext(() => undefined);
|
|
6
|
-
export const OnlineStatusMessageProvider =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
6
|
+
export const OnlineStatusMessageProvider = ({
|
|
7
|
+
children
|
|
8
|
+
}) => {
|
|
10
9
|
const [onlineStatusMessage, setOnlineStatusMessage] = useState(); // note: not undefined
|
|
11
10
|
|
|
12
11
|
return /*#__PURE__*/React.createElement(OnlineStatusMessageValueContext.Provider, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export const successfulRecordingMock = jest.fn().mockImplementation(async
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1
|
+
export const successfulRecordingMock = jest.fn().mockImplementation(async ({
|
|
2
|
+
onStarted,
|
|
3
|
+
onCompleted
|
|
4
|
+
} = {}) => {
|
|
6
5
|
// in 100ms, call 'onStarted' callback (allows 'pending' state)
|
|
7
6
|
if (onStarted) {
|
|
8
7
|
setTimeout(onStarted, 100);
|
|
@@ -16,11 +15,10 @@ export const successfulRecordingMock = jest.fn().mockImplementation(async functi
|
|
|
16
15
|
// resolve
|
|
17
16
|
return Promise.resolve();
|
|
18
17
|
});
|
|
19
|
-
export const errorRecordingMock = jest.fn().mockImplementation(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
export const errorRecordingMock = jest.fn().mockImplementation(({
|
|
19
|
+
onStarted,
|
|
20
|
+
onError
|
|
21
|
+
} = {}) => {
|
|
24
22
|
// in 100ms, call 'onStarted' callback (allows 'pending' state)
|
|
25
23
|
if (onStarted) {
|
|
26
24
|
setTimeout(onStarted, 100);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/app-service-offline",
|
|
3
3
|
"description": "A runtime service for online/offline detection and offline caching",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.17.0-beta.2",
|
|
5
5
|
"main": "./build/cjs/index.js",
|
|
6
6
|
"module": "./build/es/index.js",
|
|
7
|
-
"types": "build/types/index.d.ts",
|
|
7
|
+
"types": "./build/types/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
"import": "./build/es/index.js",
|
|
10
10
|
"require": "./build/cjs/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"coverage": "yarn test --coverage"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@dhis2/app-service-config": "3.
|
|
37
|
+
"@dhis2/app-service-config": "3.17.0-beta.2",
|
|
38
38
|
"react": "^16.8.6 || ^18",
|
|
39
39
|
"react-dom": "^16.8.6 || ^18"
|
|
40
40
|
},
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
8
|
-
var _translations = _interopRequireDefault(require("./en/translations.json"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
//------------------------------------------------------------------------------
|
|
11
|
-
// <auto-generated>
|
|
12
|
-
// This code was generated by d2-i18n-generate.
|
|
13
|
-
//
|
|
14
|
-
// Changes to this file may cause incorrect behavior and will be lost if
|
|
15
|
-
// the code is regenerated.
|
|
16
|
-
// </auto-generated>
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const namespace = 'default';
|
|
20
|
-
_d2I18n.default.addResources('en', namespace, _translations.default);
|
|
21
|
-
var _default = exports.default = _d2I18n.default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//------------------------------------------------------------------------------
|
|
2
|
-
// <auto-generated>
|
|
3
|
-
// This code was generated by d2-i18n-generate.
|
|
4
|
-
//
|
|
5
|
-
// Changes to this file may cause incorrect behavior and will be lost if
|
|
6
|
-
// the code is regenerated.
|
|
7
|
-
// </auto-generated>
|
|
8
|
-
//------------------------------------------------------------------------------
|
|
9
|
-
import i18n from '@dhis2/d2-i18n';
|
|
10
|
-
import enTranslations from './en/translations.json';
|
|
11
|
-
const namespace = 'default';
|
|
12
|
-
i18n.addResources('en', namespace, enTranslations);
|
|
13
|
-
export default i18n;
|