Compare commits
2 Commits
10ba9a6623
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a9af74ba02 | |||
| f3e098ee84 |
Generated
+4
-4
@@ -17,7 +17,7 @@
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.22.1",
|
||||
"@microsoft/sp-property-pane": "1.22.1",
|
||||
"@microsoft/sp-webpart-base": "1.22.1",
|
||||
"@tnsu/ui-kit": "^0.13.0",
|
||||
"@tnsu/ui-kit": "^0.14.0",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"tslib": "2.3.1"
|
||||
@@ -6659,9 +6659,9 @@
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/@tnsu/ui-kit": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "http://git.tnsu.kz/api/packages/timur.gorodetskiy/npm/%40tnsu%2Fui-kit/-/0.13.0/ui-kit-0.13.0.tgz",
|
||||
"integrity": "sha512-FfIfPIXQyDwEb5v8n7EIxfn5V9CYURP98veTK9XUEplq/1lAJF8CXpVDZ/6i1DBOiNqSSs/zGMrydphXw6IMzQ==",
|
||||
"version": "0.14.0",
|
||||
"resolved": "http://git.tnsu.kz/api/packages/timur.gorodetskiy/npm/%40tnsu%2Fui-kit/-/0.14.0/ui-kit-0.14.0.tgz",
|
||||
"integrity": "sha512-Vun9AUM9jL8rttbsbKo5Yh6TUz1srkNqxiO6mmzebrSo1JOASNJqNjJPMTS+8Jt3MTrJPklvh0TbeqGQzw7qxQ==",
|
||||
"license": "ISC",
|
||||
"peerDependencies": {
|
||||
"@fluentui/react": "^8.106.4",
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.22.1",
|
||||
"@microsoft/sp-property-pane": "1.22.1",
|
||||
"@microsoft/sp-webpart-base": "1.22.1",
|
||||
"@tnsu/ui-kit": "^0.13.0",
|
||||
"@tnsu/ui-kit": "^0.14.0",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"tslib": "2.3.1"
|
||||
|
||||
@@ -37,6 +37,7 @@ export const AppShell: React.FC = () => {
|
||||
onToggleCollapsed={() => setIsCollapsed((prev) => !prev)}
|
||||
mobileOpen={isMobileMenuOpen}
|
||||
onMobileClose={() => setIsMobileMenuOpen(false)}
|
||||
dividers
|
||||
/>
|
||||
}
|
||||
mobileToggle={<SidebarToggle onClick={() => setIsMobileMenuOpen(true)} />}
|
||||
|
||||
@@ -10,6 +10,20 @@ $toggle-size: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// «← К объектам» — как «← Вернуться назад» в форме отчёта.
|
||||
.backLink {
|
||||
align-self: flex-start;
|
||||
color: $navy-600;
|
||||
font-size: $fs-sm;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
color: $navy-900;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -8,5 +8,7 @@ import { WorksPageContent } from './WorksPageContent';
|
||||
*/
|
||||
export const WorksPage: React.FC = () => {
|
||||
const { route } = useRouter();
|
||||
return <WorksPageContent key={route.objectId ?? ''} objectId={route.objectId ?? ''} />;
|
||||
return (
|
||||
<WorksPageContent key={route.objectId ?? ''} objectId={route.objectId ?? ''} projectId={route.projectId} />
|
||||
);
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import { Alert, Button, confirmModal, Spinner } from '@tnsu/ui-kit';
|
||||
import { useAppServices } from '../../app/AppServicesContext';
|
||||
import { EmptyState } from '../../shared/components/EmptyState';
|
||||
import { RouteLink } from '../../app/routing/RouteLink';
|
||||
import { ContextMenu, IContextMenuItem, IMenuAnchor } from '../_tree/ContextMenu';
|
||||
import { TreePageHeader } from '../_tree/TreePageHeader';
|
||||
import { flattenVisible, toggleId } from '../_tree/treeRules';
|
||||
@@ -28,9 +29,11 @@ const MENU_OFFSET_PX = 4;
|
||||
|
||||
interface Props {
|
||||
objectId: string;
|
||||
/** Для ссылки «← К объектам» — объекты того же проекта. */
|
||||
projectId: string | undefined;
|
||||
}
|
||||
|
||||
export const WorksPageContent: React.FC<Props> = ({ objectId }) => {
|
||||
export const WorksPageContent: React.FC<Props> = ({ objectId, projectId }) => {
|
||||
const services = useAppServices();
|
||||
const repository = React.useMemo(
|
||||
() =>
|
||||
@@ -112,6 +115,9 @@ export const WorksPageContent: React.FC<Props> = ({ objectId }) => {
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<RouteLink className={styles.backLink} to={{ page: 'objects', projectId }}>
|
||||
{WORKS_TEXTS.backToObjects}
|
||||
</RouteLink>
|
||||
<TreePageHeader icon="clipboard" title={data.headerLabel} />
|
||||
<div className={styles.container}>
|
||||
{data.canEdit && <div className={styles.toolbar}>{addButton(WORKS_TEXTS.addWork)}</div>}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
export const WORKS_TEXTS = {
|
||||
defaultHeader: 'ОБЪЕКТЫ ПРОЕКТА',
|
||||
backToObjects: '← К объектам',
|
||||
addWork: 'Добавить работу',
|
||||
addFirst: '+ Добавить работу',
|
||||
columns: {
|
||||
|
||||
Reference in New Issue
Block a user