From c28afbc75db50ce8515b02ddbfda122e490fb71f Mon Sep 17 00:00:00 2001 From: Aadhar Chandiwala Date: Mon, 14 Mar 2022 19:12:36 +0530 Subject: [PATCH 1/2] Fix Work Experience Website Link redirects to 404 if entered without http or https --- client/templates/Castform/widgets/Section.tsx | 4 ++-- client/templates/Gengar/widgets/Section.tsx | 4 ++-- client/templates/Glalie/widgets/Section.tsx | 4 ++-- client/templates/Kakuna/widgets/Section.tsx | 4 ++-- client/templates/Onyx/widgets/Section.tsx | 4 ++-- client/templates/Pikachu/widgets/Section.tsx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/templates/Castform/widgets/Section.tsx b/client/templates/Castform/widgets/Section.tsx index 3f7a195ec..da721a6b4 100644 --- a/client/templates/Castform/widgets/Section.tsx +++ b/client/templates/Castform/widgets/Section.tsx @@ -9,7 +9,7 @@ import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import DataDisplay from '@/templates/shared/DataDisplay'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import Heading from './Heading'; @@ -86,7 +86,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url}> + } link={url && addHttp(url)}> {url} )} diff --git a/client/templates/Gengar/widgets/Section.tsx b/client/templates/Gengar/widgets/Section.tsx index 8a825bfa0..80aafa3dd 100644 --- a/client/templates/Gengar/widgets/Section.tsx +++ b/client/templates/Gengar/widgets/Section.tsx @@ -9,7 +9,7 @@ import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import DataDisplay from '@/templates/shared/DataDisplay'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import Heading from './Heading'; @@ -87,7 +87,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url}> + } link={url && addHttp(url)}> {url} )} diff --git a/client/templates/Glalie/widgets/Section.tsx b/client/templates/Glalie/widgets/Section.tsx index 396c06d52..536079fca 100644 --- a/client/templates/Glalie/widgets/Section.tsx +++ b/client/templates/Glalie/widgets/Section.tsx @@ -9,7 +9,7 @@ import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import DataDisplay from '@/templates/shared/DataDisplay'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import BadgeDisplay from './BadgeDisplay'; import Heading from './Heading'; @@ -80,7 +80,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url}> + } link={url && addHttp(url)}> {url} )} diff --git a/client/templates/Kakuna/widgets/Section.tsx b/client/templates/Kakuna/widgets/Section.tsx index 98d5869a6..032ff65e0 100644 --- a/client/templates/Kakuna/widgets/Section.tsx +++ b/client/templates/Kakuna/widgets/Section.tsx @@ -8,7 +8,7 @@ import Markdown from '@/components/shared/Markdown'; import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import BadgeDisplay from './BadgeDisplay'; import Heading from './Heading'; @@ -84,7 +84,7 @@ const Section: React.FC = ({ {url && ( diff --git a/client/templates/Onyx/widgets/Section.tsx b/client/templates/Onyx/widgets/Section.tsx index 830bd57a6..2603cc37c 100644 --- a/client/templates/Onyx/widgets/Section.tsx +++ b/client/templates/Onyx/widgets/Section.tsx @@ -9,7 +9,7 @@ import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import DataDisplay from '@/templates/shared/DataDisplay'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import Heading from './Heading'; @@ -87,7 +87,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url} className="text-xs"> + } link={url && addHttp(url)} className="text-xs"> {url} )} diff --git a/client/templates/Pikachu/widgets/Section.tsx b/client/templates/Pikachu/widgets/Section.tsx index 3eb9df014..bba628493 100644 --- a/client/templates/Pikachu/widgets/Section.tsx +++ b/client/templates/Pikachu/widgets/Section.tsx @@ -9,7 +9,7 @@ import { useAppSelector } from '@/store/hooks'; import { SectionProps } from '@/templates/sectionMap'; import DataDisplay from '@/templates/shared/DataDisplay'; import { formatDateString } from '@/utils/date'; -import { parseListItemPath } from '@/utils/template'; +import { addHttp, parseListItemPath } from '@/utils/template'; import Heading from './Heading'; @@ -79,7 +79,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url}> + } link={url && addHttp(url)}> {url} )} From de53d8dfe76f97bea62044f6b4d240e832b0d3c8 Mon Sep 17 00:00:00 2001 From: Aadhar Chandiwala Date: Mon, 14 Mar 2022 19:32:12 +0530 Subject: [PATCH 2/2] Removed url && in the link prop --- client/templates/Castform/widgets/Section.tsx | 2 +- client/templates/Gengar/widgets/Section.tsx | 2 +- client/templates/Glalie/widgets/Section.tsx | 2 +- client/templates/Kakuna/widgets/Section.tsx | 2 +- client/templates/Onyx/widgets/Section.tsx | 2 +- client/templates/Pikachu/widgets/Section.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/templates/Castform/widgets/Section.tsx b/client/templates/Castform/widgets/Section.tsx index da721a6b4..3d8a524d6 100644 --- a/client/templates/Castform/widgets/Section.tsx +++ b/client/templates/Castform/widgets/Section.tsx @@ -86,7 +86,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url && addHttp(url)}> + } link={addHttp(url)}> {url} )} diff --git a/client/templates/Gengar/widgets/Section.tsx b/client/templates/Gengar/widgets/Section.tsx index 80aafa3dd..6d74ed4ba 100644 --- a/client/templates/Gengar/widgets/Section.tsx +++ b/client/templates/Gengar/widgets/Section.tsx @@ -87,7 +87,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url && addHttp(url)}> + } link={addHttp(url)}> {url} )} diff --git a/client/templates/Glalie/widgets/Section.tsx b/client/templates/Glalie/widgets/Section.tsx index 536079fca..3365dfdf3 100644 --- a/client/templates/Glalie/widgets/Section.tsx +++ b/client/templates/Glalie/widgets/Section.tsx @@ -80,7 +80,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url && addHttp(url)}> + } link={addHttp(url)}> {url} )} diff --git a/client/templates/Kakuna/widgets/Section.tsx b/client/templates/Kakuna/widgets/Section.tsx index 032ff65e0..d0ebc363c 100644 --- a/client/templates/Kakuna/widgets/Section.tsx +++ b/client/templates/Kakuna/widgets/Section.tsx @@ -84,7 +84,7 @@ const Section: React.FC = ({ {url && ( diff --git a/client/templates/Onyx/widgets/Section.tsx b/client/templates/Onyx/widgets/Section.tsx index 2603cc37c..00472af10 100644 --- a/client/templates/Onyx/widgets/Section.tsx +++ b/client/templates/Onyx/widgets/Section.tsx @@ -87,7 +87,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url && addHttp(url)} className="text-xs"> + } link={addHttp(url)} className="text-xs"> {url} )} diff --git a/client/templates/Pikachu/widgets/Section.tsx b/client/templates/Pikachu/widgets/Section.tsx index bba628493..33e785f9b 100644 --- a/client/templates/Pikachu/widgets/Section.tsx +++ b/client/templates/Pikachu/widgets/Section.tsx @@ -79,7 +79,7 @@ const Section: React.FC = ({ {summary && {summary}} {url && ( - } link={url && addHttp(url)}> + } link={addHttp(url)}> {url} )}