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

Moar articles review cleanup #2005

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{
"id": "articleForm.noClaimDescript",
"description": "Message overlay to tell the user they must complete additional fields to unlock this area",
"defaultMessage": "Start by adding Claim information for this Fact-Check"
"defaultMessage": "Start by adding Claim information<br />for this Fact-Check"
},
{
"id": "mediaFactCheck.factCheck",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"description": "Banner displayed after an article is successfully removed from an item.",
"defaultMessage": "Article successfully removed from item."
},
{
"id": "removeArticleButton.tooltip",
"description": "Tooltip message displayed on remove article button.",
"defaultMessage": "Remove article from media cluster"
},
{
"id": "removeArticleButton.confirmationDialogTitle",
"description": "Title displayed on a confirmation modal when a user tries to remove an article.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
{
"id": "projectsComponent.allItems",
"description": "Label for the 'All items' list displayed on the left sidebar",
"defaultMessage": "All"
"description": "Label for the 'All media' list displayed on the left sidebar",
"defaultMessage": "All Media"
},
{
"id": "projectsComponent.assignedToMe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@
{
"id": "bulkActionsMenu.action",
"description": "Button for popping the actions menu. User has to pick which action to perform upon currently selected items.",
"defaultMessage": "Action"
"defaultMessage": "Bulk Change [{count}]"
}
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"id": "search.allClaimsTitle",
"description": "Page title for listing all items in check",
"defaultMessage": "All items"
"description": "Page title for listing all media items in check",
"defaultMessage": "All Media"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
"description": "Pagination count of items returned",
"defaultMessage": "{count, plural, one {1 / 1} other {{from} - {to} / #}}"
},
{
"id": "searchResults.withSelection",
"description": "Label for number of selected items",
"defaultMessage": "{selectedCount, plural, one {(# selected)} other {(# selected)}}"
},
{
"id": "search.nextPage",
"description": "Pagination button to go to next page",
Expand Down
2 changes: 1 addition & 1 deletion localization/react-intl/src/app/components/task/Tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "tasks.blankAnnotation",
"description": "A message that appears when the Annotation menu is opened but no Annotation fields have been created in the project settings.",
"defaultMessage": "No annotation fields"
"defaultMessage": "No Workspace Annotations"
},
{
"id": "tasks.goToSettings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
{
"id": "teamMetadataRender.blankAnnotations",
"description": "Text for empty annotations",
"defaultMessage": "No annotation fields"
"defaultMessage": "No Workspace Annotations"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"description": "Pagination button to go to next page",
"defaultMessage": "Next page"
},
{
"id": "teamTagsComponent.blank",
"description": "Message displayed when there are no tags in the workspace",
"defaultMessage": "No Workspace Tags"
},
{
"id": "teamTagsComponent.tableHeaderName",
"description": "Column header in tags table.",
Expand Down
19 changes: 7 additions & 12 deletions localization/react-intl/src/app/components/user/UserPrivacy.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,19 @@
"defaultMessage": "Please review our {ppLink} to learn how {appName} uses and stores your information."
},
{
"id": "userPrivacy.seeInformationText",
"description": "Description of what the app will do when the user requests their information",
"defaultMessage": "We will send you a file with the content and data you created and generated on {appName}. This can be kept for your records or transferred to another service."
"id": "userPrivacy.userRequests",
"description": "Title for area instructing how to request data from Check",
"defaultMessage": "User Information Requests"
},
{
"id": "userPrivacy.seeInformationButton",
"description": "Button text for the user to see their privacy information",
"defaultMessage": "See my information"
"id": "userPrivacy.seeInformationText",
"description": "Description of what the app will do when the user requests their information",
"defaultMessage": "Request a file with the content and data you created and generated on {appName} by contacting <a href=\"mailto:{privacyEmail}?subject=Send information\">{privacyEmail}</a>."
},
{
"id": "userPrivacy.stopProcessingText",
"description": "Help text to tell the user how they can request a change to their privacy settings",
"defaultMessage": "You can request {appName} to stop processing your information under certain conditions."
},
{
"id": "userPrivacy.stopProcessingButton",
"description": "Button text for the user to request a change to their privacy settings",
"defaultMessage": "Request to stop processing"
"defaultMessage": "Request {appName} to stop processing your information under certain conditions by contacting <a href=\"mailto:{privacyEmail}?subject=Stop processing\">{privacyEmail}</a>."
},
{
"id": "userPrivacy.connectedAccounts",
Expand Down
18 changes: 7 additions & 11 deletions src/app/components/article/ArticleForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import { graphql, createFragmentContainer } from 'react-relay/compat';
import PropTypes from 'prop-types';
import { FormattedMessage, FormattedDate } from 'react-intl';
import { FormattedMessage, FormattedHTMLMessage, FormattedDate } from 'react-intl';
import Slideout from '../cds/slideout/Slideout';
import ButtonMain from '../cds/buttons-checkboxes-chips/ButtonMain';
import IconReport from '../../icons/fact_check.svg';
Expand Down Expand Up @@ -258,16 +258,12 @@ const ArticleForm = ({
}
<div className={styles['article-form-container']}>
{ claimDescriptionMissing && articleType === 'fact-check' ?
<div className={styles['article-form-no-claim-overlay']}>
<div className={styles['article-form-no-claim-container']}>
<div className="typography-subtitle2">
<FormattedMessage
id="articleForm.noClaimDescript"
defaultMessage="Start by adding Claim information for this Fact-Check"
description="Message overlay to tell the user they must complete additional fields to unlock this area"
/>
</div>
</div>
<div className={styles['article-form-no-claim-container']}>
<FormattedHTMLMessage
id="articleForm.noClaimDescript"
defaultMessage="Start by adding Claim information<br />for this Fact-Check"
description="Message overlay to tell the user they must complete additional fields to unlock this area"
/>
</div>
: null
}
Expand Down
38 changes: 25 additions & 13 deletions src/app/components/article/ArticleForm.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,40 @@
position: relative;
}

.article-form-no-claim-overlay {
background: rgba(255 255 255 / .8);
bottom: 0;
left: 0;
position: absolute;
right: 0;
text-align: center;
top: 0;
z-index: 10;
}

.article-rating-wrapper {
display: flex;
gap: 4px;
padding-bottom: 5px;
}

.article-form-no-claim-container {
bottom: 0;
color: var(--color-blue-32);
margin: 0 20px;
left: 0;
position: absolute;
top: 30%;
right: 0;
text-align: center;
top: 0;

span {
@mixin typography-subtitle2;
display: block;
margin: 80px 0 0;
position: relative;
z-index: 11;
}

&::after {
background-color: rgba(255 255 255 / .85);
bottom: 0;
content: '';
left: 0;
position: absolute;
right: 0;
text-align: center;
top: 0;
z-index: 10;
}
}

.article-form-info {
Expand Down
50 changes: 44 additions & 6 deletions src/app/components/article/Articles.module.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
.articlesSidebar {
padding: 16px;
display: flex;
flex: 1;
flex-direction: column;
overflow-y: auto;
position: relative;
width: 100%;

&::after {
background-color: var(--color-beige-86);
content: '';
display: block;
height: 2px;
left: 0;
position: absolute;
right: 16px;
top: 62px;
z-index: 1;
}

.articlesSidebarTopBar {
background: var(--color-white-100);
display: flex;
gap: 16px;
height: 62px;
justify-content: flex-end;
padding: 16px;
}

.articlesSidebarNoArticleWrapper {
display: flex;
flex: 1 1 auto;
flex-direction: column;
gap: 16px;
overflow-y: auto;
padding: 0 16px 16px;
width: 100%;

&::before {
background-color: var(--color-white-100);
content: '';
display: block;
flex-shrink: 0;
height: 2px;
left: 0;
margin: auto -16px 0;
position: relative;
right: 0;
z-index: 2;
}
}

.articlesSidebarNoArticle {
Expand All @@ -16,11 +59,6 @@
text-align: center;
}

.articlesSidebarListComponent {
max-height: 400px;
overflow: auto;
}

.articlesSidebarList {
display: flex;
flex-direction: column;
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/article/ChooseExistingArticleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const ChooseExistingArticleButton = ({ teamSlug, onAdd }) => {
{ openSlideout && (
<Slideout
title={title}
showCancel
footer
content={
<div className={styles.contentWrapper}>
<FormattedMessage
Expand Down
8 changes: 3 additions & 5 deletions src/app/components/article/MediaArticles.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const MediaArticlesComponent = ({
{ hasArticle ? (
<MediaArticlesDisplay projectMedia={projectMedia} />
) : (
<>
<div className={cx('typography-body1', styles.articlesSidebarNoArticleWrapper)}>
<div className={cx('typography-body1', styles.articlesSidebarNoArticle)}>
<DescriptionIcon style={{ fontSize: 'var(--font-size-h4)' }} />
<div>
Expand All @@ -151,10 +151,8 @@ const MediaArticlesComponent = ({
description="Message displayed on articles sidebar when an item has no articles."
/>
</div>
<div className={styles.articlesSidebarListComponent}>
<MediaArticlesTeamArticles teamSlug={team.slug} onAdd={handleConfirmAdd} />
</div>
</>
<MediaArticlesTeamArticles teamSlug={team.slug} onAdd={handleConfirmAdd} />
</div>
)}

{/* Confirm dialog for replacing fact-check */}
Expand Down
18 changes: 17 additions & 1 deletion src/app/components/article/MediaArticlesDisplay.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
.mediaArticlesDisplay {
display: flex;
flex: 1 1 auto;
flex-direction: column;
gap: 16px;
margin-top: 16px;
overflow-y: auto;
padding: 0 16px 16px;
width: 100%;

&::before {
background-color: var(--color-white-100);
content: '';
display: block;
flex-shrink: 0;
height: 2px;
left: 0;
margin: auto -16px 0;
position: relative;
right: 0;
z-index: 2;
}
}

.explainerCard:hover {
Expand Down
28 changes: 21 additions & 7 deletions src/app/components/article/RemoveArticleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const RemoveArticleWrapperButton = ({ disabled, children }) => {
return (
<Tooltip
key="remove-article-button"
placement="top"
title={
<FormattedMessage
id="removedArticleButton.tooltip"
Expand Down Expand Up @@ -153,12 +152,27 @@ const RemoveArticleButton = ({
return (
<>
<RemoveArticleWrapperButton disabled={disabled}>
<ButtonMain
size="small"
theme="text"
iconCenter={<IconClose />}
onClick={() => setOpenDialog(true)}
/>
<Tooltip
disableHoverListener={disabled}
key="remove-article-button"
title={
<FormattedMessage
id="removeArticleButton.tooltip"
defaultMessage="Remove article from media cluster"
description="Tooltip message displayed on remove article button."
/>
}
arrow
>
<span>
<ButtonMain
size="small"
theme="text"
iconCenter={<IconClose />}
onClick={() => setOpenDialog(true)}
/>
</span>
</Tooltip>
</RemoveArticleWrapperButton>
<ConfirmProceedDialog
open={openDialog}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/cds/slideout/Slideout.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const Slideout = ({

Slideout.defaultProps = {
content: null,
footer: true,
footer: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sarahkeh somethign to get your eyes on specifically is this change to the slideout that I made. I noticed that if there is a slideout with no buttons or info, then the footer is still shown, just empty. So i figured its better to be opt-in instead of out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, does footer need to be its own boolean prop or instead showing the footer or not can/should be simply inferred from the existence of footer content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably better answered/addressed by @sarahkeh as the author of that component, but seems reasonable

Copy link
Contributor

Choose a reason for hiding this comment

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

It could probably be removed, my thinking was it could be easier in some instances where the slideout contains several buttons but might need to be hidden for certain users or in certain states to just set one value. But I'm not sure that's necessary, could definitely update it to just check if any of the buttons are there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. That's more of a suggestion than a requirement. If it's going to be too much trouble, let it be

showCancel: false,
cancelProps: {},
mainActionButton: null,
Expand Down
1 change: 1 addition & 0 deletions src/app/components/cds/slideout/Slideout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('<Slideout />', () => {
const wrapper = mountWithIntl(<Slideout
title="Slideout Title"
content="Slideout content"
footer
showCancel
onClose={() => {}}
/>);
Expand Down
Loading