From 8a993d13e281c8b990d8b3239c32967db9d4bb5c Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Thu, 23 Nov 2023 01:35:30 +0200 Subject: [PATCH 1/7] style: align SidebarHeading with TopHeading --- packages/decap-cms-core/src/components/Collection/Sidebar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/decap-cms-core/src/components/Collection/Sidebar.js b/packages/decap-cms-core/src/components/Collection/Sidebar.js index 096bf9ff7a93..7d3852dec884 100644 --- a/packages/decap-cms-core/src/components/Collection/Sidebar.js +++ b/packages/decap-cms-core/src/components/Collection/Sidebar.js @@ -30,10 +30,11 @@ const SidebarContainer = styled.aside` `; const SidebarHeading = styled.h2` - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; padding: 0; - margin: 18px 12px 12px; + margin: 10px 12px 10px; color: ${colors.textLead}; `; From 2f3eb533ec304f43fa095877cca0e038b1684086 Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Thu, 23 Nov 2023 21:34:45 +0200 Subject: [PATCH 2/7] style: bring to shorthand property --- packages/decap-cms-core/src/components/Collection/Sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/decap-cms-core/src/components/Collection/Sidebar.js b/packages/decap-cms-core/src/components/Collection/Sidebar.js index 7d3852dec884..74a536e02fda 100644 --- a/packages/decap-cms-core/src/components/Collection/Sidebar.js +++ b/packages/decap-cms-core/src/components/Collection/Sidebar.js @@ -34,7 +34,7 @@ const SidebarHeading = styled.h2` font-weight: 600; line-height: 37px; padding: 0; - margin: 10px 12px 10px; + margin: 10px 12px; color: ${colors.textLead}; `; From 8c4867d7e71b7f08ab8efbe5a82c437781944f3d Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Wed, 29 Nov 2023 00:46:23 +0200 Subject: [PATCH 3/7] style: fix guides --- .../src/components/Collection/Entries/EntriesCollection.js | 4 +++- .../src/components/Collection/Entries/EntryCard.js | 4 ++-- packages/decap-cms-core/src/components/Collection/Sidebar.js | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js b/packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js index 2d61e2037de4..830f7911de8c 100644 --- a/packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js +++ b/packages/decap-cms-core/src/components/Collection/Entries/EntriesCollection.js @@ -22,8 +22,10 @@ import { selectCollectionEntriesCursor } from '../../../reducers/cursors'; import Entries from './Entries'; const GroupHeading = styled.h2` - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; + padding-inline-start: 20px; color: ${colors.textLead}; `; diff --git a/packages/decap-cms-core/src/components/Collection/Entries/EntryCard.js b/packages/decap-cms-core/src/components/Collection/Entries/EntryCard.js index 03ee71452551..47bed5bf3210 100644 --- a/packages/decap-cms-core/src/components/Collection/Entries/EntryCard.js +++ b/packages/decap-cms-core/src/components/Collection/Entries/EntryCard.js @@ -20,7 +20,7 @@ const ListCard = styled.li` const ListCardLink = styled(Link)` display: block; max-width: 100%; - padding: 16px 22px; + padding: 16px 20px; &:hover { background-color: ${colors.foreground}; @@ -63,7 +63,7 @@ const CardHeading = styled.h2` `; const CardBody = styled.div` - padding: 16px 22px; + padding: 16px 20px; height: 90px; position: relative; margin-bottom: ${props => props.hasImage && 0}; diff --git a/packages/decap-cms-core/src/components/Collection/Sidebar.js b/packages/decap-cms-core/src/components/Collection/Sidebar.js index 74a536e02fda..513d6e6a7552 100644 --- a/packages/decap-cms-core/src/components/Collection/Sidebar.js +++ b/packages/decap-cms-core/src/components/Collection/Sidebar.js @@ -34,12 +34,12 @@ const SidebarHeading = styled.h2` font-weight: 600; line-height: 37px; padding: 0; - margin: 10px 12px; + margin: 10px 20px; color: ${colors.textLead}; `; const SidebarNavList = styled.ul` - margin: 16px 0 0; + margin: 12px 0 0; list-style: none; overflow: auto; `; From 2e718e0219555be0c1d107a5691b771b2034e803 Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Wed, 29 Nov 2023 18:15:00 +0200 Subject: [PATCH 4/7] style: update after testing --- .../__snapshots__/Sidebar.spec.js.snap | 28 +++++++++-------- .../__snapshots__/EditorToolbar.spec.js.snap | 30 +++++++++---------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap index 6e7ecd2607f1..c9c60d17b588 100644 --- a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap +++ b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap @@ -20,15 +20,16 @@ exports[`Sidebar should render nested collection with filterTerm 1`] = ` } .emotion-2 { - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; padding: 0; - margin: 18px 12px 12px; + margin: 10px 20px; color: #313d3e; } .emotion-4 { - margin: 16px 0 0; + margin: 12px 0 0; list-style: none; overflow: auto; } @@ -80,15 +81,16 @@ exports[`Sidebar should render sidebar with a nested collection 1`] = ` } .emotion-2 { - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; padding: 0; - margin: 18px 12px 12px; + margin: 10px 20px; color: #313d3e; } .emotion-4 { - margin: 16px 0 0; + margin: 12px 0 0; list-style: none; overflow: auto; } @@ -139,15 +141,16 @@ exports[`Sidebar should render sidebar with a simple collection 1`] = ` } .emotion-2 { - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; padding: 0; - margin: 18px 12px 12px; + margin: 10px 20px; color: #313d3e; } .emotion-4 { - margin: 16px 0 0; + margin: 12px 0 0; list-style: none; overflow: auto; } @@ -235,15 +238,16 @@ exports[`Sidebar should render sidebar without search 1`] = ` } .emotion-2 { - font-size: 23px; + font-size: 22px; font-weight: 600; + line-height: 37px; padding: 0; - margin: 18px 12px 12px; + margin: 10px 20px; color: #313d3e; } .emotion-4 { - margin: 16px 0 0; + margin: 12px 0 0; list-style: none; overflow: auto; } diff --git a/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap b/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap index a70e21947f5e..3bf89863278e 100644 --- a/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap +++ b/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap @@ -3,7 +3,7 @@ exports[`EditorToolbar should render normal save button 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -259,7 +259,7 @@ exports[`EditorToolbar should render normal save button 1`] = ` exports[`EditorToolbar should render normal save button 2`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -515,7 +515,7 @@ exports[`EditorToolbar should render normal save button 2`] = ` exports[`EditorToolbar should render with default props 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -730,7 +730,7 @@ exports[`EditorToolbar should render with default props 1`] = ` exports[`EditorToolbar should render with status=draft,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -1020,7 +1020,7 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=false 1` exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -1371,7 +1371,7 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -1661,7 +1661,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -1989,7 +1989,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -2279,7 +2279,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -2630,7 +2630,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -2850,7 +2850,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -3040,7 +3040,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -3260,7 +3260,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=false,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -3480,7 +3480,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=true,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; @@ -3700,7 +3700,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=true,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); position: fixed; top: 0; left: 0; From 07e997084bfad355ad9e03fdf6ff852fb87ae002 Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Sat, 2 Dec 2023 00:40:14 +0200 Subject: [PATCH 5/7] style: align items in sidebar --- .../src/components/Collection/CollectionSearch.js | 6 +++--- .../src/components/Collection/NestedCollection.js | 4 ++-- .../decap-cms-core/src/components/Collection/Sidebar.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/decap-cms-core/src/components/Collection/CollectionSearch.js b/packages/decap-cms-core/src/components/Collection/CollectionSearch.js index 25c3d49a390c..2532921e1296 100644 --- a/packages/decap-cms-core/src/components/Collection/CollectionSearch.js +++ b/packages/decap-cms-core/src/components/Collection/CollectionSearch.js @@ -31,7 +31,7 @@ const SearchInput = styled.input` background-color: #eff0f4; border-radius: ${lengths.borderRadius}; font-size: 14px; - padding: 10px 6px 10px 32px; + padding: 10px 6px 10px 34px; width: 100%; position: relative; z-index: ${zIndex.zIndex1}; @@ -62,7 +62,7 @@ const Suggestions = styled.ul` `; const SuggestionHeader = styled.li` - padding: 0 6px 6px 32px; + padding: 0 6px 6px 34px; font-size: 12px; color: ${colors.text}; `; @@ -71,7 +71,7 @@ const SuggestionItem = styled.li( ({ isActive }) => ` color: ${isActive ? colors.active : colorsRaw.grayDark}; background-color: ${isActive ? colors.activeBackground : 'inherit'}; - padding: 6px 6px 6px 32px; + padding: 6px 6px 6px 34px; cursor: pointer; position: relative; diff --git a/packages/decap-cms-core/src/components/Collection/NestedCollection.js b/packages/decap-cms-core/src/components/Collection/NestedCollection.js index 6224c71e6350..0cc9a068c870 100644 --- a/packages/decap-cms-core/src/components/Collection/NestedCollection.js +++ b/packages/decap-cms-core/src/components/Collection/NestedCollection.js @@ -48,11 +48,11 @@ const TreeNavLink = styled(NavLink)` font-weight: 500; align-items: center; padding: 8px; - padding-left: ${props => props.depth * 20 + 12}px; + padding-left: ${props => props.depth * 16 + 18}px; border-left: 2px solid #fff; ${Icon} { - margin-right: 8px; + margin-right: 4px; flex-shrink: 0; } diff --git a/packages/decap-cms-core/src/components/Collection/Sidebar.js b/packages/decap-cms-core/src/components/Collection/Sidebar.js index 513d6e6a7552..78abcdebe4e7 100644 --- a/packages/decap-cms-core/src/components/Collection/Sidebar.js +++ b/packages/decap-cms-core/src/components/Collection/Sidebar.js @@ -49,12 +49,12 @@ const SidebarNavLink = styled(NavLink)` font-size: 14px; font-weight: 500; align-items: center; - padding: 8px 12px; + padding: 8px 18px; border-left: 2px solid #fff; z-index: -1; ${Icon} { - margin-right: 8px; + margin-right: 4px; flex-shrink: 0; } From afbb629e16177fc6f1468bb0f328e5ed1ee474ab Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Thu, 14 Dec 2023 22:33:32 +0200 Subject: [PATCH 6/7] style: update after testing --- dev-test/config.yml | 24 --------------- .../NestedCollection.spec.js.snap | 28 ++++++++--------- .../__snapshots__/Sidebar.spec.js.snap | 8 ++--- .../__snapshots__/EditorToolbar.spec.js.snap | 30 +++++++++---------- 4 files changed, 33 insertions(+), 57 deletions(-) diff --git a/dev-test/config.yml b/dev-test/config.yml index 66cef499d080..a8f2f95476f4 100644 --- a/dev-test/config.yml +++ b/dev-test/config.yml @@ -52,29 +52,6 @@ collections: # A list of collections the CMS should be able to edit - { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' } - - name: 'restaurants' # Used in routes, ie.: /admin/collections/:slug/edit - label: 'Restaurants' # Used in the UI - label_singular: 'Restaurant' # Used in the UI, ie: "New Post" - description: > - Restaurants is an entry type used for testing galleries, relations and other widgets. - The tests must be written in such way that adding new fields does not affect previous flows. - folder: '_restaurants' - slug: '{{year}}-{{month}}-{{day}}-{{slug}}' - summary: '{{title}} -- {{year}}/{{month}}/{{day}}' - create: true # Allow users to create new documents in this collection - fields: # The fields each document in this collection have - - { label: 'Title', name: 'title', widget: 'string', tagname: 'h1' } - - { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' } - - { name: 'gallery', widget: 'image', choose_url: true, media_library: {config: {multiple: true, max_files: 999}}} - - { name: 'post', widget: relation, collection: posts, multiple: true, search_fields: [ "title" ], display_fields: [ "title" ], value_field: "{{slug}}"} - - name: authors - label: Authors - label_singular: 'Author' - widget: list - fields: - - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } - - { label: 'Description', name: 'description', widget: 'markdown' } - - name: 'faq' # Used in routes, ie.: /admin/collections/:slug/edit label: 'FAQ' # Used in the UI folder: '_faqs' @@ -158,7 +135,6 @@ collections: # A list of collections the CMS should be able to edit multiple: true, } - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } - - { label: 'Color', name: 'color', widget: 'color' } - label: 'Object' name: 'object' widget: 'object' diff --git a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/NestedCollection.spec.js.snap b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/NestedCollection.spec.js.snap index 5e5632715e40..dd3f5fcd55ac 100644 --- a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/NestedCollection.spec.js.snap +++ b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/NestedCollection.spec.js.snap @@ -14,12 +14,12 @@ exports[`NestedCollection should render connected component 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 12px; + padding-left: 18px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -100,12 +100,12 @@ exports[`NestedCollection should render connected component 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 32px; + padding-left: 34px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -169,12 +169,12 @@ exports[`NestedCollection should render connected component 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 32px; + padding-left: 34px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -243,12 +243,12 @@ exports[`NestedCollection should render correctly with nested entries 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 12px; + padding-left: 18px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -329,12 +329,12 @@ exports[`NestedCollection should render correctly with nested entries 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 32px; + padding-left: 34px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -398,12 +398,12 @@ exports[`NestedCollection should render correctly with nested entries 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 32px; + padding-left: 34px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -472,12 +472,12 @@ exports[`NestedCollection should render correctly with no entries 1`] = ` -ms-flex-align: center; align-items: center; padding: 8px; - padding-left: 12px; + padding-left: 18px; border-left: 2px solid #fff; } .emotion-0 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; diff --git a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap index c9c60d17b588..accf2fd59286 100644 --- a/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap +++ b/packages/decap-cms-core/src/components/Collection/__tests__/__snapshots__/Sidebar.spec.js.snap @@ -166,13 +166,13 @@ exports[`Sidebar should render sidebar with a simple collection 1`] = ` -webkit-box-align: center; -ms-flex-align: center; align-items: center; - padding: 8px 12px; + padding: 8px 18px; border-left: 2px solid #fff; z-index: -1; } .emotion-6 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; @@ -263,13 +263,13 @@ exports[`Sidebar should render sidebar without search 1`] = ` -webkit-box-align: center; -ms-flex-align: center; align-items: center; - padding: 8px 12px; + padding: 8px 18px; border-left: 2px solid #fff; z-index: -1; } .emotion-6 mocked-icon { - margin-right: 8px; + margin-right: 4px; -webkit-flex-shrink: 0; -ms-flex-negative: 0; flex-shrink: 0; diff --git a/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap b/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap index 3bf89863278e..a70e21947f5e 100644 --- a/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap +++ b/packages/decap-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap @@ -3,7 +3,7 @@ exports[`EditorToolbar should render normal save button 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -259,7 +259,7 @@ exports[`EditorToolbar should render normal save button 1`] = ` exports[`EditorToolbar should render normal save button 2`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -515,7 +515,7 @@ exports[`EditorToolbar should render normal save button 2`] = ` exports[`EditorToolbar should render with default props 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -730,7 +730,7 @@ exports[`EditorToolbar should render with default props 1`] = ` exports[`EditorToolbar should render with status=draft,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -1020,7 +1020,7 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=false 1` exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -1371,7 +1371,7 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -1661,7 +1661,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -1989,7 +1989,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -2279,7 +2279,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -2630,7 +2630,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -2850,7 +2850,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -3040,7 +3040,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -3260,7 +3260,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=false,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -3480,7 +3480,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=true,useOpenAuthoring=false 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; @@ -3700,7 +3700,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=true,isNewEntry=false,isModification=true,useOpenAuthoring=true 1`] = ` .emotion-0 { - box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12); + box-shadow: 0 2px 6px 0 rgba(68, 74, 87, 0.05),0 1px 3px 0 rgba(68, 74, 87, 0.1),0 2px 54px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; From 35d45002153c48aa403b5ed5a86fc1b33b3960bd Mon Sep 17 00:00:00 2001 From: Oleg Fedak Date: Thu, 18 Jan 2024 14:52:32 +0200 Subject: [PATCH 7/7] Update config.yml --- dev-test/config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dev-test/config.yml b/dev-test/config.yml index a8f2f95476f4..66cef499d080 100644 --- a/dev-test/config.yml +++ b/dev-test/config.yml @@ -52,6 +52,29 @@ collections: # A list of collections the CMS should be able to edit - { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' } + - name: 'restaurants' # Used in routes, ie.: /admin/collections/:slug/edit + label: 'Restaurants' # Used in the UI + label_singular: 'Restaurant' # Used in the UI, ie: "New Post" + description: > + Restaurants is an entry type used for testing galleries, relations and other widgets. + The tests must be written in such way that adding new fields does not affect previous flows. + folder: '_restaurants' + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + summary: '{{title}} -- {{year}}/{{month}}/{{day}}' + create: true # Allow users to create new documents in this collection + fields: # The fields each document in this collection have + - { label: 'Title', name: 'title', widget: 'string', tagname: 'h1' } + - { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' } + - { name: 'gallery', widget: 'image', choose_url: true, media_library: {config: {multiple: true, max_files: 999}}} + - { name: 'post', widget: relation, collection: posts, multiple: true, search_fields: [ "title" ], display_fields: [ "title" ], value_field: "{{slug}}"} + - name: authors + label: Authors + label_singular: 'Author' + widget: list + fields: + - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } + - { label: 'Description', name: 'description', widget: 'markdown' } + - name: 'faq' # Used in routes, ie.: /admin/collections/:slug/edit label: 'FAQ' # Used in the UI folder: '_faqs' @@ -135,6 +158,7 @@ collections: # A list of collections the CMS should be able to edit multiple: true, } - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } + - { label: 'Color', name: 'color', widget: 'color' } - label: 'Object' name: 'object' widget: 'object'