Skip to content

Commit 3682c6d

Browse files
Merge pull request #73 from unfoldingWord/feature-cn-build-number-in-title
changes to optionally add a build number to the title on the app bar
2 parents 7bfa286 + 51451ca commit 3682c6d

File tree

5 files changed

+18177
-15
lines changed

5 files changed

+18177
-15
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@material-ui/core": "^4.7.0",
5757
"@material-ui/icons": "^4.9.1",
5858
"@types/base-64": "0.1.3",
59-
"@types/cypress": "^1.1.3",
59+
"@types/cypress": "1.1.3",
6060
"@types/jest": "^25.2.1",
6161
"@types/utf8": "2.1.6",
6262
"@typescript-eslint/eslint-plugin": "2.7.0",
@@ -67,7 +67,7 @@
6767
"babel-loader": "^8.0.6",
6868
"babel-plugin-istanbul": "6.0.0",
6969
"coveralls": "3.0.7",
70-
"cypress": "^5.1.0",
70+
"cypress": "6.2.1",
7171
"eslint": "6.6.0",
7272
"eslint-config-prettier": "6.5.0",
7373
"eslint-plugin-chai-friendly": "0.5.0",

src/components/application-bar/ApplicationBar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515

1616
function ApplicationBar({
1717
title,
18+
build,
1819
buttons,
1920
drawerMenu,
2021
drawerMenuProps,
@@ -35,6 +36,7 @@ function ApplicationBar({
3536
</div>
3637
<Typography variant="h6" color="inherit" className={classes.grow} noWrap>
3738
{title}
39+
{build && <Typography variant="caption" color="inherit" > build {build}</Typography>}
3840
</Typography>
3941
<Typography variant="subtitle2" color="inherit" className={classes.grow} noWrap>
4042
{file ? file.filepath : ''}

src/components/authentication/useAuthentication.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,6 @@ function useAuthentication({
6363
}
6464
}, [authentication, loadAuthentication, update]);
6565

66-
const onSubmit = useCallback(async ({
67-
username, password, remember,
68-
}) => {
69-
if (authentication) {
70-
logout();
71-
update();
72-
} else {
73-
await onSubmitLogin({ username, password, remember });
74-
}
75-
}, [authentication, config, logout, update, onSubmitLogin]);
76-
7766
const onSubmitLogin = useCallback(async ({
7867
username, password, remember,
7968
}) => {
@@ -110,6 +99,17 @@ function useAuthentication({
11099
messages.genericError, messages.networkError, messages.passwordError, messages.serverError, messages.usernameError,
111100
]);
112101

102+
const onSubmit = useCallback(async ({
103+
username, password, remember,
104+
}) => {
105+
if (authentication) {
106+
logout();
107+
update();
108+
} else {
109+
await onSubmitLogin({ username, password, remember });
110+
}
111+
}, [authentication, config, logout, update, onSubmitLogin]);
112+
113113
const component = useMemo(() => (
114114
config && (
115115
<LoginForm

src/components/repositories/SearchForm.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ The SearchForm component will make a search api call and return the resulting re
33
```js
44
import { useState } from 'react';
55
import { Paper } from '@material-ui/core';
6-
import ReactJson from 'react-json-view';
76
import { SearchForm } from 'gitea-react-toolkit';
87

98
const [repos, setRepos] = useState([]);
@@ -20,7 +19,7 @@ const [repos, setRepos] = useState([]);
2019
</Paper>
2120
<h3>Search Results:</h3>
2221
<Paper style={{maxHeight: '300px', overflow: 'scroll'}}>
23-
<ReactJson src={repos} />
22+
<pre>{JSON.stringify(repos)}</pre>
2423
</Paper>
2524
</div>
2625
```

0 commit comments

Comments
 (0)