diff --git a/package-lock.json b/package-lock.json index 17c76437..62f0317c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14441,11 +14441,6 @@ "object.assign": "^4.1.0" } }, - "just-curry-it": { - "version": "3.1.0", - "resolved": "https://registry.yarnpkg.com/just-curry-it/-/just-curry-it-3.1.0.tgz", - "integrity": "sha1-q1na7TCKWLhHraFm7dCi1Adm+8U=" - }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -18717,11 +18712,6 @@ "strip-indent": "^1.0.1" } }, - "reduce-reducers": { - "version": "0.4.3", - "resolved": "https://registry.yarnpkg.com/reduce-reducers/-/reduce-reducers-0.4.3.tgz", - "integrity": "sha1-jgUmGIAc2PwnFLSRWtqok3621mw=" - }, "redux": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.4.tgz", @@ -18731,18 +18721,6 @@ "symbol-observable": "^1.2.0" } }, - "redux-actions": { - "version": "2.6.5", - "resolved": "https://registry.yarnpkg.com/redux-actions/-/redux-actions-2.6.5.tgz", - "integrity": "sha1-vcpUh2jumYMqY5EMJ23vheghon4=", - "requires": { - "invariant": "^2.2.4", - "just-curry-it": "^3.1.0", - "loose-envify": "^1.4.0", - "reduce-reducers": "^0.4.3", - "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", @@ -22007,25 +21985,12 @@ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, - "to-camel-case": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-camel-case/-/to-camel-case-1.0.0.tgz", - "integrity": "sha1-GlYFSy+daWKYzmamCJcyK29CPkY=", - "requires": { - "to-space-case": "^1.0.0" - } - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-no-case": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", - "integrity": "sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo=" - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -22088,14 +22053,6 @@ "repeat-string": "^1.6.1" } }, - "to-space-case": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", - "integrity": "sha1-sFLar7Gysp3HcM6gFj5ewOvJ/Bc=", - "requires": { - "to-no-case": "^1.0.0" - } - }, "toggle-selection": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", diff --git a/package.json b/package.json index 513d0a43..5dfe27e9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "leaflet": "^1.5.1", "moment": "^2.24.0", "promise": "^8.0.3", - "prop-types": "^15.7.2", "qs": "^6.9.0", "ramda": "^0.26.1", "react": "^16.13.1", @@ -61,7 +60,6 @@ "react-tagsinput": "^3.19.0", "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/utils/services/ShlinkApiClient.ts b/src/utils/services/ShlinkApiClient.ts index 84b5bc9e..a4db10ad 100644 --- a/src/utils/services/ShlinkApiClient.ts +++ b/src/utils/services/ShlinkApiClient.ts @@ -2,7 +2,7 @@ import qs from 'qs'; import { isEmpty, isNil, reject } from 'ramda'; import { AxiosInstance, AxiosResponse, Method } from 'axios'; import { ShortUrlsListParams } from '../../short-urls/reducers/shortUrlsListParams'; -import { ShortUrl } from '../../short-urls/data'; +import { ShortUrl, ShortUrlData } from '../../short-urls/data'; import { OptionalString } from '../utils'; import { ShlinkHealth, @@ -33,8 +33,8 @@ export default class ShlinkApiClient { this.performRequest<{ shortUrls: ShlinkShortUrlsResponse }>('/short-urls', 'GET', params) .then(({ data }) => data.shortUrls); - public readonly createShortUrl = async (options: any): Promise => { // TODO CreateShortUrl interface - const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options); + public readonly createShortUrl = async (options: ShortUrlData): Promise => { + const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options as any); return this.performRequest('/short-urls', 'POST', {}, filteredOptions) .then((resp) => resp.data); diff --git a/src/utils/services/types.ts b/src/utils/services/types.ts index 8c4c53d3..9c10ce7d 100644 --- a/src/utils/services/types.ts +++ b/src/utils/services/types.ts @@ -25,12 +25,12 @@ interface ShlinkTagsStats { export interface ShlinkTags { tags: string[]; - stats?: ShlinkTagsStats[]; // TODO Is only optional in old versions + stats?: ShlinkTagsStats[]; // Is only optional in old Shlink versions } export interface ShlinkTagsResponse { data: string[]; - stats?: ShlinkTagsStats[]; // TODO Is only optional in old versions + stats?: ShlinkTagsStats[]; // Is only optional in old Shlink versions } export interface ShlinkPaginator { @@ -40,7 +40,7 @@ export interface ShlinkPaginator { export interface ShlinkVisits { data: Visit[]; - pagination?: ShlinkPaginator; // TODO Is only optional in old versions + pagination?: ShlinkPaginator; // Is only optional in old Shlink versions } export interface ShlinkVisitsParams { diff --git a/src/visits/helpers/DefaultChart.tsx b/src/visits/helpers/DefaultChart.tsx index 1fa9a3bc..2d8f1094 100644 --- a/src/visits/helpers/DefaultChart.tsx +++ b/src/visits/helpers/DefaultChart.tsx @@ -68,7 +68,6 @@ const determineHeight = (isBarChart: boolean, labels: string[]): number | undefi return isBarChart && labels.length > 20 ? labels.length * 8 : undefined; }; -/* eslint-disable react/prop-types */ const renderPieChartLegend = ({ config }: Chart) => { const { labels = [], datasets = [] } = config.data ?? {}; const { defaultColor } = config.options ?? {} as any; @@ -88,7 +87,6 @@ const renderPieChartLegend = ({ config }: Chart) => { ); }; -/* eslint-enable react/prop-types */ const chartElementAtEvent = (onClick?: (label: string) => void) => ([ chart ]: [{ _index: number; _chart: Chart }]) => { if (!onClick || !chart) {