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
Headless CMS - "multipleValues" renderer for Date/Time field #973
Conversation
add `RemoveFieldButton`
add `dateTimeFields` components for field with multipleValues true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace `ButtonDefault` with `IconButton`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at these minor things. Nothing critical.
import React from "react"; | ||
import {css} from "emotion"; | ||
import {Cell} from "@webiny/ui/Grid"; | ||
import {IconButton} from "@webiny/ui/Button"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check prettier.
<IconButton className={deleteIconStyles} onClick={trailingIcon.onClick} icon={trailingIcon.icon} /> | ||
</Cell> | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this as well.
|
||
const plugin: CmsEditorFieldRendererPlugin = { | ||
type: "cms-editor-field-renderer", | ||
name: "cms-editor-field-renderer-date-time", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it, check packages/app-headless-cms/src/admin/plugins/fields/dateTime.tsx:12
, this one has dateTime
in the name. Ideally we'd use kebab case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you opened this file in a different branch
@@ -3,16 +3,25 @@ import { I18NValue } from "@webiny/app-i18n/components"; | |||
import { CmsEditorField } from "@webiny/app-headless-cms/types"; | |||
import { BindComponentRenderProp } from "@webiny/form"; | |||
import { Input as UiInput } from "@webiny/ui/Input"; | |||
import {ReactNode} from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier.
closes #914
Related Issue
#914
Headless CMS - "multipleValues" renderer for Date/Time field
Your solution
Use
DynamicListMultipleValues
componentHow Has This Been Tested?
Manually, using the Admin app
Screenshots:
https://www.loom.com/share/ed8b97db76e8426ba86af1aa70e4572f