Merge pull request #194 from acelaya-forks/feature/fix-set-empty-max-visits

Fixed maxVisits being set to 0 when trying to reset it
This commit is contained in:
Alejandro Celaya 2020-01-28 18:51:18 +01:00 committed by GitHub
commit 3adcaef455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 6 deletions

View file

@ -1,6 +1,6 @@
build:
environment:
node: v12.11.0
node: v12.14.1
tools:
external_code_coverage:
timeout: 1200

View file

@ -1,7 +1,7 @@
language: node_js
node_js:
- "12.11.0"
- "12.14.1"
cache:
directories:

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);