Skip to content

Commit 536d98e

Browse files
Merge pull request #73 from OpenDTU-App/2-implement-firmware-selector
2 parents 041c67d + 55d3594 commit 536d98e

File tree

25 files changed

+1158
-101
lines changed

25 files changed

+1158
-101
lines changed

.github/workflows/pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Install node modules
3636
run: |
37-
yarn install --immutable --immutable-cache --check-cache
37+
yarn install --immutable --check-cache
3838
3939
- name: Cache Gradle Wrapper
4040
uses: actions/cache@v3

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Install node modules
3737
run: |
38-
yarn install --immutable --immutable-cache --check-cache
38+
yarn install --immutable --check-cache
3939
4040
- name: Cache Gradle Wrapper
4141
uses: actions/cache@v3

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Install node modules
2626
run: |
27-
yarn install --immutable --immutable-cache --check-cache
27+
yarn install --immutable --check-cache
2828
2929
- name: Run ESLint
3030
run: |

__mocks__/react-native-fs.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* @format
3+
*/
4+
/* eslint-env jest */
5+
6+
jest.mock('react-native-fs', () => {
7+
return {
8+
mkdir: jest.fn(),
9+
moveFile: jest.fn(),
10+
copyFile: jest.fn(),
11+
pathForBundle: jest.fn(),
12+
pathForGroup: jest.fn(),
13+
getFSInfo: jest.fn(),
14+
getAllExternalFilesDirs: jest.fn(),
15+
unlink: jest.fn(),
16+
exists: jest.fn(),
17+
stopDownload: jest.fn(),
18+
resumeDownload: jest.fn(),
19+
isResumable: jest.fn(),
20+
stopUpload: jest.fn(),
21+
completeHandlerIOS: jest.fn(),
22+
readDir: jest.fn(),
23+
readDirAssets: jest.fn(),
24+
existsAssets: jest.fn(),
25+
readdir: jest.fn(),
26+
setReadable: jest.fn(),
27+
stat: jest.fn(),
28+
readFile: jest.fn(),
29+
read: jest.fn(),
30+
readFileAssets: jest.fn(),
31+
hash: jest.fn(),
32+
copyFileAssets: jest.fn(),
33+
copyFileAssetsIOS: jest.fn(),
34+
copyAssetsVideoIOS: jest.fn(),
35+
writeFile: jest.fn(),
36+
appendFile: jest.fn(),
37+
write: jest.fn(),
38+
downloadFile: jest.fn(),
39+
uploadFiles: jest.fn(),
40+
touch: jest.fn(),
41+
MainBundlePath: jest.fn(),
42+
CachesDirectoryPath: jest.fn(),
43+
DocumentDirectoryPath: jest.fn(),
44+
ExternalDirectoryPath: jest.fn(),
45+
ExternalStorageDirectoryPath: jest.fn(),
46+
TemporaryDirectoryPath: jest.fn(),
47+
LibraryDirectoryPath: jest.fn(),
48+
PicturesDirectoryPath: jest.fn(),
49+
};
50+
});

licenses.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"licenseUrl": "http://github.com/mwittig/npm-license-crawler/raw/master/LICENSE",
9696
"parents": "opendtu-react-native"
9797
},
98-
98+
9999
"licenses": "MIT",
100100
"repository": "github:octokit/octokit.js",
101101
"licenseUrl": "github:octokit/octokit.js",
@@ -113,6 +113,12 @@
113113
"licenseUrl": "https://github.com/ds300/postinstall-postinstall/raw/master/LICENSE",
114114
"parents": "opendtu-react-native"
115115
},
116+
117+
"licenses": "MIT",
118+
"repository": "https://github.com/sindresorhus/pretty-bytes",
119+
"licenseUrl": "https://github.com/sindresorhus/pretty-bytes/raw/master/license",
120+
"parents": "opendtu-react-native"
121+
},
116122
117123
"licenses": "MIT",
118124
"repository": "https://github.com/samber/prometheus-query-js",
@@ -143,6 +149,12 @@
143149
"licenseUrl": "https://github.com/yamankatby/react-native-flex-layout/raw/master/LICENSE",
144150
"parents": "opendtu-react-native"
145151
},
152+
153+
"licenses": "MIT",
154+
"repository": "https://github.com/itinance/react-native-fs",
155+
"licenseUrl": "https://github.com/itinance/react-native-fs/raw/master/LICENSE",
156+
"parents": "opendtu-react-native"
157+
},
146158
147159
"licenses": "MIT",
148160
"repository": "https://github.com/LinusU/react-native-get-random-values",

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
"octokit": "^3.2.0",
4747
"patch-package": "^8.0.0",
4848
"postinstall-postinstall": "^2.1.0",
49+
"pretty-bytes": "^6.1.1",
4950
"prometheus-query": "^3.4.0",
5051
"react": "18.2.0",
5152
"react-i18next": "^14.1.1",
5253
"react-native": "^0.74.1",
5354
"react-native-charts-wrapper": "^0.6.0",
5455
"react-native-fast-image": "^8.6.3",
5556
"react-native-flex-layout": "^0.1.5",
57+
"react-native-fs": "^2.20.0",
5658
"react-native-get-random-values": "^1.11.0",
5759
"react-native-linear-gradient": "^2.8.3",
5860
"react-native-logs": "^5.1.0",

src/App.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { store, persistor, useAppSelector } from '@/store';
2828
import { ReactNavigationDarkTheme, ReactNavigationLightTheme } from '@/style';
2929
import '@/translations';
3030
import NavigationStack from '@/views/navigation/NavigationStack';
31+
import type { TranslationsType } from 'react-native-paper-dates';
3132

3233
const log = rootLogger.extend('App');
3334

@@ -219,7 +220,7 @@ const _App: FC = () => {
219220
}, [i18nLanguageMatchesSettings]);
220221

221222
useEffect(() => {
222-
registerTranslation(i18n.language, {
223+
const translation: TranslationsType = {
223224
selectSingle: t('RNPaperDates.selectSingle'),
224225
selectMultiple: t('RNPaperDates.selectMultiple'),
225226
selectRange: t('RNPaperDates.selectRange'),
@@ -238,7 +239,11 @@ const _App: FC = () => {
238239
typeInDate: t('RNPaperDates.typeInDate'),
239240
pickDateFromCalendar: t('RNPaperDates.pickDateFromCalendar'),
240241
close: t('RNPaperDates.close'),
241-
});
242+
hour: t('RNPaperDates.hour'),
243+
minute: t('RNPaperDates.minute'),
244+
};
245+
246+
registerTranslation(i18n.language, translation);
242247
}, [i18n.language, t]);
243248

244249
const showEnableAppUpdatesModal = useAppSelector(

0 commit comments

Comments
 (0)