Skip to content

Commit 495227f

Browse files
authored
Merge pull request #416 from AVAnnotate/develop
v1.2.2 updates
2 parents c54cd46 + 5fa50d5 commit 495227f

29 files changed

Lines changed: 685 additions & 158 deletions

File tree

src/apps/AnnotationImport/AnnotationImport.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,21 @@ export const AnnotationImportForm: React.FC<Props> = (props) => {
9595
() =>
9696
Object.keys(props.project.annotations)
9797
.filter(
98-
(uuid) => props.project.annotations[uuid].event_id === props.eventUuid
98+
(uuid) =>
99+
props.project.annotations[uuid].event_id === props.eventUuid &&
100+
props.project.events[props.project?.annotations[uuid]?.event_id]
101+
?.audiovisual_files[props.project?.annotations[uuid]?.source_id] //filter out annotations from deleted files
99102
)
100-
.map((uuid) => ({
101-
label: `${
102-
props.project.events[props.project.annotations[uuid].event_id]
103-
.audiovisual_files[props.project.annotations[uuid].source_id]
104-
.label
105-
} - ${props.project.annotations[uuid].set}`,
106-
value: uuid,
107-
})),
103+
.map((uuid) => {
104+
return {
105+
label: `${
106+
props.project.events[props.project.annotations[uuid].event_id]
107+
.audiovisual_files[props.project.annotations[uuid].source_id]
108+
?.label
109+
} - ${props.project.annotations[uuid].set}`,
110+
value: uuid,
111+
};
112+
}),
108113
[]
109114
);
110115

src/apps/EventDetail/AnnotationSearchBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const AnnotationSearchBox: React.FC<Props> = (props) => {
2525
);
2626
}}
2727
type='text'
28+
aria-label='Search Annotations'
2829
/>
2930
<MagnifyingGlassIcon />
3031
</div>

src/apps/EventDetail/AnnotationTable.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ interface AnnotationTableProps {
108108
hideHeader?: boolean;
109109
project: ProjectData;
110110
projectSlug: string;
111+
search?: boolean;
111112
setDeleteAnnoUuid: (uuid: string) => void;
112113
setEditAnnoUuid: (uuid: string) => void;
113114
setAnnoPosition: (pos: number) => void;
@@ -145,10 +146,16 @@ const AnnotationTable: React.FC<AnnotationTableProps> = (props) => {
145146
return () => resizeObserver.disconnect();
146147
}, []);
147148

149+
const emptyNoticeText = useMemo(() => {
150+
return props.search
151+
? t['No search results found.']
152+
: t['No annotations have been added.'];
153+
}, [props.search]);
154+
148155
const emptyNotice = useMemo(
149156
() => (
150157
<Table.Cell colSpan={4} className='empty-annos-note'>
151-
<p>{t['No annotations have been added.']}</p>
158+
<p>{emptyNoticeText}</p>
152159
<div className='empty-annos-buttons'>
153160
<Button
154161
className='primary'
@@ -167,7 +174,7 @@ const AnnotationTable: React.FC<AnnotationTableProps> = (props) => {
167174
</div>
168175
</Table.Cell>
169176
),
170-
[]
177+
[emptyNoticeText]
171178
);
172179

173180
const containerRef = useRef(null);

src/apps/EventDetail/AvFile.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import AnnotationTable from './AnnotationTable.tsx';
2020
import { formatTimestamp } from '@lib/events/index.ts';
2121
import { SetSelect } from './SetSelect.tsx';
2222
import SetManagementDropdown from './SetManagementDropdown.tsx';
23+
import { navigate } from 'astro:transitions/client';
2324

2425
interface Props {
2526
avFile: AudiovisualFile;
@@ -101,7 +102,7 @@ const onSubmitCreateSet = async (
101102
});
102103

103104
if (res.ok) {
104-
window.location.reload();
105+
navigate(window.location.href, { history: 'replace' });
105106
}
106107
};
107108

@@ -319,6 +320,7 @@ const AvFile: React.FC<Props> = (props) => {
319320
setShowAnnoCreateModal={setShowAnnoCreateModal}
320321
tagPosition={props.fileType === 'Video' ? 'below' : 'column'}
321322
hideHeader={props.fileType === 'Video'}
323+
search={!!search}
322324
/>
323325
</div>
324326
{props.fileType === 'Audio' && props.event.citation && (

src/apps/EventDetail/SetManagementDropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const SetManagementDropdown: React.FC<Props> = (props) => {
1919
<Button
2020
className='unstyled meatball-menu-icon annotation-tab-meatball-button'
2121
type='button'
22+
aria-label='Manage Annotation Sets'
2223
>
2324
<DotsThree size={16} color='black' />
2425
</Button>

src/apps/EventDetail/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ export const EventDetail: React.FC<EventDetailProps> = (props) => {
9999
<h1 className='event-title'>{props.event.label}</h1>
100100
<Dropdown.Root modal={false}>
101101
<Dropdown.Trigger asChild>
102-
<Button className='meatball-menu-button unstyled' type='button'>
102+
<Button
103+
className='meatball-menu-button unstyled'
104+
type='button'
105+
aria-label='Event Options'
106+
>
103107
<DotsThree size={30} color='white' />
104108
</Button>
105109
</Dropdown.Trigger>

src/apps/Project/Project.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Avatar } from '@components/Avatar/Avatar.tsx';
1919
import { DataManager } from '@components/DataManager/DataManager.tsx';
2020
import { SiteBuilder } from '@components/SiteBuilder/SiteBuilder.tsx';
2121
import { BuildStatus } from '@components/BuildStatus/BuildStatus.tsx';
22+
import { navigate } from 'astro:transitions/client';
2223

2324
interface Props {
2425
i18n: Translations;
@@ -64,7 +65,9 @@ export const Project: React.FC<Props> = (props) => {
6465
annotations={props.project.annotations}
6566
eventUuid={deleteUuid}
6667
i18n={props.i18n}
67-
onAfterSave={() => window.location.reload()}
68+
onAfterSave={() =>
69+
navigate(window.location.href, { history: 'replace' })
70+
}
6871
onCancel={() => setDeleteUuid(null)}
6972
projectSlug={props.projectSlug}
7073
/>
@@ -118,7 +121,10 @@ export const Project: React.FC<Props> = (props) => {
118121
</div>
119122
<DropdownMenu.Root>
120123
<DropdownMenu.Trigger asChild>
121-
<Button className='settings-button'>
124+
<Button
125+
className='settings-button'
126+
aria-label='Project Options'
127+
>
122128
<ThreeDots />
123129
</Button>
124130
</DropdownMenu.Trigger>

src/apps/Tags/TagGroupCard.tsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,28 @@ export const TagGroupCard = (props: TagGroupCardProps) => {
151151
</h3>
152152
<MeatballMenu
153153
row={props}
154-
buttons={[
155-
{
156-
label: t['Edit'],
157-
icon: Pencil,
158-
onClick: handleUpdateGroup,
159-
},
160-
{
161-
label: t['Delete'],
162-
icon: Trash,
163-
onClick: handleDeleteGroup,
164-
},
165-
]}
154+
buttons={
155+
group && group === '_uncategorized_'
156+
? [
157+
{
158+
label: t['Edit'],
159+
icon: Pencil,
160+
onClick: handleUpdateGroup,
161+
},
162+
]
163+
: [
164+
{
165+
label: t['Edit'],
166+
icon: Pencil,
167+
onClick: handleUpdateGroup,
168+
},
169+
{
170+
label: t['Delete'],
171+
icon: Trash,
172+
onClick: handleDeleteGroup,
173+
},
174+
]
175+
}
166176
/>
167177
</div>
168178
{list.slice(0, expanded ? 9999999 : 4).map((t) => (

src/components/DataManager/DataManager.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as Tabs from '@radix-ui/react-tabs';
44
import { Tags } from '@apps/Tags/Tags.tsx';
55
import { useState } from 'react';
66
import { DeleteEventModal } from '@components/DeleteEventModal/DeleteEventModal.tsx';
7+
import { navigate } from 'astro:transitions/client';
78

89
import './DataManager.css';
910

@@ -54,7 +55,9 @@ export const DataManager = (props: DataManagerProps) => {
5455
annotations={props.project.annotations}
5556
eventUuid={deleteUuid}
5657
i18n={props.i18n}
57-
onAfterSave={() => window.location.reload()}
58+
onAfterSave={() =>
59+
navigate(window.location.href, { history: 'replace' })
60+
}
5861
onCancel={() => setDeleteUuid(null)}
5962
projectSlug={props.projectSlug}
6063
/>

src/components/DragTable/DragTable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ export const DragTable: React.FC<Props> = (props) => {
8383
width='100%'
8484
style={{ gridTemplateColumns: gridSettings }}
8585
>
86-
<GripVertical width={38} />
86+
<GripVertical
87+
width={38}
88+
aria-label='grip button to reorder a v files'
89+
tabIndex={0}
90+
/>
8791
{row.component}
8892
</Box>
8993
);

0 commit comments

Comments
 (0)