merge bis + fix merge conflicts

This commit is contained in:
ronronscelestes 2022-01-28 14:45:51 +01:00
commit 31ea7896ca
33 changed files with 339 additions and 258 deletions

View File

@ -23,6 +23,10 @@ const Wrapper = styled.div`
margin-block-end: 10px; margin-block-end: 10px;
} }
p {
margin-bottom: 10px;
}
h1 { h1 {
font-size: ${36 / 16}rem; font-size: ${36 / 16}rem;
font-weight: 600; font-weight: 600;

View File

@ -20,7 +20,7 @@ loadCss();
const md = new Markdown({ const md = new Markdown({
html: true, // Enable HTML tags in source html: true, // Enable HTML tags in source
xhtmlOut: false, xhtmlOut: false,
breaks: false, breaks: true,
langPrefix: 'language-', langPrefix: 'language-',
linkify: true, linkify: true,
typographer: true, typographer: true,

View File

@ -12,6 +12,7 @@ const Editor = ({
editorRef, editorRef,
error, error,
isPreviewMode, isPreviewMode,
isExpandMode,
name, name,
onChange, onChange,
placeholder, placeholder,
@ -64,7 +65,7 @@ const Editor = ({
return ( return (
<EditorAndPreviewWrapper> <EditorAndPreviewWrapper>
<EditorStylesContainer disabled={disabled || isPreviewMode}> <EditorStylesContainer isExpandMode={isExpandMode} disabled={disabled || isPreviewMode}>
<textarea ref={textareaRef} /> <textarea ref={textareaRef} />
</EditorStylesContainer> </EditorStylesContainer>
{isPreviewMode && <PreviewWysiwyg data={value} />} {isPreviewMode && <PreviewWysiwyg data={value} />}
@ -76,6 +77,7 @@ Editor.defaultProps = {
disabled: false, disabled: false,
error: undefined, error: undefined,
isPreviewMode: false, isPreviewMode: false,
isExpandMode: false,
placeholder: '', placeholder: '',
value: '', value: '',
}; };
@ -85,6 +87,7 @@ Editor.propTypes = {
editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired, editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired,
error: PropTypes.string, error: PropTypes.string,
isPreviewMode: PropTypes.bool, isPreviewMode: PropTypes.bool,
isExpandMode: PropTypes.bool,
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
placeholder: PropTypes.string, placeholder: PropTypes.string,

View File

@ -4,6 +4,7 @@ import styled from 'styled-components';
/* stylelint-disable */ /* stylelint-disable */
export const EditorStylesContainer = styled.div` export const EditorStylesContainer = styled.div`
cursor: ${({ disabled }) => (disabled ? 'not-allowed !important' : 'auto')}; cursor: ${({ disabled }) => (disabled ? 'not-allowed !important' : 'auto')};
height: 100%;
/* BASICS */ /* BASICS */
.CodeMirror-placeholder { .CodeMirror-placeholder {
color: ${({ theme }) => theme.colors.neutral600} !important; color: ${({ theme }) => theme.colors.neutral600} !important;
@ -12,7 +13,7 @@ export const EditorStylesContainer = styled.div`
.CodeMirror { .CodeMirror {
/* Set height, width, borders, and global font properties here */ /* Set height, width, borders, and global font properties here */
font-size: ${14 / 16}rem; font-size: ${14 / 16}rem;
height: 290px; height: ${({ isExpandMode }) => (isExpandMode ? '100%' : '290px')};
color: ${({ theme }) => theme.colors.neutral800}; color: ${({ theme }) => theme.colors.neutral800};
direction: ltr; direction: ltr;
font-family: --apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, font-family: --apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,

View File

@ -28,7 +28,9 @@ import {
} from './WysiwygStyles'; } from './WysiwygStyles';
const WysiwygNav = ({ const WysiwygNav = ({
disabled,
editorRef, editorRef,
isExpandMode,
isPreviewMode, isPreviewMode,
onActionClick, onActionClick,
onToggleMediaLib, onToggleMediaLib,
@ -46,7 +48,7 @@ const WysiwygNav = ({
setVisiblePopover(prev => !prev); setVisiblePopover(prev => !prev);
}; };
if (isPreviewMode) { if (disabled || isPreviewMode) {
return ( return (
<Box padding={2} background="neutral100"> <Box padding={2} background="neutral100">
<Flex justifyContent="space-between"> <Flex justifyContent="space-between">
@ -87,12 +89,14 @@ const WysiwygNav = ({
<MoreButton disabled id="more" label="More" icon={<More />} /> <MoreButton disabled id="more" label="More" icon={<More />} />
</Flex> </Flex>
{!isExpandMode && (
<Button onClick={onTogglePreviewMode} variant="tertiary" id="preview"> <Button onClick={onTogglePreviewMode} variant="tertiary" id="preview">
{formatMessage({ {formatMessage({
id: 'components.Wysiwyg.ToggleMode.markdown-mode', id: 'components.Wysiwyg.ToggleMode.markdown-mode',
defaultMessage: 'Markdown mode', defaultMessage: 'Markdown mode',
})} })}
</Button> </Button>
)}
</Flex> </Flex>
</Box> </Box>
); );
@ -149,7 +153,7 @@ const WysiwygNav = ({
/> />
{visiblePopover && ( {visiblePopover && (
<Popover centered source={buttonMoreRef} spacing={4} id="popover"> <Popover centered source={buttonMoreRef} spacing={4} id="popover">
<FocusTrap onEscape={handleTogglePopover}> <FocusTrap onEscape={handleTogglePopover} restoreFocus={false}>
<Flex> <Flex>
<IconButtonGroupMargin> <IconButtonGroupMargin>
<CustomIconButton <CustomIconButton
@ -235,7 +239,9 @@ WysiwygNav.defaultProps = {
}; };
WysiwygNav.propTypes = { WysiwygNav.propTypes = {
disabled: PropTypes.bool.isRequired,
editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired, editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired,
isExpandMode: PropTypes.bool.isRequired,
isPreviewMode: PropTypes.bool, isPreviewMode: PropTypes.bool,
onActionClick: PropTypes.func, onActionClick: PropTypes.func,
onToggleMediaLib: PropTypes.func, onToggleMediaLib: PropTypes.func,

View File

@ -45,6 +45,7 @@ export const IconButtonGroupMargin = styled(IconButtonGroup)`
export const EditorAndPreviewWrapper = styled.div` export const EditorAndPreviewWrapper = styled.div`
position: relative; position: relative;
height: calc(100% - 48px);
`; `;
// FOOTER // FOOTER

View File

@ -144,15 +144,18 @@ const Wysiwyg = ({
onCollapse={handleToggleExpand} onCollapse={handleToggleExpand}
> >
<WysiwygNav <WysiwygNav
isExpandMode={isExpandMode}
editorRef={editorRef} editorRef={editorRef}
isPreviewMode={isPreviewMode} isPreviewMode={isPreviewMode}
onActionClick={handleActionClick} onActionClick={handleActionClick}
onToggleMediaLib={handleToggleMediaLib} onToggleMediaLib={handleToggleMediaLib}
onTogglePreviewMode={isExpandMode ? undefined : handleTogglePreviewMode} onTogglePreviewMode={isExpandMode ? undefined : handleTogglePreviewMode}
disabled={disabled}
/> />
<Editor <Editor
disabled={disabled} disabled={disabled}
isExpandMode={isExpandMode}
editorRef={editorRef} editorRef={editorRef}
error={errorMessage} error={errorMessage}
isPreviewMode={isPreviewMode} isPreviewMode={isPreviewMode}
@ -185,7 +188,7 @@ const Wysiwyg = ({
Wysiwyg.defaultProps = { Wysiwyg.defaultProps = {
description: null, description: null,
disabled: true, disabled: false,
error: '', error: '',
labelAction: undefined, labelAction: undefined,
placeholder: null, placeholder: null,

View File

@ -1,7 +1,8 @@
import * as React from 'react'; import * as React from 'react';
import { IntlProvider } from 'react-intl'; import { IntlProvider } from 'react-intl';
import { render, waitFor, fireEvent } from '@testing-library/react'; import { render, waitFor, fireEvent } from '@testing-library/react';
import { lightTheme, ThemeProvider } from '@strapi/design-system'; import { ThemeProvider } from '@strapi/design-system/ThemeProvider';
import { lightTheme } from '@strapi/design-system/themes';
import Wysiwyg from '../index'; import Wysiwyg from '../index';
jest.mock('@strapi/helper-plugin', () => ({ jest.mock('@strapi/helper-plugin', () => ({
@ -39,6 +40,7 @@ describe('Wysiwyg render and actions buttons', () => {
name="rich-text" name="rich-text"
intlLabel={{ id: 'hello world', defaultMessage: 'hello world' }} intlLabel={{ id: 'hello world', defaultMessage: 'hello world' }}
onChange={onChange} onChange={onChange}
disabled={false}
/> />
</IntlProvider> </IntlProvider>
</ThemeProvider> </ThemeProvider>
@ -203,7 +205,7 @@ describe('Wysiwyg render and actions buttons', () => {
background: #ffffff; background: #ffffff;
} }
.c28 .sc-BHvUt { .c28 .sc-pVTFL {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -607,7 +609,8 @@ describe('Wysiwyg render and actions buttons', () => {
} }
.c32 { .c32 {
cursor: not-allowed !important; cursor: auto;
height: 100%;
} }
.c32 .CodeMirror-placeholder { .c32 .CodeMirror-placeholder {
@ -1008,6 +1011,7 @@ describe('Wysiwyg render and actions buttons', () => {
.c31 { .c31 {
position: relative; position: relative;
height: calc(100% - 48px);
} }
.c36 { .c36 {
@ -1238,7 +1242,6 @@ describe('Wysiwyg render and actions buttons', () => {
> >
<div <div
class="c32" class="c32"
disabled=""
> >
<textarea <textarea
style="display: none;" style="display: none;"
@ -1254,8 +1257,6 @@ describe('Wysiwyg render and actions buttons', () => {
aria-label="Editor" aria-label="Editor"
autocapitalize="off" autocapitalize="off"
autocorrect="off" autocorrect="off"
disabled=""
readonly=""
spellcheck="false" spellcheck="false"
style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; min-height: 1em; outline: none;" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; min-height: 1em; outline: none;"
tabindex="0" tabindex="0"

View File

@ -41,9 +41,7 @@ const DisplayedFields = ({ editLayout, editLayoutRemainingFields, onRemoveField,
<Box padding={4} hasRadius borderStyle="dashed" borderWidth="1px" borderColor="neutral300"> <Box padding={4} hasRadius borderStyle="dashed" borderWidth="1px" borderColor="neutral300">
<Stack size={2}> <Stack size={2}>
{editLayout.map((row, index) => ( {editLayout.map((row, index) => (
<React.Fragment key={row.rowId}> <RowsLayout key={row.rowId} row={row} rowIndex={index} onRemoveField={onRemoveField} />
<RowsLayout row={row} rowIndex={index} onRemoveField={onRemoveField} />
</React.Fragment>
))} ))}
<SimpleMenu <SimpleMenu
id="label" id="label"

View File

@ -47,19 +47,18 @@ const ModalForm = ({ onChange }) => {
return formToDisplay.map(meta => { return formToDisplay.map(meta => {
const formType = get(attributes, [selectedField, 'type']); const formType = get(attributes, [selectedField, 'type']);
if (formType === 'dynamiczone' && !['label', 'description'].includes(meta)) { if (
formType === 'dynamiczone' ||
(formType === 'component' && !['label', 'description'].includes(meta))
) {
return null; return null;
} }
if ((formType === 'component' || formType === 'media') && meta !== 'label') { if (formType === 'component' && meta !== 'label') {
return null; return null;
} }
if ((formType === 'json' || formType === 'boolean') && meta === 'placeholder') { if (['media', 'json', 'boolean'].includes(formType) && meta === 'placeholder') {
return null;
}
if (formType === 'richtext' && meta === 'editable') {
return null; return null;
} }

View File

@ -87,12 +87,12 @@
"koa-passport": "4.1.4", "koa-passport": "4.1.4",
"koa-static": "5.0.0", "koa-static": "5.0.0",
"lodash": "4.17.21", "lodash": "4.17.21",
"markdown-it": "^12.0.6", "markdown-it": "^12.3.2",
"markdown-it-abbr": "^1.0.4", "markdown-it-abbr": "^1.0.4",
"markdown-it-container": "^3.0.0", "markdown-it-container": "^3.0.0",
"markdown-it-deflist": "^2.0.3", "markdown-it-deflist": "^2.1.0",
"markdown-it-emoji": "^2.0.0", "markdown-it-emoji": "^2.0.0",
"markdown-it-footnote": "^3.0.2", "markdown-it-footnote": "^3.0.3",
"markdown-it-ins": "^3.0.1", "markdown-it-ins": "^3.0.1",
"markdown-it-mark": "^3.0.1", "markdown-it-mark": "^3.0.1",
"markdown-it-sub": "^1.0.0", "markdown-it-sub": "^1.0.0",

View File

@ -38,6 +38,7 @@ const DateTimePicker = ({
name, name,
required, required,
size, size,
step,
value, value,
...props ...props
}) => { }) => {
@ -146,6 +147,7 @@ const DateTimePicker = ({
onClear={onClear && handleTimeClear} onClear={onClear && handleTimeClear}
clearLabel={clearLabel} clearLabel={clearLabel}
disabled={disabled} disabled={disabled}
step={step}
/> />
</Stack> </Stack>
<FieldHint /> <FieldHint />
@ -168,6 +170,7 @@ DateTimePicker.defaultProps = {
onClear: undefined, onClear: undefined,
required: false, required: false,
size: 'M', size: 'M',
step: 1,
value: undefined, value: undefined,
}; };
@ -184,6 +187,7 @@ DateTimePicker.propTypes = {
onClear: PropTypes.func, onClear: PropTypes.func,
required: PropTypes.bool, required: PropTypes.bool,
size: PropTypes.oneOf(['S', 'M']), size: PropTypes.oneOf(['S', 'M']),
step: PropTypes.number,
value: PropTypes.instanceOf(Date), value: PropTypes.instanceOf(Date),
}; };

View File

@ -146,6 +146,7 @@ const GenericInput = ({
onChange({ target: { name, value: formattedDate, type } }); onChange({ target: { name, value: formattedDate, type } });
}} }}
step={step}
onClear={() => onChange({ target: { name, value: '', type } })} onClear={() => onChange({ target: { name, value: '', type } })}
placeholder={formattedPlaceholder} placeholder={formattedPlaceholder}
required={required} required={required}

View File

@ -12,6 +12,7 @@ import {
CardTitle, CardTitle,
CardSubtitle, CardSubtitle,
} from '@strapi/design-system/Card'; } from '@strapi/design-system/Card';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex'; import { Flex } from '@strapi/design-system/Flex';
import { IconButton } from '@strapi/design-system/IconButton'; import { IconButton } from '@strapi/design-system/IconButton';
import Pencil from '@strapi/icons/Pencil'; import Pencil from '@strapi/icons/Pencil';
@ -68,7 +69,9 @@ export const DocAssetCard = ({ name, extension, selected, onSelect, onEdit, size
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<CardContent> <CardContent>
<Box paddingTop={1}>
<CardTitle as="h2">{name}</CardTitle> <CardTitle as="h2">{name}</CardTitle>
</Box>
<CardSubtitle> <CardSubtitle>
<Extension>{extension}</Extension> <Extension>{extension}</Extension>
</CardSubtitle> </CardSubtitle>

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import styled from 'styled-components'; import styled from 'styled-components';
import { Box } from '@strapi/design-system/Box';
import { import {
Card, Card,
CardAction, CardAction,
@ -58,7 +59,9 @@ export const ImageAssetCard = ({
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<CardContent> <CardContent>
<Box paddingTop={1}>
<CardTitle as="h2">{name}</CardTitle> <CardTitle as="h2">{name}</CardTitle>
</Box>
<CardSubtitle> <CardSubtitle>
<Extension>{extension}</Extension> <Extension>{extension}</Extension>
{height && width && ` - ${height}${width}`} {height && width && ` - ${height}${width}`}

View File

@ -12,6 +12,7 @@ import {
} from '@strapi/design-system/Card'; } from '@strapi/design-system/Card';
import { Typography } from '@strapi/design-system/Typography'; import { Typography } from '@strapi/design-system/Typography';
import { Stack } from '@strapi/design-system/Stack'; import { Stack } from '@strapi/design-system/Stack';
import { Box } from '@strapi/design-system/Box';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { getTrad } from '../../utils'; import { getTrad } from '../../utils';
import { AssetType } from '../../constants'; import { AssetType } from '../../constants';
@ -82,7 +83,9 @@ export const UploadingAssetCard = ({ asset, onCancel, onStatusChange, addUploade
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<CardContent> <CardContent>
<Box paddingTop={1}>
<CardTitle as="h2">{asset.name}</CardTitle> <CardTitle as="h2">{asset.name}</CardTitle>
</Box>
<CardSubtitle> <CardSubtitle>
<Extension>{asset.ext}</Extension> <Extension>{asset.ext}</Extension>
</CardSubtitle> </CardSubtitle>

View File

@ -70,7 +70,9 @@ export const VideoAssetCard = ({
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<CardContent> <CardContent>
<Box paddingTop={1}>
<CardTitle as="h2">{name}</CardTitle> <CardTitle as="h2">{name}</CardTitle>
</Box>
<CardSubtitle> <CardSubtitle>
<Extension>{extension}</Extension> <Extension>{extension}</Extension>
</CardSubtitle> </CardSubtitle>

View File

@ -29,7 +29,7 @@ describe('DocAssetCard', () => {
); );
expect(container).toMatchInlineSnapshot(` expect(container).toMatchInlineSnapshot(`
.c23 { .c24 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -54,7 +54,7 @@ describe('DocAssetCard', () => {
padding-left: 12px; padding-left: 12px;
} }
.c19 { .c20 {
background: #f6f6f9; background: #f6f6f9;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
@ -105,7 +105,7 @@ describe('DocAssetCard', () => {
align-items: flex-start; align-items: flex-start;
} }
.c20 { .c21 {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
@ -123,20 +123,20 @@ describe('DocAssetCard', () => {
align-items: center; align-items: center;
} }
.c15 { .c16 {
font-weight: 600; font-weight: 600;
color: #32324d; color: #32324d;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c16 { .c17 {
color: #666687; color: #666687;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c22 { .c23 {
color: #666687; color: #666687;
font-weight: 600; font-weight: 600;
font-size: 0.6875rem; font-size: 0.6875rem;
@ -144,14 +144,14 @@ describe('DocAssetCard', () => {
text-transform: uppercase; text-transform: uppercase;
} }
.c18 { .c19 {
margin-left: auto; margin-left: auto;
-webkit-flex-shrink: 0; -webkit-flex-shrink: 0;
-ms-flex-negative: 0; -ms-flex-negative: 0;
flex-shrink: 0; flex-shrink: 0;
} }
.c21 { .c22 {
margin-left: 4px; margin-left: 4px;
} }
@ -232,6 +232,10 @@ describe('DocAssetCard', () => {
border-bottom: 1px solid #eaeaef; border-bottom: 1px solid #eaeaef;
} }
.c15 {
padding-top: 4px;
}
.c8 { .c8 {
width: 100%; width: 100%;
height: 5.5rem; height: 5.5rem;
@ -353,7 +357,7 @@ describe('DocAssetCard', () => {
fill: #666687; fill: #666687;
} }
.c17 { .c18 {
text-transform: uppercase; text-transform: uppercase;
} }
@ -447,30 +451,34 @@ describe('DocAssetCard', () => {
<div <div
class="c14" class="c14"
> >
<h2 <div
class="c15" class="c15"
>
<h2
class="c16"
id="card-1-title" id="card-1-title"
> >
hello.png hello.png
</h2> </h2>
</div>
<div <div
class="c16" class="c17"
> >
<span <span
class="c17" class="c18"
> >
png png
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c18" class="c19"
> >
<div <div
class="c19 c20 c21" class="c20 c21 c22"
> >
<span <span
class="c22" class="c23"
> >
Doc Doc
</span> </span>
@ -480,7 +488,7 @@ describe('DocAssetCard', () => {
</div> </div>
</article> </article>
<div <div
class="c23" class="c24"
> >
<p <p
aria-live="polite" aria-live="polite"

View File

@ -31,7 +31,7 @@ describe('ImageAssetCard', () => {
); );
expect(container).toMatchInlineSnapshot(` expect(container).toMatchInlineSnapshot(`
.c21 { .c22 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -43,6 +43,10 @@ describe('ImageAssetCard', () => {
width: 1px; width: 1px;
} }
.c13 {
padding-top: 4px;
}
.c0 { .c0 {
background: #ffffff; background: #ffffff;
border-radius: 4px; border-radius: 4px;
@ -56,7 +60,7 @@ describe('ImageAssetCard', () => {
padding-left: 12px; padding-left: 12px;
} }
.c17 { .c18 {
background: #f6f6f9; background: #f6f6f9;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
@ -107,7 +111,7 @@ describe('ImageAssetCard', () => {
align-items: flex-start; align-items: flex-start;
} }
.c18 { .c19 {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
@ -146,20 +150,20 @@ describe('ImageAssetCard', () => {
background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px; background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px;
} }
.c13 { .c14 {
font-weight: 600; font-weight: 600;
color: #32324d; color: #32324d;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c14 { .c15 {
color: #666687; color: #666687;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c20 { .c21 {
color: #666687; color: #666687;
font-weight: 600; font-weight: 600;
font-size: 0.6875rem; font-size: 0.6875rem;
@ -167,14 +171,14 @@ describe('ImageAssetCard', () => {
text-transform: uppercase; text-transform: uppercase;
} }
.c16 { .c17 {
margin-left: auto; margin-left: auto;
-webkit-flex-shrink: 0; -webkit-flex-shrink: 0;
-ms-flex-negative: 0; -ms-flex-negative: 0;
flex-shrink: 0; flex-shrink: 0;
} }
.c19 { .c20 {
margin-left: 4px; margin-left: 4px;
} }
@ -353,7 +357,7 @@ describe('ImageAssetCard', () => {
fill: #666687; fill: #666687;
} }
.c15 { .c16 {
text-transform: uppercase; text-transform: uppercase;
} }
@ -422,17 +426,21 @@ describe('ImageAssetCard', () => {
<div <div
class="c12" class="c12"
> >
<h2 <div
class="c13" class="c13"
>
<h2
class="c14"
id="card-1-title" id="card-1-title"
> >
hello.png hello.png
</h2> </h2>
</div>
<div <div
class="c14" class="c15"
> >
<span <span
class="c15" class="c16"
> >
png png
</span> </span>
@ -440,13 +448,13 @@ describe('ImageAssetCard', () => {
</div> </div>
</div> </div>
<div <div
class="c16" class="c17"
> >
<div <div
class="c17 c18 c19" class="c18 c19 c20"
> >
<span <span
class="c20" class="c21"
> >
Image Image
</span> </span>
@ -456,7 +464,7 @@ describe('ImageAssetCard', () => {
</div> </div>
</article> </article>
<div <div
class="c21" class="c22"
> >
<p <p
aria-live="polite" aria-live="polite"

View File

@ -11,8 +11,8 @@ export const DialogTitle = () => {
<ModalHeader> <ModalHeader>
<Typography fontWeight="bold" textColor="neutral800" as="h2" id="asset-dialog-title"> <Typography fontWeight="bold" textColor="neutral800" as="h2" id="asset-dialog-title">
{formatMessage({ {formatMessage({
id: getTrad('header.actions.upload-assets'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Typography> </Typography>
</ModalHeader> </ModalHeader>

View File

@ -25,7 +25,7 @@ export const SelectedStep = ({ selectedAssets, onSelectAsset, onReorderAsset })
<Typography variant="pi" textColor="neutral600"> <Typography variant="pi" textColor="neutral600">
{formatMessage({ {formatMessage({
id: getTrad('modal.upload-list.sub-header-subtitle'), id: getTrad('modal.upload-list.sub-header-subtitle'),
defaultMessage: 'Manage the assets before adding them to the Media Library', defaultMessage: 'Manage the assets before uploading them to the Media Library',
})} })}
</Typography> </Typography>
</Stack> </Stack>

View File

@ -127,8 +127,8 @@ export const AssetDialog = ({
canCreate ? ( canCreate ? (
<Button variant="secondary" startIcon={<PlusIcon />} onClick={onAddAsset}> <Button variant="secondary" startIcon={<PlusIcon />} onClick={onAddAsset}>
{formatMessage({ {formatMessage({
id: getTrad('modal.header.browse'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Button> </Button>
) : ( ) : (

View File

@ -130,7 +130,7 @@ describe('MediaLibrary / AssetList', () => {
); );
expect(container).toMatchInlineSnapshot(` expect(container).toMatchInlineSnapshot(`
.c31 { .c32 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -142,12 +142,16 @@ describe('MediaLibrary / AssetList', () => {
width: 1px; width: 1px;
} }
.c26 { .c11 {
padding-top: 4px;
}
.c27 {
width: 100%; width: 100%;
height: 10.25rem; height: 10.25rem;
} }
.c27 { .c28 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -165,7 +169,7 @@ describe('MediaLibrary / AssetList', () => {
align-items: center; align-items: center;
} }
.c21 { .c22 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -190,14 +194,14 @@ describe('MediaLibrary / AssetList', () => {
padding-left: 12px; padding-left: 12px;
} }
.c15 { .c16 {
background: #f6f6f9; background: #f6f6f9;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
min-width: 20px; min-width: 20px;
} }
.c22 { .c23 {
background: #32324d; background: #32324d;
color: #ffffff; color: #ffffff;
padding: 4px; padding: 4px;
@ -242,7 +246,7 @@ describe('MediaLibrary / AssetList', () => {
align-items: flex-start; align-items: flex-start;
} }
.c16 { .c17 {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
@ -260,7 +264,7 @@ describe('MediaLibrary / AssetList', () => {
align-items: center; align-items: center;
} }
.c19 { .c20 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -295,20 +299,20 @@ describe('MediaLibrary / AssetList', () => {
background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px; background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px;
} }
.c11 { .c12 {
font-weight: 600; font-weight: 600;
color: #32324d; color: #32324d;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c12 { .c13 {
color: #666687; color: #666687;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c18 { .c19 {
color: #666687; color: #666687;
font-weight: 600; font-weight: 600;
font-size: 0.6875rem; font-size: 0.6875rem;
@ -316,20 +320,20 @@ describe('MediaLibrary / AssetList', () => {
text-transform: uppercase; text-transform: uppercase;
} }
.c24 { .c25 {
color: #ffffff; color: #ffffff;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c14 { .c15 {
margin-left: auto; margin-left: auto;
-webkit-flex-shrink: 0; -webkit-flex-shrink: 0;
-ms-flex-negative: 0; -ms-flex-negative: 0;
flex-shrink: 0; flex-shrink: 0;
} }
.c17 { .c18 {
margin-left: 4px; margin-left: 4px;
} }
@ -410,36 +414,36 @@ describe('MediaLibrary / AssetList', () => {
border-bottom: 1px solid #eaeaef; border-bottom: 1px solid #eaeaef;
} }
.c23 { .c24 {
position: absolute; position: absolute;
bottom: 4px; bottom: 4px;
right: 4px; right: 4px;
} }
.c13 { .c14 {
text-transform: uppercase; text-transform: uppercase;
} }
.c25 { .c26 {
text-transform: uppercase; text-transform: uppercase;
} }
.c20 canvas, .c21 canvas,
.c20 video { .c21 video {
display: block; display: block;
max-width: 100%; max-width: 100%;
max-height: 10.25rem; max-height: 10.25rem;
} }
.c30 { .c31 {
text-transform: uppercase; text-transform: uppercase;
} }
.c29 svg { .c30 svg {
font-size: 3rem; font-size: 3rem;
} }
.c28 { .c29 {
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
background: linear-gradient(180deg,#ffffff 0%,#f6f6f9 121.48%); background: linear-gradient(180deg,#ffffff 0%,#f6f6f9 121.48%);
} }
@ -494,17 +498,21 @@ describe('MediaLibrary / AssetList', () => {
<div <div
class="c10" class="c10"
> >
<h2 <div
class="c11" class="c11"
>
<h2
class="c12"
id="card-1-title" id="card-1-title"
> >
strapi-cover_1fabc982ce.png strapi-cover_1fabc982ce.png
</h2> </h2>
</div>
<div <div
class="c12" class="c13"
> >
<span <span
class="c13" class="c14"
> >
png png
</span> </span>
@ -512,13 +520,13 @@ describe('MediaLibrary / AssetList', () => {
</div> </div>
</div> </div>
<div <div
class="c14" class="c15"
> >
<div <div
class="c15 c16 c17" class="c16 c17 c18"
> >
<span <span
class="c18" class="c19"
> >
Image Image
</span> </span>
@ -548,10 +556,10 @@ describe('MediaLibrary / AssetList', () => {
class="c6" class="c6"
> >
<div <div
class="c19" class="c20"
> >
<div <div
class="c20" class="c21"
> >
<figure <figure
class="" class=""
@ -565,7 +573,7 @@ describe('MediaLibrary / AssetList', () => {
/> />
</video> </video>
<figcaption <figcaption
class="c21" class="c22"
> >
mov_bbb.mp4 mov_bbb.mp4
</figcaption> </figcaption>
@ -574,10 +582,10 @@ describe('MediaLibrary / AssetList', () => {
</div> </div>
</div> </div>
<time <time
class="c22 c23" class="c23 c24"
> >
<span <span
class="c24" class="c25"
> >
... ...
</span> </span>
@ -592,30 +600,34 @@ describe('MediaLibrary / AssetList', () => {
<div <div
class="c10" class="c10"
> >
<h2 <div
class="c11" class="c11"
>
<h2
class="c12"
id="card-2-title" id="card-2-title"
> >
mov_bbb.mp4 mov_bbb.mp4
</h2> </h2>
</div>
<div <div
class="c12" class="c13"
> >
<span <span
class="c25" class="c26"
> >
mp4 mp4
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c14" class="c15"
> >
<div <div
class="c15 c16 c17" class="c16 c17 c18"
> >
<span <span
class="c18" class="c19"
> >
Video Video
</span> </span>
@ -642,12 +654,12 @@ describe('MediaLibrary / AssetList', () => {
/> />
</div> </div>
<div <div
class="c26 c27 c28" class="c27 c28 c29"
height="10.25rem" height="10.25rem"
width="100%" width="100%"
> >
<span <span
class="c29" class="c30"
> >
<svg <svg
aria-label="CARTE MARIAGE AVS - Printemps.pdf" aria-label="CARTE MARIAGE AVS - Printemps.pdf"
@ -680,30 +692,34 @@ describe('MediaLibrary / AssetList', () => {
<div <div
class="c10" class="c10"
> >
<h2 <div
class="c11" class="c11"
>
<h2
class="c12"
id="card-3-title" id="card-3-title"
> >
CARTE MARIAGE AVS - Printemps.pdf CARTE MARIAGE AVS - Printemps.pdf
</h2> </h2>
</div>
<div <div
class="c12" class="c13"
> >
<span <span
class="c30" class="c31"
> >
pdf pdf
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c14" class="c15"
> >
<div <div
class="c15 c16 c17" class="c16 c17 c18"
> >
<span <span
class="c18" class="c19"
> >
Doc Doc
</span> </span>
@ -733,7 +749,7 @@ describe('MediaLibrary / AssetList', () => {
</div> </div>
</div> </div>
<div <div
class="c31" class="c32"
> >
<p <p
aria-live="polite" aria-live="polite"

View File

@ -79,7 +79,7 @@ export const EmptyStateAsset = ({ disabled, onClick, onDropAsset }) => {
> >
{formatMessage({ {formatMessage({
id: getTrad('mediaLibraryInput.placeholder'), id: getTrad('mediaLibraryInput.placeholder'),
defaultMessage: 'Click to select an asset or drag and drop one in this area', defaultMessage: 'Click to add an asset or drag and drop one in this area',
})} })}
</TextAlignTypography> </TextAlignTypography>
</Flex> </Flex>

View File

@ -18,8 +18,8 @@ export const AddAssetStep = ({ onClose, onAddAsset, trackedLocation }) => {
<ModalHeader> <ModalHeader>
<Typography fontWeight="bold" textColor="neutral800" as="h2" id="title"> <Typography fontWeight="bold" textColor="neutral800" as="h2" id="title">
{formatMessage({ {formatMessage({
id: getTrad('header.actions.upload-assets'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Typography> </Typography>
</ModalHeader> </ModalHeader>

View File

@ -62,8 +62,8 @@ export const PendingAssetStep = ({
<ModalHeader> <ModalHeader>
<Typography fontWeight="bold" textColor="neutral800" as="h2" id="title"> <Typography fontWeight="bold" textColor="neutral800" as="h2" id="title">
{formatMessage({ {formatMessage({
id: getTrad('header.actions.upload-assets'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Typography> </Typography>
</ModalHeader> </ModalHeader>
@ -85,14 +85,14 @@ export const PendingAssetStep = ({
<Typography variant="pi" textColor="neutral600"> <Typography variant="pi" textColor="neutral600">
{formatMessage({ {formatMessage({
id: getTrad('modal.upload-list.sub-header-subtitle'), id: getTrad('modal.upload-list.sub-header-subtitle'),
defaultMessage: 'Manage the assets before adding them to the Media Library', defaultMessage: 'Manage the assets before uploading them to the Media Library',
})} })}
</Typography> </Typography>
</Stack> </Stack>
<Button size="S" onClick={onClickAddAsset}> <Button size="S" onClick={onClickAddAsset}>
{formatMessage({ {formatMessage({
id: getTrad('header.actions.upload-new-asset'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload new asset', defaultMessage: 'Add new assets',
})} })}
</Button> </Button>
</Flex> </Flex>

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PendingAssetStep snapshots the component with valid cards 1`] = ` exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
.c51 { .c52 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -46,7 +46,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
align-items: center; align-items: center;
} }
.c48 { .c49 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -163,12 +163,12 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
border-bottom: 1px solid #eaeaef; border-bottom: 1px solid #eaeaef;
} }
.c47 { .c48 {
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
border-top: 1px solid #eaeaef; border-top: 1px solid #eaeaef;
} }
.c49 > * + * { .c50 > * + * {
margin-left: 8px; margin-left: 8px;
} }
@ -327,7 +327,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
background: #4945ff; background: #4945ff;
} }
.c50 { .c51 {
-webkit-align-items: center; -webkit-align-items: center;
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
@ -339,7 +339,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
background: #ffffff; background: #ffffff;
} }
.c50 .sc-kJpAUB { .c51 .sc-kJpAUB {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -350,56 +350,56 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
align-items: center; align-items: center;
} }
.c50 .c15 { .c51 .c15 {
color: #ffffff; color: #ffffff;
} }
.c50[aria-disabled='true'] { .c51[aria-disabled='true'] {
border: 1px solid #dcdce4; border: 1px solid #dcdce4;
background: #eaeaef; background: #eaeaef;
} }
.c50[aria-disabled='true'] .c15 { .c51[aria-disabled='true'] .c15 {
color: #666687; color: #666687;
} }
.c50[aria-disabled='true'] svg > g, .c51[aria-disabled='true'] svg > g,
.c50[aria-disabled='true'] svg path { .c51[aria-disabled='true'] svg path {
fill: #666687; fill: #666687;
} }
.c50[aria-disabled='true']:active { .c51[aria-disabled='true']:active {
border: 1px solid #dcdce4; border: 1px solid #dcdce4;
background: #eaeaef; background: #eaeaef;
} }
.c50[aria-disabled='true']:active .c15 { .c51[aria-disabled='true']:active .c15 {
color: #666687; color: #666687;
} }
.c50[aria-disabled='true']:active svg > g, .c51[aria-disabled='true']:active svg > g,
.c50[aria-disabled='true']:active svg path { .c51[aria-disabled='true']:active svg path {
fill: #666687; fill: #666687;
} }
.c50:hover { .c51:hover {
background-color: #f6f6f9; background-color: #f6f6f9;
} }
.c50:active { .c51:active {
background-color: #eaeaef; background-color: #eaeaef;
} }
.c50 .c15 { .c51 .c15 {
color: #32324d; color: #32324d;
} }
.c50 svg > g, .c51 svg > g,
.c50 svg path { .c51 svg path {
fill: #32324d; fill: #32324d;
} }
.c35 { .c36 {
width: 100%; width: 100%;
height: 5.5rem; height: 5.5rem;
} }
@ -422,7 +422,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
align-items: center; align-items: center;
} }
.c36 { .c37 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -488,7 +488,11 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
grid-column: span 4; grid-column: span 4;
} }
.c42 { .c27 {
padding-top: 4px;
}
.c43 {
border: 0; border: 0;
-webkit-clip: rect(0 0 0 0); -webkit-clip: rect(0 0 0 0);
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
@ -513,14 +517,14 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
padding-left: 12px; padding-left: 12px;
} }
.c31 { .c32 {
background: #f6f6f9; background: #f6f6f9;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
min-width: 20px; min-width: 20px;
} }
.c43 { .c44 {
background: #32324d; background: #32324d;
color: #ffffff; color: #ffffff;
padding: 4px; padding: 4px;
@ -559,7 +563,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
align-items: flex-start; align-items: flex-start;
} }
.c32 { .c33 {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -webkit-inline-flex; display: -webkit-inline-flex;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
@ -577,7 +581,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
align-items: center; align-items: center;
} }
.c40 { .c41 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
@ -612,20 +616,20 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px; background: repeating-conic-gradient(#f6f6f9 0% 25%,transparent 0% 50%) 50% / 20px 20px;
} }
.c27 { .c28 {
font-weight: 600; font-weight: 600;
color: #32324d; color: #32324d;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c28 { .c29 {
color: #666687; color: #666687;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c34 { .c35 {
color: #666687; color: #666687;
font-weight: 600; font-weight: 600;
font-size: 0.6875rem; font-size: 0.6875rem;
@ -633,20 +637,20 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
text-transform: uppercase; text-transform: uppercase;
} }
.c45 { .c46 {
color: #ffffff; color: #ffffff;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.33; line-height: 1.33;
} }
.c30 { .c31 {
margin-left: auto; margin-left: auto;
-webkit-flex-shrink: 0; -webkit-flex-shrink: 0;
-ms-flex-negative: 0; -ms-flex-negative: 0;
flex-shrink: 0; flex-shrink: 0;
} }
.c33 { .c34 {
margin-left: 4px; margin-left: 4px;
} }
@ -659,36 +663,36 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
border-bottom: 1px solid #eaeaef; border-bottom: 1px solid #eaeaef;
} }
.c44 { .c45 {
position: absolute; position: absolute;
bottom: 4px; bottom: 4px;
right: 4px; right: 4px;
} }
.c29 { .c30 {
text-transform: uppercase; text-transform: uppercase;
} }
.c46 { .c47 {
text-transform: uppercase; text-transform: uppercase;
} }
.c41 canvas, .c42 canvas,
.c41 video { .c42 video {
display: block; display: block;
max-width: 100%; max-width: 100%;
max-height: 5.5rem; max-height: 5.5rem;
} }
.c39 { .c40 {
text-transform: uppercase; text-transform: uppercase;
} }
.c38 svg { .c39 svg {
font-size: 3rem; font-size: 3rem;
} }
.c37 { .c38 {
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
background: linear-gradient(180deg,#ffffff 0%,#f6f6f9 121.48%); background: linear-gradient(180deg,#ffffff 0%,#f6f6f9 121.48%);
} }
@ -717,7 +721,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
class="c3" class="c3"
id="title" id="title"
> >
Upload assets Add new assets
</h2> </h2>
<button <button
aria-disabled="false" aria-disabled="false"
@ -755,12 +759,12 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
<span <span
class="c11" class="c11"
> >
{number, plural, =0 {No asset} one {1 asset} other {# assets}} selected {number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload
</span> </span>
<span <span
class="c12" class="c12"
> >
Manage the assets before adding them to the Media Library Manage the assets before uploading them to the Media Library
</span> </span>
</div> </div>
<button <button
@ -771,7 +775,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
<span <span
class="c15 c16" class="c15 c16"
> >
Upload new asset Add new assets
</span> </span>
</button> </button>
</div> </div>
@ -814,28 +818,32 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
<div <div
class="c26" class="c26"
> >
<h2 <div
class="c27" class="c27"
>
<h2
class="c28"
id="card-1-title" id="card-1-title"
/> />
</div>
<div <div
class="c28" class="c29"
> >
<span <span
class="c29" class="c30"
> >
jpg jpg
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c30" class="c31"
> >
<div <div
class="c31 c32 c33" class="c32 c33 c34"
> >
<span <span
class="c34" class="c35"
> >
Image Image
</span> </span>
@ -861,12 +869,12 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
class="c20 c21" class="c20 c21"
> >
<div <div
class="c35 c36 c37" class="c36 c37 c38"
height="5.5rem" height="5.5rem"
width="100%" width="100%"
> >
<span <span
class="c38" class="c39"
> >
<svg <svg
fill="none" fill="none"
@ -898,28 +906,32 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
<div <div
class="c26" class="c26"
> >
<h2 <div
class="c27" class="c27"
>
<h2
class="c28"
id="card-2-title" id="card-2-title"
/> />
</div>
<div <div
class="c28" class="c29"
> >
<span <span
class="c39" class="c40"
> >
pdf pdf
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c30" class="c31"
> >
<div <div
class="c31 c32 c33" class="c32 c33 c34"
> >
<span <span
class="c34" class="c35"
> >
Doc Doc
</span> </span>
@ -948,10 +960,10 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
class="c22" class="c22"
> >
<div <div
class="c40" class="c41"
> >
<div <div
class="c41" class="c42"
> >
<figure <figure
class="" class=""
@ -965,17 +977,17 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
/> />
</video> </video>
<figcaption <figcaption
class="c42" class="c43"
/> />
</figure> </figure>
</div> </div>
</div> </div>
</div> </div>
<time <time
class="c43 c44" class="c44 c45"
> >
<span <span
class="c45" class="c46"
> >
... ...
</span> </span>
@ -990,28 +1002,32 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
<div <div
class="c26" class="c26"
> >
<h2 <div
class="c27" class="c27"
>
<h2
class="c28"
id="card-3-title" id="card-3-title"
/> />
</div>
<div <div
class="c28" class="c29"
> >
<span <span
class="c46" class="c47"
> >
mp4 mp4
</span> </span>
</div> </div>
</div> </div>
<div <div
class="c30" class="c31"
> >
<div <div
class="c31 c32 c33" class="c32 c33 c34"
> >
<span <span
class="c34" class="c35"
> >
Video Video
</span> </span>
@ -1027,17 +1043,17 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
</div> </div>
</div> </div>
<div <div
class="c0 c47" class="c0 c48"
> >
<div <div
class="c2" class="c2"
> >
<div <div
class="c48 c49" class="c49 c50"
> >
<button <button
aria-disabled="false" aria-disabled="false"
class="c13 c50" class="c13 c51"
type="button" type="button"
> >
<span <span
@ -1046,7 +1062,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
</button> </button>
</div> </div>
<div <div
class="c48 c49" class="c49 c50"
> >
<button <button
aria-disabled="false" aria-disabled="false"
@ -1064,7 +1080,7 @@ exports[`PendingAssetStep snapshots the component with valid cards 1`] = `
</div> </div>
</form> </form>
<div <div
class="c51" class="c52"
> >
<p <p
aria-live="polite" aria-live="polite"

View File

@ -94,14 +94,14 @@ describe('UploadAssetDialog', () => {
target: { files: fileList }, target: { files: fileList },
}); });
expect(screen.getByText('Upload new asset')).toBeInTheDocument(); expect(screen.getAllByText(`Add new assets`).length).toBe(2);
expect( expect(
screen.getByText( screen.getByText(
'{number, plural, =0 {No asset} one {1 asset} other {# assets}} selected' '{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload'
) )
).toBeInTheDocument(); ).toBeInTheDocument();
expect( expect(
screen.getByText('Manage the assets before adding them to the Media Library') screen.getByText('Manage the assets before uploading them to the Media Library')
).toBeInTheDocument(); ).toBeInTheDocument();
expect(screen.getAllByText(`test.${ext}`).length).toBe(number); expect(screen.getAllByText(`test.${ext}`).length).toBe(number);
expect(screen.getByText(ext)).toBeInTheDocument(); expect(screen.getByText(ext)).toBeInTheDocument();
@ -193,13 +193,13 @@ describe('UploadAssetDialog', () => {
await waitFor(() => await waitFor(() =>
expect( expect(
screen.getByText( screen.getByText(
'{number, plural, =0 {No asset} one {1 asset} other {# assets}} selected' '{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload'
) )
).toBeInTheDocument() ).toBeInTheDocument()
); );
expect(screen.getByText('Upload new asset')).toBeInTheDocument(); expect(screen.getAllByText(`Add new assets`).length).toBe(2);
expect( expect(
screen.getByText('Manage the assets before adding them to the Media Library') screen.getByText('Manage the assets before uploading them to the Media Library')
).toBeInTheDocument(); ).toBeInTheDocument();
assets.forEach(asset => { assets.forEach(asset => {

View File

@ -598,7 +598,7 @@ exports[`UploadAssetDialog from computer snapshots the component 1`] = `
class="c7" class="c7"
id="title" id="title"
> >
Upload assets Add new assets
</h2> </h2>
<button <button
aria-disabled="false" aria-disabled="false"
@ -1434,7 +1434,7 @@ exports[`UploadAssetDialog from url snapshots the component 1`] = `
class="c6" class="c6"
id="title" id="title"
> >
Upload assets Add new assets
</h2> </h2>
<button <button
aria-disabled="false" aria-disabled="false"

View File

@ -89,8 +89,8 @@ export const MediaLibrary = () => {
canCreate ? ( canCreate ? (
<Button startIcon={<Plus />} onClick={toggleUploadAssetDialog}> <Button startIcon={<Plus />} onClick={toggleUploadAssetDialog}>
{formatMessage({ {formatMessage({
id: getTrad('header.actions.upload-assets'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Button> </Button>
) : ( ) : (
@ -157,8 +157,8 @@ export const MediaLibrary = () => {
onClick={toggleUploadAssetDialog} onClick={toggleUploadAssetDialog}
> >
{formatMessage({ {formatMessage({
id: getTrad('modal.header.browse'), id: getTrad('header.actions.add-assets'),
defaultMessage: 'Upload assets', defaultMessage: 'Add new assets',
})} })}
</Button> </Button>
) : ( ) : (

View File

@ -179,7 +179,7 @@ describe('Media library homepage', () => {
renderML(); renderML();
await waitFor(() => expect(screen.queryByText(`Upload assets`)).not.toBeInTheDocument()); await waitFor(() => expect(screen.queryByText(`Add new assets`)).not.toBeInTheDocument());
}); });
it('shows the "Upload assets" button when the user does have the permissions to', async () => { it('shows the "Upload assets" button when the user does have the permissions to', async () => {
@ -193,7 +193,7 @@ describe('Media library homepage', () => {
renderML(); renderML();
await waitFor(() => expect(screen.getByText(`Upload assets`)).toBeInTheDocument()); await waitFor(() => expect(screen.getByText(`Add new assets`)).toBeInTheDocument());
}); });
}); });

View File

@ -21,6 +21,7 @@
"form.input.label.file-name": "File name", "form.input.label.file-name": "File name",
"form.upload-url.error.url.invalid": "One URL is invalid", "form.upload-url.error.url.invalid": "One URL is invalid",
"form.upload-url.error.url.invalids": "{number} URLs are invalids", "form.upload-url.error.url.invalids": "{number} URLs are invalids",
"header.actions.add-assets": "Add new assets",
"header.actions.upload-assets": "Upload assets", "header.actions.upload-assets": "Upload assets",
"header.actions.upload-new-asset": "Upload new asset", "header.actions.upload-new-asset": "Upload new asset",
"header.content.assets-empty": "No assets", "header.content.assets-empty": "No assets",
@ -30,7 +31,7 @@
"input.label": "Drag & Drop here or", "input.label": "Drag & Drop here or",
"input.label-bold": "Drag & drop", "input.label-bold": "Drag & drop",
"input.label-normal": "to upload or", "input.label-normal": "to upload or",
"input.placeholder": "Click to select an asset or drag & drop a file in this area", "input.placeholder": "Click to add an asset or drag & drop a file in this area",
"input.placeholder.icon": "Drop the asset in this zone", "input.placeholder.icon": "Drop the asset in this zone",
"input.url.description": "Separate your URL links by a carriage return.", "input.url.description": "Separate your URL links by a carriage return.",
"input.url.label": "URL", "input.url.label": "URL",
@ -44,12 +45,12 @@
"list.assets.loading-asset": "Loading the preview for the media: {path}", "list.assets.loading-asset": "Loading the preview for the media: {path}",
"list.assets.not-supported-content": "No preview available", "list.assets.not-supported-content": "No preview available",
"list.assets.preview-asset": "Preview for the video at path {path}", "list.assets.preview-asset": "Preview for the video at path {path}",
"list.assets.selected": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} selected", "list.assets.selected": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
"list.assets.type-not-allowed": "This type of file is not allowed.", "list.assets.type-not-allowed": "This type of file is not allowed.",
"list.assets-empty.search": "No result found", "list.assets-empty.search": "No result found",
"mediaLibraryInput.actions.nextSlide": "Next slide", "mediaLibraryInput.actions.nextSlide": "Next slide",
"mediaLibraryInput.actions.previousSlide": "Previous slide", "mediaLibraryInput.actions.previousSlide": "Previous slide",
"mediaLibraryInput.placeholder": "Click to select an asset or drag and drop one in this area", "mediaLibraryInput.placeholder": "Click to add an asset or drag and drop one in this area",
"mediaLibraryInput.slideCount": "{n} of {m} slides", "mediaLibraryInput.slideCount": "{n} of {m} slides",
"modal.edit.title": "Details", "modal.edit.title": "Details",
"modal.file-details.date": "Date", "modal.file-details.date": "Date",
@ -68,7 +69,7 @@
"modal.selected-list.sub-header-subtitle": "Drag & drop to reorder the assets in the field", "modal.selected-list.sub-header-subtitle": "Drag & drop to reorder the assets in the field",
"modal.upload-list.footer.button.plural": "Upload {number} assets to the library", "modal.upload-list.footer.button.plural": "Upload {number} assets to the library",
"modal.upload-list.footer.button.singular": "Upload {number} asset to the library", "modal.upload-list.footer.button.singular": "Upload {number} asset to the library",
"modal.upload-list.sub-header-subtitle": "Manage the assets before adding them to the Media Library", "modal.upload-list.sub-header-subtitle": "Manage the assets before uploading them to the Media Library",
"modal.upload-list.sub-header-title.plural": "{number} assets selected", "modal.upload-list.sub-header-title.plural": "{number} assets selected",
"modal.upload-list.sub-header-title.singular": "{number} asset selected", "modal.upload-list.sub-header-title.singular": "{number} asset selected",
"modal.upload-list.sub-header.button": "Add more assets", "modal.upload-list.sub-header.button": "Add more assets",

View File

@ -15246,7 +15246,7 @@ markdown-it-container@^3.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b" resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b"
integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw== integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==
markdown-it-deflist@^2.0.3: markdown-it-deflist@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz#50d7a56b9544cd81252f7623bd785e28a8dcef5c" resolved "https://registry.yarnpkg.com/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz#50d7a56b9544cd81252f7623bd785e28a8dcef5c"
integrity sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg== integrity sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg==
@ -15256,7 +15256,7 @@ markdown-it-emoji@^2.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-2.0.0.tgz#3164ad4c009efd946e98274f7562ad611089a231" resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-2.0.0.tgz#3164ad4c009efd946e98274f7562ad611089a231"
integrity sha512-39j7/9vP/CPCKbEI44oV8yoPJTpvfeReTn/COgRhSpNrjWF3PfP/JUxxB0hxV6ynOY8KH8Y8aX9NMDdo6z+6YQ== integrity sha512-39j7/9vP/CPCKbEI44oV8yoPJTpvfeReTn/COgRhSpNrjWF3PfP/JUxxB0hxV6ynOY8KH8Y8aX9NMDdo6z+6YQ==
markdown-it-footnote@^3.0.2: markdown-it-footnote@^3.0.3:
version "3.0.3" version "3.0.3"
resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8" resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8"
integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w== integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==
@ -15281,7 +15281,7 @@ markdown-it-sup@1.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3" resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3"
integrity sha1-y5yf+RpSVawI8/09YyhuFd8KH8M= integrity sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=
markdown-it@^12.0.6: markdown-it@^12.3.2:
version "12.3.2" version "12.3.2"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90"
integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==