From b6547a28b5b884b52d75d36f72309a051b021978 Mon Sep 17 00:00:00 2001 From: Malin J Date: Fri, 3 May 2024 12:59:52 +0200 Subject: [PATCH] Remove old iframe component #2204 (#2212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔥 Remove deprecated iframe #2204 * 🔥 Remove iframe fields #2204 * 🔥 Remove deprecated iframe from event page #2204 --- sanityv3/schemas/documents/event.ts | 15 +------------ web/lib/queries/common/eventContentFields.ts | 11 ---------- web/pageComponents/pageTemplates/Event.tsx | 23 ++++---------------- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/sanityv3/schemas/documents/event.ts b/sanityv3/schemas/documents/event.ts index 539b12d46..2380a829a 100644 --- a/sanityv3/schemas/documents/event.ts +++ b/sanityv3/schemas/documents/event.ts @@ -5,9 +5,9 @@ import { EdsIcon } from '../../icons' import CompactBlockEditor from '../components/CompactBlockEditor' import { i18n } from '../documentTranslation' import { configureBlockContent, configureTitleBlockContent } from '../editors' -import basicIframe, { IFrame } from '../objects/basicIframe' import type { EventDate } from '../objects/eventDate' import type { RelatedLinksArray } from '../objects/relatedLinks' +import basicIframe from '../objects/basicIframe' const titleContentType = configureTitleBlockContent() const blockContentType = configureBlockContent() @@ -125,19 +125,6 @@ export default { type: 'array', of: [blockContentType, basicIframe], }, - { - title: 'IFrame (Deprecated)', - name: 'iframe', - type: 'basicIframe', - validation: (Rule: Rule) => - Rule.custom((value: IFrame) => { - if (!value) { - return true - } else return 'IFrame is deprecated. Please insert iframe inside the content field.' - }).warning(), - - description: 'Iframe is deprecated on event page. You can insert iframe directly in to the content field above.', - }, { title: 'Title', name: 'promotedPeopleTitle', diff --git a/web/lib/queries/common/eventContentFields.ts b/web/lib/queries/common/eventContentFields.ts index 779dab29d..48be3852b 100644 --- a/web/lib/queries/common/eventContentFields.ts +++ b/web/lib/queries/common/eventContentFields.ts @@ -28,17 +28,6 @@ export const eventContentFields = /* groq */ ` }, }, }, - "iframe": iframe{ - title, - frameTitle, - url, - "cookiePolicy": coalesce(cookiePolicy, 'none'), - "designOptions": { - "aspectRatio": coalesce(aspectRatio, '16:9'), - height, - ${background} - }, - }, "promotedPeople": { "title": promotedPeopleTitle[]{ ..., diff --git a/web/pageComponents/pageTemplates/Event.tsx b/web/pageComponents/pageTemplates/Event.tsx index 70fe21fc6..7ffdef436 100644 --- a/web/pageComponents/pageTemplates/Event.tsx +++ b/web/pageComponents/pageTemplates/Event.tsx @@ -4,7 +4,6 @@ import { FormattedMessage } from 'react-intl' import styled from 'styled-components' import { getEventDates } from '../../common/helpers/dateUtilities' import ContactList from '../shared/ContactList' -import BasicIFrame from '../shared/iframe/BasicIFrame' import EventText from '../shared/portableText/EventText' import IngressText from '../shared/portableText/IngressText' import TitleText from '../shared/portableText/TitleText' @@ -32,9 +31,9 @@ const HeaderInner = styled.div` margin-left: auto; margin-right: auto; ` -const ContentWrapper = styled.div<{ iframe?: boolean }>` +const ContentWrapper = styled.div` margin: var(--space-3xLarge) 0 0 0; - padding: ${({ iframe }) => (iframe ? '0' : '0 0 var(--space-xLarge) 0')}; + padding: 0 0 var(--space-xLarge) 0; ` const LeadParagraph = styled.div` @@ -109,19 +108,6 @@ const StyledPromotion = styled(Promotion)` } ` -const StyledBasicIFrame = styled(BasicIFrame)` - --iframe-maxWidth: var(--topbar-innerMaxWidth); - --iframe-innerPadding: var(--space-3xLarge) 0; - - --iframe-titleAlign: center; - - @media (min-width: 450px) { - --iframe-titleAlign: left; - } - - padding: 0 var(--layout-paddingHorizontal-small); -` - const StyledContactList = styled(ContactList)` --contactList-titleAlign: center; @@ -135,7 +121,7 @@ const StyledContactList = styled(ContactList)` export default function Event({ data }: { data: EventSchema }): JSX.Element { const { title } = data - const { location, ingress, content, iframe, promotedPeople, relatedLinks, contactList, eventDate } = data.content + const { location, ingress, content, promotedPeople, relatedLinks, contactList, eventDate } = data.content const plainTitle = title ? toPlainText(title as PortableTextBlock[]) : '' const { start, end } = getEventDates(eventDate) @@ -176,7 +162,7 @@ export default function Event({ data }: { data: EventSchema }): JSX.Element { {(ingress || content) && ( - + {ingress && ( @@ -189,7 +175,6 @@ export default function Event({ data }: { data: EventSchema }): JSX.Element { )} )} - {iframe && } {promotedPeople?.people && promotedPeople?.people.length > 0 && (