diff --git a/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx b/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx index ae10a5438e85..dc3c1e953919 100644 --- a/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx +++ b/cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx @@ -53,6 +53,7 @@ const getAttributesSubfields = (labels: Label[]): Record => { }; const labelSubfields = subfields[adjustedLabelName].subfields; + // Add root label attributes label.attributes.forEach((attr: any): void => { const adjustedAttrName = adjustName(attr.name); labelSubfields[adjustedAttrName] = { @@ -68,6 +69,34 @@ const getAttributesSubfields = (labels: Label[]): Record => { }; } }); + + // If skeleton, add sublabel (point) attributes as nested fields + if (label.type === 'skeleton' && Array.isArray(label.sublabels)) { + label.sublabels.forEach((sublabel: any) => { + const adjustedSublabelName = adjustName(sublabel.name); + labelSubfields[adjustedSublabelName] = { + type: '!struct', + label: sublabel.name, + subfields: {}, + }; + const sublabelSubfields = labelSubfields[adjustedSublabelName].subfields; + sublabel.attributes.forEach((attr: any) => { + const adjustedAttrName = adjustName(attr.name); + sublabelSubfields[adjustedAttrName] = { + label: attr.name, + type: getConvertedInputType(attr.inputType), + }; + if (sublabelSubfields[adjustedAttrName].type === 'select') { + sublabelSubfields[adjustedAttrName] = { + ...sublabelSubfields[adjustedAttrName], + fieldSettings: { + listValues: attr.values, + }, + }; + } + }); + }); + } }); return subfields; diff --git a/cvat-ui/src/components/common/not-found.tsx b/cvat-ui/src/components/common/not-found.tsx index 762fc2a84c94..39d58b665e17 100644 --- a/cvat-ui/src/components/common/not-found.tsx +++ b/cvat-ui/src/components/common/not-found.tsx @@ -2,26 +2,51 @@ // // SPDX-License-Identifier: MIT + import React from 'react'; import Result from 'antd/lib/result'; +import Button from 'antd/lib/button'; +import { useHistory } from 'react-router'; -export const JobNotFoundComponent = React.memo((): JSX.Element => ( - -)); +export const JobNotFoundComponent = React.memo((): JSX.Element => { + const history = useHistory(); + const handleGoToJobs = () => { + history.push('/jobs'); + }; + return ( + + Go to Jobs (reset filters) + + } + /> + ); +}); -export const TaskNotFoundComponent = React.memo((): JSX.Element => ( - -)); +export const TaskNotFoundComponent = React.memo((): JSX.Element => { + const history = useHistory(); + const handleGoToTasks = () => { + history.push('/tasks'); + }; + return ( + + Go to Tasks (reset filters) + + } + /> + ); +}); export const ProjectNotFoundComponent = React.memo((): JSX.Element => (