From c85eb46a43a0dd138de2096408f29be3daeffe31 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 21 Dec 2020 14:20:03 +0100 Subject: [PATCH] Fix input display Signed-off-by: soupette --- .../admin/src/components/InputUID/index.js | 8 ++++++++ .../admin/src/containers/ListView/index.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js b/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js index f893a39e11..a978c41f62 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/InputUID/index.js @@ -115,6 +115,14 @@ const InputUID = ({ } }; + // FIXME: we need to find a better way to autofill the input when it is required. + // useEffect(() => { + // if (!value && validations.required) { + // generateUid.current(true); + // } + // // eslint-disable-next-line react-hooks/exhaustive-deps + // }, []); + useEffect(() => { if ( debouncedValue && diff --git a/packages/strapi-plugin-content-manager/admin/src/containers/ListView/index.js b/packages/strapi-plugin-content-manager/admin/src/containers/ListView/index.js index c8c928be42..eb1b6e214d 100644 --- a/packages/strapi-plugin-content-manager/admin/src/containers/ListView/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/containers/ListView/index.js @@ -118,7 +118,7 @@ function ListView({ const [isFilterPickerOpen, setFilterPickerState] = useState(false); const [idToDelete, setIdToDelete] = useState(null); const contentType = layout.contentType; - const hasDraftAndPublish = contentType.options.draftAndPublish || false; + const hasDraftAndPublish = get(contentType, 'options.draftAndPublish', false); const allAllowedHeaders = useMemo(() => getAllAllowedHeaders(attributes), [attributes]); const filters = useMemo(() => {