Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callouts in DCR - PR 1/5 - Add deadline component and separate new/legacy components into two folders #6741

Merged
merged 18 commits into from
Jan 3, 2023

Conversation

tkgnm
Copy link
Contributor

@tkgnm tkgnm commented Dec 9, 2022

Callouts in DCR

This PR is part of a larger body of work to create a new Callout component in DCR. We are separating this PR into chunks so that it is easier to communicate the intent of each PR and to make it easier for DCR to review. After each PR is merged, we can merge it into the next branch which will incrementally reduce the size of each subsequent PR.

Important note for DCR reviewers: Please review these PR's in order below!

PR 1 #6741
PR 2 #6819
PR 3 #6833
PR 4 #6806
PR 5 #6836

Why?

We are soon to support a newer type of callout in DCR. However, as it necessary to still support the older (legacy) callout, we need to keep both in production. This PR is largely a shuffling of files around in the codebase - legacy files are now in a folder named CalloutEmbed, and files for the new component go into a folder simply named Callout. This PR also adds a deadline component that will be used in subsequent PR's that will implement our new callout component.

What does this change?

  1. Adds a new component called Deadline. This will be used in a subsequent PR when we add our new CalloutBlockComponent.
  2. Moves the old form components into our new legacy folder named CalloutEmbed. Soon after the rollout of our shiny new callout component, all of these files will be deleted. However, for now it is still necessary to keep them in production in order to support our current callout embed.

Testing

This PR should not change anything in production. The new deadline component is not being used anywhere as of yet, but it will be soon. The rest of the PR is just moving and renaming files in the codebase.

Screenshots

Deadline component
deadline

@@ -0,0 +1,62 @@
// File upload is the only legacy component that is still used on the old callout form
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old FileUpload component. It's now going to live in the (legacy) CalloutEmbed folder as it is only used there.

@@ -1,31 +1,79 @@
import { css } from '@emotion/react';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the nice shiny new FileUpload component.

@@ -3,11 +3,11 @@ import { text, textSans } from '@guardian/source-foundations';
import { Button, Link } from '@guardian/source-react-components';
import { useState } from 'react';
import type { CampaignFieldType } from '../../../types/content';
import { MultiSelect } from '../Callout/MultiSelect';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the other form components (such as the ones imported here) can be shared between both forms, as they are identical in design. Hence, the old CalloutEmbed imports them from the Callout folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the other components (e.g. CheckboxSelect, FieldLabel, etc.) are currently under the CalloutEmbed folder - is that right? From this comment (and I didn't see anything to the contrary) it sounds like they're to be used by the new Callout component and stored under its folder?

@tkgnm tkgnm changed the title Callouts: Add custom upload button, separate components into two folders Callouts: Add custom upload button, separate new/legacy components into two folders Dec 9, 2022
<div css={uploadStyles}>
<FieldLabel formField={formField} />
<div>
<label css={customUpload(format)} htmlFor={formField.id}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the FieldLabel here rather than having 2 labels for one component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still do use the FieldLabel on line 97, it's just that for accessibility/CSS reasons we had to wrap the 'Choose File' button in a <label> tag so that the whole form field (including the label) was not clickable. This also enables us to neatly mark what field this button is related to via the htmlFor attribute.

Copy link
Contributor

@sophie-macmillan sophie-macmillan Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the field label a html label element? If we could wrap the Choose file button in the FieldLabel rather than the label the whole thing would be clickable and there wouldn't be two labels for one button which probably doesn't make sense semantically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I get what you mean here. The problem I found was that when the whole thing was clickable you had unexpected behaviour when the 'Remove File' button appeared after uploading a file - it would mean that when you click that button you're immediately prompted to upload a file again. Just a weird UX. However, if you think there is a way around this I'd be more than happy to pair on it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe this is all a moot conversation now as we've moved the file input into source. For reference in source the label wraps the Choose file div, and the Remove file button sits outside of the label

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sophie-macmillan - I've removed this component now and have pushed the changes.

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

⚡️ Lighthouse report for the changes in this PR

Lighthouse tested 2 URLs

⚠️ Budget exceeded for 2 of 10 audits.

Report for Article

tested url https://www.theguardian.com/commentisfree/2020/feb/08/hungary-now-for-the-new-right-what-venezuela-once-was-for-the-left

Category Status Expected Actual
First Contentful Paint 1500 1482
Largest Contentful Paint 3000 1941
Time to Interactive 3500 3123
Cumulative Layout Shift ⚠️ 0.002 0.016917
accessibility 0.97 1.000000

Report for Front

tested url https://www.theguardian.com/uk

Category Status Expected Actual
First Contentful Paint 1500 1417
Largest Contentful Paint 3000 2365
Time to Interactive 3500 2552
Cumulative Layout Shift ⚠️ 0.002 0.013487
accessibility 0.97 0.980000

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Size Change: -9 B (0%)

Total Size: 2.29 MB

ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1124.modern.********************.js 8.35 kB 0 B
dotcom-rendering/dist/1398.legacy.********************.js 5.41 kB 0 B
dotcom-rendering/dist/1398.modern.********************.js 5.3 kB 0 B
dotcom-rendering/dist/1784.legacy.********************.js 3.81 kB 0 B
dotcom-rendering/dist/1931.legacy.********************.js 4.81 kB 0 B
dotcom-rendering/dist/1954.modern.********************.js 6.7 kB 0 B
dotcom-rendering/dist/2054.legacy.********************.js 25.6 kB 0 B
dotcom-rendering/dist/2054.modern.********************.js 24.4 kB 0 B
dotcom-rendering/dist/208.js 1.99 kB 0 B
dotcom-rendering/dist/243.legacy.********************.js 6.16 kB 0 B
dotcom-rendering/dist/243.modern.********************.js 5.96 kB 0 B
dotcom-rendering/dist/2513.legacy.********************.js 2.92 kB 0 B
dotcom-rendering/dist/2513.modern.********************.js 2.92 kB 0 B
dotcom-rendering/dist/290.legacy.********************.js 10.3 kB 0 B
dotcom-rendering/dist/290.modern.********************.js 12.1 kB 0 B
dotcom-rendering/dist/2913.legacy.********************.js 6.77 kB 0 B
dotcom-rendering/dist/3039.legacy.********************.js 2.9 kB 0 B
dotcom-rendering/dist/3039.modern.********************.js 2.89 kB 0 B
dotcom-rendering/dist/3206.legacy.********************.js 5.71 kB 0 B
dotcom-rendering/dist/3428.legacy.********************.js 3.75 kB 0 B
dotcom-rendering/dist/3428.modern.********************.js 3.75 kB 0 B
dotcom-rendering/dist/3490.legacy.********************.js 23.8 kB 0 B
dotcom-rendering/dist/3490.modern.********************.js 23.8 kB 0 B
dotcom-rendering/dist/3559.legacy.********************.js 5.6 kB 0 B
dotcom-rendering/dist/3584.legacy.********************.js 1.8 kB 0 B
dotcom-rendering/dist/3584.modern.********************.js 1.8 kB 0 B
dotcom-rendering/dist/3736.modern.********************.js 5.17 kB 0 B
dotcom-rendering/dist/385.legacy.********************.js 5.29 kB 0 B
dotcom-rendering/dist/385.modern.********************.js 5.29 kB 0 B
dotcom-rendering/dist/3998.legacy.********************.js 3.61 kB 0 B
dotcom-rendering/dist/4356.modern.********************.js 4.68 kB 0 B
dotcom-rendering/dist/446.modern.********************.js 3.32 kB 0 B
dotcom-rendering/dist/4547.legacy.********************.js 4.62 kB 0 B
dotcom-rendering/dist/4547.modern.********************.js 4.59 kB 0 B
dotcom-rendering/dist/4621.modern.********************.js 4.42 kB 0 B
dotcom-rendering/dist/463.js 10.5 kB 0 B
dotcom-rendering/dist/4734.legacy.********************.js 3.79 kB 0 B
dotcom-rendering/dist/490.js 2.57 kB 0 B
dotcom-rendering/dist/5.js 1.13 kB 0 B
dotcom-rendering/dist/5001.modern.********************.js 20.6 kB 0 B
dotcom-rendering/dist/5481.legacy.********************.js 3.45 kB 0 B
dotcom-rendering/dist/5481.modern.********************.js 3.43 kB 0 B
dotcom-rendering/dist/5491.legacy.********************.js 3.28 kB 0 B
dotcom-rendering/dist/5578.legacy.********************.js 5.11 kB 0 B
dotcom-rendering/dist/5578.modern.********************.js 5.06 kB 0 B
dotcom-rendering/dist/5814.legacy.********************.js 3.79 kB 0 B
dotcom-rendering/dist/5821.modern.********************.js 5.36 kB 0 B
dotcom-rendering/dist/5888.modern.********************.js 4.61 kB 0 B
dotcom-rendering/dist/5951.legacy.********************.js 3.79 kB 0 B
dotcom-rendering/dist/598.legacy.********************.js 3.69 kB 0 B
dotcom-rendering/dist/598.modern.********************.js 3.38 kB 0 B
dotcom-rendering/dist/6053.legacy.********************.js 4.62 kB 0 B
dotcom-rendering/dist/6053.modern.********************.js 4.59 kB 0 B
dotcom-rendering/dist/6131.legacy.********************.js 4.3 kB 0 B
dotcom-rendering/dist/6131.modern.********************.js 4.3 kB 0 B
dotcom-rendering/dist/6214.legacy.********************.js 6.45 kB 0 B
dotcom-rendering/dist/6214.modern.********************.js 6.45 kB 0 B
dotcom-rendering/dist/642.js 9 kB 0 B
dotcom-rendering/dist/6544.modern.********************.js 4.51 kB 0 B
dotcom-rendering/dist/6589.legacy.********************.js 7.45 kB 0 B
dotcom-rendering/dist/684.legacy.********************.js 7.1 kB 0 B
dotcom-rendering/dist/684.modern.********************.js 7.1 kB 0 B
dotcom-rendering/dist/6881.legacy.********************.js 6.08 kB 0 B
dotcom-rendering/dist/6881.modern.********************.js 5.57 kB 0 B
dotcom-rendering/dist/7185.legacy.********************.js 3.56 kB 0 B
dotcom-rendering/dist/7185.modern.********************.js 3.53 kB 0 B
dotcom-rendering/dist/7198.modern.********************.js 5.47 kB 0 B
dotcom-rendering/dist/7460.modern.********************.js 6.66 kB 0 B
dotcom-rendering/dist/7576.legacy.********************.js 10.1 kB 0 B
dotcom-rendering/dist/7576.modern.********************.js 8.55 kB 0 B
dotcom-rendering/dist/7585.legacy.********************.js 5.32 kB 0 B
dotcom-rendering/dist/7585.modern.********************.js 5.28 kB 0 B
dotcom-rendering/dist/7635.legacy.********************.js 2.81 kB 0 B
dotcom-rendering/dist/7635.modern.********************.js 3.42 kB 0 B
dotcom-rendering/dist/764.legacy.********************.js 6.77 kB 0 B
dotcom-rendering/dist/7716.legacy.********************.js 9.16 kB 0 B
dotcom-rendering/dist/7800.legacy.********************.js 11.3 kB 0 B
dotcom-rendering/dist/7800.modern.********************.js 11.3 kB 0 B
dotcom-rendering/dist/7812.modern.********************.js 4.2 kB 0 B
dotcom-rendering/dist/7829.legacy.********************.js 4.07 kB 0 B
dotcom-rendering/dist/7829.modern.********************.js 3.4 kB 0 B
dotcom-rendering/dist/8227.legacy.********************.js 3.75 kB 0 B
dotcom-rendering/dist/8227.modern.********************.js 3.73 kB 0 B
dotcom-rendering/dist/8255.legacy.********************.js 3.5 kB 0 B
dotcom-rendering/dist/8558.legacy.********************.js 5.22 kB 0 B
dotcom-rendering/dist/8558.modern.********************.js 5.49 kB 0 B
dotcom-rendering/dist/8829.legacy.********************.js 2.98 kB 0 B
dotcom-rendering/dist/8995.modern.********************.js 5.31 kB 0 B
dotcom-rendering/dist/9030.legacy.********************.js 4.01 kB 0 B
dotcom-rendering/dist/9030.modern.********************.js 3.97 kB 0 B
dotcom-rendering/dist/9259.modern.********************.js 5.62 kB 0 B
dotcom-rendering/dist/9393.legacy.********************.js 4.19 kB 0 B
dotcom-rendering/dist/9394.legacy.********************.js 5.04 kB 0 B
dotcom-rendering/dist/9439.legacy.********************.js 4.94 kB 0 B
dotcom-rendering/dist/9614.legacy.********************.js 21.6 kB 0 B
dotcom-rendering/dist/9661.modern.********************.js 3.79 kB 0 B
dotcom-rendering/dist/9751.legacy.********************.js 5.89 kB 0 B
dotcom-rendering/dist/9789.legacy.********************.js 8.54 kB 0 B
dotcom-rendering/dist/9789.modern.********************.js 8.31 kB 0 B
dotcom-rendering/dist/9861.modern.********************.js 6.21 kB 0 B
dotcom-rendering/dist/9909.legacy.********************.js 4.8 kB 0 B
dotcom-rendering/dist/9933.legacy.********************.js 9.14 kB 0 B
dotcom-rendering/dist/9933.modern.********************.js 8.61 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.legacy.********************.js 5.72 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.modern.********************.js 5.72 kB 0 B
dotcom-rendering/dist/atomIframe.legacy.********************.js 13.5 kB 0 B
dotcom-rendering/dist/atomIframe.modern.********************.js 13.4 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.legacy.********************.js 524 B 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.modern.********************.js 485 B 0 B
dotcom-rendering/dist/bootCmp.legacy.********************.js 36.9 kB 0 B
dotcom-rendering/dist/bootCmp.modern.********************.js 33.1 kB 0 B
dotcom-rendering/dist/Branding-importable.legacy.********************.js 7.89 kB 0 B
dotcom-rendering/dist/Branding-importable.modern.********************.js 7.88 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.legacy.********************.js 36.9 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.modern.********************.js 36.9 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.legacy.********************.js 9.11 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.modern.********************.js 8.1 kB 0 B
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.legacy.********************.js 4.94 kB 0 B
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.modern.********************.js 4.65 kB 0 B
dotcom-rendering/dist/Carousel-importable.legacy.********************.js 4.77 kB 0 B
dotcom-rendering/dist/Carousel-importable.modern.********************.js 4.59 kB 0 B
dotcom-rendering/dist/ChartAtomWrapper-importable.legacy.********************.js 284 B 0 B
dotcom-rendering/dist/ChartAtomWrapper-importable.modern.********************.js 275 B 0 B
dotcom-rendering/dist/CommentCount-importable.legacy.********************.js 2.92 kB 0 B
dotcom-rendering/dist/CommentCount-importable.modern.********************.js 2.92 kB 0 B
dotcom-rendering/dist/CommercialMetrics-importable.legacy.********************.js 3.52 kB 0 B
dotcom-rendering/dist/CommercialMetrics-importable.modern.********************.js 3.49 kB 0 B
dotcom-rendering/dist/CoreVitals-importable.legacy.********************.js 3.62 kB 0 B
dotcom-rendering/dist/CoreVitals-importable.modern.********************.js 3.07 kB 0 B
dotcom-rendering/dist/debug.js 1.75 kB -4 B (0%)
dotcom-rendering/dist/DiscussionContainer-importable.legacy.********************.js 3.87 kB 0 B
dotcom-rendering/dist/DiscussionContainer-importable.modern.********************.js 3.61 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.legacy.********************.js 2.25 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.modern.********************.js 2.21 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.legacy.********************.js 1.67 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.modern.********************.js 1.59 kB 0 B
dotcom-rendering/dist/dynamicImport.legacy.********************.js 22 kB 0 B
dotcom-rendering/dist/dynamicImport.modern.********************.js 21.6 kB 0 B
dotcom-rendering/dist/EditionDropdown-importable.legacy.********************.js 2.36 kB 0 B
dotcom-rendering/dist/EditionDropdown-importable.modern.********************.js 4.53 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.legacy.********************.js 4.35 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.modern.********************.js 3.15 kB 0 B
dotcom-rendering/dist/embedIframe.legacy.********************.js 13.5 kB 0 B
dotcom-rendering/dist/embedIframe.modern.********************.js 13.4 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.legacy.********************.js 7.22 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.modern.********************.js 6.66 kB 0 B
dotcom-rendering/dist/FetchCommentCounts-importable.legacy.********************.js 7.52 kB 0 B
dotcom-rendering/dist/FetchCommentCounts-importable.modern.********************.js 6.99 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.legacy.********************.js 2.76 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.modern.********************.js 2.71 kB 0 B
dotcom-rendering/dist/FilterButton-importable.legacy.********************.js 2.94 kB 0 B
dotcom-rendering/dist/FilterButton-importable.modern.********************.js 2.35 kB 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.legacy.********************.js 794 B 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.modern.********************.js 758 B 0 B
dotcom-rendering/dist/FocusStyles-importable.legacy.********************.js 4.73 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.modern.********************.js 4.67 kB 0 B
dotcom-rendering/dist/frontend.server.js 426 kB +1 B (0%)
dotcom-rendering/dist/ga.legacy.********************.js 20 kB 0 B
dotcom-rendering/dist/ga.modern.********************.js 19.3 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.legacy.********************.js 2.17 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.modern.********************.js 2.1 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.legacy.********************.js 7.83 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.modern.********************.js 7.71 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.legacy.********************.js 5.36 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.modern.********************.js 4.58 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.legacy.********************.js 2.92 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.modern.********************.js 2.83 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.legacy.********************.js 11.8 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.modern.********************.js 11.6 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.legacy.********************.js 10.1 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.modern.********************.js 9.8 kB 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.legacy.********************.js 285 B 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.modern.********************.js 277 B 0 B
dotcom-rendering/dist/HeaderTopBar-importable.legacy.********************.js 9.96 kB 0 B
dotcom-rendering/dist/HeaderTopBar-importable.modern.********************.js 10.9 kB 0 B
dotcom-rendering/dist/initDiscussion.legacy.********************.js 32.1 kB -3 B (0%)
dotcom-rendering/dist/initDiscussion.modern.********************.js 29 kB 0 B
dotcom-rendering/dist/InstagramBlockComponent-importable.legacy.********************.js 5.84 kB 0 B
dotcom-rendering/dist/InstagramBlockComponent-importable.modern.********************.js 4.75 kB 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.legacy.********************.js 4.53 kB 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.modern.********************.js 4.37 kB 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.legacy.********************.js 7.21 kB 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.modern.********************.js 6.61 kB 0 B
dotcom-rendering/dist/islands.legacy.********************.js 33 kB 0 B
dotcom-rendering/dist/islands.modern.********************.js 29.5 kB -3 B (0%)
dotcom-rendering/dist/KeyEventsCarousel-importable.legacy.********************.js 2 kB 0 B
dotcom-rendering/dist/KeyEventsCarousel-importable.modern.********************.js 1.98 kB 0 B
dotcom-rendering/dist/KnowledgeQuizAtomWrapper-importable.legacy.********************.js 289 B 0 B
dotcom-rendering/dist/KnowledgeQuizAtomWrapper-importable.modern.********************.js 281 B 0 B
dotcom-rendering/dist/LabsHeader-importable.legacy.********************.js 5.22 kB 0 B
dotcom-rendering/dist/LabsHeader-importable.modern.********************.js 5.51 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.legacy.********************.js 2.03 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.modern.********************.js 1.97 kB 0 B
dotcom-rendering/dist/Liveness-importable.legacy.********************.js 7.3 kB 0 B
dotcom-rendering/dist/Liveness-importable.modern.********************.js 6.34 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.legacy.********************.js 3.08 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.modern.********************.js 5.25 kB 0 B
dotcom-rendering/dist/MostViewedFooter-importable.legacy.********************.js 4.92 kB 0 B
dotcom-rendering/dist/MostViewedFooter-importable.modern.********************.js 4.85 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.legacy.********************.js 7.42 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.modern.********************.js 7.3 kB 0 B
dotcom-rendering/dist/MostViewedRightWrapper-importable.legacy.********************.js 5.63 kB 0 B
dotcom-rendering/dist/MostViewedRightWrapper-importable.modern.********************.js 5.4 kB 0 B
dotcom-rendering/dist/newsletterEmbedIframe.legacy.********************.js 12.4 kB 0 B
dotcom-rendering/dist/newsletterEmbedIframe.modern.********************.js 12.4 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.legacy.********************.js 7.89 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.modern.********************.js 7.59 kB 0 B
dotcom-rendering/dist/ophan.legacy.********************.js 24.9 kB 0 B
dotcom-rendering/dist/ophan.modern.********************.js 24.1 kB 0 B
dotcom-rendering/dist/PersonalityQuizAtomWrapper-importable.legacy.********************.js 291 B 0 B
dotcom-rendering/dist/PersonalityQuizAtomWrapper-importable.modern.********************.js 284 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.legacy.********************.js 284 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.modern.********************.js 276 B 0 B
dotcom-rendering/dist/PulsingDot-importable.legacy.********************.js 2.31 kB 0 B
dotcom-rendering/dist/PulsingDot-importable.modern.********************.js 1.7 kB 0 B
dotcom-rendering/dist/QandaAtomWrapper-importable.legacy.********************.js 283 B 0 B
dotcom-rendering/dist/QandaAtomWrapper-importable.modern.********************.js 275 B 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.legacy.********************.js 4.64 kB 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.modern.********************.js 4.63 kB 0 B
dotcom-rendering/dist/readerRevenueDevUtils.legacy.********************.js 3.97 kB 0 B
dotcom-rendering/dist/readerRevenueDevUtils.modern.********************.js 3.64 kB 0 B
dotcom-rendering/dist/ReaderRevenueLinks-importable.legacy.********************.js 5.92 kB 0 B
dotcom-rendering/dist/ReaderRevenueLinks-importable.modern.********************.js 5.56 kB 0 B
dotcom-rendering/dist/RecipeMultiplier-importable.legacy.********************.js 5.7 kB 0 B
dotcom-rendering/dist/RecipeMultiplier-importable.modern.********************.js 4.59 kB 0 B
dotcom-rendering/dist/relativeTime.legacy.********************.js 12.5 kB 0 B
dotcom-rendering/dist/relativeTime.modern.********************.js 12.1 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.legacy.********************.js 5.26 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.modern.********************.js 5.81 kB 0 B
dotcom-rendering/dist/SecureSignupIframe-importable.legacy.********************.js 3.1 kB 0 B
dotcom-rendering/dist/SecureSignupIframe-importable.modern.********************.js 2.8 kB 0 B
dotcom-rendering/dist/sentry.legacy.********************.js 791 B 0 B
dotcom-rendering/dist/sentry.modern.********************.js 789 B 0 B
dotcom-rendering/dist/sentryLoader.legacy.********************.js 37.7 kB 0 B
dotcom-rendering/dist/sentryLoader.modern.********************.js 33.6 kB 0 B
dotcom-rendering/dist/SetABTests-importable.legacy.********************.js 5.66 kB 0 B
dotcom-rendering/dist/SetABTests-importable.modern.********************.js 5.64 kB 0 B
dotcom-rendering/dist/ShareCount-importable.legacy.********************.js 1.64 kB 0 B
dotcom-rendering/dist/ShareCount-importable.modern.********************.js 1.62 kB 0 B
dotcom-rendering/dist/shimport.legacy.********************.js 9.53 kB 0 B
dotcom-rendering/dist/shimport.modern.********************.js 6.87 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.legacy.********************.js 1.64 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.modern.********************.js 1.07 kB 0 B
dotcom-rendering/dist/ShowMore-importable.legacy.********************.js 6.59 kB 0 B
dotcom-rendering/dist/ShowMore-importable.modern.********************.js 6.51 kB 0 B
dotcom-rendering/dist/SignInGateMain.legacy.********************.js 5.21 kB 0 B
dotcom-rendering/dist/SignInGateMain.modern.********************.js 4.92 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.legacy.********************.js 4.43 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.modern.********************.js 4.14 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.legacy.********************.js 3.03 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.modern.********************.js 4.56 kB 0 B
dotcom-rendering/dist/Snow-importable.legacy.********************.js 7.18 kB 0 B
dotcom-rendering/dist/Snow-importable.modern.********************.js 6.6 kB 0 B
dotcom-rendering/dist/SpotifyBlockComponent-importable.legacy.********************.js 3 kB 0 B
dotcom-rendering/dist/SpotifyBlockComponent-importable.modern.********************.js 5.17 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.legacy.********************.js 8.58 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.modern.********************.js 9.59 kB 0 B
dotcom-rendering/dist/SubNav-importable.legacy.********************.js 3.65 kB 0 B
dotcom-rendering/dist/SubNav-importable.modern.********************.js 3.06 kB 0 B
dotcom-rendering/dist/SupportTheG-importable.legacy.********************.js 5.88 kB 0 B
dotcom-rendering/dist/SupportTheG-importable.modern.********************.js 5.51 kB 0 B
dotcom-rendering/dist/TimelineAtomWrapper-importable.legacy.********************.js 284 B 0 B
dotcom-rendering/dist/TimelineAtomWrapper-importable.modern.********************.js 276 B 0 B
dotcom-rendering/dist/TopicFilterBank-importable.legacy.********************.js 1.76 kB 0 B
dotcom-rendering/dist/TopicFilterBank-importable.modern.********************.js 1.7 kB 0 B
dotcom-rendering/dist/TopRightAdSlot-importable.legacy.********************.js 1.98 kB 0 B
dotcom-rendering/dist/TopRightAdSlot-importable.modern.********************.js 1.98 kB 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.legacy.********************.js 826 B 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.modern.********************.js 833 B 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.legacy.********************.js 5.85 kB 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.modern.********************.js 4.76 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.legacy.********************.js 3.09 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.modern.********************.js 5.27 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.legacy.********************.js 5.64 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.modern.********************.js 4.52 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.legacy.********************.js 7.05 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.modern.********************.js 6.76 kB 0 B

compressed-size-action

const onSelectFile = async (event: React.ChangeEvent<HTMLInputElement>) => {
if (event.target.files && event.target.files[0]) {
if (event.target.files?.[0]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The && operator seemed unnecessary here, hence I removed it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We even have a proposal to enforce this in the future: #6715

@tkgnm tkgnm marked this pull request as ready for review December 9, 2022 15:25
@tkgnm tkgnm requested a review from a team as a code owner December 9, 2022 15:25
@tkgnm tkgnm marked this pull request as draft December 9, 2022 16:48
@tkgnm
Copy link
Contributor Author

tkgnm commented Dec 9, 2022

Moved back to draft whilst we figure out what caused a bug in a previous PR

@tkgnm tkgnm marked this pull request as ready for review December 12, 2022 12:10
@tkgnm tkgnm changed the title Callouts: Add custom upload button, separate new/legacy components into two folders Callouts: Add custom upload button, deadline component and separate new/legacy components into two folders Dec 19, 2022
Copy link
Contributor

@abeddow91 abeddow91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great! a couple of small tweaks but otherwise its great work 🥳

return (second.getTime() - first.getTime()) / ONE_DAY;
}

export const getDeadlineText = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we actually exporting this function? if not we can lose the export key word


function formatOptionalDate(date: number | undefined): Date | undefined {
if (date === undefined) return undefined;
const d = new Date(date * 1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to store this into a const, we can just return this line 👍

};

export const FileUpload = ({ formField, formData, setFormData }: Props) => {
const customUpload = (format: ArticleFormat): SerializedStyles => css`
${textSans.small()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presuming we don't need this as we have another text declaration below on line 59


const deadlineStyles = css`
${textSans.xxsmall()};
color: ${palette.brand};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think color can go

@tkgnm tkgnm changed the title Callouts: Add custom upload button, deadline component and separate new/legacy components into two folders Callouts in DCR: Add deadline component and separate new/legacy components into two folders Dec 20, 2022
@tkgnm tkgnm changed the title Callouts in DCR: Add deadline component and separate new/legacy components into two folders Callouts in DCR - PR #1 - Add deadline component and separate new/legacy components into two folders Dec 23, 2022
@tkgnm tkgnm changed the title Callouts in DCR - PR #1 - Add deadline component and separate new/legacy components into two folders Callouts in DCR - PR 1/5 - Add deadline component and separate new/legacy components into two folders Dec 23, 2022
@tkgnm tkgnm requested a review from mxdvl December 23, 2022 17:04
Copy link
Contributor

@Georges-GNM Georges-GNM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall!
Aside from the question about which folder some of the components are in, I remember speaking about what to rename the legacy component and saying there was no set rule to my knowledge - in hindsight, I'd say it would be helpful if CalloutEmbed could be called something like LegacyCalloutEmbed to highlight its status.

@tkgnm
Copy link
Contributor Author

tkgnm commented Dec 28, 2022

This looks good overall! Aside from the question about which folder some of the components are in, I remember speaking about what to rename the legacy component and saying there was no set rule to my knowledge - in hindsight, I'd say it would be helpful if CalloutEmbed could be called something like LegacyCalloutEmbed to highlight its status.

Thanks for the approval @Georges-GNM - everything in the folder CalloutEmbed (including the old form fields) is going to be deleted from the codebase as soon as this piece of work is done (so hopefully early Jan). We're not going to use those form fields hence they're under the CalloutEmbed folder. That's a good point on the naming - I think given that these are all to be deleted imminently anyway, it's probably not worth worrying about too much.

@tkgnm tkgnm merged commit 6c86cb1 into main Jan 3, 2023
@tkgnm tkgnm deleted the tom-king-add-custom-upload-make-legacy-callout-folders branch January 3, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants