diff --git a/.eslintrc.js b/.eslintrc.js
index 9950201..a5d4807 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -6,7 +6,7 @@ module.exports = {
browser: true,
},
parser: 'babel-eslint',
- extends: ['eslint:recommended', 'prettier', 'prettier/react'],
+ extends: ['eslint:recommended', 'prettier'],
plugins: ['react'],
globals: {
Promise: false,
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90011af..346d07a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+###### [V5.0.0]
+- Upgrading dependencies
+- NodeJS 12 is now the minimum supported version
+
###### [V4.0.0]
Bringing back Immoscout :tada:
diff --git a/package.json b/package.json
index 0665f5b..1f89ca6 100755
--- a/package.json
+++ b/package.json
@@ -1,11 +1,11 @@
{
"name": "fredy",
- "version": "4.0.0",
+ "version": "5.0.0",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": {
"start": "node index.js",
"dev": "yarn && export BUILD_DEV='true' && export NODE_ENV='development' && webpack-dev-server --progress --colors --watch --config ./webpack.dev.js",
- "prod": "export BUILD_DEV='false' && export NODE_ENV='production' && webpack --config ./webpack.prod.js",
+ "prod": "export BUILD_DEV='false' && webpack --node-env=production --config ./webpack.prod.js",
"format": "prettier --write lib/**/*.js ui/src/**/*.js test/**/*.js *.js --single-quote --print-width 120",
"test": "mocha --timeout 20000 test/**/*.test.js"
},
@@ -41,7 +41,7 @@
},
"license": "MIT",
"engines": {
- "node": ">=11.0.0",
+ "node": ">=12.0.0",
"npm": ">=6.0.0"
},
"browserslist": [
@@ -79,31 +79,31 @@
"x-ray": "2.3.4"
},
"devDependencies": {
- "@babel/core": "7.14.2",
+ "@babel/core": "7.14.3",
"@babel/preset-env": "7.14.2",
"@babel/preset-react": "7.13.13",
"babel-eslint": "10.1.0",
"babel-loader": "8.2.2",
"chai": "4.3.4",
"clean-webpack-plugin": "3.0.0",
- "copy-webpack-plugin": "6.3.0",
- "css-loader": "5.0.1",
+ "copy-webpack-plugin": "8.1.1",
+ "css-loader": "5.2.4",
"eslint": "7.26.0",
- "eslint-config-prettier": "7.1.0",
- "eslint-plugin-react": "7.23.1",
+ "eslint-config-prettier": "8.3.0",
+ "eslint-plugin-react": "7.23.2",
"file-loader": "6.2.0",
"history": "5.0.0",
"husky": "4.3.8",
"less": "4.1.1",
- "less-loader": "7.2.1",
- "lint-staged": "10.5.4",
+ "less-loader": "9.0.0",
+ "lint-staged": "11.0.0",
"mocha": "8.4.0",
"prettier": "2.3.0",
"proxyquire": "2.1.3",
"redux-logger": "3.0.6",
"style-loader": "2.0.0",
"url-loader": "4.1.1",
- "webpack": "4.44.2",
+ "webpack": "5.37.1",
"webpack-cli": "3.3.12",
"webpack-dev-server": "3.11.2",
"webpack-merge": "5.7.3"
diff --git a/ui/src/components/table/JobTable.js b/ui/src/components/table/JobTable.js
index deefd17..2012014 100644
--- a/ui/src/components/table/JobTable.js
+++ b/ui/src/components/table/JobTable.js
@@ -31,8 +31,8 @@ const content = (jobs, onJobRemoval, onJobStatusChanged, onJobEdit, onJobInsight
diff --git a/ui/src/components/table/NotificationAdapterTable.js b/ui/src/components/table/NotificationAdapterTable.js
index b1939f5..ee199d9 100644
--- a/ui/src/components/table/NotificationAdapterTable.js
+++ b/ui/src/components/table/NotificationAdapterTable.js
@@ -12,7 +12,7 @@ const emptyTable = () => {
);
};
-const content = (adapterData, onRemove) => {
+const content = (adapterData, onRemove, onEdit) => {
return (
{adapterData.map((data) => {
@@ -21,6 +21,7 @@ const content = (adapterData, onRemove) => {
{data.name}
+ onEdit(data.id)} />
onRemove(data.id)} />
@@ -31,7 +32,7 @@ const content = (adapterData, onRemove) => {
);
};
-export default function NotificationAdapterTable({ notificationAdapter = [], onRemove } = {}) {
+export default function NotificationAdapterTable({ notificationAdapter = [], onRemove, onEdit } = {}) {
return (
@@ -42,7 +43,7 @@ export default function NotificationAdapterTable({ notificationAdapter = [], onR
- {notificationAdapter.length === 0 ? emptyTable() : content(notificationAdapter, onRemove)}
+ {notificationAdapter.length === 0 ? emptyTable() : content(notificationAdapter, onRemove, onEdit)}
);
diff --git a/ui/src/views/jobs/mutation/JobMutation.js b/ui/src/views/jobs/mutation/JobMutation.js
index f96741c..d85b901 100644
--- a/ui/src/views/jobs/mutation/JobMutation.js
+++ b/ui/src/views/jobs/mutation/JobMutation.js
@@ -29,6 +29,7 @@ export default function JobMutator() {
const [providerCreationVisible, setProviderCreationVisibility] = useState(false);
const [notificationCreationVisible, setNotificationCreationVisibility] = useState(false);
+ const [editNotificationAdapter, setEditNotificationAdapter] = useState(null);
const [providerData, setProviderData] = useState(defaultProviderData);
const [name, setName] = useState(defaultName);
const [blacklist, setBlacklist] = useState(defaultBlacklist);
@@ -88,7 +89,7 @@ export default function JobMutator() {
ctx.showToast({
title: 'Error',
message: Exception.json != null ? Exception.json.message : Exception,
- delay: 35000,
+ delay: 8000,
backgroundColor: '#db2828',
color: '#fff',
});
@@ -106,14 +107,25 @@ export default function JobMutator() {
}}
/>
- setNotificationCreationVisibility(visible)}
- selected={providerData}
- onData={(data) => {
- setNotificationAdapterData([...notificationAdapterData, data]);
- }}
- />
+ {notificationCreationVisible && (
+ {
+ setEditNotificationAdapter(null);
+ setNotificationCreationVisibility(visible);
+ }}
+ selected={notificationAdapterData}
+ editNotificationAdapter={
+ editNotificationAdapter == null
+ ? null
+ : notificationAdapterData.find((adapter) => adapter.id === editNotificationAdapter)
+ }
+ onData={(data) => {
+ const oldData = [...notificationAdapterData].filter((o) => o.id !== data.id);
+ setNotificationAdapterData([...oldData, data]);
+ }}
+ />
+ )}