+
{item.title} {item.status}
- {['draft', 'ready', 'publish'].includes(query) ? null :
- ((item.status === 'draft')
- ?
- : (item.status === 'ready') ? : null
- )}
+ {['draft', 'ready', 'publish'].includes(query) ? null : item.status === 'draft' ? (
+
+ ) : item.status === 'ready' ? (
+
+ ) : null}
{/*
{item.published_date && (
@@ -95,9 +97,7 @@ function PostList({ actions, format, filters, onPagination, data, fetchPosts, qu
item && (
<>
- {item.published_date
- ? formatDate(item.published_date)
- : '---'}
+ {item.published_date ? formatDate(item.published_date) : '---'}
@@ -120,8 +120,8 @@ function PostList({ actions, format, filters, onPagination, data, fetchPosts, qu
{authors[author]?.display_name
? authors[author]?.display_name
: authors[author]?.['email']
- ? authors[author]?.['email']
- : null}
+ ? authors[author]?.['email']
+ : null}
{' '}
>
@@ -198,7 +198,7 @@ function PostList({ actions, format, filters, onPagination, data, fetchPosts, qu
icon={}
onClick={(e) => {
e.stopPropagation();
- alert("this do nothing")
+ alert('this do nothing');
}}
/>
@@ -225,7 +225,7 @@ function PostList({ actions, format, filters, onPagination, data, fetchPosts, qu
},
onMouseLeave: (event) => {
document.body.style.cursor = 'default';
- }
+ },
};
}}
style={{ maxWidth: '100vw', overflowX: 'auto' }}
@@ -251,7 +251,7 @@ function PostList({ actions, format, filters, onPagination, data, fetchPosts, qu
onQuickEditUpdate={() => setExpandedRowKeys([])}
/>
),
- expandIcon: () => { },
+ expandIcon: () => {},
}}
pagination={{
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} results`,
diff --git a/studio/src/components/PageHeader/index.css b/studio/src/components/PageHeader/index.css
index ef1544532..43affd631 100644
--- a/studio/src/components/PageHeader/index.css
+++ b/studio/src/components/PageHeader/index.css
@@ -1,4 +1,4 @@
.ant-page-header-breadcrumb ol {
- width: 0 !important;
- height: 0 !important;
+ width: 0 !important;
+ height: 0 !important;
}
diff --git a/studio/src/components/PageHeader/index.js b/studio/src/components/PageHeader/index.js
index c8b6d02e4..e5c69ebe9 100644
--- a/studio/src/components/PageHeader/index.js
+++ b/studio/src/components/PageHeader/index.js
@@ -20,8 +20,8 @@ function Pageheader() {
(pathSnippets[0] === 'advanced' && pathSnippets[1] === 'formats') ||
(pathSnippets[0] === 'admin' && pathSnippets[1] === 'events') ||
(pathSnippets[0] === 'advanced' && pathSnippets[1] === 'webhooks')
- ? pathSnippets[1]
- : pathSnippets[0];
+ ? pathSnippets[1]
+ : pathSnippets[0];
const isBreadCrumbsHidden =
(pathSnippets.includes('edit') || pathSnippets.includes('create')) &&
diff --git a/studio/src/components/Search/index.js b/studio/src/components/Search/index.js
index d1fdd9aaa..b31011d0a 100644
--- a/studio/src/components/Search/index.js
+++ b/studio/src/components/Search/index.js
@@ -55,7 +55,7 @@ function Search({ collapsed }) {
});
setSelected({ entityIndex, indexItem });
}}
- style={{ width: '100%', display: 'flex', justifyContent: 'center', }}
+ style={{ width: '100%', display: 'flex', justifyContent: 'center' }}
>
{!collapsed ? (
@@ -174,7 +174,7 @@ function BasicLayout(props) {
{/* */}
- {['/posts', '/pages', '/categories', '/tags', "/media"].includes(location.pathname) || (
+ {['/posts', '/pages', '/categories', '/tags', '/media'].includes(location.pathname) || (
)}
diff --git a/studio/src/pages/categories/components/CategoryList.js b/studio/src/pages/categories/components/CategoryList.js
index 57fe69452..27f5c95a6 100644
--- a/studio/src/pages/categories/components/CategoryList.js
+++ b/studio/src/pages/categories/components/CategoryList.js
@@ -65,7 +65,7 @@ function CategoryList({ actions, data, filters, setFilters, fetchCategories }) {
}}
to={`/categories/${record.id}/edit`}
>
-
+
{record.parent_category?.name}
@@ -123,14 +123,14 @@ function CategoryList({ actions, data, filters, setFilters, fetchCategories }) {
];
return (
-
+
{
document.body.style.cursor = 'default';
- }
+ },
};
}}
rowKey={'id'}
diff --git a/studio/src/pages/categories/index.js b/studio/src/pages/categories/index.js
index 8a85635a2..dde90e7fe 100644
--- a/studio/src/pages/categories/index.js
+++ b/studio/src/pages/categories/index.js
@@ -114,7 +114,10 @@ function Categories({ permission }) {
-
+
Categories
diff --git a/studio/src/pages/media/EditMedium.js b/studio/src/pages/media/EditMedium.js
index c915e1864..ede21714f 100644
--- a/studio/src/pages/media/EditMedium.js
+++ b/studio/src/pages/media/EditMedium.js
@@ -1,6 +1,18 @@
import React from 'react';
import { Link, useParams } from 'react-router-dom';
-import { Row, Col, Skeleton, Form, Input, Button, Space, Popconfirm, Collapse, ConfigProvider, Typography } from 'antd';
+import {
+ Row,
+ Col,
+ Skeleton,
+ Form,
+ Input,
+ Button,
+ Space,
+ Popconfirm,
+ Collapse,
+ ConfigProvider,
+ Typography,
+} from 'antd';
import { useSelector, useDispatch } from 'react-redux';
import { getMedium, updateMedium, deleteMedium } from '../../actions/media';
import RecordNotFound from '../../components/ErrorsAndImage/RecordNotFound';
@@ -61,7 +73,8 @@ function EditMedium() {
colorBgContainer: '#F9FAFB',
},
},
- }}>
+ }}
+ >
+
-
+
);
}
diff --git a/studio/src/pages/media/components/MediumList.js b/studio/src/pages/media/components/MediumList.js
index 251751ed3..2e1533673 100644
--- a/studio/src/pages/media/components/MediumList.js
+++ b/studio/src/pages/media/components/MediumList.js
@@ -8,7 +8,7 @@ function MediumList({ data, filters, setFilters }) {
(
-
-
+
+
diff --git a/studio/src/pages/media/index.js b/studio/src/pages/media/index.js
index e7bfb51b2..c66555f09 100644
--- a/studio/src/pages/media/index.js
+++ b/studio/src/pages/media/index.js
@@ -1,6 +1,17 @@
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useEffect } from 'react';
-import { Space, Button, Row, Col, Form, Input, Select, ConfigProvider, Typography, Tooltip } from 'antd';
+import {
+ Space,
+ Button,
+ Row,
+ Col,
+ Form,
+ Input,
+ Select,
+ ConfigProvider,
+ Typography,
+ Tooltip,
+} from 'antd';
import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
import { useDispatch, useSelector } from 'react-redux';
import MediumList from './components/MediumList';
@@ -23,7 +34,6 @@ function Media({ permission }) {
});
const [searchFieldExpand, setSearchFieldExpand] = React.useState(false);
-
const pathName = useLocation().pathname;
useEffect(() => {
@@ -75,35 +85,35 @@ function Media({ permission }) {
},
}}
>
-
+
(
-
+
{item.title}
{/*
@@ -137,7 +136,7 @@ function PageList({ actions, format, status, data, filters, setFilters, fetchPag
size="large"
icon={}
onClick={() => {
- alert("this do nothing")
+ alert('this do nothing');
}}
/>
- Are you sure you want to delete this page?
+
+ Are you sure you want to delete this page?
+
{/* }
@@ -193,7 +194,7 @@ function PageList({ actions, format, status, data, filters, setFilters, fetchPag
},
onMouseLeave: (event) => {
document.body.style.cursor = 'default';
- }
+ },
};
}}
style={{ maxWidth: '100vw', overflowX: 'auto' }}
@@ -218,7 +219,7 @@ function PageList({ actions, format, status, data, filters, setFilters, fetchPag
onQuickEditUpdate={() => setExpandedRowKeys([])}
/>
),
- expandIcon: () => { },
+ expandIcon: () => {},
}}
pagination={{
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} results`,
diff --git a/studio/src/pages/pages/index.js b/studio/src/pages/pages/index.js
index 5582f027b..0921d3d4f 100644
--- a/studio/src/pages/pages/index.js
+++ b/studio/src/pages/pages/index.js
@@ -202,7 +202,10 @@ function Pages({ formats }) {
-
+
Pages
@@ -210,7 +213,8 @@ function Pages({ formats }) {
{searchFieldExpand ? (
- {/**/}
+
+ {/**/}
}>
@@ -236,11 +240,12 @@ function Pages({ formats }) {
-
+
- {/**/}
+
+ {/**/}
-
+
@@ -296,13 +308,17 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
<>
{actions.includes('admin') || actions.includes('publish') ? (
- { setStatus('publish'); form.submit(); }
- }
- menu={{ items: postActions }} htmlType="submit" icon={}>
+ {
+ setStatus('publish');
+ form.submit();
+ }}
+ menu={{ items: postActions }}
+ htmlType="submit"
+ icon={}
+ >
-
{data.id && status === 'publish' ? 'Update' : 'Publish'}
@@ -331,9 +347,15 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
}}
layout="vertical"
>
- }
+ (
+
+ )}
>
@@ -341,8 +363,7 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
-
- Last updated on: {' '}
+ Last updated on:{' '}
{getDatefromStringWithoutDay(data.updated_at)}
@@ -373,19 +394,29 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
-
- console.log("checked")} />
+
+ console.log('checked')} />
-
- console.log("checked")} />
+
+ console.log('checked')} />
- }
+ (
+
+ )}
>
@@ -401,14 +432,23 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
},
]}
>
-
+
-
- }
+ (
+
+ )}
>
@@ -417,9 +457,14 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
-
- }
+ (
+
+ )}
>
@@ -428,19 +473,29 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
- setSeoDrawerVisible(true)}>
-
-
- SEO
-
+
setSeoDrawerVisible(true)}
+ >
+
+ SEO
-
}
+ (
+
+ )}
>
- setCodeDrawerVisible(true)}>
+ setCodeDrawerVisible(true)}
+ >
Code Injection
@@ -586,7 +641,7 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
-
+
>
);
}
diff --git a/studio/src/pages/posts/index.js b/studio/src/pages/posts/index.js
index 06632d3f8..92732ce6e 100644
--- a/studio/src/pages/posts/index.js
+++ b/studio/src/pages/posts/index.js
@@ -216,7 +216,10 @@ function Posts({ formats }) {
-
+
Posts
diff --git a/studio/src/pages/tags/components/TagForm.js b/studio/src/pages/tags/components/TagForm.js
index 90e750b46..0ff9a5281 100644
--- a/studio/src/pages/tags/components/TagForm.js
+++ b/studio/src/pages/tags/components/TagForm.js
@@ -44,7 +44,8 @@ const TagForm = ({ onCreate, data = {} }) => {
colorBgContainer: '#F9FAFB',
},
},
- }}>
+ }}
+ >
{displayBgColorPicker ? (
-
+
{
-
+
diff --git a/studio/src/pages/tags/components/TagList.js b/studio/src/pages/tags/components/TagList.js
index c7f6aa9c0..bd9dd93f1 100644
--- a/studio/src/pages/tags/components/TagList.js
+++ b/studio/src/pages/tags/components/TagList.js
@@ -109,9 +109,9 @@ function TagList({ actions, filters, setFilters, fetchTags, data }) {
theme={{
components: {
Typography: {
- "colorText": "#101828"
+ colorText: '#101828',
},
- }
+ },
}}
>
{
document.body.style.cursor = 'default';
- }
+ },
};
}}
pagination={{
diff --git a/studio/src/pages/tags/index.js b/studio/src/pages/tags/index.js
index 6a49b1e8d..cc69b1f9b 100644
--- a/studio/src/pages/tags/index.js
+++ b/studio/src/pages/tags/index.js
@@ -117,7 +117,10 @@ function Tags({ permission }) {
-
+
Tags
diff --git a/studio/src/utils/date.js b/studio/src/utils/date.js
index b31149a8c..02fc11f4f 100644
--- a/studio/src/utils/date.js
+++ b/studio/src/utils/date.js
@@ -5,7 +5,8 @@ export const getDatefromString = (dateString) => {
return dateObj.toDateString();
};
-export const getDateAndTimeFromString = (dateString) => new Date(dateString).toLocaleString().replaceAll(",","").replaceAll("/","-")
+export const getDateAndTimeFromString = (dateString) =>
+ new Date(dateString).toLocaleString().replaceAll(',', '').replaceAll('/', '-');
export const getDatefromStringWithoutDay = (dateString) => {
const dateObj = new Date(Date.parse(dateString));
@@ -25,7 +26,10 @@ export const formatDate = (dateString) => {
let formattedDate = new Intl.DateTimeFormat('en-US', options).format(date);
formattedDate = formattedDate.replaceAll(',', '').replaceAll('/', '-');
const [month, day, year, time] = formattedDate.split(' ');
- const formattedTime = time.split(':').map((str) => str.padStart(2, '0')).join(':');
+ const formattedTime = time
+ .split(':')
+ .map((str) => str.padStart(2, '0'))
+ .join(':');
const formattedDateString = `${month} ${day}, ${year} ${formattedTime}`;
return formattedDateString;
From 38fba1c81995d6d014066f8703d82c3dd015044c Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com>
Date: Wed, 5 Apr 2023 11:32:49 +0000
Subject: [PATCH 27/69] fixed media padding and colors, index pages table
responsiveness and edit page changes
---
studio/src/assets/ThreeDotIcon.jsx | 12 ++-
studio/src/components/List/index.js | 18 ++--
studio/src/components/PageHeader/index.css | 4 -
studio/src/components/PageHeader/index.js | 1 -
studio/src/index.css | 22 ++++-
.../categories/components/CategoryList.js | 6 +-
studio/src/pages/media/EditMedium.js | 3 +-
studio/src/pages/pages/components/PageList.js | 9 +-
studio/src/pages/posts/components/PostForm.js | 85 +++++++++++++------
studio/src/pages/tags/components/TagList.js | 3 +
studio/src/utils/date.js | 6 +-
11 files changed, 112 insertions(+), 57 deletions(-)
delete mode 100644 studio/src/components/PageHeader/index.css
diff --git a/studio/src/assets/ThreeDotIcon.jsx b/studio/src/assets/ThreeDotIcon.jsx
index a484cc9a0..4a6b0ba7e 100644
--- a/studio/src/assets/ThreeDotIcon.jsx
+++ b/studio/src/assets/ThreeDotIcon.jsx
@@ -1,8 +1,14 @@
-import React from 'react';
+import React from "react";
-function ThreeEditIcon({ color = '#858585' }) {
+function ThreeEditIcon({ color="#858585" }) {
return (
-