From f3154e770e6bd2286dca113d8b91275a4eca156d Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 28 Jan 2020 18:36:23 +0100 Subject: [PATCH 1/2] Fixed maxVisits being set to 0 when trying to reset it --- CHANGELOG.md | 23 +++++++++++++++++++++++ src/short-urls/helpers/EditMetaModal.js | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 543aee7a..3d467d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +#### Added + +* *Nothing* + +#### Changed + +* *Nothing* + +#### Deprecated + +* *Nothing* + +#### Removed + +* *Nothing* + +#### Fixed + +* [#193](https://github.com/shlinkio/shlink-web-client/issues/193) Fixed `maxVisits` being set to 0 when trying to reset it from having a value to `null`. + + ## 2.3.0 - 2020-01-19 #### Added diff --git a/src/short-urls/helpers/EditMetaModal.js b/src/short-urls/helpers/EditMetaModal.js index f4cec441..3d403be8 100644 --- a/src/short-urls/helpers/EditMetaModal.js +++ b/src/short-urls/helpers/EditMetaModal.js @@ -5,7 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons'; import { ExternalLink } from 'react-external-link'; import moment from 'moment'; -import { pipe } from 'ramda'; +import { isEmpty, pipe } from 'ramda'; import { shortUrlType } from '../reducers/shortUrlsList'; import { shortUrlEditMetaType } from '../reducers/shortUrlMeta'; import DateInput from '../../utils/DateInput'; @@ -37,7 +37,7 @@ const EditMetaModal = ( const close = pipe(resetShortUrlMeta, toggle); const doEdit = () => editShortUrlMeta(shortUrl.shortCode, { - maxVisits: maxVisits && parseInt(maxVisits), + maxVisits: maxVisits && !isEmpty(maxVisits) ? parseInt(maxVisits) : null, validSince: validSince && formatIsoDate(validSince), validUntil: validUntil && formatIsoDate(validUntil), }).then(close); From 43cd9722a94b2f3dfb5eac3eb4488ba48b09ab97 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 28 Jan 2020 18:40:33 +0100 Subject: [PATCH 2/2] Updated project to node 12.14.1 --- .scrutinizer.yml | 2 +- .travis.yml | 2 +- Dockerfile | 2 +- docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index b4f77216..e7caa7ac 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,6 +1,6 @@ build: environment: - node: v12.11.0 + node: v12.14.1 tools: external_code_coverage: timeout: 1200 diff --git a/.travis.yml b/.travis.yml index 41bb89d5..b18498b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - - "12.11.0" + - "12.14.1" cache: directories: diff --git a/Dockerfile b/Dockerfile index fe2d61c4..02684ce2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12.11.1-alpine as node +FROM node:12.14.1-alpine as node COPY . /shlink-web-client RUN cd /shlink-web-client && npm install && npm run build diff --git a/docker-compose.yml b/docker-compose.yml index 4240ffc8..47f8cbfe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: shlink_web_client_node: container_name: shlink_web_client_node - image: node:12.11.0-alpine + image: node:12.14.1-alpine command: /bin/sh -c "cd /home/shlink/www && npm install && npm run start" volumes: - ./:/home/shlink/www