Skip to content

Commit

Permalink
+ client: Update packages - Merge pull request #613 in DNS/adguard-ho…
Browse files Browse the repository at this point in the history
…me from fix/1597 to master

Close #1597

Squashed commit of the following:

commit 1eb89586dd71260e561420fe669abc8b56a506a1
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Wed May 20 14:54:10 2020 +0300

    Fix translation in install options

commit 1ebdc9ebfe12a609f978e47db6505c7095b10f7e
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Wed May 20 13:11:34 2020 +0300

    Remove commented code

commit 2a8302c65a2a3cf7b6b1596115d1153dac32a794
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 19:02:49 2020 +0300

    Update i18n packages, add development browserlist, downgrade eslint to match peerDepencancies version

commit 3fcf73fb14cd9da508522d1a300b66af24da95e5
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 17:30:37 2020 +0300

    Remove all unused dependencies

commit e761810e3e54e188ada41245bdce7414cd0f03e8
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 16:35:24 2020 +0300

    Remove unused dependencies

commit d89d27da6befcaabcdc12bf5e7e94cbb24140010
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 16:14:09 2020 +0300

    Update regular dependencies

commit d2dfd01233d059870d5173ffd748cf61a477936f
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 15:34:10 2020 +0300

    Update all dev dependancies

commit 02b6fb480e9d310039fbe9b7aae062a41128f070
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 14:14:44 2020 +0300

    Update all postcss packages

commit 5e1fa5f99ad75f77e5e429b28ee1ca0b5e65a9a0
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 12:45:02 2020 +0300

    Prevent git from converting linebreaks in .js files

commit 0b9b3b0dccd47cfa50c9531fb61729e6b5a04523
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 12:43:01 2020 +0300

    Prevent git from converting linebreaks in .js files

commit 18b7495e9ef7130b1ac4dbba84c54127d16c6350
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Tue May 19 12:24:47 2020 +0300

    Remove linebreak-style eslint rule

commit df893dec53adebb1d662fe805fab508fd4ed5e06
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Mon May 18 20:55:47 2020 +0300

    Add prop types

commit 36178ecfc5c7fa11a6ee08d7705ca8560941af40
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Mon May 18 18:52:07 2020 +0300

    Update eslint and babel, fix eslint warnings

commit f045b4a2e6b9b78f7e88e3b5d1419c29966a8230
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Mon May 18 16:45:49 2020 +0300

    Update css loading webpack rules

commit 247fa1ed548ef0706a03fdada8309c1454d191f8
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 16:13:49 2020 +0300

    Suppress linebreak-style eslint error for Windows

commit d6499aac507100d6918c849c06d739d80f2229f0
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 14:55:07 2020 +0300

    Suppress eslint exit code

commit ae2d6c614ea23a90d515168f8752e959298894ef
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 14:05:18 2020 +0300

    Edit css file warnings

commit 60675050f2a5baebc679fc05da7e033e5c740d90
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 13:10:26 2020 +0300

    Remove uglifyjs plugin

commit a27806434dd8672e71a26c7a2e810d77e5e229fa
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 01:29:17 2020 +0300

    Fix DefinePlugin value

commit 8f2966ca59195c2f70bca5072d20515d536f42a6
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Sat May 16 01:05:03 2020 +0300

    Update webpack
  • Loading branch information
ArtemBaskal committed May 22, 2020
1 parent 8b25a48 commit 6f3cd4e
Show file tree
Hide file tree
Showing 131 changed files with 9,361 additions and 10,814 deletions.
16 changes: 16 additions & 0 deletions client/.babelrc
@@ -0,0 +1,16 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread"
]
}
File renamed without changes.
1 change: 1 addition & 0 deletions client/.gitattributes
@@ -0,0 +1 @@
*.js text eol=lf
18,169 changes: 8,282 additions & 9,887 deletions client/package-lock.json

Large diffs are not rendered by default.

166 changes: 87 additions & 79 deletions client/package.json
@@ -1,81 +1,89 @@
{ {
"name": "dashboard", "name": "dashboard",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build-dev": "cross-env NODE_ENV=development webpack --config webpack.dev.js", "build-dev": "cross-env BUILD_ENV=dev webpack --config webpack.dev.js",
"watch": "cross-env NODE_ENV=development webpack --config webpack.dev.js --watch", "watch": "cross-env BUILD_ENV=dev webpack --config webpack.dev.js --watch",
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.prod.js", "build-prod": "cross-env BUILD_ENV=prod webpack --config webpack.prod.js",
"lint": "eslint client/" "lint": "eslint src"
}, },
"dependencies": { "dependencies": {
"@nivo/line": "^0.49.1", "@nivo/line": "^0.49.1",
"axios": "^0.19.0", "axios": "^0.19.2",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"date-fns": "^1.29.0", "date-fns": "^1.29.0",
"i18next": "^12.0.0", "i18next": "^19.4.4",
"i18next-browser-languagedetector": "^2.2.3", "i18next-browser-languagedetector": "^4.2.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"nanoid": "^1.2.3", "nanoid": "^3.1.9",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.4.0", "react": "^16.13.1",
"react-click-outside": "^3.0.1", "react-click-outside": "^3.0.1",
"react-dom": "^16.4.0", "react-dom": "^16.13.1",
"react-i18next": "^8.2.0", "react-i18next": "^11.4.0",
"react-modal": "^3.4.5", "react-modal": "^3.11.2",
"react-redux": "^5.0.7", "react-redux": "^7.2.0",
"react-redux-loading-bar": "^4.0.7", "react-redux-loading-bar": "^4.6.0",
"react-router-dom": "^4.2.2", "react-router-dom": "^5.2.0",
"react-router-hash-link": "^1.2.2", "react-router-hash-link": "^1.2.2",
"react-select": "^3.0.8", "react-select": "^3.1.0",
"react-table": "^6.10.3", "react-table": "^6.11.4",
"react-transition-group": "^2.4.0", "react-transition-group": "^4.4.1",
"redux": "^4.0.0", "redux": "^4.0.5",
"redux-actions": "^2.4.0", "redux-actions": "^2.6.5",
"redux-form": "^7.4.2", "redux-form": "^8.3.5",
"redux-thunk": "^2.3.0", "redux-thunk": "^2.3.0",
"url-polyfill": "^1.1.7" "url-polyfill": "^1.1.9"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^8.6.3", "@babel/core": "^7.9.6",
"babel-core": "6.26.0", "@babel/plugin-proposal-class-properties": "^7.8.3",
"babel-eslint": "^8.2.3", "@babel/plugin-proposal-object-rest-spread": "^7.9.6",
"babel-loader": "7.1.2", "@babel/plugin-transform-runtime": "^7.9.6",
"babel-plugin-transform-runtime": "^6.23.0", "@babel/preset-env": "^7.9.6",
"babel-preset-env": "^1.7.0", "@babel/preset-react": "^7.9.4",
"babel-preset-react": "^6.24.1", "autoprefixer": "^9.8.0",
"babel-preset-stage-2": "^6.24.1", "babel-eslint": "^10.1.0",
"babel-runtime": "6.26.0", "babel-loader": "^8.1.0",
"clean-webpack-plugin": "^0.1.19", "clean-webpack-plugin": "^3.0.0",
"compression-webpack-plugin": "^1.1.11", "copy-webpack-plugin": "^6.0.1",
"copy-webpack-plugin": "^4.6.0", "cross-env": "^7.0.2",
"cross-env": "^7.0.2", "css-loader": "^3.5.3",
"css-loader": "^2.1.1", "eslint": "^6.8.0",
"eslint": "^4.19.1", "eslint-config-airbnb": "^18.1.0",
"eslint-config-airbnb-base": "^12.1.0", "eslint-import-resolver-webpack": "^0.12.1",
"eslint-config-react-app": "^2.1.0", "eslint-loader": "^4.0.2",
"eslint-import-resolver-webpack": "^0.12.1", "eslint-plugin-import": "^2.20.2",
"eslint-loader": "1.9.0", "eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-import": "^2.12.0", "eslint-plugin-react": "^7.20.0",
"eslint-plugin-jsx-a11y": "5.1.1", "eslint-plugin-react-hooks": "^2.5.0",
"eslint-plugin-react": "^7.9.1", "file-loader": "6.0.0",
"extract-text-webpack-plugin": "^3.0.2", "html-webpack-plugin": "^4.3.0",
"file-loader": "1.1.5", "mini-css-extract-plugin": "^0.9.0",
"html-webpack-plugin": "^3.2.0", "path": "^0.12.7",
"postcss-flexbugs-fixes": "3.2.0", "postcss-flexbugs-fixes": "4.2.1",
"postcss-import": "^11.1.0", "postcss-loader": "^3.0.0",
"postcss-loader": "^2.1.5", "style-loader": "^1.2.1",
"postcss-mixins": "^6.2.0", "stylelint": "^13.5.0",
"postcss-preset-env": "^5.1.0", "stylelint-webpack-plugin": "2.0.0",
"postcss-svg": "^2.4.0", "url-loader": "^4.1.0",
"style-loader": "^0.21.0", "webpack": "^4.43.0",
"stylelint": "^9.10.1", "webpack-cli": "^3.3.11",
"stylelint-webpack-plugin": "0.10.4", "webpack-dev-server": "^3.11.0",
"svg-url-loader": "^2.3.2", "webpack-merge": "^4.2.2"
"uglifyjs-webpack-plugin": "^1.2.7", },
"url-loader": "^1.0.1", "browserslist": {
"webpack": "3.8.1", "development": [
"webpack-dev-server": "^3.1.14", "last 1 chrome version",
"webpack-merge": "^4.1.3" "last 1 firefox version",
} "last 1 safari version"
],
"production": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 9"
]
}
} }
12 changes: 6 additions & 6 deletions client/src/actions/access.js
@@ -1,10 +1,10 @@
import { createAction } from 'redux-actions'; import { createAction } from 'redux-actions';
import { t } from 'i18next'; import i18next from 'i18next';


import apiClient from '../api/Api'; import apiClient from '../api/Api';
import { addErrorToast, addSuccessToast } from './index';
import { normalizeTextarea } from '../helpers/helpers'; import { normalizeTextarea } from '../helpers/helpers';
import { ACTION } from '../helpers/constants'; import { ACTION } from '../helpers/constants';
import { addErrorToast, addSuccessToast } from './toasts';


export const getAccessListRequest = createAction('GET_ACCESS_LIST_REQUEST'); export const getAccessListRequest = createAction('GET_ACCESS_LIST_REQUEST');
export const getAccessListFailure = createAction('GET_ACCESS_LIST_FAILURE'); export const getAccessListFailure = createAction('GET_ACCESS_LIST_FAILURE');
Expand All @@ -25,7 +25,7 @@ export const setAccessListRequest = createAction('SET_ACCESS_LIST_REQUEST');
export const setAccessListFailure = createAction('SET_ACCESS_LIST_FAILURE'); export const setAccessListFailure = createAction('SET_ACCESS_LIST_FAILURE');
export const setAccessListSuccess = createAction('SET_ACCESS_LIST_SUCCESS'); export const setAccessListSuccess = createAction('SET_ACCESS_LIST_SUCCESS');


export const setAccessList = config => async (dispatch) => { export const setAccessList = (config) => async (dispatch) => {
dispatch(setAccessListRequest()); dispatch(setAccessListRequest());
try { try {
const { allowed_clients, disallowed_clients, blocked_hosts } = config; const { allowed_clients, disallowed_clients, blocked_hosts } = config;
Expand Down Expand Up @@ -58,7 +58,7 @@ export const toggleClientBlock = (type, ip) => async (dispatch) => {
let updatedDisallowedClients = disallowed_clients || []; let updatedDisallowedClients = disallowed_clients || [];


if (type === ACTION.unblock && updatedDisallowedClients.includes(ip)) { if (type === ACTION.unblock && updatedDisallowedClients.includes(ip)) {
updatedDisallowedClients = updatedDisallowedClients.filter(client => client !== ip); updatedDisallowedClients = updatedDisallowedClients.filter((client) => client !== ip);
} else if (type === ACTION.block && !updatedDisallowedClients.includes(ip)) { } else if (type === ACTION.block && !updatedDisallowedClients.includes(ip)) {
updatedDisallowedClients.push(ip); updatedDisallowedClients.push(ip);
} }
Expand All @@ -73,9 +73,9 @@ export const toggleClientBlock = (type, ip) => async (dispatch) => {
dispatch(toggleClientBlockSuccess(values)); dispatch(toggleClientBlockSuccess(values));


if (type === ACTION.unblock) { if (type === ACTION.unblock) {
dispatch(addSuccessToast(t('client_unblocked', { ip }))); dispatch(addSuccessToast(i18next.t('client_unblocked', { ip })));
} else if (type === ACTION.block) { } else if (type === ACTION.block) {
dispatch(addSuccessToast(t('client_blocked', { ip }))); dispatch(addSuccessToast(i18next.t('client_blocked', { ip })));
} }
} catch (error) { } catch (error) {
dispatch(addErrorToast({ error })); dispatch(addErrorToast({ error }));
Expand Down
15 changes: 8 additions & 7 deletions client/src/actions/clients.js
@@ -1,21 +1,22 @@
import { createAction } from 'redux-actions'; import { createAction } from 'redux-actions';
import { t } from 'i18next'; import i18next from 'i18next';
import apiClient from '../api/Api'; import apiClient from '../api/Api';
import { addErrorToast, addSuccessToast, getClients } from './index'; import { getClients } from './index';
import { addErrorToast, addSuccessToast } from './toasts';


export const toggleClientModal = createAction('TOGGLE_CLIENT_MODAL'); export const toggleClientModal = createAction('TOGGLE_CLIENT_MODAL');


export const addClientRequest = createAction('ADD_CLIENT_REQUEST'); export const addClientRequest = createAction('ADD_CLIENT_REQUEST');
export const addClientFailure = createAction('ADD_CLIENT_FAILURE'); export const addClientFailure = createAction('ADD_CLIENT_FAILURE');
export const addClientSuccess = createAction('ADD_CLIENT_SUCCESS'); export const addClientSuccess = createAction('ADD_CLIENT_SUCCESS');


export const addClient = config => async (dispatch) => { export const addClient = (config) => async (dispatch) => {
dispatch(addClientRequest()); dispatch(addClientRequest());
try { try {
await apiClient.addClient(config); await apiClient.addClient(config);
dispatch(addClientSuccess()); dispatch(addClientSuccess());
dispatch(toggleClientModal()); dispatch(toggleClientModal());
dispatch(addSuccessToast(t('client_added', { key: config.name }))); dispatch(addSuccessToast(i18next.t('client_added', { key: config.name })));
dispatch(getClients()); dispatch(getClients());
} catch (error) { } catch (error) {
dispatch(addErrorToast({ error })); dispatch(addErrorToast({ error }));
Expand All @@ -27,12 +28,12 @@ export const deleteClientRequest = createAction('DELETE_CLIENT_REQUEST');
export const deleteClientFailure = createAction('DELETE_CLIENT_FAILURE'); export const deleteClientFailure = createAction('DELETE_CLIENT_FAILURE');
export const deleteClientSuccess = createAction('DELETE_CLIENT_SUCCESS'); export const deleteClientSuccess = createAction('DELETE_CLIENT_SUCCESS');


export const deleteClient = config => async (dispatch) => { export const deleteClient = (config) => async (dispatch) => {
dispatch(deleteClientRequest()); dispatch(deleteClientRequest());
try { try {
await apiClient.deleteClient(config); await apiClient.deleteClient(config);
dispatch(deleteClientSuccess()); dispatch(deleteClientSuccess());
dispatch(addSuccessToast(t('client_deleted', { key: config.name }))); dispatch(addSuccessToast(i18next.t('client_deleted', { key: config.name })));
dispatch(getClients()); dispatch(getClients());
} catch (error) { } catch (error) {
dispatch(addErrorToast({ error })); dispatch(addErrorToast({ error }));
Expand All @@ -52,7 +53,7 @@ export const updateClient = (config, name) => async (dispatch) => {
await apiClient.updateClient(data); await apiClient.updateClient(data);
dispatch(updateClientSuccess()); dispatch(updateClientSuccess());
dispatch(toggleClientModal()); dispatch(toggleClientModal());
dispatch(addSuccessToast(t('client_updated', { key: name }))); dispatch(addSuccessToast(i18next.t('client_updated', { key: name })));
dispatch(getClients()); dispatch(getClients());
} catch (error) { } catch (error) {
dispatch(addErrorToast({ error })); dispatch(addErrorToast({ error }));
Expand Down
4 changes: 2 additions & 2 deletions client/src/actions/dnsConfig.js
@@ -1,8 +1,8 @@
import { createAction } from 'redux-actions'; import { createAction } from 'redux-actions';


import apiClient from '../api/Api'; import apiClient from '../api/Api';
import { addErrorToast, addSuccessToast } from './index';
import { normalizeTextarea } from '../helpers/helpers'; import { normalizeTextarea } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './toasts';


export const getDnsConfigRequest = createAction('GET_DNS_CONFIG_REQUEST'); export const getDnsConfigRequest = createAction('GET_DNS_CONFIG_REQUEST');
export const getDnsConfigFailure = createAction('GET_DNS_CONFIG_FAILURE'); export const getDnsConfigFailure = createAction('GET_DNS_CONFIG_FAILURE');
Expand All @@ -23,7 +23,7 @@ export const setDnsConfigRequest = createAction('SET_DNS_CONFIG_REQUEST');
export const setDnsConfigFailure = createAction('SET_DNS_CONFIG_FAILURE'); export const setDnsConfigFailure = createAction('SET_DNS_CONFIG_FAILURE');
export const setDnsConfigSuccess = createAction('SET_DNS_CONFIG_SUCCESS'); export const setDnsConfigSuccess = createAction('SET_DNS_CONFIG_SUCCESS');


export const setDnsConfig = config => async (dispatch) => { export const setDnsConfig = (config) => async (dispatch) => {
dispatch(setDnsConfigRequest()); dispatch(setDnsConfigRequest());
try { try {
const data = { ...config }; const data = { ...config };
Expand Down
6 changes: 3 additions & 3 deletions client/src/actions/encryption.js
@@ -1,7 +1,7 @@
import { createAction } from 'redux-actions'; import { createAction } from 'redux-actions';
import apiClient from '../api/Api'; import apiClient from '../api/Api';
import { addErrorToast, addSuccessToast } from './index';
import { redirectToCurrentProtocol } from '../helpers/helpers'; import { redirectToCurrentProtocol } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './toasts';


export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST'); export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE'); export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
Expand All @@ -25,7 +25,7 @@ export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE'); export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS'); export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');


export const setTlsConfig = config => async (dispatch, getState) => { export const setTlsConfig = (config) => async (dispatch, getState) => {
dispatch(setTlsConfigRequest()); dispatch(setTlsConfigRequest());
try { try {
const { httpPort } = getState().dashboard; const { httpPort } = getState().dashboard;
Expand All @@ -51,7 +51,7 @@ export const validateTlsConfigRequest = createAction('VALIDATE_TLS_CONFIG_REQUES
export const validateTlsConfigFailure = createAction('VALIDATE_TLS_CONFIG_FAILURE'); export const validateTlsConfigFailure = createAction('VALIDATE_TLS_CONFIG_FAILURE');
export const validateTlsConfigSuccess = createAction('VALIDATE_TLS_CONFIG_SUCCESS'); export const validateTlsConfigSuccess = createAction('VALIDATE_TLS_CONFIG_SUCCESS');


export const validateTlsConfig = config => async (dispatch) => { export const validateTlsConfig = (config) => async (dispatch) => {
dispatch(validateTlsConfigRequest()); dispatch(validateTlsConfigRequest());
try { try {
const values = { ...config }; const values = { ...config };
Expand Down
14 changes: 7 additions & 7 deletions client/src/actions/filtering.js
@@ -1,10 +1,10 @@
import { createAction } from 'redux-actions'; import { createAction } from 'redux-actions';
import { showLoading, hideLoading } from 'react-redux-loading-bar'; import { showLoading, hideLoading } from 'react-redux-loading-bar';
import { t } from 'i18next'; import i18next from 'i18next';


import { normalizeFilteringStatus, normalizeRulesTextarea } from '../helpers/helpers'; import { normalizeFilteringStatus, normalizeRulesTextarea } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './index';
import apiClient from '../api/Api'; import apiClient from '../api/Api';
import { addErrorToast, addSuccessToast } from './toasts';


export const toggleFilteringModal = createAction('FILTERING_MODAL_TOGGLE'); export const toggleFilteringModal = createAction('FILTERING_MODAL_TOGGLE');
export const handleRulesChange = createAction('HANDLE_RULES_CHANGE'); export const handleRulesChange = createAction('HANDLE_RULES_CHANGE');
Expand All @@ -28,7 +28,7 @@ export const setRulesRequest = createAction('SET_RULES_REQUEST');
export const setRulesFailure = createAction('SET_RULES_FAILURE'); export const setRulesFailure = createAction('SET_RULES_FAILURE');
export const setRulesSuccess = createAction('SET_RULES_SUCCESS'); export const setRulesSuccess = createAction('SET_RULES_SUCCESS');


export const setRules = rules => async (dispatch) => { export const setRules = (rules) => async (dispatch) => {
dispatch(setRulesRequest()); dispatch(setRulesRequest());
try { try {
const normalizedRules = normalizeRulesTextarea(rules); const normalizedRules = normalizeRulesTextarea(rules);
Expand Down Expand Up @@ -113,7 +113,7 @@ export const refreshFiltersRequest = createAction('FILTERING_REFRESH_REQUEST');
export const refreshFiltersFailure = createAction('FILTERING_REFRESH_FAILURE'); export const refreshFiltersFailure = createAction('FILTERING_REFRESH_FAILURE');
export const refreshFiltersSuccess = createAction('FILTERING_REFRESH_SUCCESS'); export const refreshFiltersSuccess = createAction('FILTERING_REFRESH_SUCCESS');


export const refreshFilters = config => async (dispatch) => { export const refreshFilters = (config) => async (dispatch) => {
dispatch(refreshFiltersRequest()); dispatch(refreshFiltersRequest());
dispatch(showLoading()); dispatch(showLoading());
try { try {
Expand All @@ -122,7 +122,7 @@ export const refreshFilters = config => async (dispatch) => {
dispatch(refreshFiltersSuccess()); dispatch(refreshFiltersSuccess());


if (updated > 0) { if (updated > 0) {
dispatch(addSuccessToast(t('list_updated', { count: updated }))); dispatch(addSuccessToast(i18next.t('list_updated', { count: updated })));
} else { } else {
dispatch(addSuccessToast('all_lists_up_to_date_toast')); dispatch(addSuccessToast('all_lists_up_to_date_toast'));
} }
Expand All @@ -140,7 +140,7 @@ export const setFiltersConfigRequest = createAction('SET_FILTERS_CONFIG_REQUEST'
export const setFiltersConfigFailure = createAction('SET_FILTERS_CONFIG_FAILURE'); export const setFiltersConfigFailure = createAction('SET_FILTERS_CONFIG_FAILURE');
export const setFiltersConfigSuccess = createAction('SET_FILTERS_CONFIG_SUCCESS'); export const setFiltersConfigSuccess = createAction('SET_FILTERS_CONFIG_SUCCESS');


export const setFiltersConfig = config => async (dispatch, getState) => { export const setFiltersConfig = (config) => async (dispatch, getState) => {
dispatch(setFiltersConfigRequest()); dispatch(setFiltersConfigRequest());
try { try {
const { enabled } = config; const { enabled } = config;
Expand Down Expand Up @@ -170,7 +170,7 @@ export const checkHostSuccess = createAction('CHECK_HOST_SUCCESS');
* @param {string} host.name * @param {string} host.name
* @returns {undefined} * @returns {undefined}
*/ */
export const checkHost = host => async (dispatch) => { export const checkHost = (host) => async (dispatch) => {
dispatch(checkHostRequest()); dispatch(checkHostRequest());
try { try {
const data = await apiClient.checkHost(host); const data = await apiClient.checkHost(host);
Expand Down

0 comments on commit 6f3cd4e

Please sign in to comment.