Skip to content

Commit

Permalink
Merge branch 'k88hudson-simple-review'
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jun 8, 2021
2 parents 4c1ea94 + ecfd324 commit 592ffd0
Show file tree
Hide file tree
Showing 22 changed files with 1,058 additions and 24 deletions.
8 changes: 6 additions & 2 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ table.record-list td.load-more {
color: red;
}

.json-record-simple-review {
white-space: pre-wrap;
}

.card-header > .icon,
.list-group-item .icon,
.nav-tabs li .icon {
Expand Down Expand Up @@ -542,5 +546,5 @@ i.fa:before {
}

.modal {
background-color: rgba(0,0,0,0.3);
}
background-color: rgba(0, 0, 0, 0.3);
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
setupFilesAfterEnv: ["./test/setup-jsdom.js"],
testRegex: ".*_test.js",
testRegex: [".*_test.js", ".*_test.tsx", ".*_test.ts"],
moduleNameMapper: {
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
"\\.svg": "<rootDir>/test/__mocks__/svgrMock.js",
Expand Down
42 changes: 26 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@babel/preset-typescript": "^7.12.7",
"@svgr/webpack": "^5.4.0",
"@types/history": "^4.7.8",
"@types/jest": "^26.0.23",
"@types/react-redux": "^7.1.11",
"@types/react-router-dom": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^4.9.1",
Expand Down
5 changes: 3 additions & 2 deletions server/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var config = require("../webpack.dev");

var app = express();
var compiler = webpack(config);
const PORT = process.env.PORT || 3000;

app.use(
require("webpack-dev-middleware")(compiler, {
Expand All @@ -19,11 +20,11 @@ app.get("*", function(req, res) {
res.sendFile(path.join(__dirname, "..", "html", "dev.html"));
});

app.listen(3000, "0.0.0.0", function(err) {
app.listen(PORT, "0.0.0.0", function(err) {
if (err) {
console.log(err);
return;
}

console.log("Listening at http://0.0.0.0:3000");
console.log("Listening at http://0.0.0.0:" + PORT);
});
7 changes: 7 additions & 0 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import RecordBulkPage from "../containers/record/RecordBulkPage";
import RecordAttributesPage from "../containers/record/RecordAttributesPage";
import RecordPermissionsPage from "../containers/record/RecordPermissionsPage";
import RecordHistoryPage from "../containers/record/RecordHistoryPage";
import SimpleReviewPage from "../plugins/signoff/SimpleReview/SimpleReviewPage";

import { BoxArrowRight } from "react-bootstrap-icons";
import { QuestionCircleFill } from "react-bootstrap-icons";
Expand Down Expand Up @@ -286,6 +287,12 @@ export default class App extends PureComponent<Props> {
path="/buckets/:bid/collections/:cid/history"
component={CollectionHistoryPage}
/>
<CreateRoute
exact
title="simple-review"
path="/buckets/:bid/collections/:cid/simple-review"
component={SimpleReviewPage}
/>
<CreateRoute
exact
title="records"
Expand Down
69 changes: 69 additions & 0 deletions src/components/CommentDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React, { useState } from "react";

type DialogProps = {
title?: string;
description: string;
confirmLabel: string;
onConfirm: (comment: string) => void;
onClose: () => void;
};

export default function CommentDialog({
title = "Confirmation",
description,
onConfirm,
confirmLabel,
onClose,
}: DialogProps) {
const [value, setValue] = useState("");
return (
<div
className="modal"
tabIndex={-1}
role="dialog"
style={{ display: "block" }}>
<div className="modal-dialog" role="document">
<div className="modal-content">
<div className="modal-header">
<h5 className="modal-title">{title}</h5>
<button
type="button"
className="close"
data-dismiss="modal"
aria-label="Close"
onClick={onClose}>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div className="modal-body">
<p>{description}</p>
<textarea
className="form-control"
value={value}
placeholder="Comment..."
onChange={e => setValue(e.currentTarget.value)}
/>
</div>
<div className="modal-footer">
<button
type="button"
className="btn btn-primary"
onClick={() => {
onConfirm(value);
onClose();
}}>
{confirmLabel}
</button>
<button
type="button"
className="btn btn-secondary"
data-dismiss="modal"
onClick={onClose}>
Close
</button>
</div>
</div>
</div>
</div>
);
}
Loading

0 comments on commit 592ffd0

Please sign in to comment.