mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/ui-0.6.0' into 'test'
Feat/ui 0.6.0 See merge request opensource/answer!325
This commit is contained in:
commit
46b44b7db8
|
@ -47,7 +47,7 @@ const Index: FC = () => {
|
|||
{t('save')}
|
||||
</Button>
|
||||
</Card.Header>
|
||||
<Card.Body className="pb-2">
|
||||
<Card.Body className="my-n1">
|
||||
<TagSelector
|
||||
value={followingTags}
|
||||
onChange={handleTagsChange}
|
||||
|
|
|
@ -120,9 +120,7 @@ const QuestionList: FC<Props> = ({ source }) => {
|
|||
<ListGroup variant="flush" className="border-top border-bottom-0">
|
||||
{listData?.list?.map((li) => {
|
||||
return (
|
||||
<ListGroup.Item
|
||||
key={li.id}
|
||||
className="border-bottom pt-3 pb-2 px-0">
|
||||
<ListGroup.Item key={li.id} className="border-bottom py-3 px-0">
|
||||
<h5 className="text-wrap text-break">
|
||||
<NavLink
|
||||
to={pathFactory.questionLanding(li.id, li.title)}
|
||||
|
@ -131,7 +129,7 @@ const QuestionList: FC<Props> = ({ source }) => {
|
|||
{li.status === 2 ? ` [${t('closed')}]` : ''}
|
||||
</NavLink>
|
||||
</h5>
|
||||
<div className="d-flex flex-column flex-md-row align-items-md-center fs-14 text-secondary">
|
||||
<div className="d-flex flex-column flex-md-row align-items-md-center fs-14 mb-3 text-secondary">
|
||||
<QuestionLastUpdate q={li} />
|
||||
<div className="ms-0 ms-md-3 mt-2 mt-md-0">
|
||||
<span>
|
||||
|
@ -157,7 +155,7 @@ const QuestionList: FC<Props> = ({ source }) => {
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="question-tags mx-n1 mt-2">
|
||||
<div className="question-tags m-n1">
|
||||
{Array.isArray(li.tags)
|
||||
? li.tags.map((tag) => {
|
||||
return (
|
||||
|
|
|
@ -130,7 +130,9 @@ const Users: FC = () => {
|
|||
)}
|
||||
|
||||
<th style={{ width: '12%' }}>{t('status')}</th>
|
||||
{curFilter !== 'suspended' && curFilter !== 'deleted' && (
|
||||
<th style={{ width: '12%' }}>{t('role')}</th>
|
||||
)}
|
||||
{curFilter !== 'deleted' ? (
|
||||
<th style={{ width: '8%' }} className="text-end">
|
||||
{t('action')}
|
||||
|
@ -172,11 +174,13 @@ const Users: FC = () => {
|
|||
{t(user.status)}
|
||||
</span>
|
||||
</td>
|
||||
{curFilter !== 'suspended' && curFilter !== 'deleted' && (
|
||||
<td>
|
||||
<span className="badge text-bg-light">
|
||||
{t(user.role_name)}
|
||||
</span>
|
||||
</td>
|
||||
)}
|
||||
{curFilter !== 'deleted' ? (
|
||||
<td className="text-end">
|
||||
<Dropdown>
|
||||
|
|
|
@ -141,22 +141,22 @@ const Ask = () => {
|
|||
});
|
||||
|
||||
const checkValidated = (): boolean => {
|
||||
let bol = true;
|
||||
const bol = true;
|
||||
const { title, content, tags, answer } = formData;
|
||||
if (!title.value) {
|
||||
bol = false;
|
||||
formData.title = {
|
||||
value: '',
|
||||
isInvalid: true,
|
||||
errorMsg: t('form.fields.title.msg.empty'),
|
||||
};
|
||||
// bol = false;
|
||||
// formData.title = {
|
||||
// value: '',
|
||||
// isInvalid: true,
|
||||
// errorMsg: t('form.fields.title.msg.empty'),
|
||||
// };
|
||||
} else if (Array.from(title.value).length > 150) {
|
||||
bol = false;
|
||||
formData.title = {
|
||||
value: title.value,
|
||||
isInvalid: true,
|
||||
errorMsg: t('form.fields.title.msg.range'),
|
||||
};
|
||||
// bol = false;
|
||||
// formData.title = {
|
||||
// value: title.value,
|
||||
// isInvalid: true,
|
||||
// errorMsg: t('form.fields.title.msg.range'),
|
||||
// };
|
||||
} else {
|
||||
formData.title = {
|
||||
value: title.value,
|
||||
|
@ -166,12 +166,12 @@ const Ask = () => {
|
|||
}
|
||||
|
||||
if (!content.value) {
|
||||
bol = false;
|
||||
formData.content = {
|
||||
value: '',
|
||||
isInvalid: true,
|
||||
errorMsg: t('form.fields.body.msg.empty'),
|
||||
};
|
||||
// bol = false;
|
||||
// formData.content = {
|
||||
// value: '',
|
||||
// isInvalid: true,
|
||||
// errorMsg: t('form.fields.body.msg.empty'),
|
||||
// };
|
||||
} else {
|
||||
formData.content = {
|
||||
value: content.value,
|
||||
|
@ -181,12 +181,12 @@ const Ask = () => {
|
|||
}
|
||||
|
||||
if (tags.value.length === 0) {
|
||||
bol = false;
|
||||
formData.tags = {
|
||||
value: [],
|
||||
isInvalid: true,
|
||||
errorMsg: t('form.fields.tags.msg.empty'),
|
||||
};
|
||||
// bol = false;
|
||||
// formData.tags = {
|
||||
// value: [],
|
||||
// isInvalid: true,
|
||||
// errorMsg: t('form.fields.tags.msg.empty'),
|
||||
// };
|
||||
} else {
|
||||
formData.tags = {
|
||||
value: tags.value,
|
||||
|
@ -196,12 +196,12 @@ const Ask = () => {
|
|||
}
|
||||
if (checked) {
|
||||
if (!answer.value) {
|
||||
bol = false;
|
||||
formData.answer = {
|
||||
value: '',
|
||||
isInvalid: true,
|
||||
errorMsg: t('form.fields.answer.msg.empty'),
|
||||
};
|
||||
// bol = false;
|
||||
// formData.answer = {
|
||||
// value: '',
|
||||
// isInvalid: true,
|
||||
// errorMsg: t('form.fields.answer.msg.empty'),
|
||||
// };
|
||||
} else {
|
||||
formData.answer = {
|
||||
value: answer.value,
|
||||
|
|
Loading…
Reference in New Issue