diff --git a/src/shlink-web-component/Main.tsx b/src/shlink-web-component/Main.tsx index 260aaffd..e5858af7 100644 --- a/src/shlink-web-component/Main.tsx +++ b/src/shlink-web-component/Main.tsx @@ -28,7 +28,6 @@ export const Main = ( const [sidebarVisible, toggleSidebar, showSidebar, hideSidebar] = useToggle(); useEffect(() => hideSidebar(), [location]); - const addNonOrphanVisitsRoute = useFeature('nonOrphanVisits'); const addDomainVisitsRoute = useFeature('domainVisits'); const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible }); const swipeableProps = useSwipeable(showSidebar, hideSidebar); @@ -54,7 +53,7 @@ export const Main = ( } /> {addDomainVisitsRoute && } />} } /> - {addNonOrphanVisitsRoute && } />} + } /> } /> } /> = ({ domain, editDomainRedirects }) => { const [isModalOpen, toggleModal] = useToggle(); const { isDefault } = domain; - const canBeEdited = !isDefault || useFeature('defaultDomainRedirectsEdition'); + const canBeEdited = !isDefault; const withVisits = useFeature('domainVisits'); const routesPrefix = useRoutesPrefix(); diff --git a/src/shlink-web-component/overview/Overview.tsx b/src/shlink-web-component/overview/Overview.tsx index fb411d3b..5d80fbee 100644 --- a/src/shlink-web-component/overview/Overview.tsx +++ b/src/shlink-web-component/overview/Overview.tsx @@ -11,7 +11,6 @@ import type { ShortUrlsList as ShortUrlsListState } from '../short-urls/reducers import { ITEMS_IN_OVERVIEW_PAGE } from '../short-urls/reducers/shortUrlsList'; import type { ShortUrlsTableType } from '../short-urls/ShortUrlsTable'; import type { TagsList } from '../tags/reducers/tagsList'; -import { useFeature } from '../utils/features'; import { useRoutesPrefix } from '../utils/routesPrefix'; import { useSetting } from '../utils/settings'; import type { VisitsOverview } from '../visits/reducers/visitsOverview'; @@ -42,7 +41,6 @@ export const Overview = ( const { loading: loadingTags } = tagsList; const { loading: loadingVisits, nonOrphanVisits, orphanVisits } = visitsOverview; const routesPrefix = useRoutesPrefix(); - const linkToNonOrphanVisits = useFeature('nonOrphanVisits'); const navigate = useNavigate(); const visits = useSetting('visits'); @@ -58,7 +56,7 @@ export const Overview = (
; -const buildExtraProps = (link?: string) => (!link ? {} : { tag: Link, to: link }); +const buildExtraProps = (link: string) => ({ tag: Link, to: link }); export const HighlightCard: FC = ({ children, title, link, tooltip }) => { const ref = useElementRef(); @@ -20,7 +20,7 @@ export const HighlightCard: FC = ({ children, title, link, t return ( <> - {link && } + {title} {children} diff --git a/src/shlink-web-component/short-urls/ShortUrlForm.tsx b/src/shlink-web-component/short-urls/ShortUrlForm.tsx index 4b59d6cd..200a927e 100644 --- a/src/shlink-web-component/short-urls/ShortUrlForm.tsx +++ b/src/shlink-web-component/short-urls/ShortUrlForm.tsx @@ -134,8 +134,6 @@ export const ShortUrlForm = ( ); - const showForwardQueryControl = useFeature('forwardQuery'); - return (
{isBasicMode && basicComponents} @@ -242,15 +240,13 @@ export const ShortUrlForm = ( > Make it crawlable - {showForwardQueryControl && ( - setShortUrlData({ ...shortUrlData, forwardQuery })} - > - Forward query params on redirect - - )} + setShortUrlData({ ...shortUrlData, forwardQuery })} + > + Forward query params on redirect +
diff --git a/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx b/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx index 40c1185f..420c9f15 100644 --- a/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx +++ b/src/shlink-web-component/short-urls/ShortUrlsFilteringBar.tsx @@ -58,7 +58,6 @@ export const ShortUrlsFilteringBar = ( (searchTerm) => toFirstPage({ search: searchTerm }), ); const changeTagSelection = (selectedTags: string[]) => toFirstPage({ tags: selectedTags }); - const canChangeTagsMode = useFeature('allTagsFiltering'); const toggleTagsMode = pipe( () => (tagsMode === 'any' ? 'all' : 'any'), (mode) => toFirstPage({ tagsMode: mode }), @@ -70,7 +69,7 @@ export const ShortUrlsFilteringBar = ( - {canChangeTagsMode && tags.length > 1 && ( + {tags.length > 1 && ( <> - - )} +
+ +
diff --git a/src/shlink-web-component/utils/features.ts b/src/shlink-web-component/utils/features.ts index 83bc18ef..0392a233 100644 --- a/src/shlink-web-component/utils/features.ts +++ b/src/shlink-web-component/utils/features.ts @@ -3,15 +3,6 @@ import type { SemVer } from '../../utils/helpers/version'; import { versionMatch } from '../../utils/helpers/version'; const supportedFeatures = { - // Deprecated - forwardQuery: '2.9.0', - nonRestCors: '2.9.0', - defaultDomainRedirectsEdition: '2.10.0', - nonOrphanVisits: '3.0.0', - allTagsFiltering: '3.0.0', - tagsStats: '3.0.0', - // End deprecated - domainVisits: '3.1.0', excludeBotsOnShortUrls: '3.4.0', filterDisabledUrls: '3.4.0', @@ -26,15 +17,6 @@ export const isFeatureEnabledForVersion = (feature: Feature, serverVersion: SemV versionMatch(serverVersion, { minVersion: supportedFeatures[feature] }); const getFeaturesForVersion = (serverVersion: SemVer): Record => ({ - // Deprecated - forwardQuery: isFeatureEnabledForVersion('forwardQuery', serverVersion), - nonRestCors: isFeatureEnabledForVersion('nonRestCors', serverVersion), - defaultDomainRedirectsEdition: isFeatureEnabledForVersion('defaultDomainRedirectsEdition', serverVersion), - nonOrphanVisits: isFeatureEnabledForVersion('nonOrphanVisits', serverVersion), - allTagsFiltering: isFeatureEnabledForVersion('allTagsFiltering', serverVersion), - tagsStats: isFeatureEnabledForVersion('tagsStats', serverVersion), - // End - domainVisits: isFeatureEnabledForVersion('domainVisits', serverVersion), excludeBotsOnShortUrls: isFeatureEnabledForVersion('excludeBotsOnShortUrls', serverVersion), filterDisabledUrls: isFeatureEnabledForVersion('filterDisabledUrls', serverVersion),