Compare commits

...

1060 Commits

Author SHA1 Message Date
Alejandro Celaya
f16e9565e2 Added v3.1.1 to changelog 2021-05-08 11:04:21 +02:00
Alejandro Celaya
e65f9a7b89 Merge pull request #419 from acelaya-forks/feature/edit-feedback
Feature/edit feedback
2021-05-08 11:02:17 +02:00
Alejandro Celaya
0141a1e0ed Updated changelog 2021-05-08 10:57:12 +02:00
Alejandro Celaya
937876ce67 Improved feedback when editing a short URL 2021-05-08 10:56:20 +02:00
Alejandro Celaya
b52120e0d3 Updated changelog 2021-05-07 20:37:41 +02:00
Alejandro Celaya
62b65334b5 Merge pull request #418 from antwonw/patch-1
Update QrCodeModal.tsx
2021-05-07 20:36:25 +02:00
antwonw
76dae535d9 Update QrCodeModal.tsx
Remove indivisible class to fix hyperlink extending outside modal.
2021-05-06 16:56:53 -07:00
Alejandro Celaya
23ba140ff4 Merge pull request #416 from acelaya-forks/feature/prepend-visits
Feature/prepend visits
2021-05-01 16:44:21 +02:00
Alejandro Celaya
76ff7d81b9 Updated changelog 2021-05-01 16:40:22 +02:00
Alejandro Celaya
66deba29f5 Ensured new visits are prepended and not appended, ensuring they keep the proper order 2021-05-01 16:39:13 +02:00
Alejandro Celaya
e44527e9c9 Merge pull request #415 from acelaya-forks/feature/update-url-on-list
Feature/update url on list
2021-04-24 18:06:02 +02:00
Alejandro Celaya
aec629b95c Updated changelog 2021-04-24 18:01:41 +02:00
Alejandro Celaya
fa4664e583 Ensured edited short URLs are reflected in redux state when needed 2021-04-24 17:58:37 +02:00
Alejandro Celaya
2952ac8892 Merge pull request #406 from acelaya-forks/feature/reduce-margins
Feature/reduce margins
2021-03-29 21:26:49 +02:00
Alejandro Celaya
cf4fc4fa30 Updated changelog 2021-03-29 21:22:28 +02:00
Alejandro Celaya
2d61748aac Fixed styles in disabled days in date picker 2021-03-29 21:21:53 +02:00
Alejandro Celaya
7f61825768 Reduced and standardized overall vertical spacing 2021-03-29 21:08:48 +02:00
Alejandro Celaya
c3d6c83ec4 Merge pull request #405 from acelaya-forks/feature/orphan-visits-improvements
Feature/orphan visits improvements
2021-03-28 21:07:52 +02:00
Alejandro Celaya
c3e38fd580 Improved VisitsParser test 2021-03-28 21:03:46 +02:00
Alejandro Celaya
db778a73f7 Updated changelog 2021-03-28 20:57:19 +02:00
Alejandro Celaya
f0a04ced75 Added graph with orphan visits grouped by visited URL 2021-03-28 20:56:16 +02:00
Alejandro Celaya
d6bb718672 Added filtering by type to orphan visits 2021-03-28 17:45:47 +02:00
Alejandro Celaya
6d887ec4a8 Replaced custom reducers with ramda's countBy 2021-03-28 16:27:31 +02:00
Alejandro Celaya
859cd9e5e3 Improved VisitsTable test 2021-03-28 16:06:37 +02:00
Alejandro Celaya
eabd7d9ecb Added visited URL column on visits table for orphan visits 2021-03-28 15:57:22 +02:00
Alejandro Celaya
205e3ffb90 Merge pull request #404 from acelaya-forks/feature/edit-title
Feature/edit title
2021-03-27 19:01:02 +01:00
Alejandro Celaya
8c7a91c7b8 Memoized initial state for editing short URL, to ensure the form values are not reset while saving 2021-03-27 18:56:24 +01:00
Alejandro Celaya
56aab349db Updated ShortUrlForm to ensure it does not render empty cards 2021-03-27 18:39:55 +01:00
Alejandro Celaya
6628a4059e Updated changelog 2021-03-27 17:58:17 +01:00
Alejandro Celaya
10c9f7dabd Added header to EditShortUrl and created EditSHortUrl test 2021-03-27 17:56:46 +01:00
Alejandro Celaya
d703e5e182 Deleted reducers for short URL tags and short URL meta 2021-03-27 14:13:10 +01:00
Alejandro Celaya
3ad0c4d009 Deleted modals that were used to edit short URLs, since now there's a dedicated section 2021-03-27 10:49:23 +01:00
Alejandro Celaya
1403538660 Removed children from ShortUrlForm 2021-03-27 10:41:13 +01:00
Alejandro Celaya
ca670d810d Added error/loading handling to edit short URL 2021-03-27 10:27:46 +01:00
Alejandro Celaya
d5e20f445d Ensured title is not sent when its value is empty during short URL creation/edition 2021-03-27 10:19:35 +01:00
Alejandro Celaya
eea76d88c3 Ensured all data can be set when editing a short URL 2021-03-27 09:49:47 +01:00
Alejandro Celaya
a019bd30df Created view to edit short URLs 2021-03-20 16:32:12 +01:00
Alejandro Celaya
631b46393b Added title to short URL form 2021-03-20 11:18:00 +01:00
Alejandro Celaya
98aa85ca14 Created reusable component to have a short URL form 2021-03-19 19:11:27 +01:00
Alejandro Celaya
ea01d22369 Merge pull request #403 from acelaya-forks/feature/export-stats
Feature/export stats
2021-03-14 18:18:29 +01:00
Alejandro Celaya
ff1d2f63c8 Updated changelog 2021-03-14 18:14:10 +01:00
Alejandro Celaya
71468379bd Fixed headers when exporting visits to CSV 2021-03-14 18:12:10 +01:00
Alejandro Celaya
843f646264 Improved styling of the export visits button 2021-03-14 13:31:58 +01:00
Alejandro Celaya
508623f89f Improved styling of the export visits button 2021-03-14 13:30:50 +01:00
Alejandro Celaya
482489599e Created VisitsExporter test 2021-03-14 13:16:24 +01:00
Alejandro Celaya
03f63e3ee3 Added button to export visits as CSV 2021-03-14 12:53:01 +01:00
Alejandro Celaya
3f3523b80f Extracted helper function to generate a Csv file 2021-03-14 11:47:23 +01:00
Alejandro Celaya
1594717f33 Merge pull request #402 from acelaya-forks/feature/visits-default-value
Feature/visits default value
2021-03-06 17:38:08 +01:00
Alejandro Celaya
ed92b9c949 Updated changelog 2021-03-06 17:33:34 +01:00
Alejandro Celaya
e76b22b2ae Ensured consistent heights in settings cards 2021-03-06 17:30:21 +01:00
Alejandro Celaya
e380ddb40f Replaced test by it in tests 2021-03-06 17:25:09 +01:00
Alejandro Celaya
426d000a59 Added tests for new visits settings 2021-03-06 17:21:23 +01:00
Alejandro Celaya
fee62484b5 Created section to set default date interval for visits 2021-03-06 16:54:43 +01:00
Alejandro Celaya
d3f9650e82 Added new visits settings 2021-03-06 10:56:49 +01:00
Alejandro Celaya
ad46927750 Merge pull request #401 from acelaya-forks/feature/feature-improvements
Feature/feature improvements
2021-03-06 10:21:56 +01:00
Alejandro Celaya
bd79230007 Fixed version definition 2021-03-06 10:16:13 +01:00
Alejandro Celaya
5224e7b4ef Created new feature checkers 2021-03-06 09:58:29 +01:00
Alejandro Celaya
70ce099913 Added stricter types for SemVer versions 2021-03-06 09:38:48 +01:00
Alejandro Celaya
b4c2fb5b8f Merge pull request #400 from acelaya-forks/feature/improve-reducer
Feature/improve reducer
2021-03-05 16:31:18 +01:00
Alejandro Celaya
6fbf65c873 Updated changelog 2021-03-05 16:26:29 +01:00
Alejandro Celaya
13d3a95a06 Improved short URL detail redux action so that it avoids API calls when the URL is found in local state 2021-03-05 16:25:20 +01:00
Alejandro Celaya
56b3523c5b Moved short URL detail reducer to short-urls module 2021-03-05 16:04:02 +01:00
Alejandro Celaya
8a69adfbc9 Merge pull request #399 from acelaya-forks/feature/title-in-list
Feature/title in list
2021-03-05 15:48:59 +01:00
Alejandro Celaya
87a32b412f Added short URL title to visits header 2021-03-05 15:44:15 +01:00
Alejandro Celaya
df87ad5867 Updated changelog 2021-03-05 15:24:38 +01:00
Alejandro Celaya
f15bbcd027 Improved ShortUrlsRow test 2021-03-05 15:23:38 +01:00
Alejandro Celaya
3c9c0fe994 Added support for title field in short URL table 2021-03-05 14:20:49 +01:00
Alejandro Celaya
a665e96908 Updated to coding-standard v1.2.2 2021-03-05 11:14:58 +01:00
Alejandro Celaya
fddba80b08 Merge pull request #396 from acelaya-forks/feature/updated-deps
Feature/updated deps
2021-02-28 19:11:02 +01:00
Alejandro Celaya
caa3a09827 Fixed TS error in test 2021-02-28 19:00:11 +01:00
Alejandro Celaya
fa70520f38 Fixed props interface definition 2021-02-28 18:57:27 +01:00
Alejandro Celaya
b789f64a54 Updated changelog 2021-02-28 18:51:18 +01:00
Alejandro Celaya
ce0fc1094e Enabled @typescript-eslint/no-unsafe-return eslint rule again 2021-02-28 18:48:36 +01:00
Alejandro Celaya
ad0a889548 Enabled @typescript-eslint/no-base-to-string eslint rule again 2021-02-28 18:22:44 +01:00
Alejandro Celaya
1fe76500e8 Enabled @typescript-eslint/no-unsafe-call eslint rule again 2021-02-28 17:43:41 +01:00
Alejandro Celaya
86544f4b24 Enabled @typescript-eslint/unbound-method eslint rule again 2021-02-28 17:21:26 +01:00
Alejandro Celaya
c8f8416c06 No longer continue on error when linting fails during CI 2021-02-28 17:02:47 +01:00
Alejandro Celaya
3d2228441a Enabled @typescript-eslint/ban-ts-comment eslint rule 2021-02-28 13:11:27 +01:00
Alejandro Celaya
3f616d5482 Updated to @shlinkio/eslint-config-js-coding-standard@1.2.1 2021-02-28 13:01:11 +01:00
Alejandro Celaya
47fb26368b Updated dependencies and fixed coding styles 2021-02-28 12:56:56 +01:00
Alejandro Celaya
fb2194d2d1 Updated dependencies 2021-02-28 11:13:07 +01:00
Alejandro Celaya
8ec49b8cfc Merge pull request #394 from acelaya-forks/feature/orphan-visits-stats
Feature/orphan visits stats
2021-02-28 11:00:33 +01:00
Alejandro Celaya
4d77c3abf9 Updated changelog 2021-02-28 10:46:57 +01:00
Alejandro Celaya
d921c44d3b Created orphanVisitsReducer test 2021-02-28 10:45:14 +01:00
Alejandro Celaya
eb0ab92472 Created OrphanVisits test 2021-02-28 10:36:56 +01:00
Alejandro Celaya
9904ac757b Updated mercure integration so that the hook accepts a list of topics to subscribe 2021-02-28 10:12:30 +01:00
Alejandro Celaya
71ee886e24 Updated overview page cards to be links to other sections when suitable 2021-02-28 09:50:01 +01:00
Alejandro Celaya
25e53bf627 Created MenuLayout test 2021-02-28 09:28:46 +01:00
Alejandro Celaya
d7edd69e60 Created OrphanVisitsTitle test 2021-02-28 08:52:31 +01:00
Alejandro Celaya
115038f80f Created visits type helpers test 2021-02-27 20:13:18 +01:00
Alejandro Celaya
5479210366 Created section to display orphan visits stats 2021-02-27 20:03:51 +01:00
Alejandro Celaya
46d012b6ff Merge pull request #393 from acelaya-forks/feature/patch-tags
Feature/patch tags
2021-02-27 10:03:36 +01:00
Alejandro Celaya
80dcbf0668 Updated changelog 2021-02-27 09:51:31 +01:00
Alejandro Celaya
d0825089d0 Enhanced edit tags action so that it calls PATCH endpoint 2021-02-27 09:49:56 +01:00
Alejandro Celaya
f653739d50 Merge pull request #391 from acelaya-forks/feature/dark-theme
Feature/dark theme
2021-02-27 09:02:58 +01:00
Alejandro Celaya
2553b27d7d Rolled-back blurred modal 2021-02-27 08:52:10 +01:00
Alejandro Celaya
3cd30b61e4 More style fixes for dark theme 2021-02-27 08:34:44 +01:00
Alejandro Celaya
ae4921b865 Improved contrast in input border colors for dark theme 2021-02-26 23:10:19 +01:00
Alejandro Celaya
c89bcab770 Improved contrast in border colors for dark theme 2021-02-26 23:03:14 +01:00
Alejandro Celaya
f97ef8df83 Added proper blurred background for modals 2021-02-21 21:05:59 +01:00
Alejandro Celaya
e7466ced18 Added dark theme styles for date picker 2021-02-21 21:05:59 +01:00
Alejandro Celaya
0ee899f309 Updated changelog 2021-02-21 21:05:59 +01:00
Alejandro Celaya
36c97ad804 Updated styles in tags section to make it more dark-theme friendly 2021-02-21 21:05:30 +01:00
Alejandro Celaya
d6633f7555 More dark theme styles for visits page 2021-02-21 21:05:30 +01:00
Alejandro Celaya
61af43f9d9 Fixed visits table styles for dark theme 2021-02-21 21:05:30 +01:00
Alejandro Celaya
9523277311 Added icon to show which theme is selected 2021-02-21 21:05:30 +01:00
Alejandro Celaya
9703eba6ec Fixed styles for disabled inputs in dark theme 2021-02-21 21:05:30 +01:00
Alejandro Celaya
83791157ce Fixed inputs colors in dark theme when they are outside of cards 2021-02-21 21:05:30 +01:00
Alejandro Celaya
7f6c71e8d7 Created UserInterface test 2021-02-21 21:05:30 +01:00
Alejandro Celaya
9dbf790cc8 Added components and logic to dynamically change theme 2021-02-21 21:05:30 +01:00
Alejandro Celaya
f313a39b81 Added brand color and input styles to dark theme 2021-02-21 21:05:30 +01:00
Alejandro Celaya
53f16ac8b5 Added primary color alfa and tables color 2021-02-21 21:05:30 +01:00
Alejandro Celaya
13c681dc39 Added first bits of the dark theme styles 2021-02-21 21:05:30 +01:00
Alejandro Celaya
f35be007c1 Merge pull request #392 from acelaya-forks/feature/orphan-visits-card
Feature/orphan visits card
2021-02-21 21:04:37 +01:00
Alejandro Celaya
e2d26e8bdd Updated changelog 2021-02-21 20:57:57 +01:00
Alejandro Celaya
5a373fd7ae Added new card in overview to display orphan visits 2021-02-21 20:55:39 +01:00
Alejandro Celaya
3c53f7d0fc Merge pull request #389 from acelaya-forks/feature/validate-urls-setting
Feature/validate urls setting
2021-02-14 17:38:08 +01:00
Alejandro Celaya
57e3db1e1c Updated changelog 2021-02-14 17:34:20 +01:00
Alejandro Celaya
5afd3869dd Created ShortUrlCreation test 2021-02-14 17:33:01 +01:00
Alejandro Celaya
c3ebb0d10f Added test for setShortUrlCreationSettings action 2021-02-14 13:28:17 +01:00
Alejandro Celaya
4885088d59 Added option to customize initial state fo the 'Validate URL' option 2021-02-14 13:23:42 +01:00
Alejandro Celaya
872890e674 Merge pull request #388 from acelaya-forks/feature/qr-code-margin
Feature/qr code margin
2021-02-14 10:34:18 +01:00
Alejandro Celaya
8a2e39a935 Added subtle shadow in QR code image, so that it's easier to notice the margin 2021-02-14 10:21:10 +01:00
Alejandro Celaya
f8edcda665 Updated changelog 2021-02-14 10:17:34 +01:00
Alejandro Celaya
c95cb144a8 Added margin option to QR code component 2021-02-14 10:16:30 +01:00
Alejandro Celaya
f9da22c5a1 Added support for margin param in buildQrCodeUrl function 2021-02-14 09:50:26 +01:00
Alejandro Celaya
be085f50e0 Updated to bootstrap 4.6 2021-02-14 09:29:24 +01:00
Alejandro Celaya
1122f4e560 Merge pull request #381 from acelaya-forks/feature/qr-code-improvements
Feature/qr code improvements
2021-01-24 18:38:51 +01:00
Alejandro Celaya
ecefa22204 Replace nested ternary conditions with ramda's cond 2021-01-24 18:21:04 +01:00
Alejandro Celaya
e2ba63ff58 Updated changelog 2021-01-24 18:14:19 +01:00
Alejandro Celaya
277069a0af Fixed warnings in SortingDropdown 2021-01-24 18:12:16 +01:00
Alejandro Celaya
0c9434b555 Created CopyToClipboardIcon test 2021-01-24 18:06:11 +01:00
Alejandro Celaya
0fce6dd821 Fixed warnings in DropdownBtn test 2021-01-24 18:05:37 +01:00
Alejandro Celaya
4b8e5bf3fc Added qrCode helper test 2021-01-24 17:47:03 +01:00
Alejandro Celaya
3546a17575 Improved QR code modal, to allow selecting size, format and copy URL 2021-01-24 17:37:31 +01:00
Alejandro Celaya
556495ea7e Improved QR code component 2021-01-21 16:51:54 +01:00
Alejandro Celaya
e9cef8a029 Merge pull request #375 from acelaya-forks/feature/servers-import-error
Feature/servers import error
2020-12-30 21:04:59 +01:00
Alejandro Celaya
e577eb48d6 Changed env for github workflows from ubuntu-latest to ubuntu-20.04 2020-12-30 20:58:36 +01:00
Alejandro Celaya
d08a69954a Updated changelog 2020-12-30 20:53:14 +01:00
Alejandro Celaya
fe81bfccef Fixed importing servers in android due to wrong mime type 2020-12-30 20:52:05 +01:00
Alejandro Celaya
4869435aca Changed linting order 2020-12-30 20:10:37 +01:00
Alejandro Celaya
0822cebb10 Merge pull request #374 from acelaya-forks/feature/responsive-table
Feature/responsive table
2020-12-30 20:09:42 +01:00
Alejandro Celaya
01a18f2342 Updated changelog 2020-12-30 20:05:53 +01:00
Alejandro Celaya
a22274f382 Increased breakpoint in which short URLs table collapses 2020-12-30 20:05:04 +01:00
Alejandro Celaya
c0098ac7fd Merge pull request #373 from acelaya-forks/feature/ui-fixes
Fixed minor UI glitches in visits section
2020-12-30 19:52:24 +01:00
Alejandro Celaya
ba5a99dc2a Fixed minor UI glitches in visits section 2020-12-30 19:48:02 +01:00
Alejandro Celaya
1927ad2d3a Merge pull request #370 from acelaya-forks/feature/stryker-updates
Updated stryker
2020-12-25 19:13:57 +01:00
Alejandro Celaya
0356a0204d Updated stryker 2020-12-25 19:10:35 +01:00
Alejandro Celaya
3bf64bee1e Merge pull request #369 from acelaya-forks/feature/consistent-dropdowns
Feature/consistent dropdowns
2020-12-25 11:25:48 +01:00
Alejandro Celaya
da484374a1 Renamed Dropdnown.scss to DropdownBtn.scss for consistency with component 2020-12-25 11:21:39 +01:00
Alejandro Celaya
7b9447b717 Updated changelog 2020-12-25 11:17:57 +01:00
Alejandro Celaya
e583eb2759 Ensured sorting dropdown for short URLs is not enclosed inside card 2020-12-25 11:15:49 +01:00
Alejandro Celaya
93b4de60f6 Improved sorting dropdown to display order field and order dir 2020-12-25 11:06:10 +01:00
Alejandro Celaya
16f4f7eac8 Reused dropdown-btn styles in sorting dropdown 2020-12-25 10:54:49 +01:00
Alejandro Celaya
90d4fe72db Renamed Dropdown component to DropdownBtn 2020-12-25 10:43:36 +01:00
Alejandro Celaya
e1298cfa81 Created Dropdown test 2020-12-25 10:39:54 +01:00
Alejandro Celaya
6be3a1223f Created common Dropdown component for style consistency 2020-12-25 10:29:25 +01:00
Alejandro Celaya
81d24432a9 Updated app gif 2020-12-24 10:58:59 +01:00
Alejandro Celaya
1d193f1187 Updated nginx version in docker image 2020-12-22 10:23:27 +01:00
Alejandro Celaya
c56994c813 Merge pull request #363 from acelaya-forks/feature/refactorings
Feature/refactorings
2020-12-22 10:17:59 +01:00
Alejandro Celaya
44862073bb Added v3 to changelog 2020-12-22 10:06:24 +01:00
Alejandro Celaya
9eb9182c21 Created ShlinkApiError test 2020-12-22 10:05:32 +01:00
Alejandro Celaya
b2abfd543e Moved Shlink API services to api module 2020-12-22 09:57:09 +01:00
Alejandro Celaya
8c6eaf2f1d Moved API types and type helpers to api module 2020-12-22 09:49:18 +01:00
Alejandro Celaya
811544d7df Moved api utils to subfolder 2020-12-22 09:24:33 +01:00
Alejandro Celaya
9fdfdf865e Merge pull request #361 from acelaya-forks/feature/errors-improvements
Feature/errors improvements
2020-12-22 00:00:04 +01:00
Alejandro Celaya
6a354c277c Set API response as per Shlink v2 2020-12-21 23:55:54 +01:00
Alejandro Celaya
89f6c6c283 Updated changelog 2020-12-21 23:53:15 +01:00
Alejandro Celaya
d534a4e441 Moved logic to parse API errors to a helper function 2020-12-21 23:51:49 +01:00
Alejandro Celaya
4c3772d5c8 Added meaningful error messages for the rest of API calls 2020-12-21 23:41:50 +01:00
Alejandro Celaya
ee95d5a1b7 Improved handling of errors in several API interactions 2020-12-21 21:26:45 +01:00
Alejandro Celaya
51379eb2a0 Created component holding the logic to render Shlink API errors 2020-12-21 21:19:02 +01:00
Alejandro Celaya
f69f791790 Improved handling of short URL deletion errors 2020-12-21 21:02:30 +01:00
Alejandro Celaya
54b1ab12cd Passed API error while creating URLs to display proper error messages 2020-12-21 20:55:52 +01:00
Alejandro Celaya
18d417e78c Merge pull request #359 from acelaya-forks/feature/message-improvements
Feature/message improvements
2020-12-21 18:31:21 +01:00
Alejandro Celaya
7a48a06442 Normalized import 2020-12-21 18:20:59 +01:00
Alejandro Celaya
195aaa8be6 Updated changelog 2020-12-21 18:15:09 +01:00
Alejandro Celaya
94d2f3167b Created Result test 2020-12-21 18:14:11 +01:00
Alejandro Celaya
344f5e9b0d Updated Result component so that it has the text centered by default 2020-12-21 17:58:46 +01:00
Alejandro Celaya
b211a29fc5 Created new Result component to display operation result messages consistently 2020-12-21 17:54:20 +01:00
Alejandro Celaya
c25355c531 Added Message test 2020-12-21 09:57:46 +01:00
Alejandro Celaya
5cf0c86a14 Normalized Message component, making it autocontained 2020-12-21 09:22:13 +01:00
Alejandro Celaya
852e791c80 Merge pull request #357 from acelaya-forks/feature/routable-visits-sections
Feature/routable visits sections
2020-12-20 20:01:04 +01:00
Alejandro Celaya
f5d03ed3a2 Created query helper test 2020-12-20 19:51:43 +01:00
Alejandro Celaya
4642e07fd3 Reduced duplication when defining routes in visits section 2020-12-20 19:42:37 +01:00
Alejandro Celaya
83221c1066 Added routes to subsections in visits 2020-12-20 19:28:14 +01:00
Alejandro Celaya
214b952e84 Merge pull request #356 from acelaya-forks/feature/welcome-ui
Feature/welcome UI
2020-12-20 12:39:18 +01:00
Alejandro Celaya
42adbb3739 Updated changelog 2020-12-20 12:32:54 +01:00
Alejandro Celaya
9e63c463ca Styled scroll in servers list for home page 2020-12-20 12:25:17 +01:00
Alejandro Celaya
260a6c4940 Improved welcome screen 2020-12-20 12:17:12 +01:00
Alejandro Celaya
fa949cde12 Simplified onTagClick handling in ShortUrlsTable 2020-12-20 09:09:22 +01:00
Alejandro Celaya
23da0328ec Added Shlink logo as react component 2020-12-20 08:56:46 +01:00
Alejandro Celaya
7da634e772 Fixed tags filtering from overview page 2020-12-19 22:49:11 +01:00
Alejandro Celaya
79f7459d77 Merge pull request #354 from acelaya-forks/feature/ci-migration
Replaced scrutinizer with codecov
2020-12-19 12:58:43 +01:00
Alejandro Celaya
4002392b12 Replaced scrutinizer with codecov 2020-12-19 12:55:30 +01:00
Alejandro Celaya
e9e53bb69b Added border on top of overview section cards 2020-12-17 18:42:43 +01:00
Alejandro Celaya
623deec973 Merge pull request #353 from acelaya-forks/feature/more-ui-improvements
Feature/more UI improvements
2020-12-15 19:04:04 +01:00
Alejandro Celaya
3453d4ffd5 Fixed coding styles 2020-12-15 18:59:14 +01:00
Alejandro Celaya
f9ef7eccf8 Updated changelog 2020-12-15 18:53:41 +01:00
Alejandro Celaya
3cdcffaac3 Fixed mutation checks step in ci workflow 2020-12-15 18:45:15 +01:00
Alejandro Celaya
0f23cdcd21 Updated initial interval for visits to be last 30 days 2020-12-15 18:40:36 +01:00
Alejandro Celaya
9dc6c756f2 Fixed rendering of cards in overview page 2020-12-15 18:12:15 +01:00
Alejandro Celaya
0491694839 Set fixed width to aside menu 2020-12-15 17:57:24 +01:00
Alejandro Celaya
f1f3c3f98b Merge pull request #350 from acelaya-forks/feature/ui-improvements
Feature/UI improvements
2020-12-15 10:05:16 +01:00
Alejandro Celaya
ec3ad8412c Fixed mutation tests in ci workflow 2020-12-15 10:01:15 +01:00
Alejandro Celaya
d39512732a Fixed DateRangeSelector focus state 2020-12-15 09:54:45 +01:00
Alejandro Celaya
95abf4f898 Updated changelog 2020-12-14 23:36:58 +01:00
Alejandro Celaya
61a1087d91 Added date range selector to short URLs list 2020-12-14 23:35:31 +01:00
Alejandro Celaya
3f245a757e Created DateRangeSelector test 2020-12-14 23:15:06 +01:00
Alejandro Celaya
4e236a80de Created new dropdown component to select relative or absolute date ranges 2020-12-14 22:58:15 +01:00
Alejandro Celaya
288f6e2cf8 Fixed rendering of ShlinkVersions component to match current layout 2020-12-14 19:05:25 +01:00
Alejandro Celaya
9b6d4a4d97 Added max-width to internal container 2020-12-14 18:39:19 +01:00
Alejandro Celaya
f2a8865679 Added new card styles to error pages 2020-12-13 20:57:00 +01:00
Alejandro Celaya
017db18e70 Removed unneeded step in ci workflow 2020-12-13 10:38:03 +01:00
Alejandro Celaya
19c4a61524 Added github and docker logos to badges 2020-12-13 09:32:37 +01:00
Alejandro Celaya
f01c9bd5c8 Fixed build badge 2020-12-13 06:47:46 +01:00
Alejandro Celaya
2a5fa54ae1 Merge pull request #348 from acelaya-forks/feature/github-actions
Created workflow for ci in github actions
2020-12-12 21:48:23 +01:00
Alejandro Celaya
7a1b6367a8 Changed build badges to point to github action 2020-12-12 21:43:16 +01:00
Alejandro Celaya
058860737e Removed travis-specific env vars from github action 2020-12-12 21:39:51 +01:00
Alejandro Celaya
20f2fd1080 Created workflow for ci in github actions 2020-12-12 21:29:25 +01:00
Alejandro Celaya
16ce1d24af Merge pull request #347 from acelaya-forks/feature/visits-improvements
Feature/visits improvements
2020-12-12 21:15:16 +01:00
Alejandro Celaya
a51db38749 Updated changelog 2020-12-12 21:07:32 +01:00
Alejandro Celaya
6090f97347 Updated tabs in visits section to be sticky 2020-12-12 21:05:54 +01:00
Alejandro Celaya
c74355e363 Improved visits section so that charts are grouped in sub tabs 2020-12-12 20:45:23 +01:00
Alejandro Celaya
a013d40bf1 More standardization color changes 2020-12-12 16:55:01 +01:00
Alejandro Celaya
7f7473c348 Merge pull request #346 from acelaya-forks/feature/drop-shlink-1-support
Dropped support for Shlink 1
2020-12-12 13:50:38 +01:00
Alejandro Celaya
df6f1b984f Dropped support for Shlink 1 2020-12-12 13:43:16 +01:00
Alejandro Celaya
b9905c8bf4 Ensured visits amount card displays warning for old shlink versions 2020-12-12 13:22:11 +01:00
Alejandro Celaya
32957835b3 Merge pull request #345 from acelaya-forks/feature/restyle
Feature/restyle
2020-12-12 12:13:52 +01:00
Alejandro Celaya
2efc5feb3f Updated changelog 2020-12-12 12:07:51 +01:00
Alejandro Celaya
526fa14dce Improved NoMenuLayout, using a container-xl style 2020-12-12 12:04:20 +01:00
Alejandro Celaya
4d969b994e Improved server form 2020-12-12 11:43:16 +01:00
Alejandro Celaya
d62edb2249 Moved 'add server' button inside servers dropdown 2020-12-12 11:29:15 +01:00
Alejandro Celaya
bc82e7e7fd Fixed colors in visits table 2020-12-12 11:11:36 +01:00
Alejandro Celaya
1e460d3ef7 Updated edit URL modal to be large 2020-12-12 11:07:05 +01:00
Alejandro Celaya
143a05cab1 Restyled cards, background and shadows 2020-12-12 10:56:10 +01:00
Alejandro Celaya
bf1b59c0d8 Merge pull request #343 from acelaya-forks/feature/overview-page
Feature/overview page
2020-12-08 19:44:25 +01:00
Alejandro Celaya
5ab38027bf Updated changelog 2020-12-08 19:38:35 +01:00
Alejandro Celaya
3e6aee47e5 Fixed TS compilation in tests 2020-12-08 19:36:47 +01:00
Alejandro Celaya
60282281a3 Grouped basic components in 'create' form in its own card 2020-12-08 19:21:31 +01:00
Alejandro Celaya
2017ee7456 Created SimpleCard component to reduce duplicated code when rendering cards 2020-12-08 19:10:29 +01:00
Alejandro Celaya
e60d241fcf Changed 'create' page, grouping components and adding more explanations 2020-12-08 18:52:18 +01:00
Alejandro Celaya
43af6fdaba Added redirect from server base path to overview page, to ease changing default page 2020-12-08 18:27:36 +01:00
Alejandro Celaya
f359a16004 Ensured tags input looks as a large input 2020-12-08 18:18:16 +01:00
Alejandro Celaya
1b413fb0b7 Created Overview component test 2020-12-08 17:51:49 +01:00
Alejandro Celaya
20a9259109 Minor style improvements in overview page 2020-12-08 11:39:16 +01:00
Alejandro Celaya
8d5f7e942d Implemented reducers for actions affecting short URLs list 2020-12-08 10:57:27 +01:00
Alejandro Celaya
17d5c4327b Added form to create short URLs to overview page 2020-12-07 20:37:03 +01:00
Alejandro Celaya
9b30a82a79 Created visitsOverview reducer test 2020-12-07 19:19:37 +01:00
Alejandro Celaya
a0ec3c0293 Improved wording 2020-12-07 13:03:47 +01:00
Alejandro Celaya
d9e39eee2b Added new reducer for visits overview, and added it to overview page 2020-12-07 12:12:39 +01:00
Alejandro Celaya
032e9c53f3 Extracted short URLs table into reusable component to use both on list section and overview section 2020-12-07 11:17:19 +01:00
Alejandro Celaya
dba0ac6442 Created Overview page as default page after connecting to a server 2020-12-06 18:37:22 +01:00
Alejandro Celaya
920effb4c6 Merge pull request #341 from acelaya-forks/feature/validate-flag
Feature/validate flag
2020-12-06 13:21:08 +01:00
Alejandro Celaya
bd6e455cd6 Fixed import 2020-12-06 13:20:16 +01:00
Alejandro Celaya
b9fc906537 Fixed alignment and margins for checkboxes in create form 2020-12-06 13:14:43 +01:00
Alejandro Celaya
1415f196bb Updated changelog 2020-12-06 13:09:06 +01:00
Alejandro Celaya
8f7e356e54 Added support to enable/disable validating the URL while it is created 2020-12-06 13:07:44 +01:00
Alejandro Celaya
0ed88079ad Skip install step when building docker image in travis 2020-12-06 11:57:14 +01:00
Alejandro Celaya
5182f9d147 Merge pull request #339 from acelaya-forks/feature/domains-dropdown
Feature/domains dropdown
2020-11-28 12:48:20 +01:00
Alejandro Celaya
4e1579832e Updated changelog 2020-11-28 12:38:16 +01:00
Alejandro Celaya
ff48c0cd45 Added DomainSelector test 2020-11-28 12:36:40 +01:00
Alejandro Celaya
02c7125236 Created domainsList reducer test 2020-11-28 12:22:52 +01:00
Alejandro Celaya
dc397d4b82 Improved existing tests 2020-11-28 11:45:04 +01:00
Alejandro Celaya
2a206f11b9 Renamed DomainsDropdown to DomainSelector 2020-11-28 09:58:05 +01:00
Alejandro Celaya
369fcf2f6a Improved design on domains dropdown 2020-11-28 09:34:41 +01:00
Alejandro Celaya
983e4db3b1 Created component to allow selecting from existing domains list 2020-11-25 21:05:27 +01:00
Alejandro Celaya
2a7c2474cd Merge pull request #336 from acelaya-forks/feature/fix-visits
Feature/fix visits
2020-11-14 13:09:51 +01:00
Alejandro Celaya
c890124e67 Updated changelog 2020-11-14 13:02:28 +01:00
Alejandro Celaya
3e21cccb14 Fixed visits getting accumulated every time the visits page is opened 2020-11-14 13:01:35 +01:00
Alejandro Celaya
dafebc3df9 Merge pull request #332 from acelaya-forks/feature/update-deps
Feature/update deps
2020-11-14 12:21:49 +01:00
Alejandro Celaya
6619e7cdb6 Updated changelog 2020-11-14 12:13:28 +01:00
Alejandro Celaya
c54f314424 Updated react-datepicker to latest version 2020-11-14 12:10:42 +01:00
Alejandro Celaya
4964f28169 Updated more production dependencies 2020-11-14 11:00:41 +01:00
Alejandro Celaya
dead22c332 Updated reactstrap 2020-11-14 10:33:32 +01:00
Alejandro Celaya
aba65346b4 Updated react-dev-utils 2020-11-14 10:24:15 +01:00
Alejandro Celaya
4621246cec Updated color-picker and fixed error when left open and modal is closed 2020-11-14 09:16:26 +01:00
Alejandro Celaya
f83280068b Updated more dev dependencies 2020-11-14 08:59:20 +01:00
Alejandro Celaya
0671fa6567 Updated to stryker v4 2020-11-13 23:06:03 +01:00
Alejandro Celaya
5c80e853c6 #325 Updated to Typescript 4 2020-11-13 22:46:17 +01:00
Alejandro Celaya
6c90d7072f #325 Updated to react 17 2020-11-13 22:44:26 +01:00
Alejandro Celaya
18bccab27a Moved to official docker github actions for docker-image-build 2020-11-10 19:25:20 +01:00
Alejandro Celaya
b9213952d3 Added npm ci when generating release 2020-11-01 10:39:09 +01:00
Alejandro Celaya
f1ae68a300 Allow empty changelog when publishing release 2020-11-01 10:34:53 +01:00
Alejandro Celaya
3f0409f25a Merge pull request #331 from acelaya-forks/feature/automatic-release
Feature/automatic release
2020-11-01 10:32:41 +01:00
Alejandro Celaya
6f568a16bf Moved tag releasing from travis to github workflow 2020-11-01 10:27:33 +01:00
Alejandro Celaya
39ae3b4762 Updated chanegelog to more strictly endorse to keepachangelog spec 2020-11-01 10:21:44 +01:00
Alejandro Celaya
14e31ed2c3 Merge pull request #330 from acelaya-forks/feature/fix-switch-alignment
Removed hardcoded display: inline for BooleanControls
2020-10-31 17:28:19 +01:00
Alejandro Celaya
ff1fb0dd12 Removed hardcoded display: inline for BooleanControls 2020-10-31 17:18:51 +01:00
Alejandro Celaya
2e6a35181d Merge pull request #329 from acelaya-forks/feature/fix-too-long-cache
Feature/fix too long cache
2020-10-31 13:47:43 +01:00
Alejandro Celaya
22cca598ca Updated changelog 2020-10-31 13:38:37 +01:00
Alejandro Celaya
de906bf370 Added proper caching rules to nginx config included in docker image 2020-10-31 13:36:53 +01:00
Alejandro Celaya
498594c31b Deleted service worker 2020-10-31 13:22:39 +01:00
Alejandro Celaya
cfbd246cfc Merge pull request #327 from acelaya-forks/feature/dart-sass
Feature/dart sass
2020-10-31 13:07:52 +01:00
Alejandro Celaya
3f91c556e4 Explicitly installed node 14 in scrutinizer env 2020-10-31 13:00:09 +01:00
Alejandro Celaya
4d1622607c Enabled all platforms back on docker image builds 2020-10-31 12:34:42 +01:00
Alejandro Celaya
eacdee293c Replaced node-sass with dart-sass 2020-10-31 12:27:24 +01:00
Alejandro Celaya
f4b115cffd Merge pull request #326 from acelaya-forks/feature/node-14
Updated to node 14
2020-10-31 12:08:35 +01:00
Alejandro Celaya
7dcd623513 Updated to node 14 2020-10-31 11:58:07 +01:00
Alejandro Celaya
8b00d1aaae Updated reference from travis-ci.org to travis-ci.com 2020-10-31 09:11:43 +01:00
Alejandro Celaya
facfd33e96 Merge pull request #319 from acelaya-forks/feature/calendar-z-index
Feature/calendar z index
2020-10-03 11:28:20 +02:00
Alejandro Celaya
a841dc7531 Updated changelog 2020-10-03 11:23:08 +02:00
Alejandro Celaya
28ebd55b69 Fixed z-index in react-datepicker 2020-10-03 11:22:21 +02:00
Alejandro Celaya
3eade5a0c0 Merge pull request #318 from acelaya-forks/feature/manifest-basic-auth
Feature/manifest basic auth
2020-10-03 11:10:57 +02:00
Alejandro Celaya
caf74cd87b Updated changelog 2020-10-03 11:03:17 +02:00
Alejandro Celaya
049510f513 Added crossorigin=use-credentials to manifest.json, so that credentials are passed and it is propery downloaded 2020-10-03 11:00:56 +02:00
Alejandro Celaya
b151b7eedb Added missing condition for github release to work on travis build 2020-09-20 12:46:51 +02:00
Alejandro Celaya
4e22e9c092 Added script step to publish release travis job 2020-09-20 12:38:47 +02:00
Alejandro Celaya
793883148a Added v2.6 to changelog 2020-09-20 12:07:16 +02:00
Alejandro Celaya
8acb7bea24 Merge pull request #310 from acelaya-forks/feature/line-chart-highlights
Feature/line chart highlights
2020-09-20 12:05:06 +02:00
Alejandro Celaya
335cceeb82 Fixed coding styles 2020-09-20 11:58:40 +02:00
Alejandro Celaya
bf7455ad6e Updated changelog 2020-09-20 11:49:19 +02:00
Alejandro Celaya
421cc5b718 Put together all chart-related helper functions 2020-09-20 11:46:07 +02:00
Alejandro Celaya
78d97a64aa Added visits highlightning capabilities to line chart 2020-09-20 11:43:24 +02:00
Alejandro Celaya
749c757cbd Removed unneeded condition on travis deploy step, as the same condition is on the parent job 2020-09-20 10:43:21 +02:00
Alejandro Celaya
faf9554286 Added lines between job definitions in travis config 2020-09-19 18:52:49 +02:00
Alejandro Celaya
b7a0be3872 Allowed mutation testing step to fail without failing the whole build 2020-09-19 18:08:16 +02:00
Alejandro Celaya
cff8046ff8 Merge pull request #308 from acelaya-forks/feature/contributing
Added CONTRIBUTING.md file
2020-09-19 17:42:28 +02:00
Alejandro Celaya
af1289752d Added reference to the CONTRIBUTING file from the README file 2020-09-19 17:42:06 +02:00
Alejandro Celaya
b06d9d3bc7 Added CONTRIBUTING.md file 2020-09-19 17:32:54 +02:00
Alejandro Celaya
b2904189ef Merge pull request #307 from acelaya-forks/feature/parallel-builds
Feature/parallel builds
2020-09-19 17:04:52 +02:00
Alejandro Celaya
5c639d241b Disabled docker image build in arm archs, as it fails with node-sass 2020-09-19 16:58:01 +02:00
Alejandro Celaya
984e9f32a5 Split all scripts in travis build into individual jobs 2020-09-19 16:57:35 +02:00
Alejandro Celaya
59d23b584a Merge pull request #304 from acelaya-forks/feature/gh-action-docker-build
Feature/gh action docker build
2020-09-19 16:35:29 +02:00
Alejandro Celaya
a7d865228a Updated name of branch in which docker build action needs to run 2020-09-19 16:25:33 +02:00
Alejandro Celaya
260ff716d7 Updated changelog 2020-09-19 16:24:43 +02:00
Alejandro Celaya
9001a3da37 Moved docker build to github actions, enabling multi-arch support 2020-09-19 16:23:39 +02:00
Alejandro Celaya
46db1e39f3 Merge pull request #303 from acelaya-forks/feature/cancel-tags-visits
Feature/cancel tags visits
2020-09-19 11:23:54 +02:00
Alejandro Celaya
6bf3fc0fd5 Updated changelog 2020-09-19 10:51:41 +02:00
Alejandro Celaya
a136543551 Fixed tags visits loading not being cancelled when the visits component gets unmounted 2020-09-19 10:50:49 +02:00
Alejandro Celaya
23046c149c Fixed visits normalization not converting empty strings into null 2020-09-19 10:31:23 +02:00
Alejandro Celaya
2951d0d75e Merge pull request #302 from acelaya-forks/feature/number-formatting
Feature/number formatting
2020-09-19 10:16:54 +02:00
Alejandro Celaya
b52e40edd3 Updated changelog 2020-09-17 18:11:03 +02:00
Alejandro Celaya
51556d76ac Fixed tests 2020-09-17 18:05:26 +02:00
Alejandro Celaya
871868f0a4 Moved common rendering chart labels code to external module for reuse 2020-09-15 22:30:31 +02:00
Alejandro Celaya
67495fa302 Added number formatting to charts 2020-09-15 22:22:56 +02:00
Alejandro Celaya
fc9341f631 Added number formatting to visits line chart 2020-09-13 11:11:17 +02:00
Alejandro Celaya
3fea8b5505 Ensured page numbers in paginators are prettified 2020-09-13 10:03:02 +02:00
Alejandro Celaya
89e3114ef3 Merge pull request #300 from acelaya-forks/feature/default-ordering
Feature/default ordering
2020-09-13 09:54:20 +02:00
Alejandro Celaya
4dc5fad8b8 Fixed coding standards 2020-09-13 09:47:29 +02:00
Alejandro Celaya
2567bdfdf0 Updated changelog 2020-09-13 09:32:02 +02:00
Alejandro Celaya
f36cf1e7b9 Updated short URL list params so that it requests dateCreated DESC ordering by default 2020-09-12 17:59:58 +02:00
Alejandro Celaya
bd88e56331 Merge pull request #299 from acelaya-forks/feature/updates-interval
Feature/updates interval
2020-09-12 13:18:23 +02:00
Alejandro Celaya
fe3e08de0f Fixed event source not being properly closed with new boundToMercureHub HOC 2020-09-12 12:06:53 +02:00
Alejandro Celaya
cfb165d240 Fixed boundToMercureHub HOC so that it clears updates intervals when unmounted 2020-09-12 11:55:49 +02:00
Alejandro Celaya
fa074f91be Updated changelog 2020-09-12 11:35:12 +02:00
Alejandro Celaya
6fc4963663 Replaced redux action to create one visit by action that allows multiple visits at once 2020-09-12 11:31:44 +02:00
Alejandro Celaya
ad437f655e Added support to dispatch all UI actions based on mercure bindings on a specific schedule instead of real time 2020-09-12 08:52:03 +02:00
Alejandro Celaya
9b45513684 Added form controls to set real time updates interval 2020-09-09 19:16:04 +02:00
Alejandro Celaya
5d6d802d64 Moved mercure hub binding from custom hook to HOC 2020-09-06 19:41:15 +02:00
Alejandro Celaya
536d49aac9 Merge pull request #298 from acelaya-forks/feature/always-visible-versions
Feature/always visible versions
2020-09-06 13:20:17 +02:00
Alejandro Celaya
796c9ca140 Fixed changelog 2020-09-06 13:11:33 +02:00
Alejandro Celaya
1b1a1f3230 Created component decorator that resets selected server and used it on Settings 2020-09-06 13:10:30 +02:00
Alejandro Celaya
98d856700c Added missing row wrapping Message component 2020-09-06 12:47:14 +02:00
Alejandro Celaya
b814f500de Moved shlink versions to the outer element so that's always visible 2020-09-06 12:36:17 +02:00
Alejandro Celaya
90abf29db9 Merge pull request #296 from acelaya-forks/feature/typescript
Feature/typescript
2020-09-06 10:29:55 +02:00
Alejandro Celaya
d064eb5f9e Fixed inconsistent type 2020-09-06 10:22:21 +02:00
Alejandro Celaya
58c9ef9b51 Updated dependencies 2020-09-06 10:17:46 +02:00
Alejandro Celaya
125b13e059 Added stryker mutator for TS 2020-09-06 09:46:07 +02:00
Alejandro Celaya
dcdee8b308 Simplified eslint config 2020-09-06 09:32:16 +02:00
Alejandro Celaya
f33d1fca39 Updated pattern for code coverage collection 2020-09-06 09:18:02 +02:00
Alejandro Celaya
7e907ba9b6 Updated changelog 2020-09-05 09:03:40 +02:00
Alejandro Celaya
3cec2efbbd Removed no longer used dependencies 2020-09-05 08:57:50 +02:00
Alejandro Celaya
d4094e66b3 Finished TS migration 2020-09-05 08:49:18 +02:00
Alejandro Celaya
73b854037d Migrated to TS all visits components except the biggest two 2020-09-04 19:33:16 +02:00
Alejandro Celaya
f2e7a2161d Removed duplicated code on mercure-bound components 2020-09-04 19:05:41 +02:00
Alejandro Celaya
260ed3041a Finished migrating visits helpers to TS 2020-09-04 18:43:26 +02:00
Alejandro Celaya
8a146021dd Migrated first charts to TS 2020-09-03 20:34:22 +02:00
Alejandro Celaya
4083592212 Fixed coding styles and ensured linting command applies to ts and tsx files 2020-09-02 20:27:50 +02:00
Alejandro Celaya
f9c57ca659 Migrated first visits helper components to TS 2020-09-02 20:13:31 +02:00
Alejandro Celaya
d0d664ef79 Migrated VisitsParser to TS 2020-09-02 19:32:07 +02:00
Alejandro Celaya
16d96efa4a Finished migrating all remaining utils to TS 2020-08-31 18:38:27 +02:00
Alejandro Celaya
f8ea1ae3d5 Migrated remaining tags-related elements to TS 2020-08-30 20:48:09 +02:00
Alejandro Celaya
18883caa6d Migrated tags helpers to TS 2020-08-30 20:31:31 +02:00
Alejandro Celaya
84fc82b74e Fixed custom slug field not being disabled when selecting a short code length 2020-08-30 19:52:40 +02:00
Alejandro Celaya
8a9c694fbc Migrated all remaining short-url elements to TS 2020-08-30 19:45:17 +02:00
Alejandro Celaya
4b33d39d44 Finished migrating ll short-url helpers to TS 2020-08-30 09:59:14 +02:00
Alejandro Celaya
c0f5d9c12c Finished migrating servers module to TS 2020-08-29 20:20:45 +02:00
Alejandro Celaya
ef630af154 Migrated ShlinkApiClient to TS 2020-08-29 19:51:14 +02:00
Alejandro Celaya
ebd7a76896 Migrated to TS main services except ShlinkApiClient 2020-08-29 18:51:03 +02:00
Alejandro Celaya
64a968711c Migrated all servers services to TS 2020-08-29 14:16:37 +02:00
Alejandro Celaya
aee4c2d02f Migrated to TS all servers helpers 2020-08-29 13:51:53 +02:00
Alejandro Celaya
8cc0695ee9 Refactored ServerError to infer error message based on provided server type guards 2020-08-29 10:53:02 +02:00
Alejandro Celaya
f40ad91ea9 Migrated some common components and their dependencies to TS 2020-08-29 09:19:15 +02:00
Alejandro Celaya
a96539129d Migrated more common components to TS 2020-08-28 20:05:01 +02:00
Alejandro Celaya
dcf72e6818 Finished migrating remaining reducers to TS 2020-08-28 18:33:37 +02:00
Alejandro Celaya
54290d4c9a Migrated ShlinkApiClientBuilder to TS 2020-08-27 22:09:16 +02:00
Alejandro Celaya
eb3775859a Migrated tags reducers to typescripts 2020-08-27 19:12:09 +02:00
Alejandro Celaya
83531666de Migrated to typescript the most complex reducer in the project 2020-08-27 18:31:56 +02:00
Alejandro Celaya
f3a2535e2f Defined visits TS types 2020-08-27 17:56:48 +02:00
Alejandro Celaya
f283dc8569 Migrated short URL helper modal components to TS 2020-08-26 20:37:36 +02:00
Alejandro Celaya
b19bbee7fc More components migrated to TS 2020-08-26 20:03:23 +02:00
Alejandro Celaya
1b03d04318 Migrated more short-url reducers to TS 2020-08-26 18:55:40 +02:00
Alejandro Celaya
6696fb13d6 Created redux test 2020-08-25 20:23:12 +02:00
Alejandro Celaya
f04aece7df Removed dependency on redux-actions for all reducers already migrated to typescript 2020-08-25 19:42:15 +02:00
Alejandro Celaya
d8f3952920 Migrated first short URL reducers to typescript 2020-08-24 18:52:52 +02:00
Alejandro Celaya
fefa4e7848 Migrated settings module to TS 2020-08-24 17:32:20 +02:00
Alejandro Celaya
0b4a348969 Migrated remoteServers reducer to TS 2020-08-23 11:58:43 +02:00
Alejandro Celaya
3e2fee0df5 Migrated selectedServer test to typescript 2020-08-23 10:58:43 +02:00
Alejandro Celaya
294888454d Renamed NewServerData to ServerData, as it's used in other contexts too 2020-08-23 10:52:37 +02:00
Alejandro Celaya
1b7e1e2b5b Tweaked server types and data 2020-08-23 10:51:42 +02:00
Alejandro Celaya
dc78138066 Migrate servers reducer to typescript 2020-08-23 10:20:31 +02:00
Alejandro Celaya
87e64e5899 Migrated first reducer to typescript, adding also type for the shared app state 2020-08-23 09:52:09 +02:00
Alejandro Celaya
e193a692e8 Migrated all service providers to typescript 2020-08-23 09:03:44 +02:00
Alejandro Celaya
2eba607874 More elements migrated to typescript 2020-08-22 19:03:25 +02:00
Alejandro Celaya
62df46d648 Refactored many helpers to Typescript 2020-08-22 18:32:48 +02:00
Alejandro Celaya
7c67fa4149 Migrate CreateServer component to Typescript 2020-08-22 17:58:44 +02:00
Alejandro Celaya
2db85c2783 Migrated to typescript first component getting another component with props injected 2020-08-22 13:41:54 +02:00
Alejandro Celaya
39663ba936 Migrated to TS first component where some dependency was being injected 2020-08-22 11:20:27 +02:00
Alejandro Celaya
eefea0c37b Added babel plugins to support latest TS functionalities 2020-08-22 11:00:11 +02:00
Alejandro Celaya
d65a6ba970 Migrated to Typescript a file which is imported in JS files 2020-08-22 09:48:55 +02:00
Alejandro Celaya
524b0a74c6 Migrated first component and test to typescript 2020-08-22 09:15:05 +02:00
Alejandro Celaya
72de9d4ff8 Added first Typescript files 2020-08-22 08:47:19 +02:00
Alejandro Celaya
a91f1b3bd4 Fixed coding styles 2020-08-22 08:10:31 +02:00
Alejandro Celaya
343a93b984 Installed TS and updated linter 2020-08-22 08:06:41 +02:00
Alejandro Celaya
8be17cce8a Merge pull request #291 from acelaya-forks/feature/toggle-switch
Feature/toggle switch
2020-07-14 16:23:23 +02:00
Alejandro Celaya
d2f818c1ea Moved common code between Checkbox and ToggleSwitch to child component 2020-07-14 16:14:16 +02:00
Alejandro Celaya
a675d60d59 Added new ToggleSwitch component 2020-07-14 16:05:00 +02:00
Alejandro Celaya
2d96c21b50 Updated changelog 2020-07-09 17:46:44 +02:00
Alejandro Celaya
6f6ba9e34d Merge pull request #290 from MartinH0/patch-1
Added Links to Version Info
2020-07-09 17:42:39 +02:00
Alejandro Celaya
e6efda5563 Fixed wrong use of quotes 2020-07-09 17:36:26 +02:00
Alejandro Celaya
b1df1652bf Fixed ShlinkVersions test 2020-07-09 17:34:29 +02:00
Alejandro Celaya
474239c151 Moved version link to common component, and fixed coding styles 2020-07-09 17:17:19 +02:00
MartinH0
feeb212259 Update ShlinkVersions.js 2020-07-09 15:54:45 +02:00
MartinH0
90245016a0 Update ShlinkVersions.js
Hope this works now, but tests obviously fails bc it does not expect a Link
2020-07-09 15:47:09 +02:00
MartinH0
8c7616c3a7 Update ShlinkVersions.js 2020-07-09 15:33:58 +02:00
MartinH0
ea84ce9c41 Update ShlinkVersions.js 2020-07-09 15:25:53 +02:00
MartinH0
c4730ec92d Update ShlinkVersions.js 2020-07-09 15:18:48 +02:00
MartinH0
76b3d573c0 Update ShlinkVersions.js 2020-07-09 15:15:01 +02:00
MartinH0
b96f4b7a90 Update ShlinkVersions.js
Changed back ExternalLink against docs to normal closing Tag.
2020-07-09 15:04:14 +02:00
MartinH0
2a0def262d Update ShlinkVersions.js 2020-07-09 14:53:15 +02:00
MartinH0
897e35f0b8 Update ShlinkVersions.js 2020-07-09 14:43:53 +02:00
MartinH0
1c335506d8 Update ShlinkVersions.js 2020-07-09 12:58:10 +02:00
MartinH0
d46acdbd70 Added Links to Version Info
Actually it would be better if the link is just added if version info is provided. Now the Link is given always.
2020-07-07 22:10:35 +02:00
Alejandro Celaya
026bb4140e Merge branch 'main' of github.com:shlinkio/shlink-web-client into main 2020-07-06 09:31:37 +02:00
Alejandro Celaya
d80f3da55d Updated comment on issue templates 2020-07-06 09:31:11 +02:00
Alejandro Celaya
f18495a4b1 Updated comment fixing line breaks 2020-06-27 09:11:42 +02:00
Alejandro Celaya
f908da78f6 Merge pull request #287 from acelaya-forks/feature/servers-warning
Added warning to pre-configuring servers section
2020-06-22 22:04:55 +02:00
Alejandro Celaya
bc16381c90 Added warning to pre-configuring servers section 2020-06-22 21:57:58 +02:00
Alejandro Celaya
4cb7aa64cf Removed references to master branch 2020-06-20 20:03:00 +02:00
Alejandro Celaya
da6d7aea8b Merge pull request #284 from acelaya-forks/feature/simplify-travis
Removed all conditional checks in travis
2020-06-10 18:50:23 +02:00
Alejandro Celaya
b310d79110 Removed all conditional checks in travis 2020-06-10 18:43:11 +02:00
Alejandro Celaya
e26cdc11c3 Merge pull request #283 from acelaya-forks/feature/chart-legend
Feature/chart legend
2020-06-06 12:27:01 +02:00
Alejandro Celaya
fa54aa3128 Updated changelog 2020-06-06 12:17:45 +02:00
Alejandro Celaya
e31e70039d Created GraphCard test 2020-06-06 12:16:19 +02:00
Alejandro Celaya
cb761dea8f Increased default height for doughnut charts 2020-06-06 12:08:21 +02:00
Alejandro Celaya
949e0da105 Added custom responsive legend to doughnut charts 2020-06-06 11:58:25 +02:00
Alejandro Celaya
770cc59448 Extracted logic to render graph from GraphCard to DefatlChart component 2020-06-06 10:35:13 +02:00
Alejandro Celaya
72dd2bd0a7 Merge pull request #282 from acelaya-forks/feature/mercure-dup-code
Feature/mercure dup code
2020-06-06 09:47:15 +02:00
Alejandro Celaya
54733eaa18 Updated changelog 2020-06-06 09:30:39 +02:00
Alejandro Celaya
52c56f7918 Created custom react hook that binds to mercure topic 2020-06-06 09:29:43 +02:00
Alejandro Celaya
c46d5187c1 Removed duplicated code when binding to mercure by checking if enabled first 2020-06-06 09:24:05 +02:00
Alejandro Celaya
05e3e87653 Merge pull request #281 from acelaya-forks/feature/docker-version
Fixed version not properly provided to docker image
2020-06-06 08:58:41 +02:00
Alejandro Celaya
8b9289ff08 Fixed version not properly provided to docker image 2020-06-06 08:50:37 +02:00
Alejandro Celaya
16ffbcfbc0 Merge pull request #278 from acelaya-forks/feature/fix-default-grouping
Feature/fix default grouping
2020-05-31 20:30:32 +02:00
Alejandro Celaya
d825b6e174 Updated changelog 2020-05-31 20:17:59 +02:00
Alejandro Celaya
73e55cc742 Replaced if/else by functional matcher 2020-05-31 20:16:15 +02:00
Alejandro Celaya
32cc1cc580 Improved logic to determine default grouping for line chart based on how old the visits are 2020-05-31 20:03:59 +02:00
Alejandro Celaya
e00574553f Moved some helper components for visits to visits/helpers 2020-05-31 17:51:52 +02:00
Alejandro Celaya
984c1ea716 Added v2.5.0 to changelog 2020-05-31 12:00:50 +02:00
Alejandro Celaya
df38cf6ca9 Merge pull request #275 from acelaya-forks/feature/remove-class-components
Feature/remove class components
2020-05-31 11:51:08 +02:00
Alejandro Celaya
1b60b0e2a8 Updated SortableBarGraph to be a functional component 2020-05-31 11:36:56 +02:00
Alejandro Celaya
11f9c7c507 Updated TagsSelector to be a functional component 2020-05-31 11:19:53 +02:00
Alejandro Celaya
ebe649aaac Updated EditTagModal to be a functional component 2020-05-31 11:06:23 +02:00
Alejandro Celaya
656b68d422 Updated DeleteTagConfirmModal to be a functional component 2020-05-31 10:45:18 +02:00
Alejandro Celaya
cd1f186e28 Updated EditTagsModal to be a functional component 2020-05-31 10:31:00 +02:00
Alejandro Celaya
d0b3edaa2f Updated DeleteShortUrlModal to be a functional component 2020-05-31 10:23:13 +02:00
Alejandro Celaya
2268b85ade Updated CreateShortUrlResult to be a functional component 2020-05-31 10:16:09 +02:00
Alejandro Celaya
d7e3b7b912 Updated ImportServersBtn to be a functional component 2020-05-31 09:58:27 +02:00
Alejandro Celaya
4bd83eecfb Updated ScrollToTop to be a functional component 2020-05-31 09:50:00 +02:00
Alejandro Celaya
b7fd2308ad Merge pull request #274 from acelaya-forks/feature/stryker3
Updated to stryker 3
2020-05-31 09:34:02 +02:00
Alejandro Celaya
a6958941ad Updated to stryker 3 2020-05-31 09:27:42 +02:00
Alejandro Celaya
c98b28ff0f Merge pull request #273 from acelaya-forks/feature/charts-improvements
Feature/charts improvements
2020-05-31 09:19:02 +02:00
Alejandro Celaya
6a372badfa Improved labels displayed in charts when visits are highlighted 2020-05-31 09:07:21 +02:00
Alejandro Celaya
b6ab9a1bdd Improved memoization of grouped visits for line chart 2020-05-31 08:55:52 +02:00
Alejandro Celaya
daf9e7cf64 Merge pull request #272 from acelaya-forks/feature/line-chart-improvements
Some improvements on LineChartCard
2020-05-30 17:52:55 +02:00
Alejandro Celaya
ef42dcd666 Simplified code and removed duplication 2020-05-30 17:43:13 +02:00
Alejandro Celaya
1b6028ae6d Some improvements on LineChartCard 2020-05-30 17:39:08 +02:00
Alejandro Celaya
9340512980 Merge pull request #271 from acelaya-forks/feature/line-chart
Feature/line chart
2020-05-30 10:54:27 +02:00
Alejandro Celaya
9d0b4cc065 Updated changelog 2020-05-30 10:43:18 +02:00
Alejandro Celaya
c5cb0dcb26 Added test for LineChartCard 2020-05-30 10:41:46 +02:00
Alejandro Celaya
a42f5ab13e Set fixed height for time-based line chart 2020-05-30 10:26:52 +02:00
Alejandro Celaya
68b0577526 Added dynamic grouping to time-based line chart 2020-05-30 09:57:21 +02:00
Alejandro Celaya
61867366e7 Created first version of the time-based visits chart 2020-05-30 09:25:15 +02:00
Alejandro Celaya
c670d86955 Merge pull request #270 from acelaya-forks/feature/parallel-docker-build
Feature/parallel docker build
2020-05-17 10:37:34 +02:00
Alejandro Celaya
4565a64cd8 Rolled back node version for scrutinizer 2020-05-17 10:28:49 +02:00
Alejandro Celaya
f36e42d9c1 Fixed travis config error 2020-05-17 10:16:53 +02:00
Alejandro Celaya
0a3a97242b Simplified docker image building, as it will now be run in a different job as the dist file release 2020-05-17 10:13:33 +02:00
Alejandro Celaya
68253c3bc4 Disabled multi-arch building until everything is compatible 2020-05-17 10:12:39 +02:00
Alejandro Celaya
544384d85e Updated runtimne versions 2020-05-17 10:04:05 +02:00
Alejandro Celaya
91daec852f Added parallel docker image multi-arch building 2020-05-17 10:02:36 +02:00
Alejandro Celaya
dcc5b9cc8c Merge pull request #268 from acelaya-forks/feature/tag-visits
Feature/tag visits
2020-05-13 20:41:39 +02:00
Alejandro Celaya
1d26cd93fb Added real time updates to tags list page 2020-05-13 18:32:27 +02:00
Alejandro Celaya
e47dfaf36f Changed paginable charts so that they use 50 items per page by default 2020-05-11 19:44:27 +02:00
Alejandro Celaya
09e2c69e46 Ensured visits by tag route does not work for old Shlink servers 2020-05-11 19:40:19 +02:00
Alejandro Celaya
07d3567244 Added progress bar to visits page when loading a lot of visits 2020-05-11 19:32:42 +02:00
Alejandro Celaya
9bdbe90716 Ensured state is properly reset when starting, finisihing or failing to load visits 2020-05-11 18:55:35 +02:00
Alejandro Celaya
02a4380f7c Updated changelog 2020-05-10 20:36:03 +02:00
Alejandro Celaya
4e483dc5d4 Created TagVisits test 2020-05-10 20:30:19 +02:00
Alejandro Celaya
52631e629e Created TagVisitsHeader test 2020-05-10 20:23:45 +02:00
Alejandro Celaya
3a53298417 Improved visits pages titles 2020-05-10 20:17:17 +02:00
Alejandro Celaya
fb0f14fc16 Created header for visits by tag section 2020-05-10 19:49:58 +02:00
Alejandro Celaya
7a94b1730d Created common component for visits header 2020-05-10 19:37:00 +02:00
Alejandro Celaya
f856bc218a Created tagVisits reducer test 2020-05-10 19:12:18 +02:00
Alejandro Celaya
bfbb21e1cc Created page for tag visit stats 2020-05-10 19:02:58 +02:00
Alejandro Celaya
18e18f533b Extracted visits charts elements into reusable component 2020-05-10 17:49:55 +02:00
Alejandro Celaya
6eead70511 Merge pull request #266 from acelaya-forks/feature/tags-list-improvements
Feature/tags list improvements
2020-05-10 11:34:48 +02:00
Alejandro Celaya
6fd30ed51a Improved how tags are exposed by the ApiClient when listing tags 2020-05-10 11:20:40 +02:00
Alejandro Celaya
67c674f073 Updated changelog 2020-05-10 11:15:24 +02:00
Alejandro Celaya
289d8784c0 Converted TagCard component into functional component 2020-05-10 11:12:22 +02:00
Alejandro Celaya
18e026e4ca Updated tags list to display visits and short URLs when remote shlink version allows it 2020-05-10 10:57:49 +02:00
Alejandro Celaya
8741f42fe8 Merge pull request #264 from acelaya-forks/feature/charts-precision
Feature/charts precision
2020-05-07 11:21:51 +02:00
Alejandro Celaya
665d6209d9 Updated changelog 2020-05-07 11:10:10 +02:00
Alejandro Celaya
59fda29894 Added precision 0 to charts, to avoid having decimals 2020-05-07 11:06:14 +02:00
Alejandro Celaya
61c027f9a1 Merge pull request #263 from acelaya-forks/feature/minor-improvements
Minor improvements
2020-05-03 20:23:24 +02:00
Alejandro Celaya
241c9b73b0 Minor improvements 2020-05-03 20:16:21 +02:00
Alejandro Celaya
85dc1d0825 Merge pull request #260 from acelaya-forks/feature/responsive-visits-table
Feature/responsive visits table
2020-04-28 19:08:20 +02:00
Alejandro Celaya
e38887aa26 Ensured side menu is not swippoed when horizontally scrolling visits table 2020-04-28 18:54:58 +02:00
Alejandro Celaya
54fec79945 First minor improvements to the visits table responsiveness 2020-04-27 18:04:24 +02:00
Alejandro Celaya
fad0bf1c9d Merge pull request #258 from acelaya-forks/feature/redux-localstorage
Feature/redux localstorage
2020-04-27 13:49:05 +02:00
Alejandro Celaya
be2f86050f Updated changelog 2020-04-27 13:37:54 +02:00
Alejandro Celaya
a7f941e8e4 Deleted no-longer-needed ServersService 2020-04-27 13:21:07 +02:00
Alejandro Celaya
b08c6748c7 Moved remote servers loading to separated action 2020-04-27 12:54:52 +02:00
Alejandro Celaya
bdd7932e07 Refactored ServersDropdown into functional component 2020-04-27 12:30:17 +02:00
Alejandro Celaya
bcf5dcf180 Converted server handling actions into regular actions 2020-04-27 11:30:51 +02:00
Alejandro Celaya
8b2cbf7aea Some minor refactorings 2020-04-27 10:52:19 +02:00
Alejandro Celaya
277b5e43f8 Flatten model holding list of servers 2020-04-27 10:49:55 +02:00
Alejandro Celaya
7dd6a31609 Deleted SettingsService, as the task is not transparently handled by a redux middleware 2020-04-26 19:07:47 +02:00
Alejandro Celaya
86bf1515d4 Added redux middleware to save parts of the store in the local storage transparently 2020-04-26 19:04:17 +02:00
Alejandro Celaya
bbc47b387e Created single reducer to handle settings 2020-04-26 13:00:27 +02:00
Alejandro Celaya
3953e98a77 Merge pull request #257 from acelaya-forks/feature/navigate-back
Feature/navigate back
2020-04-26 12:02:54 +02:00
Alejandro Celaya
09b8bd501d Converted TagsList component into functional component 2020-04-26 11:48:08 +02:00
Alejandro Celaya
6bddaaa055 Added cancel button to edit server page 2020-04-26 10:56:27 +02:00
Alejandro Celaya
dd728d4d13 Added back button to visits stats page 2020-04-26 10:43:00 +02:00
Alejandro Celaya
9ba8bc8f3d Merge pull request #256 from acelaya-forks/feature/settings-page
Feature/settings page
2020-04-25 11:19:19 +02:00
Alejandro Celaya
16dee3664b Ensured mercure updates are not set even if supported, when they have been disabled 2020-04-25 10:37:50 +02:00
Alejandro Celaya
6fcf588bfd Updated changelog 2020-04-25 10:23:51 +02:00
Alejandro Celaya
6a6c427b0e Added unit tests for settings business logic elements 2020-04-25 10:22:17 +02:00
Alejandro Celaya
41f885d8ec Created settings page and reducers to handle real-time updates config 2020-04-25 09:49:54 +02:00
Alejandro Celaya
7516ca8dd9 Created settings page and converted MainHeader into functional component 2020-04-18 20:58:35 +02:00
Alejandro Celaya
aa59a95f91 Merge pull request #251 from acelaya-forks/feature/real-time-updates
Feature/real time updates
2020-04-18 20:57:07 +02:00
Alejandro Celaya
8a5161c0e8 Updated changelog 2020-04-18 20:36:49 +02:00
Alejandro Celaya
d8ae69e861 Added test for mercure info helpers 2020-04-18 12:49:03 +02:00
Alejandro Celaya
a485d0b507 Added token expired handling to mercure binding 2020-04-18 12:26:00 +02:00
Alejandro Celaya
ed40b79c8d Added more tests covering new use cases 2020-04-18 12:09:51 +02:00
Alejandro Celaya
91488ae294 Fixed visits count not handling separated tooltiups 2020-04-18 11:03:49 +02:00
Alejandro Celaya
a22a1938c1 Added automatic refresh on mercure events 2020-04-18 10:50:01 +02:00
Alejandro Celaya
0f73cb9f8c Converted short URLs list in functional component 2020-04-17 17:39:30 +02:00
Alejandro Celaya
f3129399de Added EventSource connection to mercure hub possible 2020-04-17 17:11:52 +02:00
Alejandro Celaya
37e6c27461 Created mercure info reducer and loaded info when server is reachable 2020-04-17 15:51:18 +02:00
Alejandro Celaya
d231ed3ede Merge pull request #247 from acelaya-forks/feature/user-agent-improvements
Feature/user agent improvements
2020-04-10 20:06:57 +02:00
Alejandro Celaya
cf6f9028f2 Some more improvements on how chart height is calculated 2020-04-10 19:57:33 +02:00
Alejandro Celaya
7cf49d2c1a Increased minimum charts height 2020-04-10 19:47:42 +02:00
Alejandro Celaya
e37fb1b4bd Updated changelog 2020-04-10 19:29:57 +02:00
Alejandro Celaya
faf5d0bf7b Unified function parsing user agent for browser and os 2020-04-10 19:22:13 +02:00
Alejandro Celaya
6fede88072 Added dependency on bowser to have a more accurate browser and OS detection 2020-04-10 19:16:44 +02:00
Alejandro Celaya
87ffbefa61 Merge pull request #246 from acelaya-forks/feature/create-improvements
Feature/create improvements
2020-04-10 18:50:09 +02:00
Alejandro Celaya
f33ae17781 Updated changelog 2020-04-10 18:43:16 +02:00
Alejandro Celaya
2a2bae6d1a Improved short URL creation 2020-04-10 18:42:08 +02:00
Alejandro Celaya
eb65e99024 Merge pull request #244 from acelaya-forks/feature/chart-visit-highlighting
Feature/chart visit highlighting
2020-04-10 15:21:07 +02:00
Alejandro Celaya
52dbeb6201 Optimized visits parser to act over the normalized list of visits 2020-04-10 14:59:12 +02:00
Alejandro Celaya
fafe920b7b Ensured highlighted stats are properly sorted and paginated on charts that support that 2020-04-10 14:38:31 +02:00
Alejandro Celaya
9d1e48ee90 Updated main list paginator to be sticky 2020-04-10 13:42:21 +02:00
Alejandro Celaya
3851342e1b Added button to reset visits selection 2020-04-10 13:27:01 +02:00
Alejandro Celaya
b863c2e19d Used cursor pointer in bar charts 2020-04-10 13:04:39 +02:00
Alejandro Celaya
ed584d19e5 Ensured charts datasets have a unique label 2020-04-10 12:57:14 +02:00
Alejandro Celaya
73256dcf5b Handled toggling between highlighted chart bars 2020-04-10 12:53:54 +02:00
Alejandro Celaya
c67a23c988 Added support to disable date inputs 2020-04-10 12:25:06 +02:00
Alejandro Celaya
8f42e65ccd Allowed visits to be selected on charts so that they get highlighted on the rest of the charts 2020-04-10 11:59:53 +02:00
Alejandro Celaya
05deb1aff0 Merge pull request #242 from acelaya-forks/feature/visits-table
Feature/visits table
2020-04-09 11:23:51 +02:00
Alejandro Celaya
a74b7cdfad Updated changelog 2020-04-09 11:00:27 +02:00
Alejandro Celaya
1c3119ee76 Allowed multiple selection on visits table 2020-04-09 10:56:54 +02:00
Alejandro Celaya
ca52911e42 Added VisitsTable test 2020-04-09 10:21:38 +02:00
Alejandro Celaya
9177bc7cef Tested how hilghlighted data behaves on GraphCards 2020-04-09 09:44:14 +02:00
Alejandro Celaya
310831a26a Converted ShortUrlVisits in functional component 2020-04-07 22:33:41 +02:00
Alejandro Celaya
8a486d991b Implemented some improvements and fixes on how visits table is split and calculated 2020-04-05 18:04:15 +02:00
Alejandro Celaya
b79333393b Converted SearchField component into funcitonal component 2020-04-05 16:18:08 +02:00
Alejandro Celaya
cb7062bb95 Created fake border with before and after pseudoelements for sticky table cells 2020-04-05 16:02:42 +02:00
Alejandro Celaya
94c5b2c471 Improved useToggle hook so that it also returns enabler and disabler 2020-04-05 12:18:41 +02:00
Alejandro Celaya
66bf26f1dc Improved highlighted data calculation so that it works with values different than 1 2020-04-05 11:57:39 +02:00
Alejandro Celaya
f5cc1abe75 Ensured info for selected visit in visits table gets highlighted in bar charts 2020-04-04 20:16:20 +02:00
Alejandro Celaya
bd4255108d Improved VisitsTable performance by memoizing visits lists 2020-04-04 12:58:04 +02:00
Alejandro Celaya
06b63d1af2 Improved rendering of visits table on mobile devices 2020-04-04 12:09:17 +02:00
Alejandro Celaya
2bd70fb9e6 Fixed unit tests 2020-04-04 10:36:38 +02:00
Alejandro Celaya
e6034dfb14 Created VisitsTable 2020-04-03 23:00:57 +02:00
Alejandro Celaya
c8ba6764c2 Merge pull request #238 from acelaya-forks/feature/edit-long-url
Feature/edit long url
2020-03-30 21:36:20 +02:00
Alejandro Celaya
19337d6c05 Added tests for elements regarding short URL edition 2020-03-30 21:26:30 +02:00
Alejandro Celaya
a6ad3c2d4d Updated changelog 2020-03-30 21:01:54 +02:00
Alejandro Celaya
b0dd885c09 Converted ShortUrlsRowMenu into functional component 2020-03-30 21:01:01 +02:00
Alejandro Celaya
2235592308 Fixed ShortUrlsRowMenu test 2020-03-30 20:50:31 +02:00
Alejandro Celaya
1219a16261 Ensured short URLs list is updated after editing the long URL of a short URL 2020-03-30 20:47:33 +02:00
Alejandro Celaya
7949e224e0 Created modal to edit the loing URL behind a short URL 2020-03-30 20:42:58 +02:00
Alejandro Celaya
ab2f311bb7 Merge pull request #237 from acelaya-forks/feature/short-code-length
Feature/short code length
2020-03-29 19:49:09 +02:00
Alejandro Celaya
a5aab43666 Updated changelog 2020-03-29 19:41:29 +02:00
Alejandro Celaya
74ebd4e572 Converted CreateShortUrl to functional component 2020-03-29 19:36:45 +02:00
Alejandro Celaya
bd29670108 Added short code length field to form to create short URLs 2020-03-29 18:55:41 +02:00
Alejandro Celaya
9a20b4428d Merge pull request #236 from acelaya-forks/feature/progressive-paginator
Feature/progressive paginator
2020-03-28 17:52:35 +01:00
Alejandro Celaya
d7da8521ce Created helper functions to determine the key and if a page is disabled on a progressive paginator 2020-03-28 17:43:09 +01:00
Alejandro Celaya
bab3b252c1 Updated changelog 2020-03-28 17:35:02 +01:00
Alejandro Celaya
7f05c5c2da Split utils module into several helpers modules 2020-03-28 17:33:27 +01:00
Alejandro Celaya
2d5c2779c3 Moved helper functions to render progressive paginators to a common place 2020-03-28 17:25:12 +01:00
Alejandro Celaya
06db4f6556 Used progressive pagination for the short URLs list 2020-03-28 17:19:33 +01:00
Alejandro Celaya
ea5ec63a22 Ensured all branches build the docker image 2020-03-22 09:34:24 +01:00
Alejandro Celaya
f46e737e77 Merge pull request #233 from acelaya-forks/feature/fix-docker-build-condition
Fixed docker build condition so that it's run for any branch or tag a…
2020-03-21 13:39:31 +01:00
Alejandro Celaya
6e63bdaafa Fixed docker build condition so that it's run for any branch or tag as long as it is not a PR 2020-03-21 08:43:35 +01:00
Alejandro Celaya
79ccef9f7e Avoid latest docker to be build when building a tag 2020-03-21 06:59:37 +01:00
Alejandro Celaya
a9653b3674 Merge pull request #232 from acelaya-forks/feature/improve-docker-build
Feature/improve docker build
2020-03-20 09:23:35 +01:00
Alejandro Celaya
b5a188e802 Improved building process so that already generated dist files are reused when building docker image is possible 2020-03-20 09:12:43 +01:00
Alejandro Celaya
38fc402b16 Improved docker build script to avoid duplicating code 2020-03-20 07:12:07 +01:00
Alejandro Celaya
584d1ec1ce Fixed conditional in docker build script 2020-03-19 20:39:34 +01:00
Alejandro Celaya
2ca7faa457 Merge pull request #230 from acelaya-forks/feature/travis-docker-build
Added docker image building as a deployment step for travis
2020-03-19 20:32:00 +01:00
Alejandro Celaya
03806abda0 Changed build steps so that mutation testing a docker build are only run on pull request builds 2020-03-19 20:26:35 +01:00
Alejandro Celaya
18d125430d Added docker image building as a deployment step for travis 2020-03-19 20:04:30 +01:00
Alejandro Celaya
f57f6b7745 Merge pull request #228 from acelaya-forks/feature/memoize-server-version
Feature/memoize server version
2020-03-16 19:01:33 +01:00
Alejandro Celaya
75ff2b8f40 Added app gif to readme 2020-03-16 18:53:06 +01:00
Alejandro Celaya
2ec04c0121 Fixed test by using different serverId every time, preventing memoization 2020-03-16 18:51:04 +01:00
Alejandro Celaya
5145a41dac Memoized the loading of the server version, assuming it will not change at runtime 2020-03-16 13:34:24 +01:00
Alejandro Celaya
25c67f1c3e Merge pull request #227 from acelaya-forks/feature/edit-servers
Feature/edit servers
2020-03-15 14:32:30 +01:00
Alejandro Celaya
77b9181150 Replaced hardcoded color by sass var 2020-03-15 14:23:57 +01:00
Alejandro Celaya
e4f7ded8e2 Updated changelog 2020-03-15 14:04:33 +01:00
Alejandro Celaya
35a62f1fb1 Added link to edit existing servers 2020-03-15 14:03:41 +01:00
Alejandro Celaya
24f2deda46 Moved common code to handle currently selected server to HOC 2020-03-15 13:43:12 +01:00
Alejandro Celaya
5d8af1a0e5 Simplified EditServer component by wrapping ServerForm 2020-03-15 12:02:19 +01:00
Alejandro Celaya
6d44ac1e0c Created common component that can be used both for create and edit servers 2020-03-15 11:59:07 +01:00
Alejandro Celaya
fb0ebddf28 Created component to edit existing servers 2020-03-15 11:29:20 +01:00
Alejandro Celaya
0aebaa4da1 Extracted logic to render horizontal form groups to their own components 2020-03-15 10:50:05 +01:00
Alejandro Celaya
f6baedc655 Converted CreateServer into functional component 2020-03-15 10:33:23 +01:00
Alejandro Celaya
7db222664d Fixed tests 2020-03-15 09:56:16 +01:00
Alejandro Celaya
8223f0fd64 Undone weird changes in package lock file 2020-03-15 09:43:42 +01:00
Alejandro Celaya
f44ec42f51 Added links to delete and edit the server when a server could not be reached 2020-03-15 09:17:33 +01:00
Alejandro Celaya
dab75ab6a9 Updated badges 2020-03-10 21:53:21 +01:00
Alejandro Celaya
01672b88e1 Merge pull request #222 from acelaya-forks/feature/server-not-found
Feature/server not found
2020-03-08 13:17:56 +01:00
Alejandro Celaya
78dc297022 Updated changelog 2020-03-08 13:05:15 +01:00
Alejandro Celaya
c8cf75fa28 Created ServerError test 2020-03-08 13:04:21 +01:00
Alejandro Celaya
b011b4e1d8 Fixed tests 2020-03-08 12:57:01 +01:00
Alejandro Celaya
9804a2d18d Added list of servers connected to store in ServerError component 2020-03-08 12:50:42 +01:00
Alejandro Celaya
d1a5ee43e9 Created components to display errors when loading a server 2020-03-08 12:41:18 +01:00
Alejandro Celaya
febecab33c Migrated Home component to a functional component 2020-03-08 11:35:06 +01:00
Alejandro Celaya
99042c0979 Extracted servers list group from home component to a reusable component 2020-03-08 11:16:57 +01:00
Alejandro Celaya
6395e4e00b Improved NotFount component so that link text is passed as children 2020-03-08 10:28:04 +01:00
Alejandro Celaya
4a69907ca3 Fixed generation of component keys to make them render properly 2020-03-08 10:16:45 +01:00
Alejandro Celaya
c8d682cc98 Handled loading server in just one place, and added error handling for loading servers 2020-03-08 10:00:25 +01:00
Alejandro Celaya
f4cc8d3a0c Fixed default value for vertically aligned items 2020-03-07 12:07:51 +01:00
Alejandro Celaya
6ac89334fd Merge pull request #220 from acelaya-forks/feature/improvements
Feature/improvements
2020-03-06 21:56:20 +01:00
Alejandro Celaya
f55d3a66aa Converted ShortUrlsRow component into a functional component 2020-03-06 21:44:03 +01:00
Alejandro Celaya
972eafab34 Updated changelog 2020-03-06 21:26:19 +01:00
Alejandro Celaya
fba156b271 Moved copy-to-clipboard control next to short URL 2020-03-06 21:25:30 +01:00
Alejandro Celaya
96d538db15 Replaced Unknown by Direct for traffic comming from undetermined referrers 2020-03-06 20:42:22 +01:00
Alejandro Celaya
b89bfa3c1c Merge pull request #215 from acelaya-forks/feature/versions
Feature/versions
2020-03-05 14:20:31 +01:00
Alejandro Celaya
73e3f42614 Added ShlinkVersions test 2020-03-05 13:55:39 +01:00
Alejandro Celaya
e761f5e1bd Updated changelog 2020-03-05 13:45:24 +01:00
Alejandro Celaya
4a6dd66ecd Added scripts to pass version when building docker image 2020-03-05 13:37:07 +01:00
Alejandro Celaya
8e1c6908c6 Updated build script so that it replaces version placeholder when a version is provided 2020-03-05 13:27:57 +01:00
Alejandro Celaya
f59e569e22 Extracted logic to determine app version from function to generate dist file 2020-03-05 13:04:12 +01:00
Alejandro Celaya
be50b24504 Added mechanism to provide a version to shlink-web-client 2020-03-05 12:53:32 +01:00
Alejandro Celaya
c181831a37 Fixed tests 2020-03-05 11:58:35 +01:00
Alejandro Celaya
dbee62ac8c Moved shlink versions component to main container 2020-03-05 11:46:38 +01:00
Alejandro Celaya
1e949b3a22 Added shlink versions to side menu 2020-03-05 11:11:26 +01:00
Alejandro Celaya
b02dcf6c53 Refactored delete server components 2020-03-05 10:18:38 +01:00
Alejandro Celaya
ab7718e335 Removed duplicated code from AsideMenu by creating an AsideMenuItem helper component 2020-03-05 10:03:38 +01:00
Alejandro Celaya
451c77d47f Merge pull request #214 from acelaya-forks/feature/consistent-server-loading
Feature/consistent server loading
2020-03-05 09:32:59 +01:00
Alejandro Celaya
fa0d3d4047 Removed no longer needed async/await when building api client 2020-03-05 09:23:53 +01:00
Alejandro Celaya
397a183f65 Converted MenuLayout into a functional component with hooks 2020-03-05 09:08:50 +01:00
Alejandro Celaya
bc8905ee7f Ensured server is properly loaded before trying to render any children component 2020-03-05 08:59:07 +01:00
Alejandro Celaya
853032ac7f Displayed preloader when a server is being loaded 2020-03-05 08:41:55 +01:00
Alejandro Celaya
3b0e282a52 Merge pull request #211 from acelaya-forks/feature/jest-each
Feature/jest each
2020-02-17 18:32:52 +01:00
Alejandro Celaya
bb28cb3862 Updated changelog 2020-02-17 18:25:21 +01:00
Alejandro Celaya
d0f458bece Uninstalled jest-each and replaced by jest's native each 2020-02-17 18:21:52 +01:00
Alejandro Celaya
da54a72b3e Merge pull request #206 from acelaya-forks/feature/match-domain
Feature/match domain
2020-02-08 11:04:58 +01:00
Alejandro Celaya
86c155d8d1 Updated changelog 2020-02-08 10:47:44 +01:00
Alejandro Celaya
666d2d3065 Ensured domain is dispatched when modifying a short URL somehow 2020-02-08 10:46:11 +01:00
Alejandro Celaya
01e69fb6ca Merge pull request #204 from acelaya-forks/feature/multi-domain-fixes
Feature/multi domain fixes
2020-02-08 10:24:49 +01:00
Alejandro Celaya
30e5253acd Simplified instructions removing redundant vars 2020-02-08 10:07:34 +01:00
Alejandro Celaya
c67ce3918b Removed redundant function call 2020-02-08 10:03:24 +01:00
Alejandro Celaya
58077f2d86 Updated changelog 2020-02-08 09:59:13 +01:00
Alejandro Celaya
098c94bccf Ensured domain is passed when deleting a short URL on a specific domain 2020-02-08 09:57:18 +01:00
Alejandro Celaya
861a3c068f Ensured domain is passed when editing meta for a short URL on a specific domain 2020-02-08 09:52:30 +01:00
Alejandro Celaya
3b95e8ebc0 Ensured domain is passed when editing tags for a short URL on a specific domain 2020-02-08 09:48:35 +01:00
Alejandro Celaya
170e427530 Ensured domain is passed when loading detail for a short URL on a specific domain 2020-02-08 09:38:19 +01:00
Alejandro Celaya
707c9f4ce6 Created VisitStatsLink test 2020-02-08 09:22:17 +01:00
Alejandro Celaya
dc672bf0f0 Ensured domain is passed when loading visits for a short URL on a specific domain 2020-02-08 09:07:55 +01:00
Alejandro Celaya
c682737505 Standardized date-picker selected day color 2020-02-02 09:30:41 +01:00
Alejandro Celaya
46fa3d4345 Merge pull request #201 from acelaya-forks/feature/document-routing-fallback
Updated documentation
2020-01-31 20:51:17 +01:00
Alejandro Celaya
9b7bc4b495 Updated documentation 2020-01-31 20:37:50 +01:00
Alejandro Celaya
4385061499 Merge pull request #200 from acelaya-forks/feature/refactor-edit-tags-modal
Feature/refactor edit tags modal
2020-01-31 20:22:04 +01:00
Alejandro Celaya
e17498e68b Updated changelog 2020-01-31 20:13:18 +01:00
Alejandro Celaya
3e298f010b Simplified DeleteShortUrlModal component and shortUrlDeletion reducer 2020-01-31 20:12:22 +01:00
Alejandro Celaya
30117bd121 Simplified EditTagsModal component and shortUrlTags reducer 2020-01-31 20:06:28 +01:00
Alejandro Celaya
93f33b6218 Fixed some tests after not injecting a component 2020-01-31 20:04:03 +01:00
Alejandro Celaya
535d08a607 Merge pull request #197 from MartinH0/master
Add htaccess to redirect if not found to index
2020-01-31 16:21:30 +01:00
MartinH0
6ac3a49db2 Updated nginx.conf (optimization for future)
1. changed location from "~" (case sensitive!) to "~*" (case insensitive!) to also match uppercase static assets. (http://nginx.org/en/docs/http/ngx_http_core_module.html#location)
2. added regex "jpe?g" to match "jpg" and "jpeg" in one command.
2020-01-31 01:36:17 +01:00
MartinH0
c16f760d79 Update .htaccess
1. removed $ (dollar sign from line 14
2. changed line 8 from ".*" to "(.*)"
2020-01-31 01:29:41 +01:00
MartinH0
965c2b243f Update .htaccess
1. added more comments.
2. added NC Tag for making all the static assets case insensetive ("jpg" now matches "jpg" and "JPG" and so on)
3. transformed "jpe|jpeg" into "jpe?g" as its regex for the same, but shorter
4. changed line 8 from "+" to "*" to match everything, also zero times the wildcard
2020-01-31 01:27:13 +01:00
MartinH0
703addddb9 updated htaccess
deleted second json (just needed once)
2020-01-30 21:05:20 +01:00
MartinH0
ab6dff5c31 Updates htaccess
return 404 error if static assets does not exist
2020-01-30 20:51:23 +01:00
MartinH0
2ef330c62b Updated htaccess 2020-01-30 20:49:46 +01:00
MartinH0
72e71aff40 Updated htaccess to meet required functions.
If a file gets called it will be redirected to index.html

But not if it the requested File does contain a dot (and with this does have a file extension.

If you call:
links.domain.de/notexistingfile.jpg 
It will trigger 404

If you call:
links.domain.de/server/[CODE-CODE-CODE]/list-short-urls/1
It will redirect the call to index.html
2020-01-30 19:06:50 +01:00
MartinH0
cefd6ec752 Add htaccess to redirect if not found to index
If (file not found or directory not found)
then > redirect to index.html
2020-01-30 18:51:38 +01:00
MartinH0
aec3de18aa Deleted .htaccess at wrong directory
Sorry fucked it up, will correct it.
2020-01-30 18:51:32 +01:00
MartinH0
97620cb583 Add htaccess to redirect if not found to index
If file not fount or directory not found redirect to index.html
2020-01-30 18:36:02 +01:00
Alejandro Celaya
cf4e8190a4 Merge pull request #195 from acelaya-forks/feature/server-version-wrapper
Feature/server version wrapper
2020-01-28 19:55:24 +01:00
Alejandro Celaya
8af7436f13 Updated changelog 2020-01-28 19:47:41 +01:00
Alejandro Celaya
c53520ae56 Moved logic to dynamically render components based on server version to a separated component 2020-01-28 19:46:36 +01:00
Alejandro Celaya
3adcaef455 Merge pull request #194 from acelaya-forks/feature/fix-set-empty-max-visits
Fixed maxVisits being set to 0 when trying to reset it
2020-01-28 18:51:18 +01:00
Alejandro Celaya
43cd9722a9 Updated project to node 12.14.1 2020-01-28 18:40:33 +01:00
Alejandro Celaya
f3154e770e Fixed maxVisits being set to 0 when trying to reset it 2020-01-28 18:36:23 +01:00
Alejandro Celaya
44aca4aeda Merge pull request #192 from acelaya-forks/feature/version-constraints
Feature/version constraints
2020-01-19 21:37:56 +01:00
Alejandro Celaya
5762342d6c Ensured edit meta menu item is only displayed when shlink v1.18 or greater is run 2020-01-19 21:30:01 +01:00
Alejandro Celaya
2236ed467e Ensured date range filtering is only displayed if Shlink v1.21 ow higer is run 2020-01-19 21:25:45 +01:00
Alejandro Celaya
d244b830ac Updated date on license file 2020-01-19 21:20:32 +01:00
Alejandro Celaya
e89b68fe1e Merge pull request #190 from acelaya-forks/feature/edit-meta
Feature/edit meta
2020-01-19 21:15:25 +01:00
Alejandro Celaya
1f588c5b13 Updated changelog with v2.3.0 2020-01-19 21:00:31 +01:00
Alejandro Celaya
38cad143a0 Created EditMetaModal test 2020-01-19 20:59:01 +01:00
Alejandro Celaya
f52bcc5389 Ensured state is reset on edit meta modal after closing it 2020-01-19 20:37:12 +01:00
Alejandro Celaya
caa6f7bcd8 Created shortUrlMetaReducer test 2020-01-19 20:21:59 +01:00
Alejandro Celaya
207a8cef20 Updated tests from modified code 2020-01-19 13:20:46 +01:00
Alejandro Celaya
d44a4b260e Finished component to allow metadata to be edited on existing short URLs 2020-01-19 13:07:33 +01:00
Alejandro Celaya
80a8e0b55c Created component to edit short URLs meta 2020-01-17 21:07:59 +01:00
Alejandro Celaya
2d60f830f7 Improved icons on short URL menu 2020-01-15 20:25:58 +01:00
Alejandro Celaya
90751a09f7 Merge pull request #188 from acelaya-forks/feature/visits-amount
Feature/visits amount
2020-01-15 18:42:09 +01:00
Alejandro Celaya
301da4bb2a Recovered behavior to show amount of visits in selected date range on visits detail page 2020-01-15 18:31:28 +01:00
Alejandro Celaya
c90cd46095 Removed old ExternalLink component in favor of external one 2020-01-15 18:16:12 +01:00
Alejandro Celaya
7826000384 Merge pull request #187 from acelaya-forks/feature/date-filter
Feature/date filter
2020-01-14 20:59:01 +01:00
Alejandro Celaya
b48dcdd5e1 Fixed wrong files being picked for mutations 2020-01-14 20:48:01 +01:00
Alejandro Celaya
4f6326b139 Updated changelog 2020-01-14 20:21:14 +01:00
Alejandro Celaya
cff96eeccc Created DateRangeRow test 2020-01-14 20:20:27 +01:00
Alejandro Celaya
5eb4a3adec Fixed tests and typos 2020-01-14 20:12:30 +01:00
Alejandro Celaya
b60908a5e9 Added filtering by date to short URLs list 2020-01-14 19:59:25 +01:00
Alejandro Celaya
124441238b Moved style to the proper scope 2020-01-12 12:08:26 +01:00
Alejandro Celaya
4ec0287a74 Merge pull request #185 from Starbix/patch-2
Update nginx base image
2020-01-12 11:01:38 +01:00
Cédric Laubacher
05c67a5c99 Update nginx base image 2020-01-12 10:50:40 +01:00
Alejandro Celaya
f507a3628c Merge pull request #184 from acelaya-forks/feature/show-max-visits
Feature/show max visits
2020-01-11 20:23:02 +01:00
Alejandro Celaya
89e9d2b2d1 Fixed accidentally refactored string 2020-01-11 20:11:41 +01:00
Alejandro Celaya
595858ac4b Used visits count component in short URL visits view 2020-01-11 20:10:12 +01:00
Alejandro Celaya
3f2162fe62 Extracted visits count component to reuse it in other places 2020-01-11 19:58:04 +01:00
Alejandro Celaya
f2cb30409a Updated changelog 2020-01-11 19:41:41 +01:00
Alejandro Celaya
5c4fec5a2f Displayed amount of max visits on those URLs which have it 2020-01-11 19:40:16 +01:00
Alejandro Celaya
e96c119432 Merge pull request #183 from acelaya-forks/feature/support-shlink-2
Feature/support shlink 2
2020-01-11 14:25:25 +01:00
Alejandro Celaya
0920962d72 Used already unpacked property 2020-01-11 14:16:23 +01:00
Alejandro Celaya
aaeb0fff78 Updated changelog 2020-01-11 14:13:58 +01:00
Alejandro Celaya
de41f50945 Ensured preview menu item is hidden when consuming Shlink 2 2020-01-11 14:12:58 +01:00
Alejandro Celaya
0f51bf95e3 Updated ShlinkApiClient so that it retries API version when v2 is not supported 2020-01-11 13:55:37 +01:00
Alejandro Celaya
ba8cade6fc When handling API errors, use the type prop and fallback to error if not found 2020-01-11 12:24:45 +01:00
Alejandro Celaya
dbefae5a01 Merge pull request #173 from Starbix/patch-1
Update baseimages
2019-11-21 11:35:49 +01:00
Cédric Laubacher
727b219742 Update nginx image to latest version 2019-11-21 07:55:40 +01:00
Alejandro Celaya
fb25e44b58 Used strict version number for nginx base image 2019-11-21 07:52:50 +01:00
Cédric Laubacher
fe2d394831 Update baseimages
Nginx can be set to the latest patch version, as its API is really stable.
2019-11-16 10:24:34 +01:00
Alejandro Celaya
efd08ff1d6 Updated changelog 2019-11-10 13:04:15 +01:00
Alejandro Celaya
4b861a5376 Removed profanity 2019-11-10 08:47:13 +01:00
Alejandro Celaya
2076e7d5e8 Merge pull request #171 from MartinH0/master
Updated FavIcons
2019-11-10 08:44:59 +01:00
MartinH0
37f6f1f90c rename to favicon 2019-11-09 22:34:41 +01:00
MartinH0
81f76e0bd6 SVG FavIcon Fix
Added sizes="any" to the svg FavIcon
2019-11-09 22:32:13 +01:00
MartinH0
69b305cd8a Added SVG FavIcon
Added SVG FavIcon as File in Rootdirectory
2019-11-09 22:29:37 +01:00
MartinH0
45742a066e Added SVG FavIcon 2019-11-09 22:28:44 +01:00
MartinH0
86fb8b3f7c Added FavIcons
Added .gif and .png FavIcon
2019-11-09 19:38:50 +01:00
MartinH0
9c0fc8e1d2 Adjusted to FavIcons
Added MS Icons, Added all Apple Icons, Added all normal Icons and standard FavIcons
2019-11-09 19:37:31 +01:00
MartinH0
10d6302180 Added all FavIcons to Manifest
Added all missing FavIcons to the manifest
2019-11-09 19:22:55 +01:00
MartinH0
da7ed6992f FavIcon
Overwrite FavIcon with 128x128 new optimized FavIcon
2019-11-09 19:17:45 +01:00
MartinH0
32c9375ac8 FavIcons edits
Added new FavIcons and overwrite old ones
2019-11-09 19:16:12 +01:00
MartinH0
7ed1334a51 Updated FavIcons
Added all Versions of all available FavIcons.
Also Added normal FavIcons additionally to the apple ones.
Also added the "msapplication-TileImage" meta for Microsoft.
2019-11-07 21:47:57 +01:00
Alejandro Celaya
d9097896f6 Added github funding 2019-10-22 19:33:59 +02:00
Alejandro Celaya
359b16e700 Merge pull request #168 from acelaya-forks/feature/default-servers-issue
Feature/default servers issue
2019-10-21 19:52:31 +02:00
Alejandro Celaya
0237af771d Fixed outdated comment 2019-10-21 19:45:35 +02:00
Alejandro Celaya
86cce5b205 Updated changelog 2019-10-21 19:39:59 +02:00
Alejandro Celaya
fc7a2e0c6d Ensured response from servers.json has been parsed to a json array 2019-10-21 19:38:32 +02:00
Alejandro Celaya
f74d135922 Ensured default servers is validated as JSON and ignored otherwise 2019-10-21 19:26:09 +02:00
Alejandro Celaya
66124370a6 Added json extension to the list of known static files that have to fall back to 404 on nginx 2019-10-21 18:49:47 +02:00
Alejandro Celaya
e9fc2bb73a Merge pull request #166 from acelaya-forks/feature/fix-create-short-url
Ensured server version is properly parsed to avoid errors due to inva…
2019-10-18 17:48:02 +02:00
Alejandro Celaya
12f6b94ece Ensured server version is properly parsed to avoid errors due to invalid semver 2019-10-18 17:39:38 +02:00
Alejandro Celaya
d9a8243d36 Merge pull request #163 from acelaya-forks/feature/update-deps
Feature/update deps
2019-10-05 20:09:22 +02:00
Alejandro Celaya
232c54885e Updated node version in which builds are run 2019-10-05 19:58:27 +02:00
Alejandro Celaya
42c43f6c78 Added v2.2 to changelog 2019-10-05 19:54:10 +02:00
Alejandro Celaya
9d2494834c Fixed timing issue when navigating to another server 2019-10-05 19:51:50 +02:00
Alejandro Celaya
a7613435ea Fixed test throwing unhandled promise 2019-10-05 19:31:47 +02:00
Alejandro Celaya
c9df044e1a Updated docker image versions 2019-10-05 19:26:06 +02:00
Alejandro Celaya
5a37787042 Fixed warnings in tests 2019-10-05 19:13:57 +02:00
Alejandro Celaya
923cc3ba01 Updated dev dependencies 2019-10-05 19:08:50 +02:00
Alejandro Celaya
8fcf72f564 Updated production dependencies to latest versions 2019-10-05 18:50:49 +02:00
Alejandro Celaya
a7f7666ccd Merge pull request #162 from acelaya-forks/feature/domain
Feature/domain
2019-10-05 11:15:09 +02:00
Alejandro Celaya
c181948afe Updated changelog 2019-10-05 11:05:03 +02:00
Alejandro Celaya
ce9ecd7b93 Defined custom function to compare versions which defines the operator in the middle 2019-10-05 11:03:17 +02:00
Alejandro Celaya
354d19af1b Disabled domain component for Shlink versions not supporting it 2019-10-05 10:54:58 +02:00
Alejandro Celaya
6d996baf5d Added tests for new logics 2019-10-05 10:40:32 +02:00
Alejandro Celaya
4120d09220 Loaded version of selected server and created component to filter content based on that version 2019-10-05 10:20:33 +02:00
Alejandro Celaya
67a23bfe33 Added domain input to create short url form 2019-10-05 09:02:02 +02:00
Alejandro Celaya
08b710930d Merge pull request #161 from acelaya-forks/feature/further-issue-template-improvements
Solved inconsistencies in issue templates due to copy-pasting from ot…
2019-09-29 09:46:57 +02:00
Alejandro Celaya
7ec3b332ed Solved inconsistencies in issue templates due to copy-pasting from other project 2019-09-29 09:46:19 +02:00
Alejandro Celaya
722eb060f0 Merge pull request #160 from acelaya-forks/feature/improved-issue-templates
Added improved issue templates and funding config
2019-09-29 09:42:45 +02:00
Alejandro Celaya
ce740aed68 Added improved issue templates and funding config 2019-09-29 09:36:57 +02:00
Alejandro Celaya
09f582daa1 Merge pull request #159 from acelaya-forks/feature/fix-docker-image-reload
Added nginx congif which ensures client-side paths are served as the …
2019-09-22 12:02:18 +02:00
Alejandro Celaya
1b5f7b0d76 Added nginx congif which ensures client-side paths are served as the index.html 2019-09-22 11:55:21 +02:00
Alejandro Celaya
2c93e9a587 Merge pull request #158 from acelaya-forks/feature/improved-pagination
Feature/improved pagination
2019-09-22 11:44:54 +02:00
Alejandro Celaya
ab0976981b Fixed style files being excluded when finding what files to mutate 2019-09-22 11:35:52 +02:00
Alejandro Celaya
959ce42137 Updated changelog 2019-09-22 11:16:16 +02:00
Alejandro Celaya
1c25db9179 Created SimplePaginator test 2019-09-22 11:14:08 +02:00
Alejandro Celaya
810ddd7717 Added foldable pagination to SimplePaginator 2019-09-22 10:41:31 +02:00
Alejandro Celaya
7bbff114a4 Extracted paginator used in SortableBarGraph to its own component 2019-09-21 18:29:58 +02:00
Alejandro Celaya
99475fc311 Merge pull request #154 from Haocen/151
Fix an inaccurate variable name in test
2019-09-15 15:26:17 +02:00
Haocen Xu
df121eb294 Fix an inaccurate variable name in test 2019-09-15 09:14:00 -04:00
Alejandro Celaya
138194a149 Merge pull request #153 from Haocen/151
When no order is specified, the order by indicator(triangle) in column header should be Cleared
2019-09-15 09:30:11 +02:00
Haocen Xu
ab99213d8c When no order is specified, the order by indicator(triangle) in column header should be Cleared 2019-09-14 18:13:15 -04:00
Alejandro Celaya
2fe923678e Installed react-external-links 2019-08-29 17:47:18 +02:00
Alejandro Celaya
34f194c714 Merge pull request #143 from acelaya-forks/feature/docker-versions-bump
Feature/docker versions bump
2019-08-24 16:42:22 +02:00
Alejandro Celaya
2bef398d4c Added repository and license fields to package.json 2019-08-24 16:38:44 +02:00
Alejandro Celaya
404b5c45dd Updated changelog 2019-08-24 16:33:23 +02:00
Alejandro Celaya
f607ade508 Bumbed version of docker images 2019-08-24 16:31:54 +02:00
Alejandro Celaya
158ed84ec5 Updated changelog 2019-05-19 20:31:57 +02:00
Alejandro Celaya
7c22713d7d Merge pull request #139 from acelaya/feature/coverage-80
Created tags list reducer test
2019-05-19 20:30:13 +02:00
Alejandro Celaya
fb94077260 Created shortUrlTags reducer test 2019-05-19 13:22:16 +02:00
Alejandro Celaya
d3491869bd Created tags list reducer test 2019-05-19 12:54:19 +02:00
Alejandro Celaya
5cefadbf37 Added missing link in changelog to docs on new feature 2019-05-19 11:42:24 +02:00
Alejandro Celaya
95462b0c1d Merge pull request #137 from acelaya/feature/pre-configure-servers
Feature/pre configure servers
2019-04-28 18:01:46 +02:00
Alejandro Celaya
258330f985 Mentioned that pre-configured servers won't work on versions previous to 2.1.0 2019-04-28 17:53:35 +02:00
Alejandro Celaya
a09b661b51 Updated changelog 2019-04-28 17:42:20 +02:00
Alejandro Celaya
a1a0b935c7 Improved documentation mentioning how to pre-configure servers 2019-04-28 17:41:01 +02:00
Alejandro Celaya
4c11d9c6d5 Catched error when loading servers from a servers.json file 2019-04-28 13:07:55 +02:00
Alejandro Celaya
78c34a342d Added tests for new use cases 2019-04-28 12:40:50 +02:00
Alejandro Celaya
20820c47d4 Updated list servers action so that it tries to fetch servers from the servers.json file when no local servers are found 2019-04-28 12:07:09 +02:00
Alejandro Celaya
502c8a7e02 Echoing travis commit range 2019-04-22 19:13:02 +02:00
Alejandro Celaya
ce8a198acd Merge pull request #136 from acelaya/feature/stryker
Feature/stryker
2019-04-22 10:11:32 +02:00
Alejandro Celaya
32f171d861 Updated travis to run mutations on changed files only 2019-04-22 10:04:41 +02:00
Alejandro Celaya
b83c0e0aba Improved stryker config 2019-04-21 23:18:35 +02:00
Alejandro Celaya
831c0444d6 Added stryker to the project 2019-04-21 23:03:53 +02:00
Alejandro Celaya
e5ef2eb5c6 Merge pull request #135 from acelaya/feature/shlink-client-improvements
Removed duplicated code when building ShlinkApiClient
2019-04-21 11:37:14 +02:00
Alejandro Celaya
7b80d78dc5 Removed duplicated code when building ShlinkApiClient 2019-04-21 11:31:40 +02:00
Alejandro Celaya
48f7103205 Merge pull request #134 from acelaya/feature/jest-mocks
Feature/jest mocks
2019-04-19 13:02:28 +02:00
Alejandro Celaya
bc8de096be Updated changelog 2019-04-19 12:55:41 +02:00
Alejandro Celaya
ba3189fd46 Removed no longer needed constants 2019-04-19 12:54:56 +02:00
Alejandro Celaya
33d67cbe3d Simplified code making it easier to read 2019-04-19 12:52:55 +02:00
Alejandro Celaya
28ca54547e Removed remaining usages of sinon 2019-04-19 12:41:59 +02:00
Alejandro Celaya
f8de069567 First replacements of sinon mocks with jest mocks 2019-04-19 10:29:49 +02:00
Alejandro Celaya
2cd6e52e9c Merge pull request #133 from acelaya/feature/remove-yarn
Replaced yarn by npm
2019-04-14 22:06:59 +02:00
Alejandro Celaya
372d3f17cc Replaced yarn by npm 2019-04-14 21:58:10 +02:00
Alejandro Celaya
92d5b2eb3e Merge pull request #132 from acelaya/feature/issue-template
Created issue template with some reminders
2019-04-11 22:11:12 +02:00
Alejandro Celaya
6be55e30d9 Dockerignored .gihub folder 2019-04-11 22:03:53 +02:00
Alejandro Celaya
fd517ccbe2 Created issue template with some reminders 2019-04-11 22:01:11 +02:00
Alejandro Celaya
c2a34b4079 Merge pull request #127 from acelaya/feature/check-existing
Feature/check existing
2019-03-17 18:41:22 +01:00
Alejandro Celaya
ce0f036bef Created custom react hook that can be used to handle toggles 2019-03-17 18:35:47 +01:00
Alejandro Celaya
977e143b4e Fixed coding styles 2019-03-17 18:24:09 +01:00
Alejandro Celaya
d847ccf0f4 Updated changelog 2019-03-17 18:17:29 +01:00
Alejandro Celaya
7eeed76539 Created UseExistingIfFoundInfoIcon test 2019-03-17 18:15:44 +01:00
Alejandro Celaya
2e452993ff Created Checkbox test 2019-03-17 18:09:10 +01:00
Alejandro Celaya
f4dbd03c7e Added checkbox to control the findIfExists shlink flag 2019-03-17 17:48:05 +01:00
Alejandro Celaya
312c6cd550 Merge pull request #126 from acelaya/feature/redux-actions
Feature/redux actions
2019-03-17 10:31:13 +01:00
Alejandro Celaya
8d9e8565f0 Updated changelog 2019-03-17 10:23:17 +01:00
Alejandro Celaya
d1c10e4895 Removed test cases for the old default on reducers switch statements 2019-03-17 10:17:44 +01:00
Alejandro Celaya
232c059e4f Replaced usages of defaultState by initialState 2019-03-17 10:11:20 +01:00
Alejandro Celaya
5bb9d15e27 Refactored tagEdit reducer to take advantage of redux-actions 2019-03-17 10:07:28 +01:00
Alejandro Celaya
879034c9c6 Refactored tagDelete reducer to take advantage of redux-actions 2019-03-17 10:02:44 +01:00
Alejandro Celaya
740aacbbf1 Refactored tagsList reducer to take advantage of redux-actions 2019-03-17 09:59:26 +01:00
Alejandro Celaya
fcfab79bed Refactored shortUrlDetail reducer to take advantage of redux-actions 2019-03-17 09:38:37 +01:00
Alejandro Celaya
468e34aa3d Refactored shortUrlVisits reducer to take advantage of redux-actions 2019-03-17 09:36:07 +01:00
Alejandro Celaya
7ff7318089 Refactored shortUrlTags reducer to take advantage of redux-actions 2019-03-17 09:32:53 +01:00
Alejandro Celaya
4654bff737 Refactored shortUrlDeletion reducer to takle advantage of redux-actions 2019-03-17 09:27:01 +01:00
Alejandro Celaya
3075ccb4b9 Refactored shortUrlCreation reducer to takle advantage of redux-actions 2019-03-17 09:20:02 +01:00
Alejandro Celaya
4894ab9035 Refactored shortUrlsListParams reducer to takle advantage of redux-actions 2019-03-17 09:15:58 +01:00
Alejandro Celaya
4a09d99322 Refactored shortUrlsList to take advantage of redux-actions 2019-03-17 09:11:37 +01:00
Alejandro Celaya
51b5f6264d Refactored server reducer, removing duplicated code and taking advantage of redux-actions 2019-03-17 09:06:10 +01:00
Alejandro Celaya
724c804971 Installed redux-actions dependency and used it for selectedServer reducer 2019-03-17 08:49:24 +01:00
Alejandro Celaya
2ba86767fe Merge pull request #124 from acelaya/feature/paginated-charts
Feature/paginated charts
2019-03-16 09:11:01 +01:00
Alejandro Celaya
391424d8a1 Ensured bar charts are regenerated when their height changes 2019-03-16 09:02:40 +01:00
Alejandro Celaya
e0db6d5a57 Improved SortableBarGraph test 2019-03-10 17:55:02 +01:00
Alejandro Celaya
87dc24e8a2 Fixed and improved OpenMapModalBtn and ShortUrlVisit components tests 2019-03-10 13:05:20 +01:00
Alejandro Celaya
5233f5a07b Updated OpenMapModalBtn so that it allows showing only active cities 2019-03-10 12:09:54 +01:00
Alejandro Celaya
478ee59bb0 Updated cities chart so that map shows locations from current page when result set is paginated 2019-03-10 10:56:36 +01:00
Alejandro Celaya
b6f6b1ae9d Enabled stickiness on footer 2019-03-10 10:08:42 +01:00
Alejandro Celaya
1ad4290487 Applied some naming improvements 2019-03-10 09:54:40 +01:00
Alejandro Celaya
61480abd2e Updated charts to allow optional pagination 2019-03-10 08:28:14 +01:00
Alejandro Celaya
c094a27c97 Created PaginationDropdown component 2019-03-09 13:20:43 +01:00
Alejandro Celaya
83704ca4b5 Created rangeOf helper function which does a range + map 2019-03-09 12:19:33 +01:00
Alejandro Celaya
60576388c5 Merge pull request #122 from acelaya/feature/cancel-visits-load
Feature/cancel visits load
2019-03-08 19:56:45 +01:00
Alejandro Celaya
9f172c308c Ensured travis makes use of a working node version for builds 2019-03-08 19:50:47 +01:00
Alejandro Celaya
d7312d26f7 Added missing test for new action creator 2019-03-08 19:45:35 +01:00
Alejandro Celaya
4e6ef6ac53 Removed empty line 2019-03-08 19:43:27 +01:00
Alejandro Celaya
de563f9ebf Updated changelog 2019-03-08 19:42:07 +01:00
Alejandro Celaya
3982d77775 Ensured visits loading is cancelled when the visits page is unmounted 2019-03-08 19:40:43 +01:00
Alejandro Celaya
24bbbf6cb1 Merge pull request #121 from acelaya/feature/fix-empty-locations
Feature/fix empty locations
2019-03-05 14:33:33 +01:00
Alejandro Celaya
9ddd5de008 Updated changelog 2019-03-05 14:12:11 +01:00
Alejandro Celaya
87a4598391 Ensured maps modal btn is not rendered when the number of located cities is 0 2019-03-05 14:09:08 +01:00
Alejandro Celaya
701c143149 Updated ErrorHandler so that it logs errors in production 2019-03-05 14:04:52 +01:00
Alejandro Celaya
43097b93e5 Fixed docker build badge 2019-03-05 12:11:18 +01:00
Alejandro Celaya
e303a80683 Updated bootstrap to solve security issue 2019-03-04 21:05:30 +01:00
Alejandro Celaya
5defc20e9f Merge pull request #117 from acelaya/feature/error-handler
Feature/error handler
2019-03-04 20:55:48 +01:00
Alejandro Celaya
d75eff62e3 Updated changelog 2019-03-04 20:50:05 +01:00
Alejandro Celaya
ad9f0c00d0 Created ErrorHandler test 2019-03-04 20:49:18 +01:00
Alejandro Celaya
cd908fa358 Created ErrorHandler component 2019-03-04 20:41:02 +01:00
Alejandro Celaya
2bf79dbc80 Merge pull request #114 from acelaya/feature/lat-lang-error
Fixed crash when trying to load a map with just one location
2019-03-04 20:35:10 +01:00
Alejandro Celaya
4c729a405d Fixed crash when trying to load a map with just one location 2019-03-04 20:24:28 +01:00
Alejandro Celaya
28c9f9ac96 Merge pull request #112 from acelaya/feature/many-visits
Improved performance while calculating status
2019-03-04 19:37:00 +01:00
Alejandro Celaya
2820caf955 Updated changelog 2019-03-04 19:29:56 +01:00
Alejandro Celaya
ba5ea7407b Used native javascript reduce instead of ramda reduce 2019-03-04 19:28:24 +01:00
Alejandro Celaya
1bc406b0d9 Ensured requests when loading visits are made in parallel for big dataset 2019-03-04 19:21:46 +01:00
Alejandro Celaya
7e27ceb885 Ensured same timestamp is used when generating memoization ID after mounting the component 2019-03-04 18:19:50 +01:00
Alejandro Celaya
252edaa2ca Improved performance while calculating status by doing one iteration only and memoizing the result when possible 2019-03-04 18:14:45 +01:00
Alejandro Celaya
9a6fad4db5 Merge pull request #110 from acelaya/feature/swipe-map
Prevented side menu to be swipeable while a modal window is displayed
2019-03-03 12:11:28 +01:00
Alejandro Celaya
127bcc14eb Prevented side menu to be swipeable while a modal window is displayed 2019-03-03 12:05:29 +01:00
Alejandro Celaya
220d634f80 Merge pull request #109 from acelaya/feature/map-center
Fixed initial zoom and center on maps
2019-03-03 11:54:44 +01:00
Alejandro Celaya
6291af2865 Fixed initial zoom and center on maps 2019-03-03 11:47:19 +01:00
Alejandro Celaya
e9e808d339 Merge pull request #108 from acelaya/feature/not-found-page
Feature/not found page
2019-03-03 11:24:56 +01:00
Alejandro Celaya
780e4a6e9e Replaced component by render on route rendering not found component with custom props 2019-03-03 11:18:58 +01:00
Alejandro Celaya
c4bc2f24d6 Used not-found component for menu layout inner router 2019-03-03 11:15:34 +01:00
Alejandro Celaya
d23ddd0e0b Created NotFound component 2019-03-03 11:02:29 +01:00
Alejandro Celaya
4f0ee79409 Added missing changelogs 2019-03-03 10:33:37 +01:00
Alejandro Celaya
7b07445c5d Merge pull request #107 from acelaya/feature/improve-docker-image
Feature/improve docker image
2019-03-03 10:28:30 +01:00
Alejandro Celaya
dcbf4bfef8 Added missing docker dependency in travis config 2019-03-03 10:22:26 +01:00
Alejandro Celaya
6ec870bb08 Updated travis so that it tries to build the docker image, whcih in turn builds the project 2019-03-03 10:18:23 +01:00
Alejandro Celaya
2c6dbb42c1 Simplified Dockerfile using multi-stage build 2019-03-03 10:12:59 +01:00
Alejandro Celaya
98725dce04 Added missing array-related dependencies 2019-03-03 10:01:10 +01:00
Alejandro Celaya
2d3363153a Merge pull request #100 from acelaya/feature/tests
Feature/tests
2019-01-13 23:38:01 +01:00
Alejandro Celaya
9318c1c6fb Updated changelog with v2.0.0 2019-01-13 23:32:23 +01:00
Alejandro Celaya
11d49fb70f Created DeleteTagConfirmModal test 2019-01-13 23:31:10 +01:00
Alejandro Celaya
056286636d Created ScrollToTop test 2019-01-13 23:03:31 +01:00
Alejandro Celaya
d020ed0b13 Created ShortUrlsRowMenu test 2019-01-13 13:08:47 +01:00
Alejandro Celaya
30b4cb4068 Created ShortUrlsRow test 2019-01-13 09:49:02 +01:00
Alejandro Celaya
1aa1d29d97 Removed direct calls between actions without DI 2019-01-12 23:59:03 +01:00
Alejandro Celaya
4f8c7afc76 Created SortableBarGraph test 2019-01-12 23:47:41 +01:00
Alejandro Celaya
c2ee688176 Merge pull request #99 from acelaya/feature/visits-pagination
Feature/visits pagination
2019-01-10 20:17:28 +01:00
Alejandro Celaya
f58b815ef8 Fixed typo 2019-01-10 20:11:32 +01:00
Alejandro Celaya
daaf91b836 Updated changelog 2019-01-10 20:06:57 +01:00
Alejandro Celaya
dee5994b1e Fixed tests 2019-01-10 20:05:02 +01:00
Alejandro Celaya
0c1f533747 Updated short URL visits loading so that it loads visits in several requests 2019-01-10 19:50:25 +01:00
Alejandro Celaya
58d3a59e58 Merge pull request #98 from acelaya/feature/clean-api-client
Feature/clean api client
2019-01-10 19:26:28 +01:00
Alejandro Celaya
811008ee1c Updated changelog 2019-01-10 19:20:09 +01:00
Alejandro Celaya
23af0de34a Simplified ShlinkApiCLient by using the new simplified authentication approach 2019-01-10 19:17:15 +01:00
Alejandro Celaya
b96ea89f90 Merge pull request #92 from acelaya/feature/map
Created component to show a map on a modal window
2019-01-09 20:39:59 +01:00
Alejandro Celaya
77a624a889 Removed not needed call to function 2019-01-09 20:34:35 +01:00
Alejandro Celaya
40892f3e91 Updated changelog 2019-01-09 20:31:52 +01:00
Alejandro Celaya
b12dac1e35 Improved map modal title 2019-01-09 20:30:59 +01:00
Alejandro Celaya
150dcd2d5d Created tests for new map-related components 2019-01-09 20:11:22 +01:00
Alejandro Celaya
c599d2837b Improved VisitsParser test 2019-01-09 07:59:56 +01:00
Alejandro Celaya
bb6fb6b9ea Created utils test 2019-01-08 21:19:38 +01:00
Alejandro Celaya
8b8be2d7ca Updated stateFlagTimeout to get the setTimeout function injected as a dependency 2019-01-08 20:49:47 +01:00
Alejandro Celaya
00d386f19f Skipped locations from unknown cities when processing cities stats for map 2019-01-07 21:11:09 +01:00
Alejandro Celaya
4870801f8f Implemented map to show visits from every city 2019-01-07 21:00:28 +01:00
Alejandro Celaya
78745366c2 Moved button to open map to separated component 2019-01-07 19:43:25 +01:00
Alejandro Celaya
2be771cbcc Improved styles 2019-01-07 13:45:16 +01:00
Alejandro Celaya
6abc0e7d02 Created component to show a map on a modal window 2019-01-07 13:35:25 +01:00
Alejandro Celaya
95220b913a Merge pull request #91 from acelaya/feature/cities-graph
Feature/cities graph
2019-01-07 12:02:11 +01:00
Alejandro Celaya
a2c1f5ce7d Improved function name 2019-01-07 11:56:54 +01:00
Alejandro Celaya
5208a266e4 Updated changelog 2019-01-07 11:54:32 +01:00
Alejandro Celaya
dc9c1712ff Added cities stats graphic on short url visits page 2019-01-07 11:53:14 +01:00
Alejandro Celaya
f9360683e9 Added docker build status badge 2019-01-07 10:37:24 +01:00
Alejandro Celaya
456f50620b Updated base docker image used during development 2019-01-07 09:50:14 +01:00
Alejandro Celaya
d76008582f Merge pull request #90 from acelaya/feature/create-react-app-2
Feature/create react app 2
2019-01-07 09:48:19 +01:00
Alejandro Celaya
6e9cbb9b28 Updated docker base image and removed deprecated MAINTAINER instruction 2019-01-07 09:41:54 +01:00
Alejandro Celaya
b5f799528d Updated changelog 2019-01-07 09:27:18 +01:00
Alejandro Celaya
f410657133 Updated build script 2019-01-07 09:24:46 +01:00
Alejandro Celaya
b1e0124aff Fixed fontawesome import 2019-01-07 09:06:29 +01:00
Alejandro Celaya
b3e3bbdd9b Slightly fixed dependencies 2019-01-06 10:46:19 +01:00
Alejandro Celaya
fac3edaea7 Updated coding styles and test configs 2019-01-05 23:16:13 +01:00
Alejandro Celaya
08488e9bad Imported config files and start script from new create react app 2019-01-05 22:54:54 +01:00
Alejandro Celaya
835d54e90c Updated dependencies and source code 2019-01-05 22:25:54 +01:00
Alejandro Celaya
10c3abd29a Happy 2019! 2019-01-05 08:42:34 +01:00
Alejandro Celaya
906e9ddb5c Updated yarn.lock 2019-01-01 12:33:53 +01:00
Alejandro Celaya
c165c8e301 Merge pull request #88 from acelaya/feature/update-dependencies
Updated linting dependencies
2018-12-31 18:31:28 +01:00
Alejandro Celaya
7d63e05900 Updated changelog 2018-12-31 18:27:16 +01:00
Alejandro Celaya
03f409a803 Updated linting dependencies 2018-12-31 18:23:47 +01:00
Alejandro Celaya
f427234373 Move out of Travis container-based infrastructure 2018-12-29 09:38:23 +01:00
Alejandro Celaya
019ce2e8ed Added v1.2.1 to changelog 2018-12-21 11:03:51 +01:00
Alejandro Celaya
e93082a64d Merge pull request #86 from acelaya/feature/code-coverage
Feature/code coverage
2018-12-21 11:03:12 +01:00
Alejandro Celaya
8a9a4f40a7 Created shortUrlsList reducer test 2018-12-21 10:58:51 +01:00
Alejandro Celaya
047d99be6d Updated ScrollTop component so that it gets the window object injected as a dependency 2018-12-21 10:38:40 +01:00
Alejandro Celaya
16cf30f26f Created EditTagsModal component test 2018-12-21 10:34:12 +01:00
Alejandro Celaya
9268114fe1 Created shortUrlDeletion reducer test 2018-12-21 10:02:42 +01:00
Alejandro Celaya
fefbb73568 Created Storage service test 2018-12-19 20:43:55 +01:00
Alejandro Celaya
12cddac27a Merge pull request #83 from acelaya/feature/insensitive-ordering
Ensured bar graphs are sorted case insensitive
2018-12-19 11:15:30 +01:00
Alejandro Celaya
77a2f32cfd Ensured bar graphs are sorted case insensitive 2018-12-19 11:07:47 +01:00
Alejandro Celaya
9d513e9ea0 Merge pull request #82 from acelaya/feature/disable-tag-build
Disabled yarn build when a tag exists in travis
2018-12-19 10:44:48 +01:00
Alejandro Celaya
9df2de5b30 Disabled yarn build when a tag exists in travis 2018-12-19 10:38:00 +01:00
Alejandro Celaya
fd2367b005 Updated nginx base image for Docker. Closes #79 2018-12-18 20:33:37 +01:00
Alejandro Celaya
a2b08277dc Merge pull request #81 from acelaya/feature/dependency-injection
Feature/dependency injection
2018-12-18 20:31:25 +01:00
Alejandro Celaya
8bd3a15a1d Updated changelog 2018-12-18 20:28:21 +01:00
Alejandro Celaya
cd11dd9848 Updated tests config excluding config files form code coverage 2018-12-18 20:24:18 +01:00
Alejandro Celaya
eec79043cc Moved common and utils services to their own service providers 2018-12-18 20:19:22 +01:00
Alejandro Celaya
4b1f5e9f4c Extracted short-url related services to its own service provider 2018-12-18 20:00:23 +01:00
Alejandro Celaya
cf1239cf6e Moved all server-related services to its own service provider 2018-12-18 19:45:09 +01:00
Alejandro Celaya
566322a8c5 Extracted tag related services to its own service provider 2018-12-18 14:55:00 +01:00
Alejandro Celaya
fa3e1eba93 Moved all visits-related services to its own service provide function inside visits 2018-12-18 14:36:32 +01:00
Alejandro Celaya
471322f4db Implemented dependency injection in all tag related components 2018-12-18 11:28:15 +01:00
Alejandro Celaya
79a0a5e4ea Fixed tests 2018-12-18 10:23:09 +01:00
Alejandro Celaya
4f54e3315f Simplified ShlinkApiClient and moved runtime creation logic to external service 2018-12-18 10:14:25 +01:00
Alejandro Celaya
7bd4b39b5a Added lazy loading to action services 2018-12-18 05:03:38 +01:00
Alejandro Celaya
12ddeebedf Registered first actions as services 2018-12-18 04:54:32 +01:00
Alejandro Celaya
d6e53918a2 Created function which dynamically resolve action services from the container for connected components 2018-12-18 04:34:37 +01:00
Alejandro Celaya
bab1e57ab1 Registered remaining short URLs components in DI container 2018-12-17 23:11:55 +01:00
Alejandro Celaya
bec755b121 Fixed tests 2018-12-17 22:32:51 +01:00
Alejandro Celaya
5616d045ab Migrated a lot more components to new DI system 2018-12-17 22:18:47 +01:00
Alejandro Celaya
5e6ad14a85 More components migrated for dependency injection 2018-12-17 20:24:31 +01:00
Alejandro Celaya
79a518b02d Registered first components as services 2018-12-17 20:03:36 +01:00
Alejandro Celaya
e996a08c02 Added v1.2.0 to changelog 2018-11-01 19:31:53 +01:00
Alejandro Celaya
cc206c2843 Added missing changelog entry 2018-11-01 15:03:26 +01:00
Alejandro Celaya
591c3b76f9 Merge pull request #70 from acelaya/feature/tests
Feature/tests
2018-11-01 15:02:09 +01:00
Alejandro Celaya
07b1d5be2e Created shortUrlCreation reducer test 2018-11-01 14:55:30 +01:00
Alejandro Celaya
f94b5b7c68 Created tagDelete reducer test 2018-11-01 14:44:55 +01:00
Alejandro Celaya
824a2facac Created tagEdit reducer test 2018-11-01 14:13:49 +01:00
Alejandro Celaya
4445c79540 Created TagsList test 2018-11-01 13:51:03 +01:00
Alejandro Celaya
85cb849ba5 Created TagCard test 2018-11-01 13:34:31 +01:00
Alejandro Celaya
53132fa900 Created CreateShortUrl test 2018-11-01 13:15:09 +01:00
Alejandro Celaya
c774a00610 Created ShortUrls test 2018-11-01 12:44:27 +01:00
Alejandro Celaya
1697ef9306 Created QrCodeModal test 2018-11-01 12:35:51 +01:00
Alejandro Celaya
79a16a2c2c Created PreviewModal test 2018-11-01 12:34:18 +01:00
Alejandro Celaya
30192cb349 Created DeleteShortUrlModal test 2018-11-01 12:24:16 +01:00
Alejandro Celaya
8d0c0bcc99 Created CreateShortUrlResult test 2018-11-01 09:30:05 +01:00
Alejandro Celaya
70ebb0362a Converted DateInput into functional component 2018-11-01 09:16:18 +01:00
Alejandro Celaya
cccf57a35a Moved DateInput from common to utils 2018-11-01 09:05:20 +01:00
Alejandro Celaya
756e0c637e Merge pull request #69 from acelaya/feature/server-subpatch
Feature/server subpatch
2018-11-01 08:58:06 +01:00
Alejandro Celaya
44541d5e97 Fixed typo 2018-11-01 08:49:17 +01:00
Alejandro Celaya
655045c975 Documented how to build the project so that it can be served from a subpath 2018-11-01 08:46:54 +01:00
Alejandro Celaya
6784c30fa0 Ensured react router uses homepage defined in package.jsoin as basename 2018-11-01 08:20:33 +01:00
Alejandro Celaya
a65aadd4b2 Merge pull request #68 from acelaya/feature/chart-labels
Feature/chart labels
2018-10-30 20:48:21 +01:00
Alejandro Celaya
3c12bc1434 Updated changelog 2018-10-30 20:43:20 +01:00
Alejandro Celaya
822afa6db7 Ensured tooltips are not intersect for bar charts 2018-10-30 20:41:36 +01:00
Alejandro Celaya
0c1c471714 Fixed test 2018-10-30 07:45:57 +01:00
Alejandro Celaya
b1b215e84a Updated react dependency 2018-10-30 07:41:31 +01:00
Alejandro Celaya
7a63f737ac Updated sort icons in SortingDropdown 2018-10-30 07:35:35 +01:00
Alejandro Celaya
4adf618026 Merge pull request #67 from acelaya/feature/order-countries
Feature/order countries
2018-10-28 23:13:02 +01:00
Alejandro Celaya
f1c464fd3e Added unreleased entry in changelog 2018-10-28 23:08:46 +01:00
Alejandro Celaya
99833b51a9 Ensured dropdown item styles are not overriden for disabled items 2018-10-28 23:06:57 +01:00
Alejandro Celaya
05936c52b3 Added sorting to referrers bar graph 2018-10-28 23:04:52 +01:00
Alejandro Celaya
368de2b4c7 Added order control to countries graph 2018-10-28 22:54:08 +01:00
Alejandro Celaya
6634fc41c5 Fixed short urls dropdown menu not properly located 2018-10-28 21:51:54 +01:00
Alejandro Celaya
4ad8e909d4 Extracted sorting dropdown to its own component 2018-10-28 21:26:47 +01:00
Alejandro Celaya
56ad6d9e1b Added missing changes for v1.1.1 to changelog 2018-10-20 17:23:26 +02:00
Alejandro Celaya
169c69df2c Merge pull request #64 from acelaya/bugfix/graphs-height
Bugfix/graphs height
2018-10-19 21:12:38 +02:00
Alejandro Celaya
0e8631ae9d Updated GraphCard so that it automatically calculates the proper aspect ration for bar chart graphs 2018-10-19 20:27:25 +02:00
Alejandro Celaya
812e391e34 Moved helper functions in GraphCard outside of component function 2018-10-19 19:04:22 +02:00
Alejandro Celaya
4c1a044fd3 Merge pull request #62 from acelaya/bugfix/date-boxes-margin
Recovered missing class
2018-10-07 09:26:59 +02:00
Alejandro Celaya
bb17dbe680 Recovered missing class 2018-10-07 09:22:15 +02:00
Alejandro Celaya
160de66b44 Merge pull request #61 from acelaya/feature/automatic-release
Feature/automatic release
2018-10-07 09:15:01 +02:00
Alejandro Celaya
02b38cf84a Updated changelog including the automation of the release 2018-10-07 09:10:44 +02:00
Alejandro Celaya
2101dadfd7 Added release generation to travis deploy step 2018-10-07 09:09:40 +02:00
Alejandro Celaya
782a5c1d35 Merge pull request #60 from acelaya/bugfix/color-generator
Bugfix/color generator
2018-10-07 09:08:12 +02:00
Alejandro Celaya
de9f20b7a6 Added unreleased changes to changelog 2018-10-07 09:01:24 +02:00
Alejandro Celaya
644caf7dfb Ensured ColorGenerator matches keys in a case insensitive way 2018-10-07 08:59:25 +02:00
Alejandro Celaya
f26deb51eb Fixed typo in badge 2018-09-16 13:18:41 +02:00
Alejandro Celaya
606397b542 Merge pull request #41 from acelaya/feature/1.1.0
Feature/1.1.0
2018-09-16 13:05:03 +02:00
Alejandro Celaya
bc8eaaaee4 Added v1.1.0 to changelog 2018-09-16 12:52:00 +02:00
Alejandro Celaya
7d665f3933 Ensured tags returned from server are used after editing short URL tags in order to use the normalized values 2018-09-16 12:48:28 +02:00
Alejandro Celaya
fc1af04243 Created tests for Paginator and SearchBar 2018-09-16 12:18:02 +02:00
Alejandro Celaya
f2d03203ae Implemented short URLs deletion 2018-09-16 10:47:17 +02:00
Alejandro Celaya
2d6dda3576 Created delete short URLs modal 2018-09-16 09:35:39 +02:00
Alejandro Celaya
9b3bfe56bb Ensured list filtering params are reset when list component unmounts 2018-09-16 09:01:05 +02:00
Alejandro Celaya
5d5a2be498 Ensured bar charts start at 0 2018-09-08 20:42:14 +02:00
Alejandro Celaya
64c1b56973 Created ShortUrlVisits test 2018-09-08 13:28:40 +02:00
Alejandro Celaya
d37e7ca7ce Created VisitsHeader test 2018-09-08 09:31:44 +02:00
Alejandro Celaya
eb0f219403 Created GraphCard test 2018-09-08 09:06:18 +02:00
Alejandro Celaya
0c1656285b Created shortUrlVisits reducer test 2018-09-08 08:49:49 +02:00
Alejandro Celaya
bbce53ade6 Created shortUrlDetail reducer test 2018-09-07 20:41:21 +02:00
Alejandro Celaya
3e63734e2b Improved visits page 2018-09-05 20:17:46 +02:00
Alejandro Celaya
f0b0fdf114 Replaced hardcoded paypal link by short link 2018-09-02 11:10:59 +02:00
Alejandro Celaya
f84e3c5b60 Moved jest config from package.json to external file 2018-09-02 11:10:59 +02:00
Alejandro Celaya
28bd39f974 Fixed stylelint not properly inspecting files in src root 2018-09-02 11:10:59 +02:00
Alejandro Celaya
8b17ff88ed Split short URL visits reducer into two individual reducers 2018-09-02 11:10:59 +02:00
Alejandro Celaya
0d97c084c2 Extracted components in ShortUrlVisits to simplify maintainability 2018-09-02 11:10:59 +02:00
Alejandro Celaya
b7ca32ff8f Moved visits-related elements to visits folder 2018-09-02 11:10:59 +02:00
Alejandro Celaya
b454810357 Moved tag helper components from utils to tags/helpers folder 2018-09-02 11:10:59 +02:00
Alejandro Celaya
fd57d70a0b Fixed tags input autofocus 2018-09-02 11:10:59 +02:00
Alejandro Celaya
b0bce7498a Added first autocomplete implementation on tags selector 2018-09-02 11:10:59 +02:00
Alejandro Celaya
1519f89318 Created different functions which load tags always or only once 2018-09-02 11:10:59 +02:00
Alejandro Celaya
0b089e24de Moved propTypes and defaultProps as static properties in class components 2018-09-02 11:10:59 +02:00
473 changed files with 50040 additions and 14921 deletions

View File

@@ -1,4 +1,7 @@
./.github
./build
./dist
./coverage
./node_modules
./test
./shlink-web-client.gif
./dist

View File

@@ -1,40 +1,17 @@
{
"extends": [
"adidas-env/browser",
"adidas-env/module",
"adidas-es6",
"adidas-babel",
"adidas-react"
"@shlinkio/js-coding-standard"
],
"plugins": ["jest"],
"env": {
"jest/globals": true
},
"parserOptions": {
"tsconfigRootDir": ".",
"createDefaultProgram": true
},
"globals": {
"process": true,
"setImmediate": true
},
"settings": {
"react": {
"version": "16.3"
}
},
"rules": {
"comma-dangle": ["error", "always-multiline"],
"no-invalid-this": "off",
"no-console": "warn",
"template-curly-spacing": ["error", "never"],
"no-warning-comments": "off",
"no-undefined": "off",
"indent": ["error", 2, {
"SwitchCase": 1
}
],
"react/jsx-curly-spacing": ["error", "never"],
"react/jsx-indent-props": ["error", 2],
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
"react/no-array-index-key": "off",
"react/no-did-update-set-state": "off"
}
}

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: ['acelaya']
custom: ['https://acel.me/donate']

7
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,7 @@
<!--
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
-->

36
.github/ISSUE_TEMPLATE/Bug.md vendored Normal file
View File

@@ -0,0 +1,36 @@
---
name: Bug report
about: Something on shlink is broken or not working as documented?
labels: bug
---
<!--
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested once the issue is open.
-->
#### Shlink web client version
* Version: x.y.z
* How do you use shlink-web-client: app.shlink.io|Docker image|self-hosted
#### Summary
<!-- Provide a summary describing the problem you are experiencing. -->
#### Current behavior
<!-- How is it actually behaving (and it shouldn't)? -->
#### Expected behavior
<!-- How did you expected to behave? -->
#### How to reproduce
<!-- Provide steps to reproduce the bug. -->

View File

@@ -0,0 +1,19 @@
---
name: Feature request
about: Do you find shlink is missing some important feature that would make it more useful?
labels: feature
---
<!--
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested once the issue is open.
-->
#### Summary
<!-- Describe the new feature you would like to request. -->

View File

@@ -0,0 +1,24 @@
---
name: Question - Support
about: Do you have a problem setting up or using shlink?
labels: question
---
<!--
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested once the issue is open.
-->
#### Shlink web client version
* Version: x.y.z
* How do you use shlink-web-client: app.shlink.io|Docker image|self-hosted
#### Summary
<!-- Describe the issue you are facing here. -->

58
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: Continuous integration
on:
pull_request: null
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use node.js 14.15
uses: actions/setup-node@v1
with:
node-version: 14.15
- run: npm ci
- run: npm run lint
unit-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use node.js 14.15
uses: actions/setup-node@v1
with:
node-version: 14.15
- run: npm ci
- run: npm run test:ci
- name: Publish coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage/clover.xml
mutation-tests:
continue-on-error: true
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # needed so that the main branch is also fetched
- name: Use node.js 14.15
uses: actions/setup-node@v1
with:
node-version: 14.15
- run: npm ci
- run: npm run mutate -- --mutate=$(git diff origin/main --name-only | grep -E 'src\/(.*).(ts|tsx)$' | paste -sd ",")
build-docker-image:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: docker build -t shlink-web-client:test .

View File

@@ -0,0 +1,28 @@
name: Build docker image
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to docker hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build the image
run: bash ./scripts/docker/build

28
.github/workflows/publish-release.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Publish release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use node.js 14.15
uses: actions/setup-node@v1
with:
node-version: 14.15
- name: Generate release assets
run: npm ci && npm run build ${GITHUB_REF#refs/tags/v}
- name: Publish release with assets
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOW_TAG_PREFIX: "true"
ALLOW_EMPTY_CHANGELOG: "true"
with:
args: |
dist/shlink-web-client_*_dist.zip

16
.gitignore vendored
View File

@@ -1,24 +1,16 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
package-lock.json
# testing
/coverage
/.stryker-tmp
/reports
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
docker-compose.override.yml
home
public/servers.json*

View File

@@ -1,5 +0,0 @@
build:
environment:
node: v10.4.1
tools:
external_code_coverage: true

View File

@@ -1,22 +0,0 @@
language: node_js
node_js:
- "stable"
cache:
yarn: true
directories:
- node_modules
install:
- yarn install
script:
- yarn lint
- yarn test:ci
- yarn build # Make sure the app can be built without errors
after_script:
- yarn ocular coverage/clover.xml
sudo: false

View File

@@ -1,39 +1,579 @@
# CHANGELOG
## 1.0.1 - 2018-09-02
All notable changes to this project will be documented in this file.
#### Added
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).
## [3.1.1] - 2021-05-08
### Added
* *Nothing*
#### Changed
### Changed
* *Nothing*
#### Deprecated
### Deprecated
* *Nothing*
#### Removed
### Removed
* *Nothing*
#### Fixed
### Fixed
* [#413](https://github.com/shlinkio/shlink-web-client/issues/413) Fixed edit short URL form reflecting outdated info after navigating back from other section.
* [#412](https://github.com/shlinkio/shlink-web-client/issues/412) Ensured new visits coming from mercure hub are prepended and not appended, to keep proper sorting.
* [#417](https://github.com/shlinkio/shlink-web-client/issues/417) Fixed link spanning out of QR code modal.
* [#411](https://github.com/shlinkio/shlink-web-client/issues/411) Added missing feedback when editing a short URL to know if everything went right.
## [3.1.0] - 2021-03-29
### Added
* [#379](https://github.com/shlinkio/shlink-web-client/issues/379) and [#384](https://github.com/shlinkio/shlink-web-client/issues/384) Improved QR code modal, including controls to customize size, format and margin, as well as a button to copy the link to the clipboard.
* [#385](https://github.com/shlinkio/shlink-web-client/issues/385) Added setting to determine if "validate URL" should be enabled or disabled by default.
* [#386](https://github.com/shlinkio/shlink-web-client/issues/386) Added new card in overview section to display amount of orphan visits when using Shlink 2.6.0 or higher.
* [#177](https://github.com/shlinkio/shlink-web-client/issues/177) Added dark theme.
* [#387](https://github.com/shlinkio/shlink-web-client/issues/387) and [#395](https://github.com/shlinkio/shlink-web-client/issues/395) Added a section to see orphan visits stats, when consuming Shlink >=2.6.0.
* [#383](https://github.com/shlinkio/shlink-web-client/issues/383) Added title to short URLs list, displayed when consuming Shlink >=2.6.0.
* [#368](https://github.com/shlinkio/shlink-web-client/issues/368) Added new settings to define the default interval for visits pages.
* [#349](https://github.com/shlinkio/shlink-web-client/issues/349) Added support to export visits to CSV.
* [#397](https://github.com/shlinkio/shlink-web-client/issues/397) New section to edit all data for short URLs, including title when using Shlink v2.6 or newer.
This new section replaces the old modals to edit short URL meta, short URL tags and the long URL. Everything is now together in the same section.
### Changed
* [#382](https://github.com/shlinkio/shlink-web-client/issues/382) Ensured short URL tags are edited through the `PATCH /short-urls/{shortCode}` endpoint when using Shlink 2.6.0 or higher.
* [#398](https://github.com/shlinkio/shlink-web-client/issues/398) Improved performance when loading short URL details by avoiding API calls if the short URL is already present in local state.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#335](https://github.com/shlinkio/shlink-web-client/issues/335) Fixed linting errors.
## [3.0.1] - 2020-12-30
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#364](https://github.com/shlinkio/shlink-web-client/issues/364) Fixed all dropdowns so that they are consistently styled.
* [#366](https://github.com/shlinkio/shlink-web-client/issues/366) Fixed text in visits menu jumping to next line in some tablet resolutions.
* [#367](https://github.com/shlinkio/shlink-web-client/issues/367) Removed conflicting overflow in visits table for mobile devices.
* [#365](https://github.com/shlinkio/shlink-web-client/issues/365) Fixed weird rendering of short URLs list in tablets.
* [#372](https://github.com/shlinkio/shlink-web-client/issues/372) Fixed importing servers in Android devices.
## [3.0.0] - 2020-12-22
### Added
* [#340](https://github.com/shlinkio/shlink-web-client/issues/340) Added new "overview" page, showing basic information of the active server.
As a side effect, it also introduces improvements in the "create short URL" page, grouping components by context and explaining what they are for.
* [#309](https://github.com/shlinkio/shlink-web-client/issues/309) Added new domain selector component in create URL form which allows selecting from previously used domains or set a new one.
* [#315](https://github.com/shlinkio/shlink-web-client/issues/315) Now you can tell if you want to validate the long URL when using Shlink >=2.4.
* [#285](https://github.com/shlinkio/shlink-web-client/issues/285) Improved visits section:
* Charts are now grouped in tabs, so that only one part of the components is rendered at a time.
* Amount of highlighted visits is now displayed.
* Date filtering can be now selected through relative times (last 7 days, last 30 days, etc) or absolute dates using date pickers.
* Only the visits for last 30 days are loaded by default. You can change that at any moment if required.
* [#355](https://github.com/shlinkio/shlink-web-client/issues/355) Improved home page, fixing also its scrolling behavior for mobile devices.
### Changed
* [#267](https://github.com/shlinkio/shlink-web-client/issues/267) Added some subtle but important improvements on UI/UX.
* [#352](https://github.com/shlinkio/shlink-web-client/issues/352) Moved from Scrutinizer to Codecov as the code coverage backend.
* [#217](https://github.com/shlinkio/shlink-web-client/issues/217) Improved how messages are displayed, by centralizing it in the `Message` and `Result` components.
* [#219](https://github.com/shlinkio/shlink-web-client/issues/219) Improved error messages when something fails while interacting with Shlink's API.
### Deprecated
* *Nothing*
### Removed
* [#344](https://github.com/shlinkio/shlink-web-client/issues/344) Dropped support for Shlink v1.
### Fixed
* *Nothing*
## [2.6.2] - 2020-11-14
### Added
* *Nothing*
### Changed
* [#325](https://github.com/shlinkio/shlink-web-client/issues/325) and [#294](https://github.com/shlinkio/shlink-web-client/issues/294) Updated all dependencies, including React 17, Typescript 4, react-datepicker 3 and Stryker 4.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#334](https://github.com/shlinkio/shlink-web-client/issues/334) Fixed color-picker making the app crash when closing the modal without closing the color-picker, and then trying to open the modal again.
* [#333](https://github.com/shlinkio/shlink-web-client/issues/333) Fixed visits getting accumulated every time the visits page is opened.
## [2.6.1] - 2020-10-31
### Added
* *Nothing*
### Changed
* [#292](https://github.com/shlinkio/shlink-web-client/issues/292) Improved a bit how caching works by removing the service worker and adding proper HTTP caching config on nginx inside docker image.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#316](https://github.com/shlinkio/shlink-web-client/issues/316) Fixed manifest.json file not getting downloaded after passing credentials when the app is protected with basic auth.
* [#311](https://github.com/shlinkio/shlink-web-client/issues/311) Fixed datepicker showing below other components.
* [#306](https://github.com/shlinkio/shlink-web-client/issues/306) Fixed multi-arch docker builds by replacing node-sass with dart-sass.
* [#328](https://github.com/shlinkio/shlink-web-client/issues/328) Fixed toggle switches getting broken in mobile resolutions.
## [2.6.0] - 2020-09-20
### Added
* [#289](https://github.com/shlinkio/shlink-web-client/issues/289) Client and server version constraints are now links to the corresponding project release notes.
* [#293](https://github.com/shlinkio/shlink-web-client/issues/293) Shlink versions are now always displayed in footer, hiding the server version when there's no connected server.
* [#250](https://github.com/shlinkio/shlink-web-client/issues/250) Added support to group real time updates in fixed intervals.
The settings page now allows to provide the interval in which the UI should get updated, making that happen at once, with all the updates that have happened during that interval.
By default updates are immediately applied if real-time updates are enabled, to keep the behavior as it was.
* [#277](https://github.com/shlinkio/shlink-web-client/issues/277) Added highlighting capabilities to the visits line chart.
### Changed
* [#150](https://github.com/shlinkio/shlink-web-client/issues/150) The list of short URLs is now ordered by the creation date, showing newest results first.
* [#248](https://github.com/shlinkio/shlink-web-client/issues/248) Numbers displayed application-wide are now prettified.
* [#40](https://github.com/shlinkio/shlink-web-client/issues/40) Migrated project to TypeScript.
* [#297](https://github.com/shlinkio/shlink-web-client/issues/297) Moved docker image building to github actions.
* [#305](https://github.com/shlinkio/shlink-web-client/issues/305) Split travis build so that every step is run in a parallel job.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#295](https://github.com/shlinkio/shlink-web-client/issues/295) Fixed custom slug field not being disabled when selecting a short code length.
* [#301](https://github.com/shlinkio/shlink-web-client/issues/301) Fixed tags visits loading not being cancelled when leaving visits page.
## [2.5.1] - 2020-06-06
### Added
* *Nothing*
### Changed
* [#254](https://github.com/shlinkio/shlink-web-client/issues/254) Reduced duplication on code to handle mercure topics binding.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#276](https://github.com/shlinkio/shlink-web-client/issues/276) Fixed default grouping used for visits line chart, making it be dynamic depending on how old the short URL is.
* [#280](https://github.com/shlinkio/shlink-web-client/issues/280) Fixed shlink-web-client version not being properly passed when building stable tags of the docker image.
* [#269](https://github.com/shlinkio/shlink-web-client/issues/269) Fixed doughnut chart legends getting to big and hiding charts on mobile devices.
## [2.5.0] - 2020-05-31
### Added
* [#148](https://github.com/shlinkio/shlink-web-client/issues/148) Added support for real-time updates when consuming a Shlink version that is integrated with a mercure hub server.
The integration is transparent. When a server is opened, shlink-web-client will try to get the mercure info from it.
* If it works, it will setup the necessary `EventSource`s, dispatching redux actions when an event is pushed, which will in turn update the UI.
* If it fails, it will assume it is either not configured or not supported by the Shlink version.
* [#265](https://github.com/shlinkio/shlink-web-client/issues/265) Updated tags section to allow displaying number of short URLs using every tag and number of visits for all short URLs using the tag.
This will work only when using Shlink v2.2.0 or above. For previous versions, the tags page will continue behaving the same.
* [#261](https://github.com/shlinkio/shlink-web-client/issues/261) Added new page to show visit stats by tag.
This new page will return a "not found" error when the server is lower than v2.2.0, as older versions do not support fetching stats by tag.
* [#253](https://github.com/shlinkio/shlink-web-client/issues/253) Created new settings page that will be used to define customizations in the app.
* [#149](https://github.com/shlinkio/shlink-web-client/issues/149) and [#198](https://github.com/shlinkio/shlink-web-client/issues/198) Added new line chart to visits and tags stats which displays amount of visits during selected time period, grouped by month, week, day or hour.
### Changed
* [#218](https://github.com/shlinkio/shlink-web-client/issues/218) Added back button to sections not displayed in left menu.
* [#255](https://github.com/shlinkio/shlink-web-client/issues/255) Improved how servers and settings are persisted in the local storage.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#262](https://github.com/shlinkio/shlink-web-client/issues/262) Fixed charts displaying decimal numbers, when visits are absolute and that makes no sense.
## [2.4.0] - 2020-04-10
### Added
* [#199](https://github.com/shlinkio/shlink-web-client/issues/199) Added table to visits page which displays the information in a paginated, sortable and filterable list.
It also supports selecting multiple visits in the table which makes the corresponding data to be highlighted in the visits charts.
* [#241](https://github.com/shlinkio/shlink-web-client/issues/241) Added support to select charts bars in order to highlight related stats in other charts.
It also selects the visits in the new table, and you can even combine a selection in the chart and in the table.
* [#213](https://github.com/shlinkio/shlink-web-client/issues/213) The versions of both shlink-web-client and currently consumed Shlink server are now displayed in the footer.
* [#221](https://github.com/shlinkio/shlink-web-client/issues/221) Improved how servers are handled, displaying meaningful errors when a not-found or a not-reachable server is tried to be loaded.
* [#226](https://github.com/shlinkio/shlink-web-client/issues/226) Created servers can now be edited.
* [#234](https://github.com/shlinkio/shlink-web-client/issues/234) Allowed short code length to be edited on any new short URL when using Shlink 2.1 or higher.
* [#235](https://github.com/shlinkio/shlink-web-client/issues/235) Allowed editing the long URL for any existing short URL when suing Shlink 2.1 or higher.
### Changed
* [#205](https://github.com/shlinkio/shlink-web-client/issues/205) Replaced `jest-each` package by jet's native `test.each` function.
* [#209](https://github.com/shlinkio/shlink-web-client/issues/209) Replaced `Unknown` by `Direct` for visits from undetermined referrers.
* [#212](https://github.com/shlinkio/shlink-web-client/issues/212) Moved copy-to-clipboard next to short URL.
* [#208](https://github.com/shlinkio/shlink-web-client/issues/208) Short URLs list paginator is now progressive.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#243](https://github.com/shlinkio/shlink-web-client/issues/243) Fixed loading state and resetting on short URL creation form.
* [#239](https://github.com/shlinkio/shlink-web-client/issues/239) Fixed how user agents are parsed, reducing false results.
## [2.3.1] - 2020-02-08
### Added
* *Nothing*
### Changed
* [#191](https://github.com/shlinkio/shlink-web-client/issues/191) Created `ForServerVersion` helper component which dynamically renders children if current server conditions are met.
* [#189](https://github.com/shlinkio/shlink-web-client/issues/189) Simplified short url tags and short url deletion components and reducers, by removing redundant actions.
### 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`.
* [#196](https://github.com/shlinkio/shlink-web-client/issues/196) Included apache `.htaccess` file which takes care of falling back to index.html when reloading the page on a client-side handled route.
* [#179](https://github.com/shlinkio/shlink-web-client/issues/179) Ensured domain is provided to Shlink server when editing, deleting or fetching short URLs which do not belong to default domain.
* [#202](https://github.com/shlinkio/shlink-web-client/issues/202) Fixed domain not passed when dispatching actions that affect a single short URL (edit tags, edit meta and delete), which cased the list not to be properly updated.
## [2.3.0] - 2020-01-19
### Added
* [#174](https://github.com/shlinkio/shlink-web-client/issues/174) Added complete support for Shlink v2.x together with currently supported Shlink versions.
* [#164](https://github.com/shlinkio/shlink-web-client/issues/164) Added max visits control on those URLs which have `maxVisits`.
* [#178](https://github.com/shlinkio/shlink-web-client/issues/178) Short URLs list can now be filtered by date range.
* [#46](https://github.com/shlinkio/shlink-web-client/issues/46) Allowed short URL's metadata to be edited (`maxVisits`, `validSince` and `validUntil`).
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#170](https://github.com/shlinkio/shlink-web-client/issues/170) Fixed apple icon referencing to incorrect file names.
## [2.2.2] - 2019-10-21
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#167](https://github.com/shlinkio/shlink-web-client/issues/167) Fixed `/servers.json` path not being ignored when returning something other than an array.
## [2.2.1] - 2019-10-18
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#165](https://github.com/shlinkio/shlink-web-client/issues/165) Fixed error thrown when opening "create" page while using a Shlink version which does not return a valid SemVer version (like `latest` docker image, or any development instance).
## [2.2.0] - 2019-10-05
### Added
* [#144](https://github.com/shlinkio/shlink-web-client/issues/144) Added domain input to create domain page.
### Changed
* [#140](https://github.com/shlinkio/shlink-web-client/issues/140) Updated project dependencies.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* *Nothing*
## [2.1.1] - 2019-09-22
### Added
* *Nothing*
### Changed
* [#142](https://github.com/shlinkio/shlink-web-client/issues/142) Updated to newer versions of base docker images for dev and production.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#151](https://github.com/shlinkio/shlink-web-client/issues/151) Fixed "order by" indicator (caret) still indicate ASC on column header when no order is specified.
* [#157](https://github.com/shlinkio/shlink-web-client/issues/157) Fixed pagination control on graphs expanding too much when lots of pages need to be rendered.
* [#155](https://github.com/shlinkio/shlink-web-client/issues/155) Fixed client-side paths resolve to 404 when served from nginx in docker image instead of falling back to `index.html`.
## [2.1.0] - 2019-05-19
### Added
* [#101](https://github.com/shlinkio/shlink-web-client/issues/101) Added checkbox to short URL creation form that allows to determine the value of the `findIfExists` flag introduced in Shlink v1.16.0.
* [#105](https://github.com/shlinkio/shlink-web-client/issues/105) Added support to pre-configure servers. See [how to pre-configure servers](README.md#pre-configuring-servers) to get more details on how to do it.
### Changed
* [#125](https://github.com/shlinkio/shlink-web-client/issues/125) Refactored reducers to replace `switch` statements by `handleActions` from [redux-actions](https://github.com/redux-utilities/redux-actions).
* [#116](https://github.com/shlinkio/shlink-web-client/issues/116) Removed sinon in favor of jest mocks.
* [#72](https://github.com/shlinkio/shlink-web-client/issues/72) Increased code coverage up to 80%.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* *Nothing*
## [2.0.3] - 2019-03-16
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#120](https://github.com/shlinkio/shlink-web-client/issues/120) Fixed crash when visits page is loaded and there are no visits with known cities.
* [#113](https://github.com/shlinkio/shlink-web-client/issues/113) Ensured visits loading is cancelled when the visits page is unmounted. Requests on flight will still finish.
* [#118](https://github.com/shlinkio/shlink-web-client/issues/118) Fixed chart crashing when trying to render lots of bars by adding pagination.
## [2.0.2] - 2019-03-04
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#103](https://github.com/shlinkio/shlink-web-client/issues/103) Fixed visits page getting freezed when loading large amounts of visits.
* [#111](https://github.com/shlinkio/shlink-web-client/issues/111) Fixed crash when trying to load a map modal with only one location.
* [#115](https://github.com/shlinkio/shlink-web-client/issues/115) Created `ErrorHandler` component which will prevent crashes in app to make it unusable.
## [2.0.1] - 2019-03-03
### Added
* *Nothing*
### Changed
* [#106](https://github.com/shlinkio/shlink-web-client/issues/106) Reduced size of docker image by using a multi-stage build Dockerfile.
* [#95](https://github.com/shlinkio/shlink-web-client/issues/95) Tested docker image build during travis executions.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#104](https://github.com/shlinkio/shlink-web-client/issues/104) Fixed blank page being showed when not-found paths are loaded.
* [#94](https://github.com/shlinkio/shlink-web-client/issues/94) Fixed initial zoom and center on maps.
* [#93](https://github.com/shlinkio/shlink-web-client/issues/93) Prevented side menu to be swipeable while a modal window is displayed.
## [2.0.0] - 2019-01-13
### Added
* [#54](https://github.com/shlinkio/shlink-web-client/issues/54) Added stats by city graphic in visits page.
* [#55](https://github.com/shlinkio/shlink-web-client/issues/55) Added map in visits page locating cities from which visits have occurred.
### Changed
* [#87](https://github.com/shlinkio/shlink-web-client/issues/87) and [#89](https://github.com/shlinkio/shlink-web-client/issues/89) Updated all dependencies to latest major versions.
* [#96](https://github.com/shlinkio/shlink-web-client/issues/96) Updated visits page to load visits in multiple paginated requests of `5000` visits when used shlink server supports it. This will prevent shlink to hang when trying to load big amounts of visits.
* [#71](https://github.com/shlinkio/shlink-web-client/issues/71) Improved tests and increased code coverage.
### Deprecated
* *Nothing*
### Removed
* [#59](https://github.com/shlinkio/shlink-web-client/issues/59) Dropped support for old browsers. Internet explorer and dead browsers are no longer supported.
* [#97](https://github.com/shlinkio/shlink-web-client/issues/97) Dropped support for authentication via `Authorization` header with Bearer type and JWT, which will make this version no longer work with shlink earlier than v1.13.0.
### Fixed
* *Nothing*
## [1.2.1] - 2018-12-21
### Added
* *Nothing*
### Changed
* [#80](https://github.com/shlinkio/shlink-web-client/issues/80) Deeply refactored app to do true dependency injection with an IoC container.
* [#79](https://github.com/shlinkio/shlink-web-client/issues/79) Updated to nginx 1.15.7 as the base docker image.
* [#75](https://github.com/shlinkio/shlink-web-client/issues/75) Prevented duplicated `yarn build` in travis when a tag exists.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#77](https://github.com/shlinkio/shlink-web-client/issues/77) Sortable graphs ordering is now case insensitive.
## [1.2.0] - 2018-11-01
### Added
* [#65](https://github.com/shlinkio/shlink-web-client/issues/65) Added sorting to both countries and referrers stats graphs.
* [#14](https://github.com/shlinkio/shlink-web-client/issues/14) Documented how to build the project so that it can be served from a subpath.
### Changed
* [#50](https://github.com/shlinkio/shlink-web-client/issues/50) Improved tests and increased code coverage.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#66](https://github.com/shlinkio/shlink-web-client/issues/66) Fixed tooltips in graphs with too small bars not being displayed.
## [1.1.1] - 2018-10-20
### Added
* [#57](https://github.com/shlinkio/shlink-web-client/issues/57) Automated release generation in travis build.
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#63](https://github.com/shlinkio/shlink-web-client/issues/63) Improved how bar charts are rendered in stats page, making them try to calculate a bigger height for big data sets.
* [#56](https://github.com/shlinkio/shlink-web-client/issues/56) Ensured `ColorGenerator` matches keys in a case insensitive way.
* [#53](https://github.com/shlinkio/shlink-web-client/issues/53) Fixed missing margin between date fields in visits page for mobile devices.
## [1.1.0] - 2018-09-16
### Added
* [#47](https://github.com/shlinkio/shlink-web-client/issues/47) Added support to delete short URLs (requires [shlink v1.12.0](https://github.com/shlinkio/shlink/releases/tag/v1.12.0) or greater).
### Changed
* [#35](https://github.com/shlinkio/shlink-web-client/issues/35) Visits component split into two, which makes the header not to be refreshed when filtering by date, and also the visits global counter now reflects the actual number of visits which fulfill current filter.
* [#36](https://github.com/shlinkio/shlink-web-client/issues/36) Tags selector now autocompletes existing tag names, to prevent typos and ease reusing existing tags.
* [#39](https://github.com/shlinkio/shlink-web-client/issues/39) Defined `propTypes` as static properties in class components.
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#49](https://github.com/shlinkio/shlink-web-client/issues/49) Ensured filtering parameters are reseted when list component is unmounted so that params are not mixed when coming back.
* [#45](https://github.com/shlinkio/shlink-web-client/issues/45) Ensured graphs x-axis start at `0` and don't use decimals.
* [#51](https://github.com/shlinkio/shlink-web-client/issues/51) When editing short URL tags, the value returned form server is used when refreshing the list, which is normalized.
## [1.0.1] - 2018-09-02
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#42](https://github.com/shlinkio/shlink-web-client/issues/42) Fixed selected tags lost when navigating between pages in short URLs list.
* [#43](https://github.com/shlinkio/shlink-web-client/issues/43) Fixed "List short URLs" menu item only selected when in first page.
## 1.0.0 - 2018-08-26
#### Added
## [1.0.0] - 2018-08-26
### Added
* [#4](https://github.com/shlinkio/shlink-web-client/issues/4) Now it is possible to export and import servers.
* Export all servers in a CSV file.
* Import the CSV in a different device.
* [#4](https://github.com/shlinkio/shlink-web-client/issues/4) Added tags management.
* [#3](https://github.com/shlinkio/shlink-web-client/issues/3) Added tags management.
* List existing tags, and filter the list.
* Change their name and color.
@@ -44,69 +584,53 @@
* [#22](https://github.com/shlinkio/shlink-web-client/issues/22) Improved code coverage.
* [#28](https://github.com/shlinkio/shlink-web-client/issues/28) Added integration with [Scrutinizer](https://scrutinizer-ci.com/g/shlinkio/shlink-web-client/).
#### Changed
### Changed
* [#33](https://github.com/shlinkio/shlink-web-client/issues/33) Changed to [adidas coding style](https://github.com/adidas/js-linter-configs) for Javascript.
* [#32](https://github.com/shlinkio/shlink-web-client/issues/32) Changed to [adidas coding style](https://github.com/adidas/js-linter-configs) for stylesheets.
* [#26](https://github.com/shlinkio/shlink-web-client/issues/26) The tags input now displays tags using their actual color.
#### Deprecated
### Deprecated
* *Nothing*
#### Removed
### Removed
* *Nothing*
#### Fixed
### Fixed
* *Nothing*
## 0.2.0 - 2018-08-12
#### Added
## [0.2.0] - 2018-08-12
### Added
* [#12](https://github.com/shlinkio/shlink-web-client/issues/12) Improved code coverage
* [#20](https://github.com/shlinkio/shlink-web-client/issues/20) Added servers list in welcome page, as well as added link to create one when none exist.
#### Changed
### Changed
* [#11](https://github.com/shlinkio/shlink-web-client/issues/11) Improved app icons fro progressive web apps.
#### Deprecated
### Deprecated
* *Nothing*
#### Removed
### Removed
* *Nothing*
#### Fixed
### Fixed
* [#19](https://github.com/shlinkio/shlink-web-client/issues/19) Added workaround in tags input so that it is possible to add tags on Android devices.
* [#17](https://github.com/shlinkio/shlink-web-client/issues/17) Fixed short URLs list not being sortable in mobile resolutions.
* [#13](https://github.com/shlinkio/shlink-web-client/issues/13) Improved visits page on mobile resolutions.
## 0.1.1 - 2018-08-06
#### Added
## [0.1.1] - 2018-08-06
### Added
* [#15](https://github.com/shlinkio/shlink-web-client/issues/15) Added a `Dockerfile` that can be used to generate a distributable docker image
#### Changed
### Changed
* *Nothing*
#### Deprecated
### Deprecated
* *Nothing*
#### Removed
### Removed
* *Nothing*
#### Fixed
### Fixed
* *Nothing*

72
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,72 @@
# Contributing
This file will guide you through the process of getting to project up and running, in case you want to provide coding contributions.
You will also see how to ensure the code fulfills the expected code checks, and how to create a pull request.
## System dependencies
The project can be run inside a docker container through provided docker-compose configuration.
Because of this, the only actual dependencies are [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/).
## Setting up the project
The first thing you need to do is fork the repository, and clone it in your local machine.
Then you will have to follow these steps:
* Copy the file `docker-compose.override.yml.dist` by also removing the `dist` extension.
* Start-up the project by running `docker-compose up`.
Once this is finished, you will have the project exposed in port `3000` (http://localhost:3000).
## Project structure
This project is a [react](https://reactjs.org/) & [redux](https://redux.js.org/) application, built with [typescript](https://www.typescriptlang.org/), which is distributed as a 100% client-side progressive web application.
This is the basic project structure:
```
shlink-web-client
├── config
├── public
├── scripts
├── src
├── test
├── package.json
└── README.md
```
* `config`: It contains some configuration scripts, used during testing, linting and building of the project.
* `public`: Will act as the application document root once built, and contains some static assets (favicons, images, etc).
* `scripts`: It has some of the CLI scripts used to run tests or building.
* `src`: Contains the main source code of the application, including both web components, SASS stylesheets and files with logic.
* `test`: Contains the project tests.
## Running code checks
> Note: The `indocker` shell script is a helper used to run commands inside the docker container.
* `./indocker npm run lint`: Checks coding styles are fulfilled, both in JS/TS files as well as in stylesheets.
* `./indocker npm run lint:js`: Checks coding styles are fulfilled in JS/TS files.
* `./indocker npm run lint:css`: Checks coding styles are fulfilled in stylesheets.
* `./indocker npm run lint:js:fix`: Fixes coding styles in JS/TS files.
* `./indocker npm run lint:css:fix`: Fixes coding styles in stylesheets.
* `./indocker npm run test`: Runs unit tests with Jest.
* `./indocker npm run mutate`: Runs mutation tests with StrykerJS (this command can be very slow).
## Building the project
The source code in this project cannot be run directly in a web browser, you need to build it first.
* `./indocker npm run build`: Builds the project using a combination of `webpack`, `babel` and `tsc`, generating the final static files. The content is placed in the `build` folder, which is automatically created if it does not exist.
* `./indocker npm run serve:build`: Serves the static files inside the `build` folder in port 5000 (http://localhost:5000). Useful to test the content built with previous command.
## Pull request process
In order to provide pull requests to this project, you should always start by creating a new branch, where you will make all desired changes.
The base branch should always be `main`, and the target branch for the pull request should also be `main`.
Before your branch can be merged, all the checks described in [Running code checks](#running-code-checks) have to be passing. You can verify that manually, or wait for the build to be run automatically after the pull request is created.

View File

@@ -1,21 +1,12 @@
FROM nginx:1.15.2-alpine
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
FROM node:14.15-alpine as node
COPY . /shlink-web-client
ARG VERSION="latest"
ENV VERSION ${VERSION}
RUN cd /shlink-web-client && \
npm install && npm run build -- ${VERSION} --no-dist
# Install node and yarn
RUN apk add --no-cache --virtual nodejs && apk add --no-cache --virtual yarn
ADD . ./shlink-web-client
# Install dependencies and build project
RUN cd ./shlink-web-client && \
yarn install && \
yarn build && \
# Move build contents to document root
cd .. && \
rm -r /usr/share/nginx/html/* && \
mv ./shlink-web-client/build/* /usr/share/nginx/html && \
rm -r ./shlink-web-client && \
# Delete and uninstall build tools
yarn cache clean && apk del yarn && apk del nodejs
FROM nginx:1.19.6-alpine
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
RUN rm -r /usr/share/nginx/html && rm /etc/nginx/conf.d/default.conf
COPY config/docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=node /shlink-web-client/build /usr/share/nginx/html

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 shlinkio
Copyright (c) 2018-2020 shlinkio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,29 +1,101 @@
# shlink-web-client
[![Build Status](https://img.shields.io/travis/shlinkio/shlink-web-client.svg?style=flat-square)](https://travis-ci.org/shlinkio/shlink-web-client)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/shlinkio/shlink-web-client.svg?style=flat-square)](https://scrutinizer-ci.com/gshlinkio/shlink-web-client/?branch=master)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/shlinkio/shlink-web-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/shlinkio/shlink-web-client/?branch=master)
[![Build Status](https://img.shields.io/github/workflow/status/shlinkio/shlink-web-client/Continuous%20integration/main?logo=github&style=flat-square)](https://github.com/shlinkio/shlink-web-client/actions?query=workflow%3A%22Continuous+integration%22)
[![Code Coverage](https://img.shields.io/codecov/c/gh/shlinkio/shlink-web-client/main?style=flat-square)](https://app.codecov.io/gh/shlinkio/shlink-web-client)
[![GitHub release](https://img.shields.io/github/release/shlinkio/shlink-web-client.svg?style=flat-square)](https://github.com/shlinkio/shlink-web-client/releases/latest)
[![GitHub license](https://img.shields.io/github/license/shlinkio/shlink-web-client.svg?style=flat-square)](https://github.com/shlinkio/shlink-web-client/blob/master/LICENSE)
[![Docker pulls](https://img.shields.io/docker/pulls/shlinkio/shlink-web-client.svg?logo=docker&style=flat-square)](https://hub.docker.com/r/shlinkio/shlink-web-client/)
[![GitHub license](https://img.shields.io/github/license/shlinkio/shlink-web-client.svg?style=flat-square)](https://github.com/shlinkio/shlink-web-client/blob/main/LICENSE)
[![Paypal Donate](https://img.shields.io/badge/Donate-paypal-blue.svg?style=flat-square&logo=paypal&colorA=cccccc)](https://slnk.to/donate)
A ReactJS-based progressive web application for [Shlink](https://shlink.io).
![shlink-web-client](shlink-web-client.gif)
> If you are trying to find out how to run the project in development mode or how to provide contributions, read the [CONTRIBUTING](CONTRIBUTING.md) doc.
## Installation
There are three ways in which you can use this application.
* The easiest way to use shlink-web-client is by just going to https://app.shlink.io.
### From app.shlink.io
The application runs 100% in the browser, so you can use that instance and access any shlink instance from it.
The easiest way to use shlink-web-client is by just going to <https://app.shlink.io>.
* Self hosting the application yourself.
The application runs 100% in the browser, so you can safely access any shlink instance from there.
Get the [latest release](https://github.com/shlinkio/shlink-web-client/releases/latest) and download the distributable zip file attached to it (`shlink-web-client_X.X.X_dist.zip`).
### Docker image
The package contains static files only, so just put it in a folder and serve it with the web server of your choice (just take into account that all the files are served using absolute paths, so you have to serve it from the root of your domain, not from a subpath).
If you want to deploy shlink-web-client in a container-based cluster (kubernetes, docker swarm, etc), just pick the [shlinkio/shlink-web-client](https://hub.docker.com/r/shlinkio/shlink-web-client/) image and do it.
* Use the official [docker image](https://hub.docker.com/r/shlinkio/shlink-web-client/)
It's a lightweight [nginx:alpine](https://hub.docker.com/r/library/nginx/) image serving the static app on port 80.
If you want to deploy shlink-web-client in a container-based cluster (docker swarm, kubernetes, etc), just pick the image and do it.
### Self-hosted
It's a lightweight [nginx:alpine image](https://hub.docker.com/r/library/nginx/) serving the assets on port 80.
If you want to self-host it yourself, get the [latest release](https://github.com/shlinkio/shlink-web-client/releases/latest) and download the distributable zip file attached to it (`shlink-web-client_X.X.X_dist.zip`).
The package contains static files only, so just put it in a folder and serve it with the web server of your choice.
**Considerations**:
* Provided dist files are configured to be served from the root of your domain. If you need to serve shlink-web-client from a subpath, you will have to build it yourself following [these steps](#serve-shlink-in-subpath).
* The app has a client-side router that handles dynamic paths. Because of that, you need to configure your web server to fall-back to the `index.html` file when requested files do not exist.
* If you use Apache, you are covered, since the project includes an `.htaccess` file which already does this.
* If you use nginx, you can [see how it's done](config/docker/nginx.conf) for the docker image and do the same.
## Pre-configuring servers
The first time you access shlink-web-client from a browser, you will have to configure the list of shlink servers you want to manage, and they will be saved in the local storage.
Those servers can be exported and imported in other browsers, but if for some reason you need some servers to be there from the beginning, starting with shlink-web-client 2.1.0, you can provide a `servers.json` file in the project root folder (the same containing the `index.html`, `favicon.ico`, etc) with a structure like this:
```json
[
{
"name": "Main server",
"url": "https://doma.in",
"apiKey": "09c972b7-506b-49f1-a19a-d729e22e599c"
},
{
"name": "Local",
"url": "http://localhost:8080",
"apiKey": "580d0b42-4dea-419a-96bf-6c876b901451"
}
]
```
> The list can contain as many servers as you need.
If you are using the shlink-web-client docker image, you can mount the `servers.json` file in a volume inside `/usr/share/nginx/html`, which is the app's document root inside the container.
docker run --name shlink-web-client -p 8000:80 -v ${PWD}/servers.json:/usr/share/nginx/html/servers.json shlinkio/shlink-web-client
> **Be extremely careful when using this feature.**
>
> Due to shlink-web-client's client-side nature, the file needs to be accessible from the browser.
>
> Because of that, make sure you use this only when you self-host shlink-web-client, and you know only trusted people will have access to it.
>
> Failing to do this could cause your API keys to end up being exposed.
## Serve project in subpath
Official distributable files have been built so that they are served from the root of a domain.
If you need to host shlink-web-client yourself and serve it from a subpath, follow these steps:
* Download shlink-web-client source code for the version you want to build.
* For example, if you want to build `v1.0.1`, use this link https://github.com/shlinkio/shlink-web-client/archive/v1.0.1.zip
* Replace the `v1.0.1` part in the link with the one of the version you want to build.
* Decompress the file and `cd` into the resulting folder.
* Open the `package.json` file in the root of the project, locate the `homepage` property and replace the value (which should be an empty string) by the path from which you want to serve shlink-web-client.
* For example: `"homepage": "/my-projects/shlink-web-client",`.
* Build the project:
* For classic hosting:
* Download [node](https://nodejs.org/en/download/package-manager/) 10.15 or later.
* Install project dependencies by running `npm install`.
* Build the project by running `npm run build`.
* Once the command finishes, you will have a `build` folder with all the static assets you need to run shlink-web-client. Just place them wherever you want them to be served from.
* For docker image:
* Download [docker](https://docs.docker.com/install/).
* Build the docker image by running `docker build . -t shlink-web-client`.
* Once the command finishes, you will have an image with the name `shlink-web-client`.

32
config/docker/nginx.conf Normal file
View File

@@ -0,0 +1,32 @@
server {
listen 80 default_server;
charset utf-8;
root /usr/share/nginx/html;
index index.html;
# Expire rules for static content
# HTML files should never be cached. There's only one here, which is the entry point (index.html)
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}
# Images and other binary assets can be saved for a month
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
add_header Cache-Control "public";
}
# JS and CSS files can be saved for a year, as they are always hashed. New versions will include a new hash anyway, forcing the download
location ~* \.(?:css|js)$ {
expires 1y;
add_header Cache-Control "public";
}
# When requesting static paths with extension, try them, and return a 404 if not found
location ~* .+\.(css|js|html|png|jpe?g|gif|bmp|ico|json|csv|otf|eot|svg|svgz|ttf|woff|woff2|ijmap|pdf|tif|map) {
try_files $uri $uri/ =404;
}
# When requesting a path without extension, try it, and return the index if not found
# This allows HTML5 history paths to be handled by the client application
location / {
try_files $uri $uri/ /index.html$is_args$args;
}
}

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/promise-function-async, @typescript-eslint/prefer-optional-chain */
const fs = require('fs');
const path = require('path');
@@ -10,7 +11,7 @@ const { NODE_ENV } = process.env;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
'The NODE_ENV environment variable is required but was not specified.',
);
}
@@ -36,19 +37,19 @@ dotenvFiles.forEach((dotenvFile) => {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
}),
);
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebookincubator/create-react-app/issues/253.
// https://github.com/facebook/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
@@ -82,7 +83,7 @@ function getClientEnvironment(publicUrl) {
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
}
},
);
// Stringify all values so we can feed into Webpack DefinePlugin

View File

@@ -6,6 +6,24 @@ const path = require('path');
module.exports = {
process(src, filename) {
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
const assetFilename = JSON.stringify(path.basename(filename));
if (filename.match(/\.svg$/)) {
return `module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: (props) => ({
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: null,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
}),
};`;
}
return `module.exports = ${assetFilename};`;
},
};

View File

@@ -1,25 +1,26 @@
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/promise-function-async, @typescript-eslint/prefer-optional-chain */
const path = require('path');
const fs = require('fs');
const url = require('url');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
// https://github.com/facebook/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
const envPublicUrl = process.env.PUBLIC_URL;
function ensureSlash(path, needsSlash) {
const hasSlash = path.endsWith('/');
function ensureSlash(inputPath, needsSlash) {
const hasSlash = inputPath.endsWith('/');
if (hasSlash && !needsSlash) {
return path.substr(path, path.length - 1);
return inputPath.substr(0, inputPath.length - 1);
} else if (!hasSlash && needsSlash) {
return `${path}/`;
return `${inputPath}/`;
}
return path;
return inputPath;
}
const getPublicUrl = (appPackageJson) =>
@@ -33,23 +34,55 @@ const getPublicUrl = (appPackageJson) =>
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl = envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
return ensureSlash(servedUrl, true);
}
const moduleFileExtensions = [
'web.mjs',
'mjs',
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
];
// Resolve file paths in the same order as webpack
const resolveModule = (resolveFn, filePath) => {
const extension = moduleFileExtensions.find((extension) =>
fs.existsSync(resolveFn(`${filePath}.${extension}`)));
if (extension) {
return resolveFn(`${filePath}.${extension}`);
}
return resolveFn(`${filePath}.js`);
};
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
appIndexJs: resolveModule(resolveApp, 'src/index'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTsConfig: resolveApp('tsconfig.json'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveApp('src/setupTests.js'),
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
publicUrl: getPublicUrl(resolveApp('package.json')),
servedPath: getServedPath(resolveApp('package.json')),
};
module.exports.moduleFileExtensions = moduleFileExtensions;

View File

@@ -1,21 +0,0 @@
if (typeof Promise === 'undefined') {
// Rejection tracking prevents a common issue where React gets into an
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require('promise/lib/rejection-tracking').enable();
window.Promise = require('promise/lib/es6-extensions.js');
}
// fetch() polyfill for making API calls.
require('whatwg-fetch');
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
Object.assign = require('object-assign');
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if (process.env.NODE_ENV === 'test') {
require('raf').polyfill(global);
}

View File

@@ -1,4 +1,4 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
Enzyme.configure({ adapter: new Adapter() });

View File

@@ -1,308 +0,0 @@
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
// Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier.
const publicPath = '/';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
const publicUrl = '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
const postCssLoader = {
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9',
],
flexbox: 'no-2009',
}),
],
},
};
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
devtool: 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.
entry: [
// We ship a few polyfills by default:
require.resolve('./polyfills'),
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
require.resolve('react-dev-utils/webpackHotDevClient'),
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
],
output: {
// Add /* filename */ comments to generated require()s in the output.
pathinfo: true,
// This does not produce a real file. It's just the virtual path that is
// served by WebpackDevServer in development. This is the JS bundle
// containing code from all our entry points, and the Webpack runtime.
filename: 'static/js/bundle.js',
// There are also additional JS chunk files if you use code splitting.
chunkFilename: 'static/js/[name].chunk.js',
// This is the URL that app is served from. We use "/" in development.
publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: (info) =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: [ 'node_modules', paths.appNodeModules ].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: [ '.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx' ],
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [ paths.appPackageJson ]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [ /\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/ ],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
},
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use a plugin to extract that CSS to a file, but
// in development "style" loader enables hot editing of CSS.
{
test: /\.css$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},
postCssLoader,
],
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [ 'css-loader', 'sass-loader', postCssLoader ],
}),
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [ /\.(js|jsx|mjs)$/, /\.html$/, /\.json$/ ],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
],
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In development, this will be an empty string.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
}),
// Add module names to factory functions so they appear in browser profiler.
new webpack.NamedModulesPlugin(),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`.
new webpack.DefinePlugin(env.stringified),
// This is necessary to emit hot updates (currently CSS only):
new webpack.HotModuleReplacementPlugin(),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebookincubator/create-react-app/issues/240
new CaseSensitivePathsPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebookincubator/create-react-app/issues/186
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new ExtractTextPlugin('main.css'),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
// Turn off performance hints during development because we don't do any
// splitting or minification in interest of speed. These warnings become
// cumbersome.
performance: {
hints: false,
},
};

658
config/webpack.config.js Normal file
View File

@@ -0,0 +1,658 @@
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const resolve = require('resolve');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
const TerserPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const safePostCssParser = require('postcss-safe-parser');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin-alt');
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
const getClientEnvironment = require('./env');
const paths = require('./paths');
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
// Some apps do not need the benefits of saving a web request, so not inlining the chunk
// makes for a smoother build process.
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);
// style files regexes
const cssRegex = /\.css$/;
const cssModuleRegex = /\.module\.css$/;
const sassRegex = /\.(scss|sass)$/;
const sassModuleRegex = /\.module\.(scss|sass)$/;
// This is the production and development configuration.
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
/* eslint-disable complexity */
module.exports = (webpackEnv) => {
const isEnvDevelopment = webpackEnv === 'development';
const isEnvProduction = webpackEnv === 'production';
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
// In development, we always serve from the root. This makes config easier.
const publicPath = isEnvProduction
? paths.servedPath
: isEnvDevelopment && '/';
// Some apps do not use client-side routing with pushState.
// For these, "homepage" can be set to "." to enable relative asset paths.
const shouldUseRelativeAssetPaths = publicPath === './';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
const publicUrl = isEnvProduction
? publicPath.slice(0, -1)
: isEnvDevelopment && '';
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// common function to get style loaders
const getStyleLoaders = (cssOptions, preProcessor) => {
const loaders = [
isEnvDevelopment && require.resolve('style-loader'),
isEnvProduction && {
loader: MiniCssExtractPlugin.loader,
options: Object.assign(
{},
shouldUseRelativeAssetPaths ? { publicPath: '../../' } : undefined,
),
},
{
loader: require.resolve('css-loader'),
options: cssOptions,
},
{
// Options for PostCSS as we reference these options twice
// Adds vendor prefixing based on your specified browser support in
// package.json
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
}),
],
sourceMap: isEnvProduction && shouldUseSourceMap,
},
},
].filter(Boolean);
if (preProcessor) {
loaders.push({
loader: require.resolve(preProcessor),
options: {
sourceMap: isEnvProduction && shouldUseSourceMap,
},
});
}
return loaders;
};
return {
mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
// Stop compilation early in production
bail: isEnvProduction,
devtool: isEnvProduction
? shouldUseSourceMap
? 'source-map'
: false
: isEnvDevelopment && 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
entry: [
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
isEnvDevelopment &&
require.resolve('react-dev-utils/webpackHotDevClient'),
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
].filter(Boolean),
output: {
// The build folder.
path: isEnvProduction ? paths.appBuild : undefined,
// Add /* filename */ comments to generated require()s in the output.
pathinfo: isEnvDevelopment,
// There will be one main bundle, and one file per asynchronous chunk.
// In development, it does not produce real files.
filename: isEnvProduction
? 'static/js/[name].[chunkhash:8].js'
: isEnvDevelopment && 'static/js/bundle.js',
// There are also additional JS chunk files if you use code splitting.
chunkFilename: isEnvProduction
? 'static/js/[name].[chunkhash:8].chunk.js'
: isEnvDevelopment && 'static/js/[name].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
// We use "/" in development.
publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: isEnvProduction
? (info) =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/')
: isEnvDevelopment &&
((info) => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
},
optimization: {
minimize: isEnvProduction,
minimizer: [
// This is only used in production mode
new TerserPlugin({
terserOptions: {
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minfication steps that turns valid ecma 5 code
// into invalid ecma 5 code. This is why the 'compress' and 'output'
// sections only apply transformations that are ecma 5 safe
// https://github.com/facebook/create-react-app/pull/4234
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
// Disabled because of an issue with Terser breaking valid code:
// https://github.com/facebook/create-react-app/issues/5250
// Pending futher investigation:
// https://github.com/terser-js/terser/issues/120
inline: 2,
},
mangle: {
safari10: true,
},
output: {
ecma: 5,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
ascii_only: true, // eslint-disable-line @typescript-eslint/camelcase
},
},
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
parallel: true,
// Enable file caching
cache: true,
sourceMap: shouldUseSourceMap,
}),
// This is only used in production mode
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
parser: safePostCssParser,
map: shouldUseSourceMap
? {
// `inline: false` forces the sourcemap to be output into a
// separate file
inline: false,
// `annotation: true` appends the sourceMappingURL to the end of
// the css file, helping the browser find the sourcemap
annotation: true,
}
: false,
},
}),
],
// Automatically split vendor and commons
// https://twitter.com/wSokra/status/969633336732905474
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
splitChunks: {
chunks: 'all',
name: false,
},
// Keep the runtime chunk separated to enable long term caching
// https://twitter.com/wSokra/status/969679223278505985
runtimeChunk: true,
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253
modules: [ 'node_modules' ].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean),
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebook/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: paths.moduleFileExtensions
.map((ext) => `.${ext}`)
.filter((ext) => useTypeScript || !ext.includes('ts')),
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding
// guards against forgotten dependencies and such.
PnpWebpackPlugin,
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [ paths.appPackageJson ]),
],
},
resolveLoader: {
plugins: [
// Also related to Plug'n'Play, but this time it tells Webpack to load its loaders
// from the current package.
PnpWebpackPlugin.moduleLoader(module),
],
},
module: {
strictExportPresence: true,
rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|mjs|jsx)$/,
enforce: 'pre',
use: [
{
options: {
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [ /\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/ ],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process application JS with Babel.
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve(
'babel-preset-react-app/webpack-overrides',
),
plugins: [
[
require.resolve('babel-plugin-named-asset-import'),
{
loaderMap: {
svg: {
ReactComponent:
'@svgr/webpack?-prettier,-svgo![path]',
},
},
},
],
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
cacheCompression: isEnvProduction,
compact: isEnvProduction,
},
},
// Process any JS outside of the app with Babel.
// Unlike the application JS, we only compile the standard ES features.
{
test: /\.(js|mjs)$/,
exclude: /@babel(?:\/|\\{1,2})runtime/,
loader: require.resolve('babel-loader'),
options: {
babelrc: false,
configFile: false,
compact: false,
presets: [
[
require.resolve('babel-preset-react-app/dependencies'),
{ helpers: true },
],
],
cacheDirectory: true,
cacheCompression: isEnvProduction,
// If an error happens in a package, it's possible to be
// because it was compiled. Thus, we don't want the browser
// debugger to show the original code. Instead, the code
// being evaluated would be much more helpful.
sourceMaps: false,
},
},
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader turns CSS into JS modules that inject <style> tags.
// In production, we use MiniCSSExtractPlugin to extract that CSS
// to a file, but in development "style" loader enables hot editing
// of CSS.
// By default we support CSS Modules with the extension .module.css
{
test: cssRegex,
exclude: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction && shouldUseSourceMap,
}),
// Don't consider CSS imports dead code even if the
// containing package claims to have no side effects.
// Remove this when webpack adds a warning or an error for this.
// See https://github.com/webpack/webpack/issues/6571
sideEffects: true,
},
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
// using the extension .module.css
{
test: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction && shouldUseSourceMap,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
}),
},
// Opt-in support for SASS (using .scss or .sass extensions).
// By default we support SASS Modules with the
// extensions .module.scss or .module.sass
{
test: sassRegex,
exclude: sassModuleRegex,
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction && shouldUseSourceMap,
},
'sass-loader',
),
// Don't consider CSS imports dead code even if the
// containing package claims to have no side effects.
// Remove this when webpack adds a warning or an error for this.
// See https://github.com/webpack/webpack/issues/6571
sideEffects: true,
},
// Adds support for CSS Modules, but using SASS
// using the extension .module.scss or .module.sass
{
test: sassModuleRegex,
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction && shouldUseSourceMap,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
},
'sass-loader',
),
},
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [ /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/ ],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin(
Object.assign(
{},
{
inject: true,
template: paths.appHtml,
},
isEnvProduction
? {
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}
: undefined,
),
),
// Inlines the webpack runtime script. This script is too small to warrant
// a network request.
isEnvProduction &&
shouldInlineRuntimeChunk &&
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [ /runtime~.+[.]js/ ]),
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
// In development, this will be an empty string.
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
// This gives some necessary context to module not found errors, such as
// the requesting resource.
new ModuleNotFoundPlugin(paths.appPath),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV is set to production
// during a production build.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// This is necessary to emit hot updates (currently CSS only):
isEnvDevelopment && new webpack.HotModuleReplacementPlugin(),
// Watcher doesn't work well if you mistype casing in a path so we use
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebook/create-react-app/issues/240
isEnvDevelopment && new CaseSensitivePathsPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebook/create-react-app/issues/186
isEnvDevelopment &&
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
isEnvProduction &&
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
publicPath,
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// TypeScript type checking
useTypeScript &&
new ForkTsCheckerWebpackPlugin({
typescript: resolve.sync('typescript', {
basedir: paths.appNodeModules,
}),
async: false,
checkSyntacticErrors: true,
tsconfig: paths.appTsConfig,
compilerOptions: {
module: 'esnext',
moduleResolution: 'node',
resolveJsonModule: true,
isolatedModules: true,
noEmit: true,
jsx: 'preserve',
},
reportFiles: [
'**',
'!**/*.json',
'!**/__tests__/**',
'!**/?(*.)(spec|test).*',
'!**/src/setupProxy.*',
'!**/src/setupTests.*',
],
watch: paths.appSrc,
silent: true,
formatter: typescriptFormatter,
}),
].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty', // eslint-disable-line @typescript-eslint/camelcase
},
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
performance: false,
};
};

View File

@@ -1,385 +0,0 @@
const path = require('path');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
const publicPath = paths.servedPath;
// Some apps do not use client-side routing with pushState.
// For these, "homepage" can be set to "." to enable relative asset paths.
const shouldUseRelativeAssetPaths = publicPath === './';
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
// `publicUrl` is just like `publicPath`, but we will provide it to our app
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
const publicUrl = publicPath.slice(0, -1);
// Get environment variables to inject into our app.
const env = getClientEnvironment(publicUrl);
// Assert this just to be safe.
// Development builds of React are slow and not intended for production.
if (env.stringified['process.env'].NODE_ENV !== '"production"') {
throw new Error('Production builds must have NODE_ENV=production.');
}
// Note: defined here because it will be used more than once.
const cssFilename = 'static/css/[name].[contenthash:8].css';
// ExtractTextPlugin expects the build output to be flat.
// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)
// However, our output is structured with css, js and media folders.
// To have this structure working with relative paths, we have to use custom options.
// Making sure that the publicPath goes back to to build folder.
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? { publicPath: Array(cssFilename.split('/').length).join('../') }
: {};
// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
// The development configuration is different and lives in a separate file.
module.exports = {
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
devtool: shouldUseSourceMap ? 'source-map' : false,
// In production, we only want to load the polyfills and the app code.
entry: [ require.resolve('./polyfills'), paths.appIndexJs ],
output: {
// The build folder.
path: paths.appBuild,
// Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it.
filename: 'static/js/[name].[chunkhash:8].js',
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
publicPath,
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: (info) =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: [ 'node_modules', paths.appNodeModules ].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: [ '.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx' ],
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [ paths.appPackageJson ]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
{
test: [ /\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/ ],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
compact: true,
},
},
// The notation here is somewhat confusing.
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader normally turns CSS into JS modules injecting <style>,
// but unlike in development configuration, we do something different.
// `ExtractTextPlugin` first applies the "postcss" and "css" loaders
// (second argument), then grabs the result CSS and puts it into a
// separate file in our build process. This way we actually ship
// a single CSS file in production instead of JS code injecting <style>
// tags. If you use code splitting, however, any async bundles will still
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: [ /\.css$/, /\.scss$/ ],
loader: ExtractTextPlugin.extract(
Object.assign(
{
fallback: {
loader: require.resolve('style-loader'),
options: {
hmr: false,
},
},
use: [
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve('sass-loader'),
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9',
],
flexbox: 'no-2009',
}),
],
},
},
],
},
extractTextPluginOptions
)
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [ /\.(js|jsx|mjs)$/, /\.html$/, /\.json$/ ],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV was set to production here.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// Minify the code.
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebookincubator/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
},
mangle: {
safari10: true,
},
output: {
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebookincubator/create-react-app/issues/2488
ascii_only: true,
},
sourceMap: shouldUseSourceMap,
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin({
filename: cssFilename,
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the Webpack build.
new SWPrecacheWebpackPlugin({
// By default, a cache-busting query parameter is appended to requests
// used to populate the caches, to ensure the responses are fresh.
// If a URL is already hashed by Webpack, then there is no concern
// about it being stale, and the cache-busting can be skipped.
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
logger(message) {
if (message.indexOf('Total precache size is') === 0) {
// This message occurs for every build and is a bit too noisy.
return;
}
if (message.indexOf('Skipping static resource') === 0) {
// This message obscures real errors so we ignore it.
// https://github.com/facebookincubator/create-react-app/issues/2612
return;
}
console.log(message); // eslint-disable-line
},
minify: true,
// For unknown URLs, fallback to the index page
navigateFallback: `${publicUrl}/index.html`,
// Ignores URLs starting from /__ (useful for Firebase):
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
navigateFallbackWhitelist: [ /^(?!\/__).*/ ],
// Don't precache sourcemaps (they're large) and build asset manifest:
staticFileGlobsIgnorePatterns: [ /\.map$/, /asset-manifest\.json$/ ],
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
};

View File

@@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
const fs = require('fs');
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const config = require('./webpack.config.dev');
const paths = require('./paths');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
@@ -17,8 +19,8 @@ module.exports = function(proxy, allowedHost) {
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
// However, it made several existing use cases such as development in cloud
// environment or subdomains in development significantly more complicated:
// https://github.com/facebookincubator/create-react-app/issues/2271
// https://github.com/facebookincubator/create-react-app/issues/2233
// https://github.com/facebook/create-react-app/issues/2271
// https://github.com/facebook/create-react-app/issues/2233
// While we're investigating better solutions, for now we will take a
// compromise. Since our WDS configuration only serves files in the `public`
// folder we won't consider accessing them a vulnerability. However, if you
@@ -65,16 +67,16 @@ module.exports = function(proxy, allowedHost) {
// It is important to tell WebpackDevServer to use the same "root" path
// as we specified in the config. In development, we always serve from /.
publicPath: config.output.publicPath,
publicPath: '/',
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.plugin` calls above.
// by listening to the compiler events with `compiler.hooks[...].tap` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
// https://github.com/facebookincubator/create-react-app/issues/293
// https://github.com/facebook/create-react-app/issues/293
// src/node_modules is not ignored to support absolute imports
// https://github.com/facebookincubator/create-react-app/issues/1065
// https://github.com/facebook/create-react-app/issues/1065
watchOptions: {
ignored: ignoredFiles(paths.appSrc),
},
@@ -86,12 +88,20 @@ module.exports = function(proxy, allowedHost) {
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebookincubator/create-react-app/issues/387.
// See https://github.com/facebook/create-react-app/issues/387.
disableDotRule: true,
},
public: allowedHost,
proxy,
before(app) {
before(app, server) {
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
require(paths.proxySetup)(app);
}
// This lets us fetch source contents from webpack for the error overlay
app.use(evalSourceMapMiddleware(server));
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware());
@@ -99,8 +109,8 @@ module.exports = function(proxy, allowedHost) {
// previous service worker registered for the same host:port combination.
// We do this in development to avoid hitting the production cache if
// it used the same host and port.
// https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
app.use(noopServiceWorkerMiddleware());
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
app.use(noopServiceWorkerMiddleware(paths.publicUrl));
},
};
};

View File

@@ -6,3 +6,4 @@ services:
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- ./home:/home/alejandro

View File

@@ -3,8 +3,8 @@ version: '3'
services:
shlink_web_client_node:
container_name: shlink_web_client_node
image: node:10.4.1-alpine
command: /bin/sh -c "cd /home/shlink/www && yarn install && yarn start"
image: node:14.15-alpine
command: /bin/sh -c "cd /home/shlink/www && npm install && npm run start"
volumes:
- ./:/home/shlink/www
ports:

View File

@@ -1,2 +1,8 @@
#!/usr/bin/env bash
# Run docker container if it's not up yet
if ! [[ $(docker ps | grep shlink_web_client_node) ]]; then
docker-compose up -d
fi
docker exec -it shlink_web_client_node /bin/sh -c "cd /home/shlink/www && $*"

44
jest.config.js Normal file
View File

@@ -0,0 +1,44 @@
module.exports = {
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: [
'src/**/*.{js,ts,tsx}',
'!src/registerServiceWorker.js',
'!src/index.ts',
'!src/reducers/index.ts',
'!src/**/provideServices.ts',
'!src/container/*.ts',
],
resolver: 'jest-pnp-resolver',
setupFiles: [
'react-app-polyfill/jsdom',
'<rootDir>/config/setupEnzyme.js',
],
testMatch: [ '<rootDir>/test/**/*.test.{js,jsx,ts,tsx}' ],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(ts|tsx|js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(ts|tsx|js|jsx|mjs|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
moduleNameMapper: {
'^react-native$': 'react-native-web',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
};

30635
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,144 +1,171 @@
{
"name": "shlink-web-client-react",
"name": "shlink-web-client",
"description": "A React-based progressive web application for shlink",
"version": "1.0.0",
"private": false,
"homepage": "",
"repository": "https://github.com/shlinkio/shlink-web-client",
"license": "MIT",
"scripts": {
"lint": "yarn lint:js && yarn lint:css",
"lint:js": "eslint src test scripts config",
"lint:js:fix": "yarn lint:js --fix",
"lint:css": "stylelint src/**/*.scss",
"lint:css:fix": "yarn lint:css --fix",
"lint": "npm run lint:css && npm run lint:js",
"lint:js": "eslint --ext .js,.ts,.tsx src test",
"lint:js:fix": "npm run lint:js -- --fix",
"lint:css": "stylelint src/*.scss src/**/*.scss",
"lint:css:fix": "npm run lint:css -- --fix",
"start": "node scripts/start.js",
"serve:build": "serve ./build",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom --colors",
"test:ci": "yarn test --coverage --coverageReporters=text --coverageReporters=text-summary --coverageReporters=clover",
"test:pretty": "yarn test --coverage --coverageReporters=text --coverageReporters=text-summary --coverageReporters=html"
"test": "node scripts/test.js --env=jsdom --colors --verbose",
"test:ci": "npm run test -- --coverage --coverageReporters=text --coverageReporters=text-summary --coverageReporters=clover",
"test:pretty": "npm run test -- --coverage --coverageReporters=text --coverageReporters=text-summary --coverageReporters=html",
"mutate": "./node_modules/.bin/stryker run --concurrency 4"
},
"dependencies": {
"@fortawesome/fontawesome": "^1.1.8",
"@fortawesome/fontawesome-free-regular": "^5.0.13",
"@fortawesome/fontawesome-free-solid": "^5.0.13",
"@fortawesome/react-fontawesome": "0.0.19",
"axios": "^0.18.0",
"bootstrap": "^4.1.1",
"chart.js": "^2.7.2",
"@fortawesome/fontawesome-free": "^5.15.2",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-regular-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"bottlejs": "^2.0.0",
"bowser": "^2.11.0",
"chart.js": "^2.9.4",
"classnames": "^2.2.6",
"compare-versions": "^3.6.0",
"csvjson": "^5.1.0",
"moment": "^2.22.2",
"promise": "8.0.1",
"prop-types": "^15.6.2",
"qs": "^6.5.2",
"ramda": "^0.25.0",
"react": "^16.3.2",
"react-chartjs-2": "^2.7.4",
"react-color": "^2.14.1",
"react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "^1.5.0",
"react-dom": "^16.3.2",
"react-moment": "^0.7.6",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-swipeable": "^4.3.0",
"event-source-polyfill": "^1.0.22",
"leaflet": "^1.7.1",
"moment": "^2.29.1",
"promise": "^8.1.0",
"qs": "^6.9.6",
"ramda": "^0.27.1",
"react": "^17.0.1",
"react-autosuggest": "^10.1.0",
"react-chartjs-2": "^2.11.1",
"react-color": "^2.19.3",
"react-copy-to-clipboard": "^5.0.2",
"react-datepicker": "^3.6.0",
"react-dom": "^17.0.1",
"react-external-link": "^1.2.0",
"react-leaflet": "^3.1.0",
"react-moment": "^1.0.0",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-swipeable": "^6.0.1",
"react-tagsinput": "^3.19.0",
"reactstrap": "^6.0.1",
"redux": "^4.0.0",
"reactstrap": "^8.9.0",
"redux": "^4.0.5",
"redux-localstorage-simple": "^2.4.0",
"redux-thunk": "^2.3.0",
"uuid": "^3.3.2"
"uuid": "^8.3.2"
},
"devDependencies": {
"adm-zip": "^0.4.11",
"autoprefixer": "7.1.6",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "^7.1.2",
"babel-preset-react-app": "^3.1.1",
"babel-runtime": "6.26.0",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"css-loader": "0.28.7",
"dotenv": "4.0.0",
"dotenv-expand": "4.2.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.19.0",
"eslint-config-adidas-babel": "^1.0.1",
"eslint-config-adidas-env": "^1.0.1",
"eslint-config-adidas-es6": "^1.0.1",
"eslint-config-adidas-react": "^1.0.1",
"eslint-loader": "1.9.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-promise": "^3.0.0",
"eslint-plugin-react": "^7.4.0",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"node-sass": "^4.9.0",
"object-assign": "4.1.1",
"ocular.js": "^0.1.0",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
"raf": "3.4.0",
"react-dev-utils": "^5.0.1",
"resolve": "1.6.0",
"sass-loader": "^7.0.1",
"serve": "^10.0.0",
"sinon": "^6.1.5",
"style-loader": "0.19.0",
"stylelint": "^9.5.0",
"stylelint-config-adidas": "^1.0.1",
"stylelint-config-adidas-bem": "^1.0.1",
"stylelint-config-recommended-scss": "^3.2.0",
"stylelint-scss": "^3.3.0",
"sw-precache-webpack-plugin": "0.11.4",
"url-loader": "0.6.2",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3"
},
"jest": {
"coverageDirectory": "<rootDir>/coverage",
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js",
"<rootDir>/config/setupEnzyme.js"
],
"testMatch": [
"<rootDir>/test/**/*.test.{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"js",
"json",
"web.jsx",
"jsx",
"node",
"mjs"
]
"@babel/core": "^7.13.8",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@shlinkio/eslint-config-js-coding-standard": "~1.2.2",
"@stryker-mutator/core": "^4.4.1",
"@stryker-mutator/jest-runner": "^4.4.1",
"@stryker-mutator/typescript-checker": "^4.4.1",
"@svgr/webpack": "^5.5.0",
"@types/chart.js": "^2.9.31",
"@types/classnames": "^2.2.11",
"@types/enzyme": "^3.10.8",
"@types/jest": "^26.0.20",
"@types/leaflet": "^1.5.23",
"@types/moment": "^2.13.0",
"@types/qs": "^6.9.5",
"@types/ramda": "^0.27.38",
"@types/react": "^17.0.2",
"@types/react-autosuggest": "^10.1.2",
"@types/react-color": "^3.0.4",
"@types/react-copy-to-clipboard": "^5.0.0",
"@types/react-datepicker": "^3.1.5",
"@types/react-dom": "^17.0.1",
"@types/react-leaflet": "^2.5.2",
"@types/react-redux": "^7.1.16",
"@types/react-router-dom": "^5.1.7",
"@types/react-tagsinput": "^3.19.7",
"@types/uuid": "^8.3.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.1",
"adm-zip": "^0.4.16",
"autoprefixer": "^10.0.2",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.1",
"babel-plugin-named-asset-import": "^0.3.7",
"babel-preset-react-app": "^10.0.0",
"babel-runtime": "^6.26.0",
"bfj": "^7.0.2",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
"chalk": "^4.1.0",
"css-loader": "^5.0.1",
"dart-sass": "^1.25.0",
"dotenv": "^8.2.0",
"dotenv-expand": "^5.1.0",
"enzyme": "^3.11.0",
"eslint": "^7.13.0",
"eslint-loader": "^4.0.2",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin-alt": "^0.4.14",
"fs-extra": "^9.0.1",
"html-webpack-plugin": "^4.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-pnp-resolver": "^1.2.2",
"jest-resolve": "^26.6.2",
"mini-css-extract-plugin": "^1.3.1",
"object-assign": "^4.1.1",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"pnp-webpack-plugin": "^1.6.4",
"postcss": "^8.1.7",
"postcss-flexbugs-fixes": "^4.2.1",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
"postcss-safe-parser": "^5.0.2",
"raf": "^3.4.1",
"react-app-polyfill": "^2.0.0",
"react-dev-utils": "^11.0.0",
"resolve": "^1.19.0",
"sass": "^1.29.0",
"sass-loader": "^10.1.0",
"serve": "^11.3.2",
"stryker-cli": "^1.0.0",
"style-loader": "^2.0.0",
"stylelint": "^13.7.2",
"stylelint-config-adidas": "^1.3.0",
"stylelint-config-adidas-bem": "^1.2.0",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-scss": "^3.18.0",
"sw-precache-webpack-plugin": "^1.0.0",
"terser-webpack-plugin": "^4.2.3",
"ts-jest": "^26.5.2",
"ts-mockery": "^1.2.0",
"typescript": "^4.2.2",
"url-loader": "^4.1.1",
"webpack": "^4.44.2",
"webpack-dev-server": "^3.11.0",
"webpack-manifest-plugin": "^2.2.0",
"whatwg-fetch": "^3.5.0"
},
"babel": {
"presets": [
"react-app"
[
"react-app",
{
"runtime": "automatic"
}
]
],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator"
]
}
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}

16
public/.htaccess Normal file
View File

@@ -0,0 +1,16 @@
RewriteEngine on
RewriteBase /
# do not do anything for already existing files
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
# if request is no valid file NOR directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# if static asset do not do anything
RewriteRule (.*)(css|js|html|png|jpe?g|gif|bmp|ico|json|csv|otf|eot|svg|svgz|ttf|woff|woff2|ijmap|pdf|tif|map) - [NC,L,R=404]
# everything else should be redirected to /index.html so it can be routed by it
RewriteRule (.*) /index.html [L]

BIN
public/favicon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
public/favicon.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="512pt" height="512pt" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg"><g fill="#4595e3"><path d=" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z" /><path d=" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z" /><path d=" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z" /><path d=" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z" /></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
public/icons/icon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
public/icons/icon-24x24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
public/icons/icon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
public/icons/icon-40x40.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
public/icons/icon-48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/icons/icon-60x60.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

BIN
public/icons/icon-64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 750 B

BIN
public/icons/icon-76x76.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 984 B

View File

@@ -4,17 +4,81 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#4696e5">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="apple-touch-icon" href="%PUBLIC_URL%/icons/shlink-128.png">
<link rel="apple-touch-icon" sizes="64x64" href="%PUBLIC_URL%/icons/shlink-64.png">
<link rel="apple-touch-icon" sizes="32x32" href="%PUBLIC_URL%/icons/shlink-32.png">
<link rel="apple-touch-icon" sizes="24x24" href="%PUBLIC_URL%/icons/shlink-24.png">
<link rel="apple-touch-icon" sizes="16x16" href="%PUBLIC_URL%/icons/shlink-16.png">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" crossorigin="use-credentials">
<!-- FavIcon itself -->
<link rel="icon" type="image/x-icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="icon" type="image/svg+xml" href="%PUBLIC_URL%/favicon.svg" sizes="any">
<link rel="icon" type="image/png" href="%PUBLIC_URL%/favicon.png">
<link rel="icon" type="image/gif" href="%PUBLIC_URL%/favicon.gif">
<!-- Apple Touch -->
<link rel="apple-touch-icon" sizes="16x16" href="%PUBLIC_URL%/icons/icon-16x16.png">
<link rel="apple-touch-icon" sizes="24x24" href="%PUBLIC_URL%/icons/icon-24x24.png">
<link rel="apple-touch-icon" sizes="32x32" href="%PUBLIC_URL%/icons/icon-32x32.png">
<link rel="apple-touch-icon" sizes="40x40" href="%PUBLIC_URL%/icons/icon-40x40.png">
<link rel="apple-touch-icon" sizes="48x48" href="%PUBLIC_URL%/icons/icon-48x48.png">
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/icons/icon-60x60.png">
<link rel="apple-touch-icon" sizes="64x64" href="%PUBLIC_URL%/icons/icon-64x64.png">
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/icons/icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/icons/icon-76x76.png">
<link rel="apple-touch-icon" sizes="96x96" href="%PUBLIC_URL%/icons/icon-96x96.png">
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/icons/icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/icons/icon-120x120.png">
<link rel="apple-touch-icon" sizes="128x128" href="%PUBLIC_URL%/icons/icon-128x128.png">
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/icons/icon-144x144.png">
<link rel="apple-touch-icon" sizes="150x150" href="%PUBLIC_URL%/icons/icon-150x150.png">
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/icons/icon-152x152.png">
<link rel="apple-touch-icon" sizes="160x160" href="%PUBLIC_URL%/icons/icon-160x160.png">
<link rel="apple-touch-icon" sizes="167x167" href="%PUBLIC_URL%/icons/icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/icons/icon-180x180.png">
<link rel="apple-touch-icon" sizes="192x192" href="%PUBLIC_URL%/icons/icon-192x192.png">
<link rel="apple-touch-icon" sizes="196x196" href="%PUBLIC_URL%/icons/icon-196x196.png">
<link rel="apple-touch-icon" sizes="228x228" href="%PUBLIC_URL%/icons/icon-228x228.png">
<link rel="apple-touch-icon" sizes="256x256" href="%PUBLIC_URL%/icons/icon-256x256.png">
<link rel="apple-touch-icon" sizes="310x310" href="%PUBLIC_URL%/icons/icon-310x310.png">
<link rel="apple-touch-icon" sizes="384x384" href="%PUBLIC_URL%/icons/icon-384x384.png">
<link rel="apple-touch-icon" sizes="512x512" href="%PUBLIC_URL%/icons/icon-512x512.png">
<link rel="apple-touch-icon" sizes="1024x1024" href="%PUBLIC_URL%/icons/icon-1024x1024.png">
<!-- Normal -->
<link rel="icon" type="image/png" sizes="1024x1024" href="%PUBLIC_URL%/icons/icon-1024x1024.png">
<link rel="icon" type="image/png" sizes="512x512" href="%PUBLIC_URL%/icons/icon-512x512.png">
<link rel="icon" type="image/png" sizes="384x384" href="%PUBLIC_URL%/icons/icon-384x384.png">
<link rel="icon" type="image/png" sizes="310x310" href="%PUBLIC_URL%/icons/icon-310x310.png">
<link rel="icon" type="image/png" sizes="256x256" href="%PUBLIC_URL%/icons/icon-256x256.png">
<link rel="icon" type="image/png" sizes="228x228" href="%PUBLIC_URL%/icons/icon-228x228.png">
<link rel="icon" type="image/png" sizes="196x196" href="%PUBLIC_URL%/icons/icon-196x196.png">
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/icons/icon-192x192.png">
<link rel="icon" type="image/png" sizes="180x180" href="%PUBLIC_URL%/icons/icon-180x180.png">
<link rel="icon" type="image/png" sizes="167x167" href="%PUBLIC_URL%/icons/icon-167x167.png">
<link rel="icon" type="image/png" sizes="160x160" href="%PUBLIC_URL%/icons/icon-160x160.png">
<link rel="icon" type="image/png" sizes="152x152" href="%PUBLIC_URL%/icons/icon-152x152.png">
<link rel="icon" type="image/png" sizes="150x150" href="%PUBLIC_URL%/icons/icon-150x150.png">
<link rel="icon" type="image/png" sizes="144x144" href="%PUBLIC_URL%/icons/icon-144x144.png">
<link rel="icon" type="image/png" sizes="128x128" href="%PUBLIC_URL%/icons/icon-128x128.png">
<link rel="icon" type="image/png" sizes="120x120" href="%PUBLIC_URL%/icons/icon-120x120.png">
<link rel="icon" type="image/png" sizes="114x114" href="%PUBLIC_URL%/icons/icon-114x114.png">
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/icons/icon-96x96.png">
<link rel="icon" type="image/png" sizes="76x76" href="%PUBLIC_URL%/icons/icon-76x76.png">
<link rel="icon" type="image/png" sizes="72x72" href="%PUBLIC_URL%/icons/icon-72x72.png">
<link rel="icon" type="image/png" sizes="64x64" href="%PUBLIC_URL%/icons/icon-64x64.png">
<link rel="icon" type="image/png" sizes="60x60" href="%PUBLIC_URL%/icons/icon-60x60.png">
<link rel="icon" type="image/png" sizes="48x48" href="%PUBLIC_URL%/icons/icon-48x48.png">
<link rel="icon" type="image/png" sizes="40x40" href="%PUBLIC_URL%/icons/icon-40x40.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/icons/icon-32x32.png">
<link rel="icon" type="image/png" sizes="24x24" href="%PUBLIC_URL%/icons/icon-24x24.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/icons/icon-16x16.png">
<!-- MS -->
<meta name="msapplication-TileImage" content="%PUBLIC_URL%/icons/icon-144x144.png">
<meta name="msapplication-square70x70logo" content="%PUBLIC_URL%/icons/icon-70x70.png">
<meta name="msapplication-square144x144logo" content="%PUBLIC_URL%/icons/icon-144x144.png">
<meta name="msapplication-square150x150logo" content="%PUBLIC_URL%/icons/icon-150x150.png">
<meta name="msapplication-square310x310logo" content="%PUBLIC_URL%/icons/icon-310x310.png">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.

View File

@@ -6,16 +6,66 @@
"theme_color": "#4696e5",
"background_color": "#4696e5",
"icons": [
{
"src": "./icons/icon-16x16.png",
"type": "image/png",
"sizes": "16x16"
},
{
"src": "./icons/icon-24x24.png",
"type": "image/png",
"sizes": "24x24"
},
{
"src": "./icons/icon-32x32.png",
"type": "image/png",
"sizes": "32x32"
},
{
"src": "./icons/icon-40x40.png",
"type": "image/png",
"sizes": "40x40"
},
{
"src": "./icons/icon-48x48.png",
"type": "image/png",
"sizes": "48x48"
},
{
"src": "./icons/icon-60x60.png",
"type": "image/png",
"sizes": "60x60"
},
{
"src": "./icons/icon-64x64.png",
"type": "image/png",
"sizes": "64x64"
},
{
"src": "./icons/icon-72x72.png",
"type": "image/png",
"sizes": "72x72"
},
{
"src": "./icons/icon-76x76.png",
"type": "image/png",
"sizes": "76x76"
},
{
"src": "./icons/icon-96x96.png",
"type": "image/png",
"sizes": "96x96"
},
{
"src": "./icons/icon-114x114.png",
"type": "image/png",
"sizes": "114x114"
},
{
"src": "./icons/icon-120x120.png",
"type": "image/png",
"sizes": "120x120"
},
{
"src": "./icons/icon-128x128.png",
"type": "image/png",
@@ -26,20 +76,70 @@
"type": "image/png",
"sizes": "144x144"
},
{
"src": "./icons/icon-150x150.png",
"type": "image/png",
"sizes": "150x150"
},
{
"src": "./icons/icon-152x152.png",
"type": "image/png",
"sizes": "152x152"
},
{
"src": "./icons/icon-160x160.png",
"type": "image/png",
"sizes": "160x160"
},
{
"src": "./icons/icon-167x167.png",
"type": "image/png",
"sizes": "167x167"
},
{
"src": "./icons/icon-180x180.png",
"type": "image/png",
"sizes": "180x180"
},
{
"src": "./icons/icon-192x192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "./icons/icon-196x196.png",
"type": "image/png",
"sizes": "196x196"
},
{
"src": "./icons/icon-228x228.png",
"type": "image/png",
"sizes": "228x228"
},
{
"src": "./icons/icon-256x256.png",
"type": "image/png",
"sizes": "256x256"
},
{
"src": "./icons/icon-310x310.png",
"type": "image/png",
"sizes": "310x310"
},
{
"src": "./icons/icon-384x384.png",
"type": "image/png",
"sizes": "384x384"
},
{
"src": "./icons/icon-512x512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "./icons/icon-1024x1024.png",
"type": "image/png",
"sizes": "1024x1024"
}
]
}

View File

@@ -1,4 +1,4 @@
/* eslint no-console: "off" */
/* eslint-disable no-console, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/promise-function-async, @typescript-eslint/prefer-optional-chain */
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
@@ -14,34 +14,48 @@ process.on('unhandledRejection', (err) => {
// Ensure environment variables are read.
require('../config/env');
const path = require('path');
const chalk = require('chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const bfj = require('bfj');
const AdmZip = require('adm-zip');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const AdmZip = require('adm-zip');
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
const paths = require('../config/paths');
const config = require('../config/webpack.config.prod');
const configFactory = require('../config/webpack.config');
const { measureFileSizesBeforeBuild, printFileSizesAfterBuild } = FileSizeReporter;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024; // eslint-disable-line
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024; // eslint-disable-line
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([ paths.appHtml, paths.appIndexJs ])) {
process.exit(1);
}
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
measureFileSizesBeforeBuild(paths.appBuild)
// Process CLI arguments
const argvSliceStart = 2;
const argv = process.argv.slice(argvSliceStart);
const writeStatsJson = argv.includes('--stats');
const withoutDist = argv.includes('--no-dist');
const { version, hasVersion } = getVersionFromArgs(argv);
// Generate configuration
const config = configFactory('production');
checkBrowsers(paths.appPath, isInteractive)
.then(() =>
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
measureFileSizesBeforeBuild(paths.appBuild))
.then((previousFileSizes) => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
@@ -61,15 +75,16 @@ measureFileSizesBeforeBuild(paths.appBuild)
console.log(
`\nSearch for the ${
chalk.underline(chalk.yellow('keywords'))
} to learn more about each warning.`
} to learn more about each warning.`,
);
console.log(
`To ignore, add ${
chalk.cyan('// eslint-disable-next-line')
} to the line before.\n`
} to the line before.\n`,
);
} else {
console.log(chalk.green('Compiled successfully.\n'));
hasVersion && replaceVersionPlaceholder(version);
}
console.log('File sizes after gzip:\n');
@@ -78,31 +93,24 @@ measureFileSizesBeforeBuild(paths.appBuild)
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE
WARN_AFTER_CHUNK_GZIP_SIZE,
);
console.log();
const appPackage = require(paths.appPackageJson);
const { publicUrl } = paths;
const { publicPath } = config.output;
const buildFolder = path.relative(process.cwd(), paths.appBuild);
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn
);
},
(err) => {
console.log(chalk.red('Failed to compile.\n'));
printBuildError(err);
process.exit(1);
}
},
)
.then(zipDist);
.then(() => hasVersion && !withoutDist && zipDist(version))
.catch((err) => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
@@ -112,12 +120,22 @@ function build(previousFileSizes) {
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
let messages;
if (err) {
return reject(err);
if (!err.message) {
return reject(err);
}
messages = formatWebpackMessages({
errors: [ err.message ],
warnings: [],
});
} else {
messages = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true }),
);
}
const messages = formatWebpackMessages(stats.toJson({}, true));
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
@@ -136,18 +154,27 @@ function build(previousFileSizes) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n'
)
'Most CI servers set it automatically.\n',
),
);
return reject(new Error(messages.warnings.join('\n\n')));
}
return resolve({
const resolveArgs = {
stats,
previousFileSizes,
warnings: messages.warnings,
});
};
if (writeStatsJson) {
return bfj // eslint-disable-line promise/no-promise-in-callback
.write(`${paths.appBuild}/bundle-stats.json`, stats.toJson())
.then(() => resolve(resolveArgs))
.catch((error) => reject(new Error(error)));
}
return resolve(resolveArgs);
});
});
}
@@ -159,15 +186,7 @@ function copyPublicFolder() {
});
}
function zipDist() {
const minArgsToContainVersion = 3;
// If no version was provided, do nothing
if (process.argv.length < minArgsToContainVersion) {
return;
}
const [ , , version ] = process.argv;
function zipDist(version) {
const versionFileName = `./dist/shlink-web-client_${version}_dist.zip`;
console.log(chalk.cyan(`Generating dist file for version ${chalk.bold(version)}...`));
@@ -185,4 +204,24 @@ function zipDist() {
console.log(chalk.red('An error occurred while generating dist file'));
console.log(e);
}
console.log();
}
function getVersionFromArgs(argv) {
const [ version ] = argv;
return { version, hasVersion: !!version };
}
function replaceVersionPlaceholder(version) {
const staticJsFilesPath = './build/static/js';
const versionPlaceholder = '%_VERSION_%';
const isMainFile = (file) => file.startsWith('main.') && file.endsWith('.js');
const [ mainJsFile ] = fs.readdirSync(staticJsFilesPath).filter(isMainFile);
const filePath = `${staticJsFilesPath}/${mainJsFile}`;
const fileContent = fs.readFileSync(filePath, 'utf-8');
const replaced = fileContent.replace(versionPlaceholder, version);
fs.writeFileSync(filePath, replaced, 'utf-8');
}

25
scripts/docker/build Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -ex
PLATFORMS="linux/arm/v7,linux/arm64/v8,linux/amd64"
DOCKER_IMAGE="shlinkio/shlink-web-client"
if [[ "$GITHUB_REF" == *"main"* ]]; then
docker buildx build --push \
--platform ${PLATFORMS} \
-t ${DOCKER_IMAGE}:latest .
# If ref is not main, then this is a tag. Build that docker tag and also "stable"
else
VERSION=${GITHUB_REF#refs/tags/v}
TAGS="-t ${DOCKER_IMAGE}:${VERSION}"
# Push stable tag only if this is not an alpha or beta release
[[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable"
docker buildx build --push \
--build-arg VERSION=${VERSION} \
--platform ${PLATFORMS} \
${TAGS} .
fi

View File

@@ -1,4 +1,4 @@
/* eslint no-console: "off" */
/* eslint-disable no-console, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/promise-function-async, @typescript-eslint/prefer-optional-chain */
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
@@ -27,8 +27,9 @@ const {
prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
const paths = require('../config/paths');
const config = require('../config/webpack.config.dev');
const configFactory = require('../config/webpack.config');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
@@ -40,68 +41,72 @@ if (!checkRequiredFiles([ paths.appHtml, paths.appIndexJs ])) {
}
// Tools like Cloud9 rely on this.
const FALLBACK_PORT = 3000;
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || FALLBACK_PORT;
const DEFAULT_PORT = 3000;
const PORT = parseInt(process.env.PORT) || DEFAULT_PORT;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
console.log(
chalk.cyan(
`Attempting to bind to HOST environment variable: ${chalk.yellow(
chalk.bold(process.env.HOST)
)}`
)
chalk.bold(process.env.HOST),
)}`,
),
);
console.log(
'If this was unintentional, check that you haven\'t mistakenly set it in your shell.'
'If this was unintentional, check that you haven\'t mistakenly set it in your shell.',
);
console.log(
`Learn more here: ${chalk.yellow('http://bit.ly/CRA-advanced-config')}`,
);
console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`);
console.log();
}
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
choosePort(HOST, DEFAULT_PORT)
checkBrowsers(paths.appPath, isInteractive)
.then(() =>
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
choosePort(HOST, PORT))
.then((port) => {
if (port === null) {
// We have not found a port.
return;
}
const config = configFactory('development');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const appName = require(paths.appPackageJson).name;
const urls = prepareUrls(protocol, HOST, port);
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
const compiler = createCompiler({ webpack, config, appName, urls, useYarn });
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
// Serve webpack assets generated by the compiler over a web sever.
// Serve webpack assets generated by the compiler over a web server.
const serverConfig = createDevServerConfig(
proxyConfig,
urls.lanUrlForConfig
urls.lanUrlForConfig,
);
const devServer = new WebpackDevServer(compiler, serverConfig);
// Launch WebpackDevServer.
devServer.listen(port, HOST, (err) => {
if (err) {
console.log(err);
return;
return console.log(err);
}
if (isInteractive) {
clearConsole();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
return openBrowser(urls.localUrlForBrowser);
});
[ 'SIGINT', 'SIGTERM' ].forEach((sig) => {

17
shlink-web-client.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
declare module 'event-source-polyfill' {
declare class EventSourcePolyfill {
public onmessage?: ({ data }: { data: string }) => void;
public onerror?: ({ status }: { status: number }) => void;
public close: () => void;
public constructor(hubUrl: URL, options?: any);
}
}
declare module 'csvjson' {
export declare class CsvJson {
public toObject<T>(content: string): T[];
public toCSV<T>(data: T[], options: { headers: 'full' | 'none' | 'relative' | 'key' }): string;
}
}
declare module '*.png'

BIN
shlink-web-client.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@@ -1,23 +0,0 @@
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import './App.scss';
import Home from './common/Home';
import MainHeader from './common/MainHeader';
import MenuLayout from './common/MenuLayout';
import CreateServer from './servers/CreateServer';
export default function App() {
return (
<div className="container-fluid app-container">
<MainHeader />
<div className="app">
<Switch>
<Route exact path="/server/create" component={CreateServer} />
<Route exact path="/" component={Home} />
<Route path="/server/:serverId" component={MenuLayout} />
</Switch>
</div>
</div>
);
}

View File

@@ -8,3 +8,19 @@
padding-top: $headerHeight;
height: 100%;
}
.shlink-wrapper {
min-height: 100%;
padding-bottom: $footer-height + $footer-margin;
margin-bottom: -($footer-height + $footer-margin);
}
.shlink-footer {
height: $footer-height;
margin-top: $footer-margin;
padding: 0;
@media (min-width: $mdMin) {
padding: 0 15px;
}
}

57
src/App.tsx Normal file
View File

@@ -0,0 +1,57 @@
import { useEffect, FC } from 'react';
import { Route, Switch } from 'react-router-dom';
import NotFound from './common/NotFound';
import { ServersMap } from './servers/data';
import { Settings } from './settings/reducers/settings';
import { changeThemeInMarkup } from './utils/theme';
import './App.scss';
interface AppProps {
fetchServers: Function;
servers: ServersMap;
settings: Settings;
}
const App = (
MainHeader: FC,
Home: FC,
MenuLayout: FC,
CreateServer: FC,
EditServer: FC,
Settings: FC,
ShlinkVersionsContainer: FC,
) => ({ fetchServers, servers, settings }: AppProps) => {
useEffect(() => {
// On first load, try to fetch the remote servers if the list is empty
if (Object.keys(servers).length === 0) {
fetchServers();
}
changeThemeInMarkup(settings.ui?.theme ?? 'light');
}, []);
return (
<div className="container-fluid app-container">
<MainHeader />
<div className="app">
<div className="shlink-wrapper">
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/settings" component={Settings} />
<Route exact path="/server/create" component={CreateServer} />
<Route exact path="/server/:serverId/edit" component={EditServer} />
<Route path="/server/:serverId" component={MenuLayout} />
<Route component={NotFound} />
</Switch>
</div>
<div className="shlink-footer">
<ShlinkVersionsContainer />
</div>
</div>
</div>
);
};
export default App;

View File

@@ -1,114 +0,0 @@
import axios from 'axios';
import qs from 'qs';
import { isEmpty, isNil, reject } from 'ramda';
const API_VERSION = '1';
const STATUS_UNAUTHORIZED = 401;
export class ShlinkApiClient {
constructor(axios) {
this.axios = axios;
this._baseUrl = '';
this._apiKey = '';
this._token = '';
}
/**
* Sets the base URL to be used on any request
*/
setConfig = ({ url, apiKey }) => {
this._baseUrl = `${url}/rest/v${API_VERSION}`;
this._apiKey = apiKey;
};
listShortUrls = (options = {}) =>
this._performRequest('/short-codes', 'GET', options)
.then((resp) => resp.data.shortUrls)
.catch((e) => this._handleAuthError(e, this.listShortUrls, [ options ]));
createShortUrl = (options) => {
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options);
return this._performRequest('/short-codes', 'POST', {}, filteredOptions)
.then((resp) => resp.data)
.catch((e) => this._handleAuthError(e, this.createShortUrl, [ filteredOptions ]));
};
getShortUrlVisits = (shortCode, dates) =>
this._performRequest(`/short-codes/${shortCode}/visits`, 'GET', dates)
.then((resp) => resp.data.visits.data)
.catch((e) => this._handleAuthError(e, this.getShortUrlVisits, [ shortCode, dates ]));
getShortUrl = (shortCode) =>
this._performRequest(`/short-codes/${shortCode}`, 'GET')
.then((resp) => resp.data)
.catch((e) => this._handleAuthError(e, this.getShortUrl, [ shortCode ]));
updateShortUrlTags = (shortCode, tags) =>
this._performRequest(`/short-codes/${shortCode}/tags`, 'PUT', {}, { tags })
.then((resp) => resp.data.tags)
.catch((e) => this._handleAuthError(e, this.updateShortUrlTags, [ shortCode, tags ]));
listTags = () =>
this._performRequest('/tags', 'GET')
.then((resp) => resp.data.tags.data)
.catch((e) => this._handleAuthError(e, this.listTags, []));
deleteTags = (tags) =>
this._performRequest('/tags', 'DELETE', { tags })
.then(() => ({ tags }))
.catch((e) => this._handleAuthError(e, this.deleteTags, [ tags ]));
editTag = (oldName, newName) =>
this._performRequest('/tags', 'PUT', {}, { oldName, newName })
.then(() => ({ oldName, newName }))
.catch((e) => this._handleAuthError(e, this.editTag, [ oldName, newName ]));
_performRequest = async (url, method = 'GET', query = {}, body = {}) => {
if (isEmpty(this._token)) {
this._token = await this._authenticate();
}
return await this.axios({
method,
url: `${this._baseUrl}${url}`,
headers: { Authorization: `Bearer ${this._token}` },
params: query,
data: body,
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: 'brackets' }),
}).then((resp) => {
// Save new token
const { authorization = '' } = resp.headers;
this._token = authorization.substr('Bearer '.length);
return resp;
});
};
_authenticate = async () => {
const resp = await this.axios({
method: 'POST',
url: `${this._baseUrl}/authenticate`,
data: { apiKey: this._apiKey },
});
return resp.data.token;
};
_handleAuthError = (e, method, args) => {
// If auth failed, reset token to force it to be regenerated, and perform a new request
if (e.response.status === STATUS_UNAUTHORIZED) {
this._token = '';
return method(...args);
}
// Otherwise, let caller handle the rejection
return Promise.reject(e);
};
}
const shlinkApiClient = new ShlinkApiClient(axios);
export default shlinkApiClient;

View File

@@ -0,0 +1,16 @@
import { ProblemDetailsError } from './types';
import { isInvalidArgumentError } from './utils';
export interface ShlinkApiErrorProps {
errorData?: ProblemDetailsError;
fallbackMessage?: string;
}
export const ShlinkApiError = ({ errorData, fallbackMessage }: ShlinkApiErrorProps) => (
<>
{errorData?.detail ?? fallbackMessage}
{isInvalidArgumentError(errorData) &&
<p className="mb-0">Invalid elements: [{errorData.invalidElements.join(', ')}]</p>
}
</>
);

View File

@@ -0,0 +1,142 @@
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, ShortUrlData } from '../../short-urls/data';
import { OptionalString } from '../../utils/utils';
import {
ShlinkHealth,
ShlinkMercureInfo,
ShlinkShortUrlsResponse,
ShlinkTags,
ShlinkTagsResponse,
ShlinkVisits,
ShlinkVisitsParams,
ShlinkShortUrlData,
ShlinkDomain,
ShlinkDomainsResponse,
ShlinkVisitsOverview,
} from '../types';
const buildShlinkBaseUrl = (url: string, apiVersion: number) => url ? `${url}/rest/v${apiVersion}` : '';
const rejectNilProps = reject(isNil);
export default class ShlinkApiClient {
private apiVersion: number;
public constructor(
private readonly axios: AxiosInstance,
private readonly baseUrl: string,
private readonly apiKey: string,
) {
this.apiVersion = 2;
}
public readonly listShortUrls = async (params: ShortUrlsListParams = {}): Promise<ShlinkShortUrlsResponse> =>
this.performRequest<{ shortUrls: ShlinkShortUrlsResponse }>('/short-urls', 'GET', params)
.then(({ data }) => data.shortUrls);
public readonly createShortUrl = async (options: ShortUrlData): Promise<ShortUrl> => {
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options as any);
return this.performRequest<ShortUrl>('/short-urls', 'POST', {}, filteredOptions)
.then((resp) => resp.data);
};
public readonly getShortUrlVisits = async (shortCode: string, query?: ShlinkVisitsParams): Promise<ShlinkVisits> =>
this.performRequest<{ visits: ShlinkVisits }>(`/short-urls/${shortCode}/visits`, 'GET', query)
.then(({ data }) => data.visits);
public readonly getTagVisits = async (tag: string, query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits> =>
this.performRequest<{ visits: ShlinkVisits }>(`/tags/${tag}/visits`, 'GET', query)
.then(({ data }) => data.visits);
public readonly getOrphanVisits = async (query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits> =>
this.performRequest<{ visits: ShlinkVisits }>('/visits/orphan', 'GET', query)
.then(({ data }) => data.visits);
public readonly getVisitsOverview = async (): Promise<ShlinkVisitsOverview> =>
this.performRequest<{ visits: ShlinkVisitsOverview }>('/visits', 'GET')
.then(({ data }) => data.visits);
public readonly getShortUrl = async (shortCode: string, domain?: OptionalString): Promise<ShortUrl> =>
this.performRequest<ShortUrl>(`/short-urls/${shortCode}`, 'GET', { domain })
.then(({ data }) => data);
public readonly deleteShortUrl = async (shortCode: string, domain?: OptionalString): Promise<void> =>
this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain })
.then(() => {});
/* @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrl instead */
public readonly updateShortUrlTags = async (
shortCode: string,
domain: OptionalString,
tags: string[],
): Promise<string[]> =>
this.performRequest<{ tags: string[] }>(`/short-urls/${shortCode}/tags`, 'PUT', { domain }, { tags })
.then(({ data }) => data.tags);
public readonly updateShortUrl = async (
shortCode: string,
domain: OptionalString,
data: ShlinkShortUrlData,
): Promise<ShortUrl> =>
this.performRequest<ShortUrl>(`/short-urls/${shortCode}`, 'PATCH', { domain }, data)
.then(({ data }) => data);
public readonly listTags = async (): Promise<ShlinkTags> =>
this.performRequest<{ tags: ShlinkTagsResponse }>('/tags', 'GET', { withStats: 'true' })
.then((resp) => resp.data.tags)
.then(({ data, stats }) => ({ tags: data, stats }));
public readonly deleteTags = async (tags: string[]): Promise<{ tags: string[] }> =>
this.performRequest('/tags', 'DELETE', { tags })
.then(() => ({ tags }));
public readonly editTag = async (oldName: string, newName: string): Promise<{ oldName: string; newName: string }> =>
this.performRequest('/tags', 'PUT', {}, { oldName, newName })
.then(() => ({ oldName, newName }));
public readonly health = async (): Promise<ShlinkHealth> =>
this.performRequest<ShlinkHealth>('/health', 'GET')
.then((resp) => resp.data);
public readonly mercureInfo = async (): Promise<ShlinkMercureInfo> =>
this.performRequest<ShlinkMercureInfo>('/mercure-info', 'GET')
.then((resp) => resp.data);
public readonly listDomains = async (): Promise<ShlinkDomain[]> =>
this.performRequest<{ domains: ShlinkDomainsResponse }>('/domains', 'GET').then(({ data }) => data.domains.data);
private readonly performRequest = async <T>(url: string, method: Method = 'GET', query = {}, body = {}): Promise<AxiosResponse<T>> => {
try {
return await this.axios({
method,
url: `${buildShlinkBaseUrl(this.baseUrl, this.apiVersion)}${url}`,
headers: { 'X-Api-Key': this.apiKey },
params: rejectNilProps(query),
data: body,
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: 'brackets' }),
});
} catch (e) {
const { response } = e;
// Due to a bug on all previous Shlink versions, requests to non-matching URLs will always result on a CORS error
// when performed from the browser (due to the preflight request not returning a 2xx status.
// See https://github.com/shlinkio/shlink/issues/614), which will make the "response" prop not to be set here.
// The bug will be fixed on upcoming Shlink patches, but for other versions, we can consider this situation as
// if a request has been performed to a not supported API version.
const apiVersionIsNotSupported = !response;
// When the request is not invalid or we have already tried both API versions, throw the error and let the
// caller handle it
if (!apiVersionIsNotSupported || this.apiVersion === 2) {
throw e;
}
this.apiVersion = this.apiVersion - 1;
return await this.performRequest(url, method, query, body);
}
};
}

View File

@@ -0,0 +1,36 @@
import { AxiosInstance } from 'axios';
import { prop } from 'ramda';
import { hasServerData, SelectedServer, ServerWithId } from '../../servers/data';
import { GetState } from '../../container/types';
import ShlinkApiClient from './ShlinkApiClient';
const apiClients: Record<string, ShlinkApiClient> = {};
const isGetState = (getStateOrSelectedServer: GetState | ServerWithId): getStateOrSelectedServer is GetState =>
typeof getStateOrSelectedServer === 'function';
const getSelectedServerFromState = (getState: GetState): SelectedServer => prop('selectedServer', getState());
export type ShlinkApiClientBuilder = (getStateOrSelectedServer: GetState | ServerWithId) => ShlinkApiClient;
const buildShlinkApiClient = (axios: AxiosInstance): ShlinkApiClientBuilder => (
getStateOrSelectedServer: GetState | ServerWithId,
) => {
const server = isGetState(getStateOrSelectedServer)
? getSelectedServerFromState(getStateOrSelectedServer)
: getStateOrSelectedServer;
if (!hasServerData(server)) {
throw new Error('There\'s no selected server or it is not found');
}
const { url, apiKey } = server;
const clientKey = `${url}_${apiKey}`;
if (!apiClients[clientKey]) {
apiClients[clientKey] = new ShlinkApiClient(axios, url, apiKey);
}
return apiClients[clientKey];
};
export default buildShlinkApiClient;

View File

@@ -0,0 +1,8 @@
import Bottle from 'bottlejs';
import buildShlinkApiClient from './ShlinkApiClientBuilder';
const provideServices = (bottle: Bottle) => {
bottle.serviceFactory('buildShlinkApiClient', buildShlinkApiClient, 'axios');
};
export default provideServices;

93
src/api/types/index.ts Normal file
View File

@@ -0,0 +1,93 @@
import { Visit } from '../../visits/types';
import { OptionalString } from '../../utils/utils';
import { ShortUrl, ShortUrlMeta } from '../../short-urls/data';
export interface ShlinkShortUrlsResponse {
data: ShortUrl[];
pagination: ShlinkPaginator;
}
export interface ShlinkMercureInfo {
token: string;
mercureHubUrl: string;
}
export interface ShlinkHealth {
status: 'pass' | 'fail';
version: string;
}
interface ShlinkTagsStats {
tag: string;
shortUrlsCount: number;
visitsCount: number;
}
export interface ShlinkTags {
tags: string[];
stats?: ShlinkTagsStats[]; // Is only optional in Shlink older than v2.2
}
export interface ShlinkTagsResponse {
data: string[];
stats?: ShlinkTagsStats[]; // Is only optional in Shlink older than v2.2
}
export interface ShlinkPaginator {
currentPage: number;
pagesCount: number;
totalItems: number;
}
export interface ShlinkVisits {
data: Visit[];
pagination: ShlinkPaginator;
}
export interface ShlinkVisitsOverview {
visitsCount: number;
orphanVisitsCount?: number; // Optional only for versions older than 2.6.0
}
export interface ShlinkVisitsParams {
domain?: OptionalString;
page?: number;
itemsPerPage?: number;
startDate?: string;
endDate?: string;
}
export interface ShlinkShortUrlData extends ShortUrlMeta {
longUrl?: string;
title?: string;
validateUrl?: boolean;
tags?: string[];
}
export interface ShlinkDomain {
domain: string;
isDefault: boolean;
}
export interface ShlinkDomainsResponse {
data: ShlinkDomain[];
}
export interface ProblemDetailsError {
type: string;
detail: string;
title: string;
status: number;
[extraProps: string]: any;
}
export interface InvalidArgumentError extends ProblemDetailsError {
type: 'INVALID_ARGUMENT';
invalidElements: string[];
}
export interface InvalidShortUrlDeletion extends ProblemDetailsError {
type: 'INVALID_SHORTCODE_DELETION';
threshold: number;
}

10
src/api/utils/index.ts Normal file
View File

@@ -0,0 +1,10 @@
import { AxiosError } from 'axios';
import { InvalidArgumentError, InvalidShortUrlDeletion, ProblemDetailsError } from '../types';
export const parseApiError = (e: AxiosError<ProblemDetailsError>) => e.response?.data;
export const isInvalidArgumentError = (error?: ProblemDetailsError): error is InvalidArgumentError =>
error?.type === 'INVALID_ARGUMENT';
export const isInvalidDeletionError = (error?: ProblemDetailsError): error is InvalidShortUrlDeletion =>
error?.type === 'INVALID_SHORTCODE_DELETION';

View File

@@ -1,70 +0,0 @@
import listIcon from '@fortawesome/fontawesome-free-solid/faList';
import createIcon from '@fortawesome/fontawesome-free-solid/faLink';
import tagsIcon from '@fortawesome/fontawesome-free-solid/faTags';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import React from 'react';
import { NavLink } from 'react-router-dom';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import DeleteServerButton from '../servers/DeleteServerButton';
import './AsideMenu.scss';
import { serverType } from '../servers/prop-types';
const defaultProps = {
className: '',
showOnMobile: false,
};
const propTypes = {
selectedServer: serverType,
className: PropTypes.string,
showOnMobile: PropTypes.bool,
};
export default function AsideMenu({ selectedServer, className, showOnMobile }) {
const serverId = selectedServer ? selectedServer.id : '';
const asideClass = classnames('aside-menu', className, {
'aside-menu--hidden': !showOnMobile,
});
const shortUrlsIsActive = (match, location) => location.pathname.match('/list-short-urls');
return (
<aside className={asideClass}>
<nav className="nav flex-column aside-menu__nav">
<NavLink
className="aside-menu__item"
activeClassName="aside-menu__item--selected"
to={`/server/${serverId}/list-short-urls/1`}
isActive={shortUrlsIsActive}
>
<FontAwesomeIcon icon={listIcon} />
<span className="aside-menu__item-text">List short URLs</span>
</NavLink>
<NavLink
className="aside-menu__item"
activeClassName="aside-menu__item--selected"
to={`/server/${serverId}/create-short-url`}
>
<FontAwesomeIcon icon={createIcon} flip="horizontal" />
<span className="aside-menu__item-text">Create short URL</span>
</NavLink>
<NavLink
className="aside-menu__item"
activeClassName="aside-menu__item--selected"
to={`/server/${serverId}/manage-tags`}
>
<FontAwesomeIcon icon={tagsIcon} />
<span className="aside-menu__item-text">Manage tags</span>
</NavLink>
<DeleteServerButton
className="aside-menu__item aside-menu__item--danger"
server={selectedServer}
/>
</nav>
</aside>
);
}
AsideMenu.defaultProps = defaultProps;
AsideMenu.propTypes = propTypes;

View File

@@ -1,11 +1,10 @@
@import '../utils/base';
@import '../utils/mixins/box-shadow';
@import '../utils/mixins/vertical-align';
$asideMenuMobileWidth: 280px;
.aside-menu {
background-color: #f7f7f7;
width: $asideMenuWidth;
background-color: var(--primary-color);
box-shadow: rgba(0, 0, 0, .05) 0 8px 15px;
position: fixed !important;
padding-top: 13px;
padding-bottom: 10px;
@@ -19,21 +18,18 @@ $asideMenuMobileWidth: 280px;
@media (min-width: $mdMin) {
padding: 30px 15px 15px;
border-right: 1px solid #eee;
}
@media (max-width: $smMax) {
width: $asideMenuMobileWidth !important;
transition: left 300ms;
top: $headerHeight - 3px;
@include box-shadow(-10px 0 50px 11px rgba(0, 0, 0, .55));
box-shadow: -10px 0 50px 11px rgba(0, 0, 0, .55);
}
}
.aside-menu--hidden {
@media (max-width: $smMax) {
left: -($asideMenuMobileWidth + 35px);
left: -($asideMenuWidth + 35px);
}
}
@@ -46,34 +42,37 @@ $asideMenuMobileWidth: 280px;
margin: 0 -15px;
text-decoration: none !important;
cursor: pointer;
@media (max-width: $smMax) {
margin: 0;
}
}
.aside-menu__item:hover {
background-color: $lightHoverColor;
}
.aside-menu__item--selected {
color: #fff;
background-color: $mainColor;
background-color: var(--secondary-color);
}
.aside-menu__item--selected,
.aside-menu__item--selected:hover {
color: #fff;
background-color: $mainColor;
color: #ffffff;
background-color: var(--brand-color);
}
.aside-menu__item--divider {
border-bottom: 1px solid #eee;
border-bottom: 1px solid #eeeeee;
margin: 20px 0;
}
.aside-menu__item--danger {
color: $dangerColor;
}
.aside-menu__item--push {
margin-top: auto;
}
.aside-menu__item--danger:hover {
color: #fff;
color: #ffffff;
background-color: $dangerColor;
}

81
src/common/AsideMenu.tsx Normal file
View File

@@ -0,0 +1,81 @@
import {
faList as listIcon,
faLink as createIcon,
faTags as tagsIcon,
faPen as editIcon,
faHome as overviewIcon,
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { FC } from 'react';
import { NavLink, NavLinkProps } from 'react-router-dom';
import classNames from 'classnames';
import { Location } from 'history';
import { DeleteServerButtonProps } from '../servers/DeleteServerButton';
import { ServerWithId } from '../servers/data';
import './AsideMenu.scss';
export interface AsideMenuProps {
selectedServer: ServerWithId;
className?: string;
showOnMobile?: boolean;
}
interface AsideMenuItemProps extends NavLinkProps {
to: string;
}
const AsideMenuItem: FC<AsideMenuItemProps> = ({ children, to, className, ...rest }) => (
<NavLink
className={classNames('aside-menu__item', className)}
activeClassName="aside-menu__item--selected"
to={to}
{...rest}
>
{children}
</NavLink>
);
const AsideMenu = (DeleteServerButton: FC<DeleteServerButtonProps>) => (
{ selectedServer, showOnMobile = false }: AsideMenuProps,
) => {
const serverId = selectedServer ? selectedServer.id : '';
const asideClass = classNames('aside-menu', {
'aside-menu--hidden': !showOnMobile,
});
const shortUrlsIsActive = (_: null, location: Location) => location.pathname.match('/list-short-urls') !== null;
const buildPath = (suffix: string) => `/server/${serverId}${suffix}`;
return (
<aside className={asideClass}>
<nav className="nav flex-column aside-menu__nav">
<AsideMenuItem to={buildPath('/overview')}>
<FontAwesomeIcon icon={overviewIcon} />
<span className="aside-menu__item-text">Overview</span>
</AsideMenuItem>
<AsideMenuItem to={buildPath('/list-short-urls/1')} isActive={shortUrlsIsActive}>
<FontAwesomeIcon icon={listIcon} />
<span className="aside-menu__item-text">List short URLs</span>
</AsideMenuItem>
<AsideMenuItem to={buildPath('/create-short-url')}>
<FontAwesomeIcon icon={createIcon} flip="horizontal" />
<span className="aside-menu__item-text">Create short URL</span>
</AsideMenuItem>
<AsideMenuItem to={buildPath('/manage-tags')}>
<FontAwesomeIcon icon={tagsIcon} />
<span className="aside-menu__item-text">Manage tags</span>
</AsideMenuItem>
<AsideMenuItem to={buildPath('/edit')} className="aside-menu__item--push">
<FontAwesomeIcon icon={editIcon} />
<span className="aside-menu__item-text">Edit this server</span>
</AsideMenuItem>
<DeleteServerButton
className="aside-menu__item aside-menu__item--danger"
textClassName="aside-menu__item-text"
server={selectedServer}
/>
</nav>
</aside>
);
};
export default AsideMenu;

View File

@@ -1,37 +0,0 @@
import calendarIcon from '@fortawesome/fontawesome-free-regular/faCalendarAlt';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import React from 'react';
import DatePicker from 'react-datepicker';
import './DateInput.scss';
import { isNil } from 'ramda';
export default class DateInput extends React.Component {
constructor(props) {
super(props);
this.inputRef = React.createRef();
}
render() {
const { isClearable, selected } = this.props;
const showCalendarIcon = !isClearable || isNil(selected);
return (
<div className="date-input-container">
<DatePicker
{...this.props}
className={`date-input-container__input form-control ${this.props.className || ''}`}
dateFormat="YYYY-MM-DD"
readOnly
ref={this.inputRef}
/>
{showCalendarIcon && (
<FontAwesomeIcon
icon={calendarIcon}
className="date-input-container__icon"
onClick={() => this.inputRef.current.input.focus()}
/>
)}
</div>
);
}
}

View File

@@ -1,31 +0,0 @@
@import '../utils/mixins/vertical-align';
@import '../utils/base';
.date-input-container {
position: relative;
}
.date-input-container__input {
padding-right: 35px !important;
background-color: #fff !important;
}
.date-input-container__icon {
@include vertical-align();
right: .75rem;
cursor: pointer;
}
.react-datepicker__close-icon.react-datepicker__close-icon {
@include vertical-align();
right: 0;
}
.react-datepicker__close-icon.react-datepicker__close-icon:after {
right: .75rem;
line-height: 11px;
background-color: #333;
font-size: 14px;
}

View File

@@ -0,0 +1,46 @@
import { Component, ReactNode } from 'react';
import { Button } from 'reactstrap';
import { SimpleCard } from '../utils/SimpleCard';
interface ErrorHandlerState {
hasError: boolean;
}
const ErrorHandler = (
{ location }: Window,
{ error }: Console,
) => class ErrorHandler extends Component<any, ErrorHandlerState> {
public constructor(props: object) {
super(props);
this.state = { hasError: false };
}
public static getDerivedStateFromError(): ErrorHandlerState {
return { hasError: true };
}
public componentDidCatch(e: Error): void {
if (process.env.NODE_ENV !== 'development') {
error(e);
}
}
public render(): ReactNode {
if (this.state.hasError) {
return (
<div className="home">
<SimpleCard className="p-4">
<h1>Oops! This is awkward :S</h1>
<p>It seems that something went wrong. Try refreshing the page or just click this button.</p>
<br />
<Button outline color="primary" onClick={() => location.reload()}>Take me back</Button>
</SimpleCard>
</div>
);
}
return this.props.children;
}
};
export default ErrorHandler;

View File

@@ -1,58 +0,0 @@
import chevronIcon from '@fortawesome/fontawesome-free-solid/faChevronRight';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import { isEmpty, pick, values } from 'ramda';
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { ListGroup, ListGroupItem } from 'reactstrap';
import PropTypes from 'prop-types';
import { resetSelectedServer } from '../servers/reducers/selectedServer';
import './Home.scss';
const propTypes = {
resetSelectedServer: PropTypes.func,
servers: PropTypes.object,
};
export class HomeComponent extends React.Component {
componentDidMount() {
this.props.resetSelectedServer();
}
render() {
const servers = values(this.props.servers);
const hasServers = !isEmpty(servers);
return (
<div className="home">
<h1 className="home__title">Welcome to Shlink</h1>
<h5 className="home__intro">
{hasServers && <span>Please, select a server.</span>}
{!hasServers && <span>Please, <Link to="/server/create">add a server</Link>.</span>}
</h5>
{hasServers && (
<ListGroup className="home__servers-list">
{servers.map(({ name, id }) => (
<ListGroupItem
key={id}
tag={Link}
to={`/server/${id}/list-short-urls/1`}
className="home__servers-item"
>
{name}
<FontAwesomeIcon icon={chevronIcon} className="home__servers-item-icon" />
</ListGroupItem>
))}
</ListGroup>
)}
</div>
);
}
}
HomeComponent.propTypes = propTypes;
const Home = connect(pick([ 'servers' ]), { resetSelectedServer })(HomeComponent);
export default Home;

View File

@@ -2,36 +2,40 @@
@import '../utils/mixins/vertical-align';
.home {
text-align: center;
height: calc(100vh - #{$headerHeight});
display: flex;
align-items: center;
justify-content: center;
flex-flow: column;
position: relative;
padding-top: 15px;
@media (min-width: $mdMin) {
padding-top: 0;
height: calc(100vh - #{$headerHeight} - #{($footer-height + $footer-margin)});
}
}
.home__logo {
@include vertical-align();
}
.home__main-card {
margin: 0 auto;
max-width: 720px;
@media (min-width: $mdMin) {
@include vertical-align();
}
}
.home__title {
text-align: center;
font-size: 1.75rem;
margin: 0;
@media (min-width: $mdMin) {
font-size: 2.2rem;
}
}
.home__servers-list {
margin-top: 1rem;
width: 100%;
max-width: 400px;
}
.home__servers-item.home__servers-item {
text-align: left;
position: relative;
padding: .75rem 2.5rem .75rem 1rem;
}
.home__servers-item-icon {
@include vertical-align();
right: 1rem;
.home__servers-container {
@media (min-width: $mdMin) {
border-left: 1px solid var(--border-color);
}
}

50
src/common/Home.tsx Normal file
View File

@@ -0,0 +1,50 @@
import { isEmpty, values } from 'ramda';
import { Link } from 'react-router-dom';
import { Card, Row } from 'reactstrap';
import { ExternalLink } from 'react-external-link';
import ServersListGroup from '../servers/ServersListGroup';
import './Home.scss';
import { ServersMap } from '../servers/data';
import { ShlinkLogo } from './img/ShlinkLogo';
export interface HomeProps {
servers: ServersMap;
}
const Home = ({ servers }: HomeProps) => {
const serversList = values(servers);
const hasServers = !isEmpty(serversList);
return (
<div className="home">
<Card className="home__main-card">
<Row noGutters>
<div className="col-md-5 d-none d-md-block">
<div className="p-4">
<ShlinkLogo />
</div>
</div>
<div className="col-md-7 home__servers-container">
<div className="p-4">
<h1 className="home__title">Welcome!</h1>
</div>
<ServersListGroup embedded servers={serversList}>
{!hasServers && (
<div className="p-4">
<p>This application will help you to manage your Shlink servers.</p>
<p>To start, please, <Link to="/server/create">add your first server</Link>.</p>
<p className="m-0">
You still don&lsquo;t have a Shlink server?
Learn how to <ExternalLink href="https://shlink.io/documentation">get started</ExternalLink>.
</p>
</div>
)}
</ServersListGroup>
</div>
</Row>
</Card>
</div>
);
};
export default Home;

View File

@@ -1,71 +0,0 @@
import plusIcon from '@fortawesome/fontawesome-free-solid/faPlus';
import arrowIcon from '@fortawesome/fontawesome-free-solid/faChevronDown';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import React from 'react';
import { Link, withRouter } from 'react-router-dom';
import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import ServersDropdown from '../servers/ServersDropdown';
import './MainHeader.scss';
import shlinkLogo from './shlink-logo-white.png';
const propTypes = {
location: PropTypes.object,
};
export class MainHeaderComponent extends React.Component {
state = { isOpen: false };
handleToggle = () => {
this.setState(({ isOpen }) => ({
isOpen: !isOpen,
}));
};
componentDidUpdate(prevProps) {
if (this.props.location !== prevProps.location) {
this.setState({ isOpen: false });
}
}
render() {
const { location } = this.props;
const createServerPath = '/server/create';
const toggleClass = classnames('main-header__toggle-icon', {
'main-header__toggle-icon--opened': this.state.isOpen,
});
return (
<Navbar color="primary" dark fixed="top" className="main-header" expand="md">
<NavbarBrand tag={Link} to="/">
<img src={shlinkLogo} alt="Shlink" className="main-header__brand-logo" /> Shlink
</NavbarBrand>
<NavbarToggler onClick={this.handleToggle}>
<FontAwesomeIcon icon={arrowIcon} className={toggleClass} />
</NavbarToggler>
<Collapse navbar isOpen={this.state.isOpen}>
<Nav navbar className="ml-auto">
<NavItem>
<NavLink
tag={Link}
to={createServerPath}
active={location.pathname === createServerPath}
>
<FontAwesomeIcon icon={plusIcon} />&nbsp; Add server
</NavLink>
</NavItem>
<ServersDropdown />
</Nav>
</Collapse>
</Navbar>
);
}
}
MainHeaderComponent.propTypes = propTypes;
const MainHeader = withRouter(MainHeaderComponent);
export default MainHeader;

View File

@@ -1,8 +1,8 @@
@import '../utils/base';
.main-header.main-header {
background-color: $mainColor !important;
color: white;
background-color: var(--brand-color) !important;
.navbar-brand {
color: inherit !important;

45
src/common/MainHeader.tsx Normal file
View File

@@ -0,0 +1,45 @@
import { faChevronDown as arrowIcon, faCogs as cogsIcon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { FC, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import classNames from 'classnames';
import { RouteComponentProps } from 'react-router';
import { useToggle } from '../utils/helpers/hooks';
import { ShlinkLogo } from './img/ShlinkLogo';
import './MainHeader.scss';
const MainHeader = (ServersDropdown: FC) => ({ location }: RouteComponentProps) => {
const [ isOpen, toggleOpen, , close ] = useToggle();
const { pathname } = location;
useEffect(close, [ location ]);
const settingsPath = '/settings';
const toggleClass = classNames('main-header__toggle-icon', { 'main-header__toggle-icon--opened': isOpen });
return (
<Navbar color="primary" dark fixed="top" className="main-header" expand="md">
<NavbarBrand tag={Link} to="/">
<ShlinkLogo className="main-header__brand-logo" color="white" /> Shlink
</NavbarBrand>
<NavbarToggler onClick={toggleOpen}>
<FontAwesomeIcon icon={arrowIcon} className={toggleClass} />
</NavbarToggler>
<Collapse navbar isOpen={isOpen}>
<Nav navbar className="ml-auto">
<NavItem>
<NavLink tag={Link} to={'/settings'} active={pathname === settingsPath}>
<FontAwesomeIcon icon={cogsIcon} />&nbsp; Settings
</NavLink>
</NavItem>
<ServersDropdown />
</Nav>
</Collapse>
</Navbar>
);
};
export default MainHeader;

View File

@@ -1,115 +0,0 @@
import React from 'react';
import { Route, Switch, withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { pick } from 'ramda';
import Swipeable from 'react-swipeable';
import burgerIcon from '@fortawesome/fontawesome-free-solid/faBars';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import classnames from 'classnames';
import * as PropTypes from 'prop-types';
import ShortUrlsVisits from '../short-urls/ShortUrlVisits';
import { selectServer } from '../servers/reducers/selectedServer';
import CreateShortUrl from '../short-urls/CreateShortUrl';
import ShortUrls from '../short-urls/ShortUrls';
import './MenuLayout.scss';
import TagsList from '../tags/TagsList';
import { serverType } from '../servers/prop-types';
import AsideMenu from './AsideMenu';
const propTypes = {
match: PropTypes.object,
selectServer: PropTypes.func,
location: PropTypes.object,
selectedServer: serverType,
};
export class MenuLayoutComponent extends React.Component {
state = { showSideBar: false };
// FIXME Shouldn't use componentWillMount, but this code has to be run before children components are rendered
/* eslint react/no-deprecated: "off" */
componentWillMount() {
const { match, selectServer } = this.props;
const { params: { serverId } } = match;
selectServer(serverId);
}
componentDidUpdate(prevProps) {
const { location } = this.props;
// Hide sidebar when location changes
if (location !== prevProps.location) {
this.setState({ showSideBar: false });
}
}
render() {
const { selectedServer } = this.props;
const burgerClasses = classnames('menu-layout__burger-icon', {
'menu-layout__burger-icon--active': this.state.showSideBar,
});
return (
<React.Fragment>
<FontAwesomeIcon
icon={burgerIcon}
className={burgerClasses}
onClick={() => this.setState(({ showSideBar }) => ({ showSideBar: !showSideBar }))}
/>
<Swipeable
delta={40}
className="menu-layout__swipeable"
onSwipedLeft={() => this.setState({ showSideBar: false })}
onSwipedRight={() => this.setState({ showSideBar: true })}
>
<div className="row menu-layout__swipeable-inner">
<AsideMenu
className="col-lg-2 col-md-3"
selectedServer={selectedServer}
showOnMobile={this.state.showSideBar}
/>
<div
className="col-lg-10 offset-lg-2 col-md-9 offset-md-3"
onClick={() => this.setState({ showSideBar: false })}
>
<Switch>
<Route
exact
path="/server/:serverId/list-short-urls/:page"
component={ShortUrls}
/>
<Route
exact
path="/server/:serverId/create-short-url"
component={CreateShortUrl}
/>
<Route
exact
path="/server/:serverId/short-code/:shortCode/visits"
component={ShortUrlsVisits}
/>
<Route
exact
path="/server/:serverId/manage-tags"
component={TagsList}
/>
</Switch>
</div>
</div>
</Swipeable>
</React.Fragment>
);
}
}
MenuLayoutComponent.propTypes = propTypes;
const MenuLayout = compose(
connect(pick([ 'selectedServer', 'shortUrlsListParams' ]), { selectServer }),
withRouter
)(MenuLayoutComponent);
export default MenuLayout;

View File

@@ -32,3 +32,12 @@
.menu-layout__burger-icon--active {
color: white;
}
.menu-layout__container.menu-layout__container {
padding: 20px 0 0;
min-height: 100%;
@media (min-width: $mdMin) {
padding: 30px 0 0 $asideMenuWidth;
}
}

70
src/common/MenuLayout.tsx Normal file
View File

@@ -0,0 +1,70 @@
import { FC, useEffect } from 'react';
import { Redirect, Route, Switch } from 'react-router-dom';
import { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
import { withSelectedServer } from '../servers/helpers/withSelectedServer';
import { useSwipeable, useToggle } from '../utils/helpers/hooks';
import { supportsOrphanVisits, supportsTagVisits } from '../utils/helpers/features';
import { isReachableServer } from '../servers/data';
import NotFound from './NotFound';
import { AsideMenuProps } from './AsideMenu';
import './MenuLayout.scss';
const MenuLayout = (
TagsList: FC,
ShortUrls: FC,
AsideMenu: FC<AsideMenuProps>,
CreateShortUrl: FC,
ShortUrlVisits: FC,
TagVisits: FC,
OrphanVisits: FC,
ServerError: FC,
Overview: FC,
EditShortUrl: FC,
) => withSelectedServer(({ location, selectedServer }) => {
const [ sidebarVisible, toggleSidebar, showSidebar, hideSidebar ] = useToggle();
useEffect(() => hideSidebar(), [ location ]);
if (!isReachableServer(selectedServer)) {
return <ServerError />;
}
const addTagsVisitsRoute = supportsTagVisits(selectedServer);
const addOrphanVisitsRoute = supportsOrphanVisits(selectedServer);
const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible });
const swipeableProps = useSwipeable(showSidebar, hideSidebar);
return (
<>
<FontAwesomeIcon icon={burgerIcon} className={burgerClasses} onClick={toggleSidebar} />
<div {...swipeableProps} className="menu-layout__swipeable">
<div className="menu-layout__swipeable-inner">
<AsideMenu selectedServer={selectedServer} showOnMobile={sidebarVisible} />
<div className="menu-layout__container" onClick={() => hideSidebar()}>
<div className="container-xl">
<Switch>
<Redirect exact from="/server/:serverId" to="/server/:serverId/overview" />
<Route exact path="/server/:serverId/overview" component={Overview} />
<Route exact path="/server/:serverId/list-short-urls/:page" component={ShortUrls} />
<Route exact path="/server/:serverId/create-short-url" component={CreateShortUrl} />
<Route path="/server/:serverId/short-code/:shortCode/visits" component={ShortUrlVisits} />
<Route path="/server/:serverId/short-code/:shortCode/edit" component={EditShortUrl} />
{addTagsVisitsRoute && <Route path="/server/:serverId/tag/:tag/visits" component={TagVisits} />}
{addOrphanVisitsRoute && <Route path="/server/:serverId/orphan-visits" component={OrphanVisits} />}
<Route exact path="/server/:serverId/manage-tags" component={TagsList} />
<Route
render={() => <NotFound to={`/server/${selectedServer.id}/list-short-urls/1`}>List short URLs</NotFound>}
/>
</Switch>
</div>
</div>
</div>
</div>
</>
);
}, ServerError);
export default MenuLayout;

View File

@@ -0,0 +1,9 @@
@import '../utils/base';
.no-menu-wrapper {
padding: 15px 0 0;
@media (min-width: $mdMin) {
padding: 30px 20px 20px;
}
}

View File

@@ -0,0 +1,6 @@
import { FC } from 'react';
import './NoMenuLayout.scss';
const NoMenuLayout: FC = ({ children }) => <div className="no-menu-wrapper container-xl">{children}</div>;
export default NoMenuLayout;

Some files were not shown because too many files have changed in this diff Show More