fix: renders rte upload drawer #2178
This commit is contained in:
@@ -7,6 +7,7 @@ import x from '../../icons/X';
|
|||||||
import chevron from '../../icons/Chevron';
|
import chevron from '../../icons/Chevron';
|
||||||
import edit from '../../icons/Edit';
|
import edit from '../../icons/Edit';
|
||||||
import swap from '../../icons/Swap';
|
import swap from '../../icons/Swap';
|
||||||
|
import linkIcon from '../../icons/Link';
|
||||||
import Tooltip from '../Tooltip';
|
import Tooltip from '../Tooltip';
|
||||||
|
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
@@ -17,6 +18,7 @@ const icons = {
|
|||||||
chevron,
|
chevron,
|
||||||
edit,
|
edit,
|
||||||
swap,
|
swap,
|
||||||
|
link: linkIcon,
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseClass = 'btn';
|
const baseClass = 'btn';
|
||||||
|
|||||||
@@ -49,16 +49,18 @@
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rich-text-relationship__doc-drawer-toggler {
|
||||||
|
text-decoration: underline;
|
||||||
|
pointer-events: all;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
&__actions {
|
&__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: base(0.5);
|
margin-left: base(0.5);
|
||||||
|
|
||||||
.rich-text-relationship__doc-drawer-toggler {
|
|
||||||
pointer-events: all;
|
|
||||||
}
|
|
||||||
|
|
||||||
& > *:not(:last-child) {
|
& > *:not(:last-child) {
|
||||||
margin-right: base(.25);
|
margin-right: base(.25);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,25 +146,13 @@ const Element: React.FC<Props> = (props) => {
|
|||||||
<p className={`${baseClass}__label`}>
|
<p className={`${baseClass}__label`}>
|
||||||
{t('labelRelationship', { label: getTranslation(relatedCollection.labels.singular, i18n) })}
|
{t('labelRelationship', { label: getTranslation(relatedCollection.labels.singular, i18n) })}
|
||||||
</p>
|
</p>
|
||||||
<p className={`${baseClass}__title`}>
|
<DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>
|
||||||
{data[relatedCollection?.admin?.useAsTitle || 'id']}
|
<p className={`${baseClass}__title`}>
|
||||||
</p>
|
{data[relatedCollection?.admin?.useAsTitle || 'id']}
|
||||||
|
</p>
|
||||||
|
</DocumentDrawerToggler>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${baseClass}__actions`}>
|
<div className={`${baseClass}__actions`}>
|
||||||
{value?.id && (
|
|
||||||
<DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>
|
|
||||||
<Button
|
|
||||||
icon="edit"
|
|
||||||
round
|
|
||||||
buttonStyle="icon-label"
|
|
||||||
el="div"
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
}}
|
|
||||||
tooltip={t('general:editLabel', { label: getTranslation(relatedCollection.labels.singular, i18n) })}
|
|
||||||
/>
|
|
||||||
</DocumentDrawerToggler>
|
|
||||||
)}
|
|
||||||
<ListDrawerToggler
|
<ListDrawerToggler
|
||||||
disabled={fieldProps?.admin?.readOnly}
|
disabled={fieldProps?.admin?.readOnly}
|
||||||
className={`${baseClass}__list-drawer-toggler`}
|
className={`${baseClass}__list-drawer-toggler`}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import { useModal } from '@faceless-ui/modal';
|
||||||
|
import { Transforms } from 'slate';
|
||||||
|
import { ReactEditor, useSlateStatic } from 'slate-react';
|
||||||
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { ElementProps } from '..';
|
||||||
|
import fieldTypes from '../../../../..';
|
||||||
|
import { SanitizedCollectionConfig } from '../../../../../../../../../collections/config/types';
|
||||||
|
import { Drawer } from '../../../../../../../elements/Drawer';
|
||||||
|
import { useAuth } from '../../../../../../../utilities/Auth';
|
||||||
|
import { useLocale } from '../../../../../../../utilities/Locale';
|
||||||
|
import Form from '../../../../../../Form';
|
||||||
|
import RenderFields from '../../../../../../RenderFields';
|
||||||
|
import FormSubmit from '../../../../../../Submit';
|
||||||
|
import buildStateFromSchema from '../../../../../../Form/buildStateFromSchema';
|
||||||
|
import { getTranslation } from '../../../../../../../../../utilities/getTranslation';
|
||||||
|
|
||||||
|
export const UploadDrawer: React.FC<ElementProps & {
|
||||||
|
drawerSlug: string
|
||||||
|
relatedCollection: SanitizedCollectionConfig
|
||||||
|
}> = (props) => {
|
||||||
|
const editor = useSlateStatic();
|
||||||
|
|
||||||
|
const {
|
||||||
|
fieldProps,
|
||||||
|
relatedCollection,
|
||||||
|
drawerSlug,
|
||||||
|
element,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const { t, i18n } = useTranslation();
|
||||||
|
const locale = useLocale();
|
||||||
|
const { user } = useAuth();
|
||||||
|
const { closeModal } = useModal();
|
||||||
|
const [initialState, setInitialState] = useState({});
|
||||||
|
const fieldSchema = fieldProps?.admin?.upload?.collections?.[relatedCollection.slug]?.fields;
|
||||||
|
|
||||||
|
const handleUpdateEditData = useCallback((_, data) => {
|
||||||
|
const newNode = {
|
||||||
|
fields: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
const elementPath = ReactEditor.findPath(editor, element);
|
||||||
|
|
||||||
|
Transforms.setNodes(
|
||||||
|
editor,
|
||||||
|
newNode,
|
||||||
|
{ at: elementPath },
|
||||||
|
);
|
||||||
|
closeModal(drawerSlug);
|
||||||
|
}, [closeModal, editor, element, drawerSlug]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const awaitInitialState = async () => {
|
||||||
|
const state = await buildStateFromSchema({ fieldSchema, data: { ...element?.fields || {} }, user, operation: 'update', locale, t });
|
||||||
|
setInitialState(state);
|
||||||
|
};
|
||||||
|
|
||||||
|
awaitInitialState();
|
||||||
|
}, [fieldSchema, element.fields, user, locale, t]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Drawer
|
||||||
|
slug={drawerSlug}
|
||||||
|
title={t('general:editLabel', { label: getTranslation(relatedCollection.labels.singular, i18n) })}
|
||||||
|
>
|
||||||
|
<Form
|
||||||
|
onSubmit={handleUpdateEditData}
|
||||||
|
initialState={initialState}
|
||||||
|
>
|
||||||
|
<RenderFields
|
||||||
|
readOnly={false}
|
||||||
|
fieldTypes={fieldTypes}
|
||||||
|
fieldSchema={fieldSchema}
|
||||||
|
/>
|
||||||
|
<FormSubmit>
|
||||||
|
{t('fields:saveChanges')}
|
||||||
|
</FormSubmit>
|
||||||
|
</Form>
|
||||||
|
</Drawer>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -84,8 +84,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__upload-drawer-toggler {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
outline: none;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__doc-drawer-toggler {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
&__doc-drawer-toggler,
|
&__doc-drawer-toggler,
|
||||||
&__list-drawer-toggler {
|
&__list-drawer-toggler,
|
||||||
|
&__upload-drawer-toggler {
|
||||||
& > * {
|
& > * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ import { useListDrawer } from '../../../../../../elements/ListDrawer';
|
|||||||
import { SanitizedCollectionConfig } from '../../../../../../../../collections/config/types';
|
import { SanitizedCollectionConfig } from '../../../../../../../../collections/config/types';
|
||||||
import { Props as RichTextProps } from '../../../types';
|
import { Props as RichTextProps } from '../../../types';
|
||||||
import { EnabledRelationshipsCondition } from '../../EnabledRelationshipsCondition';
|
import { EnabledRelationshipsCondition } from '../../EnabledRelationshipsCondition';
|
||||||
|
import { useDrawerSlug } from '../../../../../../elements/Drawer/useDrawerSlug';
|
||||||
|
import { UploadDrawer } from './UploadDrawer';
|
||||||
|
import { DrawerToggler } from '../../../../../../elements/Drawer';
|
||||||
|
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
@@ -22,7 +25,7 @@ const initialParams = {
|
|||||||
depth: 0,
|
depth: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
type ElementProps = {
|
export type ElementProps = {
|
||||||
attributes: HTMLAttributes<HTMLDivElement>
|
attributes: HTMLAttributes<HTMLDivElement>
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
element: any
|
element: any
|
||||||
@@ -48,6 +51,8 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0);
|
const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0);
|
||||||
const [relatedCollection, setRelatedCollection] = useState<SanitizedCollectionConfig>(() => collections.find((coll) => coll.slug === relationTo));
|
const [relatedCollection, setRelatedCollection] = useState<SanitizedCollectionConfig>(() => collections.find((coll) => coll.slug === relationTo));
|
||||||
|
|
||||||
|
const drawerSlug = useDrawerSlug('upload-drawer');
|
||||||
|
|
||||||
const [
|
const [
|
||||||
ListDrawer,
|
ListDrawer,
|
||||||
ListDrawerToggler,
|
ListDrawerToggler,
|
||||||
@@ -142,6 +147,8 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
closeListDrawer();
|
closeListDrawer();
|
||||||
}, [closeListDrawer, editor, element, collections]);
|
}, [closeListDrawer, editor, element, collections]);
|
||||||
|
|
||||||
|
const customFields = fieldProps?.admin?.upload?.collections?.[relatedCollection.slug]?.fields;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={[
|
className={[
|
||||||
@@ -168,8 +175,12 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
{getTranslation(relatedCollection.labels.singular, i18n)}
|
{getTranslation(relatedCollection.labels.singular, i18n)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${baseClass}__actions`}>
|
<div className={`${baseClass}__actions`}>
|
||||||
{value?.id && (
|
{customFields?.length > 0 && (
|
||||||
<DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>
|
<DrawerToggler
|
||||||
|
slug={drawerSlug}
|
||||||
|
className={`${baseClass}__upload-drawer-toggler`}
|
||||||
|
disabled={fieldProps?.admin?.readOnly}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
icon="edit"
|
icon="edit"
|
||||||
round
|
round
|
||||||
@@ -178,9 +189,9 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}}
|
}}
|
||||||
tooltip={t('general:editLabel', { label: relatedCollection.labels.singular })}
|
tooltip={t('fields:editRelationship')}
|
||||||
/>
|
/>
|
||||||
</DocumentDrawerToggler>
|
</DrawerToggler>
|
||||||
)}
|
)}
|
||||||
<ListDrawerToggler
|
<ListDrawerToggler
|
||||||
className={`${baseClass}__list-drawer-toggler`}
|
className={`${baseClass}__list-drawer-toggler`}
|
||||||
@@ -214,9 +225,11 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${baseClass}__bottomRow`}>
|
<div className={`${baseClass}__bottomRow`}>
|
||||||
<strong>
|
<DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>
|
||||||
{data?.filename}
|
<strong>
|
||||||
</strong>
|
{data?.filename}
|
||||||
|
</strong>
|
||||||
|
</DocumentDrawerToggler>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{children}
|
{children}
|
||||||
@@ -224,6 +237,11 @@ const Element: React.FC<ElementProps> = (props) => {
|
|||||||
<DocumentDrawer onSave={updateUpload} />
|
<DocumentDrawer onSave={updateUpload} />
|
||||||
)}
|
)}
|
||||||
<ListDrawer onSelect={swapUpload} />
|
<ListDrawer onSelect={swapUpload} />
|
||||||
|
<UploadDrawer
|
||||||
|
drawerSlug={drawerSlug}
|
||||||
|
relatedCollection={relatedCollection}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
11
src/admin/components/icons/Link/index.scss
Normal file
11
src/admin/components/icons/Link/index.scss
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
@import '../../../scss/styles';
|
||||||
|
|
||||||
|
.icon--link {
|
||||||
|
width: $baseline;
|
||||||
|
height: $baseline;
|
||||||
|
|
||||||
|
.stroke {
|
||||||
|
stroke: var(--theme-elevation-800);
|
||||||
|
stroke-width: $style-stroke-width;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import './index.scss';
|
||||||
|
|
||||||
const LinkIcon: React.FC = () => (
|
const LinkIcon: React.FC = () => (
|
||||||
<svg
|
<svg
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
@@ -7,7 +9,7 @@ const LinkIcon: React.FC = () => (
|
|||||||
focusable="false"
|
focusable="false"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
className="graphic link"
|
className="graphic link icon icon--link"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
fill="none"
|
fill="none"
|
||||||
|
|||||||
@@ -106,6 +106,7 @@
|
|||||||
"customURL": "Vlastní URL",
|
"customURL": "Vlastní URL",
|
||||||
"editLabelData": "Upravit data {{label}}",
|
"editLabelData": "Upravit data {{label}}",
|
||||||
"editLink": "Upravit odkaz",
|
"editLink": "Upravit odkaz",
|
||||||
|
"editRelationship": "Upravit vztah",
|
||||||
"enterURL": "Zadejte URL",
|
"enterURL": "Zadejte URL",
|
||||||
"internalLink": "Interní odkaz",
|
"internalLink": "Interní odkaz",
|
||||||
"itemsAndMore": "{{items}} a {{count}} dalších",
|
"itemsAndMore": "{{items}} a {{count}} dalších",
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
"collapseAll": "Alle einklappen",
|
"collapseAll": "Alle einklappen",
|
||||||
"customURL": "Eigene URL",
|
"customURL": "Eigene URL",
|
||||||
"editLink": "Bearbeite Link",
|
"editLink": "Bearbeite Link",
|
||||||
|
"editRelationship": "Beziehung Hinzufügen",
|
||||||
"editLabelData": "{{label}} bearbeiten",
|
"editLabelData": "{{label}} bearbeiten",
|
||||||
"enterURL": "URL eingeben",
|
"enterURL": "URL eingeben",
|
||||||
"internalLink": "Interner Link",
|
"internalLink": "Interner Link",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "Custom URL",
|
"customURL": "Custom URL",
|
||||||
"editLabelData": "Edit {{label}} data",
|
"editLabelData": "Edit {{label}} data",
|
||||||
"editLink": "Edit Link",
|
"editLink": "Edit Link",
|
||||||
|
"editRelationship": "Edit Relationship",
|
||||||
"enterURL": "Enter a URL",
|
"enterURL": "Enter a URL",
|
||||||
"internalLink": "Internal Link",
|
"internalLink": "Internal Link",
|
||||||
"itemsAndMore": "{{items}} and {{count}} more",
|
"itemsAndMore": "{{items}} and {{count}} more",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "URL Personalizado",
|
"customURL": "URL Personalizado",
|
||||||
"editLabelData": "Editar información de {{label}}",
|
"editLabelData": "Editar información de {{label}}",
|
||||||
"editLink": "Editar Enlace",
|
"editLink": "Editar Enlace",
|
||||||
|
"editRelationship": "Editar Relación",
|
||||||
"enterURL": "Ingresar URL",
|
"enterURL": "Ingresar URL",
|
||||||
"internalLink": "Enlace Interno",
|
"internalLink": "Enlace Interno",
|
||||||
"itemsAndMore": "{{items}} y {{count}} más",
|
"itemsAndMore": "{{items}} y {{count}} más",
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
"chooseLabel": "Choisir un(e) {{label}}",
|
"chooseLabel": "Choisir un(e) {{label}}",
|
||||||
"collapseAll": "Tout réduire",
|
"collapseAll": "Tout réduire",
|
||||||
"editLabelData": "Modifier les données de ou du {{label}}",
|
"editLabelData": "Modifier les données de ou du {{label}}",
|
||||||
|
"editLink": "Modifier le lien",
|
||||||
|
"editRelationship": "Modifier la relation",
|
||||||
"itemsAndMore": "{{items}} et {{count}} de plus",
|
"itemsAndMore": "{{items}} et {{count}} de plus",
|
||||||
"labelRelationship": "Relation de ou du {{label}} ",
|
"labelRelationship": "Relation de ou du {{label}} ",
|
||||||
"latitude": "Latitude",
|
"latitude": "Latitude",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "Prilagođeni URL",
|
"customURL": "Prilagođeni URL",
|
||||||
"editLabelData": "Uredi {{label}} podatke",
|
"editLabelData": "Uredi {{label}} podatke",
|
||||||
"editLink": "Uredi poveznicu",
|
"editLink": "Uredi poveznicu",
|
||||||
|
"editRelationship": "Uredi odnos",
|
||||||
"enterURL": "Unesi URL",
|
"enterURL": "Unesi URL",
|
||||||
"internalLink": "Interna poveznika",
|
"internalLink": "Interna poveznika",
|
||||||
"itemsAndMore": "{{items}} i {{count}} više",
|
"itemsAndMore": "{{items}} i {{count}} više",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "Egyéni URL",
|
"customURL": "Egyéni URL",
|
||||||
"editLabelData": "{{label}} adatok szerkesztése",
|
"editLabelData": "{{label}} adatok szerkesztése",
|
||||||
"editLink": "Link szerkesztése",
|
"editLink": "Link szerkesztése",
|
||||||
|
"editRelationship": "Kapcsolat hozzáadása",
|
||||||
"enterURL": "Adjon meg egy URL-t",
|
"enterURL": "Adjon meg egy URL-t",
|
||||||
"internalLink": "Belső link",
|
"internalLink": "Belső link",
|
||||||
"itemsAndMore": "{{items}} és további {{count}}",
|
"itemsAndMore": "{{items}} és további {{count}}",
|
||||||
@@ -324,4 +325,4 @@
|
|||||||
"viewingVersions": "A {{entityLabel}} {{documentTitle}} verzióinak megtekintése",
|
"viewingVersions": "A {{entityLabel}} {{documentTitle}} verzióinak megtekintése",
|
||||||
"viewingVersionsGlobal": "A globális {{entityLabel}} verzióinak megtekintése"
|
"viewingVersionsGlobal": "A globális {{entityLabel}} verzióinak megtekintése"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import de from './de.json';
|
|||||||
import en from './en.json';
|
import en from './en.json';
|
||||||
import es from './es.json';
|
import es from './es.json';
|
||||||
import fr from './fr.json';
|
import fr from './fr.json';
|
||||||
import hr from "./hr.json";
|
import hr from './hr.json';
|
||||||
import it from './it.json';
|
import it from './it.json';
|
||||||
import ja from './ja.json';
|
import ja from './ja.json';
|
||||||
import my from './my.json';
|
import my from './my.json';
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
"chooseLabel": "Scegli {{label}}",
|
"chooseLabel": "Scegli {{label}}",
|
||||||
"collapseAll": "Comprimi tutto",
|
"collapseAll": "Comprimi tutto",
|
||||||
"editLabelData": "Modifica i dati di {{label}}",
|
"editLabelData": "Modifica i dati di {{label}}",
|
||||||
|
"editLink": "Modifica Collegamento",
|
||||||
|
"editRelationship": "Modifica Relazione",
|
||||||
"itemsAndMore": "{{items}} e altri {{count}}",
|
"itemsAndMore": "{{items}} e altri {{count}}",
|
||||||
"labelRelationship": "Relazione {{label}}",
|
"labelRelationship": "Relazione {{label}}",
|
||||||
"latitude": "Latitudine",
|
"latitude": "Latitudine",
|
||||||
|
|||||||
@@ -102,6 +102,8 @@
|
|||||||
"chooseLabel": "{{label}} を選択",
|
"chooseLabel": "{{label}} を選択",
|
||||||
"collapseAll": "すべて閉じる",
|
"collapseAll": "すべて閉じる",
|
||||||
"editLabelData": "{{label}} データを編集",
|
"editLabelData": "{{label}} データを編集",
|
||||||
|
"editLink": "リンクを編集",
|
||||||
|
"editRelationship": "リレーションシップを編集",
|
||||||
"itemsAndMore": "{{items}} 他{{count}}件",
|
"itemsAndMore": "{{items}} 他{{count}}件",
|
||||||
"labelRelationship": "{{label}} リレーションシップ",
|
"labelRelationship": "{{label}} リレーションシップ",
|
||||||
"latitude": "緯度",
|
"latitude": "緯度",
|
||||||
|
|||||||
@@ -102,6 +102,8 @@
|
|||||||
"chooseLabel": "{{label}} အားရွေးချယ်ပါ။",
|
"chooseLabel": "{{label}} အားရွေးချယ်ပါ။",
|
||||||
"collapseAll": "အားလုံးကို ခေါက်သိမ်းပါ။",
|
"collapseAll": "အားလုံးကို ခေါက်သိမ်းပါ။",
|
||||||
"editLabelData": "ဒေတာ {{label}} ကို တည်းဖြတ်ပါ။",
|
"editLabelData": "ဒေတာ {{label}} ကို တည်းဖြတ်ပါ။",
|
||||||
|
"editLink": "လင့်ခ်ကို တည်းဖြတ်ပါ။",
|
||||||
|
"editRelationship": "Relationship ကို တည်းဖြတ်ပါ။",
|
||||||
"itemsAndMore": "{{items}} နှင့် နောက်ထပ် {{count}} ခု",
|
"itemsAndMore": "{{items}} နှင့် နောက်ထပ် {{count}} ခု",
|
||||||
"labelRelationship": "{{label}} Relationship",
|
"labelRelationship": "{{label}} Relationship",
|
||||||
"latitude": "vĩ độ",
|
"latitude": "vĩ độ",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "Egendefinert URL",
|
"customURL": "Egendefinert URL",
|
||||||
"editLabelData": "Rediger {{label}}-data",
|
"editLabelData": "Rediger {{label}}-data",
|
||||||
"editLink": "Rediger lenke",
|
"editLink": "Rediger lenke",
|
||||||
|
"editRelationship": "Rediger relasjon",
|
||||||
"enterURL": "Skriv inn en URL",
|
"enterURL": "Skriv inn en URL",
|
||||||
"internalLink": "Intern lenke",
|
"internalLink": "Intern lenke",
|
||||||
"itemsAndMore": "{{items}} og {{count}} flere",
|
"itemsAndMore": "{{items}} og {{count}} flere",
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
"chooseLabel": "Kies {{label}}",
|
"chooseLabel": "Kies {{label}}",
|
||||||
"collapseAll": "Alles samenvouwen",
|
"collapseAll": "Alles samenvouwen",
|
||||||
"editLabelData": "Bewerk gegevens van {{label}}",
|
"editLabelData": "Bewerk gegevens van {{label}}",
|
||||||
|
"editLink": "Link bewerken",
|
||||||
|
"editRelationship": "Relatie Relatie",
|
||||||
"itemsAndMore": "{{items}} en {{count}} meer",
|
"itemsAndMore": "{{items}} en {{count}} meer",
|
||||||
"labelRelationship": "{{label}} relatie",
|
"labelRelationship": "{{label}} relatie",
|
||||||
"latitude": "Breedtegraad",
|
"latitude": "Breedtegraad",
|
||||||
|
|||||||
@@ -102,6 +102,8 @@
|
|||||||
"chooseLabel": "Wybierz {{label}}",
|
"chooseLabel": "Wybierz {{label}}",
|
||||||
"collapseAll": "Zwiń wszystko",
|
"collapseAll": "Zwiń wszystko",
|
||||||
"editLabelData": "Edytuj dane {{label}}",
|
"editLabelData": "Edytuj dane {{label}}",
|
||||||
|
"editLink": "Edytuj Link",
|
||||||
|
"editRelationship": "Edytuj Relacje",
|
||||||
"itemsAndMore": "{{items}} i {{count}} więcej",
|
"itemsAndMore": "{{items}} i {{count}} więcej",
|
||||||
"labelRelationship": "Relacja {{label}}",
|
"labelRelationship": "Relacja {{label}}",
|
||||||
"latitude": "Szerokość",
|
"latitude": "Szerokość",
|
||||||
|
|||||||
@@ -102,6 +102,8 @@
|
|||||||
"chooseLabel": "Escolher {{label}}",
|
"chooseLabel": "Escolher {{label}}",
|
||||||
"collapseAll": "Recolher todos",
|
"collapseAll": "Recolher todos",
|
||||||
"editLabelData": "Editar dados de {{label}}",
|
"editLabelData": "Editar dados de {{label}}",
|
||||||
|
"editLink": "Editar Link",
|
||||||
|
"editRelationship": "Editar Relacionamento",
|
||||||
"itemsAndMore": "{{items}} e mais {{count}}",
|
"itemsAndMore": "{{items}} e mais {{count}}",
|
||||||
"labelRelationship": "Relacionado a {{label}}",
|
"labelRelationship": "Relacionado a {{label}}",
|
||||||
"latitude": "Latitude",
|
"latitude": "Latitude",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "Пользовательский URL",
|
"customURL": "Пользовательский URL",
|
||||||
"editLabelData": "Редактировать данные {{label}}",
|
"editLabelData": "Редактировать данные {{label}}",
|
||||||
"editLink": "Редактировать ссылку",
|
"editLink": "Редактировать ссылку",
|
||||||
|
"editRelationship": "Редактировать Отношения",
|
||||||
"enterURL": "Введите URL",
|
"enterURL": "Введите URL",
|
||||||
"internalLink": "Внутренняя ссылка",
|
"internalLink": "Внутренняя ссылка",
|
||||||
"itemsAndMore": "{{items}} и ещё {{count}}",
|
"itemsAndMore": "{{items}} и ещё {{count}}",
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
"chooseLabel": "Välj {{label}}",
|
"chooseLabel": "Välj {{label}}",
|
||||||
"collapseAll": "kollapsa Alla",
|
"collapseAll": "kollapsa Alla",
|
||||||
"editLabelData": "Redigera {{label}} data",
|
"editLabelData": "Redigera {{label}} data",
|
||||||
|
"editLink": "Redigera Länk",
|
||||||
|
"editRelationship": "Redigera Relation",
|
||||||
"itemsAndMore": "{{items}} och {{count}} mer",
|
"itemsAndMore": "{{items}} och {{count}} mer",
|
||||||
"labelRelationship": "{{label}} Relation",
|
"labelRelationship": "{{label}} Relation",
|
||||||
"latitude": "Latitud",
|
"latitude": "Latitud",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "URL ที่กำหนดเอง",
|
"customURL": "URL ที่กำหนดเอง",
|
||||||
"editLabelData": "แก้ไขข้อมูล {{label}}",
|
"editLabelData": "แก้ไขข้อมูล {{label}}",
|
||||||
"editLink": "แก้ไขลิงก์",
|
"editLink": "แก้ไขลิงก์",
|
||||||
|
"editRelationship": "แก้ไขความสัมพันธ์",
|
||||||
"enterURL": "ระบุ URL",
|
"enterURL": "ระบุ URL",
|
||||||
"internalLink": "ลิงก์ภายใน",
|
"internalLink": "ลิงก์ภายใน",
|
||||||
"itemsAndMore": "{{items}} และเพิ่มเติมอีก {{count}}",
|
"itemsAndMore": "{{items}} และเพิ่มเติมอีก {{count}}",
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
"chooseDocumentToLink": "Bağlantı verilecek bir döküman seçin.",
|
"chooseDocumentToLink": "Bağlantı verilecek bir döküman seçin.",
|
||||||
"customURL": "Özel URL",
|
"customURL": "Özel URL",
|
||||||
"editLink": "Bağlantıyı Düzenle",
|
"editLink": "Bağlantıyı Düzenle",
|
||||||
|
"editRelationship": "İlişkiyi Ekle",
|
||||||
"enterURL": "Bir URL girin",
|
"enterURL": "Bir URL girin",
|
||||||
"internalLink": "İç bağlantı",
|
"internalLink": "İç bağlantı",
|
||||||
"linkType": "Bağlantı türü",
|
"linkType": "Bağlantı türü",
|
||||||
|
|||||||
@@ -384,6 +384,9 @@
|
|||||||
"editLink": {
|
"editLink": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"editRelationship": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"enterURL": {
|
"enterURL": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -497,6 +500,7 @@
|
|||||||
"chooseDocumentToLink",
|
"chooseDocumentToLink",
|
||||||
"customURL",
|
"customURL",
|
||||||
"editLink",
|
"editLink",
|
||||||
|
"editRelationship",
|
||||||
"enterURL",
|
"enterURL",
|
||||||
"internalLink",
|
"internalLink",
|
||||||
"linkType",
|
"linkType",
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
"customURL": "Власний URL",
|
"customURL": "Власний URL",
|
||||||
"editLabelData": "Редагувати данні {{label}}",
|
"editLabelData": "Редагувати данні {{label}}",
|
||||||
"editLink": "Редагувати посилання",
|
"editLink": "Редагувати посилання",
|
||||||
|
"editRelationship": "Редагувати взаємозв'язок",
|
||||||
"enterURL": "Введіть URL",
|
"enterURL": "Введіть URL",
|
||||||
"internalLink": "Внутрішнє посилання",
|
"internalLink": "Внутрішнє посилання",
|
||||||
"itemsAndMore": "{{items}} і ще {{count}}",
|
"itemsAndMore": "{{items}} і ще {{count}}",
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
"chooseLabel": "Chọn: {{label}}",
|
"chooseLabel": "Chọn: {{label}}",
|
||||||
"collapseAll": "Ẩn toàn bộ",
|
"collapseAll": "Ẩn toàn bộ",
|
||||||
"editLabelData": "Chỉnh sửa nội dung của: {{label}}",
|
"editLabelData": "Chỉnh sửa nội dung của: {{label}}",
|
||||||
|
"editLink": "Chỉnh sửa liên kết",
|
||||||
|
"editRelationship": "Chỉnh sửa mối quan hệ",
|
||||||
"itemsAndMore": "{{items}} và {{count}} món nữa",
|
"itemsAndMore": "{{items}} và {{count}} món nữa",
|
||||||
"labelRelationship": "Mối quan hệ của {{label}} (Relationship)",
|
"labelRelationship": "Mối quan hệ của {{label}} (Relationship)",
|
||||||
"latitude": "Vĩ độ",
|
"latitude": "Vĩ độ",
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
"customURL": "自定义URL",
|
"customURL": "自定义URL",
|
||||||
"editLabelData": "编辑{{label}}数据",
|
"editLabelData": "编辑{{label}}数据",
|
||||||
"editLink": "编辑链接",
|
"editLink": "编辑链接",
|
||||||
|
"editRelationship": "编辑关系",
|
||||||
"enterURL": "输入一个URL",
|
"enterURL": "输入一个URL",
|
||||||
"internalLink": "内部链接",
|
"internalLink": "内部链接",
|
||||||
"itemsAndMore": "{{items}}和{{count}}更多",
|
"itemsAndMore": "{{items}}和{{count}}更多",
|
||||||
|
|||||||
@@ -480,7 +480,20 @@ describe('fields', () => {
|
|||||||
await expect(editLinkModal).toBeHidden();
|
await expect(editLinkModal).toBeHidden();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should open uploads drawer from read-only field', async () => {
|
test('should open upload drawer and render custom relationship fields', async () => {
|
||||||
|
navigateToRichTextFields();
|
||||||
|
const field = await page.locator('#field-richText');
|
||||||
|
const button = await field.locator('button.rich-text-upload__upload-drawer-toggler');
|
||||||
|
|
||||||
|
await button.click();
|
||||||
|
|
||||||
|
const documentDrawer = await page.locator('[id^=drawer_1_upload-drawer-]');
|
||||||
|
await expect(documentDrawer).toBeVisible();
|
||||||
|
const caption = await documentDrawer.locator('#field-caption');
|
||||||
|
await expect(caption).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should open upload document drawer from read-only field', async () => {
|
||||||
navigateToRichTextFields();
|
navigateToRichTextFields();
|
||||||
const field = await page.locator('#field-richTextReadOnly');
|
const field = await page.locator('#field-richTextReadOnly');
|
||||||
const button = await field.locator('button.rich-text-upload__doc-drawer-toggler.doc-drawer__toggler');
|
const button = await field.locator('button.rich-text-upload__doc-drawer-toggler.doc-drawer__toggler');
|
||||||
@@ -491,7 +504,7 @@ describe('fields', () => {
|
|||||||
await expect(documentDrawer).toBeVisible();
|
await expect(documentDrawer).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should open relationship drawer from read-only field', async () => {
|
test('should open relationship document drawer from read-only field', async () => {
|
||||||
navigateToRichTextFields();
|
navigateToRichTextFields();
|
||||||
const field = await page.locator('#field-richTextReadOnly');
|
const field = await page.locator('#field-richTextReadOnly');
|
||||||
const button = await field.locator('button.rich-text-relationship__doc-drawer-toggler.doc-drawer__toggler');
|
const button = await field.locator('button.rich-text-relationship__doc-drawer-toggler.doc-drawer__toggler');
|
||||||
|
|||||||
Reference in New Issue
Block a user