mirror of
https://github.com/usatiuk/writer.git
synced 2025-10-28 16:07:49 +01:00
add husky checks
This commit is contained in:
@@ -119,8 +119,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const Login = withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(LoginComponent),
|
||||
connect(mapStateToProps, mapDispatchToProps)(LoginComponent),
|
||||
);
|
||||
|
||||
@@ -130,8 +130,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const Signup = withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(SignupComponent),
|
||||
connect(mapStateToProps, mapDispatchToProps)(SignupComponent),
|
||||
);
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
}
|
||||
|
||||
.document {
|
||||
|
||||
textarea,
|
||||
.documentContents {
|
||||
background: white;
|
||||
@@ -109,7 +108,7 @@
|
||||
height: 100%;
|
||||
width: 3rem;
|
||||
|
||||
>* {
|
||||
> * {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -229,7 +228,6 @@
|
||||
}
|
||||
|
||||
.document {
|
||||
|
||||
textarea,
|
||||
.documentContents {
|
||||
transition: 0.3s;
|
||||
@@ -266,4 +264,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,8 +77,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const DocumentCard = withRouter(
|
||||
connect(
|
||||
null,
|
||||
mapDispatchToProps,
|
||||
)(DocumentCardComponent),
|
||||
connect(null, mapDispatchToProps)(DocumentCardComponent),
|
||||
);
|
||||
|
||||
@@ -283,8 +283,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const DocumentEdit = withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(DocumentEditComponent),
|
||||
connect(mapStateToProps, mapDispatchToProps)(DocumentEditComponent),
|
||||
);
|
||||
|
||||
@@ -44,8 +44,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const NewDocumentCard = withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(NewDocumentCardComponent),
|
||||
connect(mapStateToProps, mapDispatchToProps)(NewDocumentCardComponent),
|
||||
);
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
margin-right: auto;
|
||||
padding-top: 2 * $pt-navbar-height + 20px;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ describe("<DocumentEdit />", () => {
|
||||
it("should warn before exiting with unsaved changes", () => {
|
||||
// https://medium.com/@DavideRama/testing-global-event-listener-within-a-react-component-b9d661e59953
|
||||
const map: { [key: string]: any } = {};
|
||||
window.addEventListener = jest.fn((event, cb) => {
|
||||
map[event] = cb;
|
||||
window.addEventListener = jest.fn((_event, cb) => {
|
||||
map[_event] = cb;
|
||||
});
|
||||
|
||||
const wrapper = mount(
|
||||
@@ -80,8 +80,8 @@ describe("<DocumentEdit />", () => {
|
||||
|
||||
it("shouldn't warn before exiting with no changes", () => {
|
||||
const map: { [key: string]: any } = {};
|
||||
window.addEventListener = jest.fn((event, cb) => {
|
||||
map[event] = cb;
|
||||
window.addEventListener = jest.fn((_event, cb) => {
|
||||
map[_event] = cb;
|
||||
});
|
||||
|
||||
const wrapper = mount(
|
||||
|
||||
@@ -15,7 +15,7 @@ describe("<CodeBlock />", () => {
|
||||
allDocs={{}}
|
||||
fetching={false}
|
||||
spinner={false}
|
||||
fetchDocs={() => {}}
|
||||
fetchDocs={() => undefined}
|
||||
/>,
|
||||
);
|
||||
|
||||
@@ -28,7 +28,7 @@ describe("<CodeBlock />", () => {
|
||||
allDocs={{ 1: { id: 1 } } as any}
|
||||
fetching={false}
|
||||
spinner={false}
|
||||
fetchDocs={() => {}}
|
||||
fetchDocs={() => undefined}
|
||||
/>,
|
||||
);
|
||||
|
||||
|
||||
@@ -45,4 +45,4 @@
|
||||
.bp3-navbar {
|
||||
transition: 0.3s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +200,5 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
}
|
||||
|
||||
export const Home = withRouter(
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(HomeComponent),
|
||||
connect(mapStateToProps, mapDispatchToProps)(HomeComponent),
|
||||
);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const apiRoot = process.env.API_ROOT || "http://localhost:3000";
|
||||
export const webRoot = process.env.WEB_ROOT || "http://localhost:1234";
|
||||
export const webRoot = process.env.WEB_ROOT || "http://localhost:1234";
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i&display=swap&subset=cyrillic,cyrillic-ext,latin-ext"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i&display=swap&subset=cyrillic,cyrillic-ext,latin-ext"
|
||||
rel="stylesheet">
|
||||
<title>Writer</title>
|
||||
</head>
|
||||
|
||||
<title>Writer</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="body"></div>
|
||||
<script src="./index.tsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<body>
|
||||
<div id="body"></div>
|
||||
<script src="./index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IDocumentJSON } from "~../../src/entity/Document";
|
||||
import { IAPIResponse } from "~../../src/types";
|
||||
|
||||
import { fetchJSONAuth, fetchJSON } from "../utils";
|
||||
import { fetchJSON, fetchJSONAuth } from "../utils";
|
||||
|
||||
export async function fetchRecentDocs(): Promise<
|
||||
IAPIResponse<IDocumentJSON[]>
|
||||
|
||||
@@ -146,7 +146,13 @@ function* docsUploadStart(action: IDocsUploadStartAction) {
|
||||
|
||||
for (const doc of changedDocs) {
|
||||
const { response, timeout } = yield race({
|
||||
response: call(patchDoc, doc.id, doc.name, doc.content, doc.shared),
|
||||
response: call(
|
||||
patchDoc,
|
||||
doc.id,
|
||||
doc.name,
|
||||
doc.content,
|
||||
doc.shared,
|
||||
),
|
||||
timeout: delay(10000),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user