diff --git a/package-lock.json b/package-lock.json index 05204cab..b13d0843 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1463,14 +1463,6 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, - "@shlinkio/redux-localstorage-simple": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@shlinkio/redux-localstorage-simple/-/redux-localstorage-simple-2.2.0.tgz", - "integrity": "sha512-2/VggbehDAM1dOH7rT3Qjr/MTp7qQ6VeTM+Ez4JnMUPtU9OxgV9FQbKqduasLT4EZhlRUhxwBp7K6WO3gROQDA==", - "requires": { - "object-merge": "2.5.1" - } - }, "@stryker-mutator/api": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@stryker-mutator/api/-/api-2.1.0.tgz", @@ -14548,6 +14540,14 @@ "to-camel-case": "^1.0.0" } }, + "redux-localstorage-simple": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/redux-localstorage-simple/-/redux-localstorage-simple-2.2.0.tgz", + "integrity": "sha512-BmgnJ3NkxTDvNsnHAZrRVDgODafg2Vtb17q2F2LEhuJ+EderZBJA6aqRsyqZC32BJWpu8PPtferv4Io9dpUf3w==", + "requires": { + "object-merge": "2.5.1" + } + }, "redux-thunk": { "version": "2.3.0", "resolved": "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz", diff --git a/package.json b/package.json index 2e2678a4..93b1ea89 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "shlink-web-client", "description": "A React-based progressive web application for shlink", - "version": "2.3.0", "private": false, "homepage": "", "repository": "https://github.com/shlinkio/shlink-web-client", @@ -27,7 +26,6 @@ "@fortawesome/free-regular-svg-icons": "^5.11.2", "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.5", - "@shlinkio/redux-localstorage-simple": "^2.2.0", "array-filter": "^1.0.0", "array-map": "^0.0.0", "array-reduce": "^0.0.0", @@ -63,6 +61,7 @@ "reactstrap": "^8.0.1", "redux": "^4.0.4", "redux-actions": "^2.6.5", + "redux-localstorage-simple": "^2.2.0", "redux-thunk": "^2.3.0", "uuid": "^3.3.3" }, diff --git a/src/container/store.js b/src/container/store.js index 41e9b9ce..5066521a 100644 --- a/src/container/store.js +++ b/src/container/store.js @@ -1,6 +1,6 @@ import ReduxThunk from 'redux-thunk'; import { applyMiddleware, compose, createStore } from 'redux'; -import { save, load } from '@shlinkio/redux-localstorage-simple'; +import { save, load } from 'redux-localstorage-simple'; import reducers from '../reducers'; const composeEnhancers = process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ @@ -11,6 +11,7 @@ const localStorageConfig = { states: [ 'settings', 'servers' ], namespace: 'shlink', namespaceSeparator: '.', + debounce: 300, }; const store = createStore(reducers, load(localStorageConfig), composeEnhancers( diff --git a/src/servers/ServersDropdown.js b/src/servers/ServersDropdown.js index d997c403..c4200e5d 100644 --- a/src/servers/ServersDropdown.js +++ b/src/servers/ServersDropdown.js @@ -2,20 +2,17 @@ import { isEmpty, values } from 'ramda'; import React from 'react'; import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap'; import PropTypes from 'prop-types'; +import { Link } from 'react-router-dom'; import { serverType } from './prop-types'; const propTypes = { servers: PropTypes.object, selectedServer: serverType, - history: PropTypes.shape({ - push: PropTypes.func, - }), }; const ServersDropdown = (serversExporter) => { - const ServersDropdownComp = ({ servers, selectedServer, history }) => { + const ServersDropdownComp = ({ servers, selectedServer }) => { const serversList = values(servers); - const loadServer = (id) => history.push(`/server/${id}/list-short-urls/1`); const renderServers = () => { if (isEmpty(serversList)) { @@ -25,7 +22,12 @@ const ServersDropdown = (serversExporter) => { return ( {serversList.map(({ name, id }) => ( - loadServer(id)}> + {name} ))} diff --git a/src/servers/services/provideServices.js b/src/servers/services/provideServices.js index a431d363..3d941eec 100644 --- a/src/servers/services/provideServices.js +++ b/src/servers/services/provideServices.js @@ -22,7 +22,6 @@ const provideServices = (bottle, connect, withRouter) => { bottle.decorator('EditServer', connect([ 'selectedServer' ], [ 'editServer', 'selectServer' ])); bottle.serviceFactory('ServersDropdown', ServersDropdown, 'ServersExporter'); - bottle.decorator('ServersDropdown', withRouter); bottle.decorator('ServersDropdown', connect([ 'servers', 'selectedServer' ])); bottle.serviceFactory('DeleteServerModal', () => DeleteServerModal); diff --git a/src/settings/RealTimeUpdates.js b/src/settings/RealTimeUpdates.js index 1425a0ac..80d65fbe 100644 --- a/src/settings/RealTimeUpdates.js +++ b/src/settings/RealTimeUpdates.js @@ -1,8 +1,6 @@ import React from 'react'; -import { Card, CardBody, CardHeader, UncontrolledTooltip } from 'reactstrap'; +import { Card, CardBody, CardHeader } from 'reactstrap'; import PropTypes from 'prop-types'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import Checkbox from '../utils/Checkbox'; import { SettingsType } from './reducers/settings'; @@ -16,12 +14,8 @@ const RealTimeUpdates = ({ settings: { realTimeUpdates }, setRealTimeUpdates }) Real-time updates - Enable real-time updates - - - Enable or disable real-time updates, when using Shlink v2.2.0 or newer. - + );