[AURORA-1058] - Отсутствует кнопка для возврата к предыдущему экрану/странице
This commit is contained in:
parent
a206bb7191
commit
32a7c001eb
@ -11,11 +11,7 @@ export const FormsApi = {
|
|||||||
return api.put(`/forms/create-by-form`, payload).then((r) => r.data);
|
return api.put(`/forms/create-by-form`, payload).then((r) => r.data);
|
||||||
},
|
},
|
||||||
getForm(formId) {
|
getForm(formId) {
|
||||||
return api
|
return api.get(`/form/${formId}`).then((r) => r.data);
|
||||||
.get('/forms/', {
|
|
||||||
params: { form_id: formId },
|
|
||||||
})
|
|
||||||
.then((r) => r.data);
|
|
||||||
},
|
},
|
||||||
formsList() {
|
formsList() {
|
||||||
return api.get('/form/').then((r) => r.data.result);
|
return api.get('/form/').then((r) => r.data.result);
|
||||||
|
|||||||
@ -1,18 +1,22 @@
|
|||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { TaskInfoContainer } from '../components/common/SwitchFormTask/SwitchFormTask.style';
|
import {
|
||||||
|
NameTask,
|
||||||
|
TaskInfoContainer,
|
||||||
|
} from '../components/common/SwitchFormTask/SwitchFormTask.style';
|
||||||
import RealtimeTable from '../components/RealtimeTable';
|
import RealtimeTable from '../components/RealtimeTable';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { useEffect } from 'react';
|
|
||||||
import { } from '../components/RealtimeTable/'
|
|
||||||
import { RealtimeProvider } from '../components/RealtimeTable/contexts/RealtimeContext';
|
import { RealtimeProvider } from '../components/RealtimeTable/contexts/RealtimeContext';
|
||||||
import { useAuth } from '../app/context/AuthProvider';
|
import { useAuth } from '../app/context/AuthProvider';
|
||||||
|
import { BackButton } from '../components/common/Buttons/BackButton';
|
||||||
|
import { SHEET_NAME } from '../constants';
|
||||||
|
|
||||||
const TableInfo = () => {
|
const TableInfo = ({ formId, sheetName }) => {
|
||||||
const portalContent = (
|
const portalContent = (
|
||||||
<TaskInfoContainer>
|
<TaskInfoContainer>
|
||||||
{/* <BackButton to={`/task/${table.task_id}`} />
|
<BackButton to={`/task/${formId}`} />
|
||||||
<NameTask>{table.name}</NameTask> */}
|
{sheetName && (
|
||||||
|
<NameTask>{SHEET_NAME[sheetName] || sheetName}</NameTask>
|
||||||
|
)}
|
||||||
</TaskInfoContainer>
|
</TaskInfoContainer>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -24,11 +28,12 @@ const TableInfo = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function NewTablePage() {
|
export default function NewTablePage() {
|
||||||
const { formId, formType, sheetName, direction } = useParams()
|
const { formId, formType, sheetName, direction } = useParams();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{formId && <TableInfo formId={formId} sheetName={sheetName} />}
|
||||||
{user && (
|
{user && (
|
||||||
<RealtimeProvider
|
<RealtimeProvider
|
||||||
formId={formId}
|
formId={formId}
|
||||||
@ -37,7 +42,6 @@ export default function NewTablePage() {
|
|||||||
direction={direction === 'null' ? null : direction}
|
direction={direction === 'null' ? null : direction}
|
||||||
>
|
>
|
||||||
<RealtimeTable formType={formType} formId={formId} sheetName={sheetName} direction={direction === 'null' ? null : direction} />
|
<RealtimeTable formType={formType} formId={formId} sheetName={sheetName} direction={direction === 'null' ? null : direction} />
|
||||||
|
|
||||||
</RealtimeProvider>
|
</RealtimeProvider>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@ -25,16 +25,10 @@ import TablesList from '../../components/common/TableList/TableList';
|
|||||||
import { SHEET_NAME } from '../../constants';
|
import { SHEET_NAME } from '../../constants';
|
||||||
|
|
||||||
const TaskInfo = ({ task }) => {
|
const TaskInfo = ({ task }) => {
|
||||||
const formattedDateRange = `${formatDate(task.start_date)} — ${formatDate(task.end_date)}`;
|
|
||||||
|
|
||||||
const portalContent = (
|
const portalContent = (
|
||||||
<TaskInfoContainer>
|
<TaskInfoContainer>
|
||||||
<BackButton to="/tasks" />
|
<BackButton to="/tasks" />
|
||||||
<NameTask>{task.title}</NameTask>
|
<NameTask>{task.form_type_code}</NameTask>
|
||||||
<Chip>
|
|
||||||
<DateIcon />
|
|
||||||
<span style={{ fontSize: '0.75rem' }}>{formattedDateRange}</span>
|
|
||||||
</Chip>
|
|
||||||
</TaskInfoContainer>
|
</TaskInfoContainer>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -122,6 +116,7 @@ export default function TaskPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{task && <TaskInfo task={task} />}
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user