Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement timelines for annotation and transcription 186955197 #544

Open
wants to merge 35 commits into
base: integration
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4358f69
feat(api): use media item IDs instead of URLs (#509)
aaron-plahn Dec 6, 2023
6f8bc88
docs(coscrad-frontend): add instructions for Redux DevTools (#497)
yaanahuu2 Dec 6, 2023
587f4b9
refactor(api): event source terms in the domain (#511)
aaron-plahn Dec 12, 2023
847403d
feat(api): introduce TRANSLATE_DIGITAL_TEXT_PAGE_CONTENT (#512)
aaron-plahn Dec 12, 2023
2653f69
feat(api): introduce ADD_AUDIO_FOR_TERM (#515)
bsellars Dec 14, 2023
929bec6
feat(cli): introduce **ingest-media-items** (#513)
aaron-plahn Dec 14, 2023
5e83cb0
feat(api): serve static media assets (#516)
aaron-plahn Dec 19, 2023
e15365f
feat(coscrad-cli): introduce **export-media-annotations** (#518)
aaron-plahn Dec 19, 2023
989ebed
feat(coscrad-cli): discover audio-visual media item lengths on ingest…
aaron-plahn Dec 20, 2023
243ebb4
feat(api): introduce CREATE_PHOTOGRAPH (#521)
aaron-plahn Dec 20, 2023
bc02871
feat(coscrad-cli): create resources in **ingest-media-items** (#522)
aaron-plahn Dec 20, 2023
ff85978
feat(coscrad-cli): discover photograph dimensions in **ingest-media-i…
aaron-plahn Dec 21, 2023
95e402b
feat(api): introduce ADD_AUDIO_FOR_DIGITAL_TEXT_PAGE (#525)
bsellars Dec 22, 2023
376d6ab
feat(media-player): introduce UX support for selecting audio time ran…
yaanahuu2 Dec 22, 2023
db27f95
feat: include tags in annotation queries (#526)
aaron-plahn Dec 22, 2023
8d9e807
test: add test for media probe duration discovery (#528)
aaron-plahn Dec 23, 2023
bcba12b
feat: update all (including user-facing) references to bibliogrpahic …
aaron-plahn Dec 29, 2023
e5affae
refactor(api): leverage multilingual audio for terms (#529)
aaron-plahn Dec 29, 2023
9ad6d7b
refactor(api): implement simpler pattern for organizing domain event …
aaron-plahn Jan 9, 2024
afab7f5
feat(api): remove redundant book resource (#535)
aaron-plahn Jan 12, 2024
4bd266d
feat(coscrad-cli): support multiple target aggregate roots when execu…
yaanahuu2 Jan 15, 2024
de24ca8
WIP: create menu component and api call (#517)
jbambrick Jan 16, 2024
cac4444
feat(api): introduce TRANSLATE_DIGITAL_TEXT_TITLE (#537)
bsellars Jan 18, 2024
fd890bd
feat(coscrad-frontend): support immersive audio annotation (#533)
yaanahuu2 Jan 23, 2024
f75448e
feat(api): introduce VocabularyList.fromEventHistory (#542)
aaron-plahn Jan 29, 2024
9b7250c
WIP: implement carousel with alphabet cards (#539)
jbambrick Jan 29, 2024
6629efc
feat(api): introduce ADD_AUDIO_FOR_DIGITAL_TEXT_TITLE (#540)
bsellars Jan 31, 2024
c66dfa0
feat(api): introduce ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE (#541)
aaron-plahn Jan 31, 2024
622b8fe
add draft timeline component
aaron-plahn Jan 31, 2024
dce4660
WIP add annotation track to audio-item detail view
aaron-plahn Feb 1, 2024
da1a80f
WIP implement annotation timeline and e2e test
aaron-plahn Feb 1, 2024
923ca82
WIP test annotation timeline
aaron-plahn Feb 5, 2024
a99abde
refresh annotations when notes are updated
aaron-plahn Feb 5, 2024
63ebafd
WIP enable full annotation
aaron-plahn Feb 6, 2024
8fe57ce
WIP deal with unwanted re-renders
aaron-plahn Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(api): introduce ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE (#541)
* implement DigitalText.addPhotographToPage

* add handler for PHOTOGRAPH_ADDED_TO_DIGITAL_TEXT_PAGE

* add happy path test ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE

* add invalid test cases

* add type validation test ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE

* fix tests for ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE
aaron-plahn authored Jan 31, 2024

Verified

This commit was signed with the committer’s verified signature.
commit c66dfa0a6a11ea9f30e9b3f05bb98cb65f643fd5
Original file line number Diff line number Diff line change
@@ -1751,6 +1751,13 @@ exports[`GET /resources should return the expected result 1`] = `
"isOptional": false,
"label": "identifier",
},
"photographId": {
"coscradDataType": "UUID",
"description": "a reference to the main photograph for this page",
"isArray": false,
"isOptional": true,
"label": "photograph ID",
},
},
},
"tags": {
8 changes: 8 additions & 0 deletions apps/api/src/app/controllers/__tests__/createTestModule.ts
Original file line number Diff line number Diff line change
@@ -87,6 +87,11 @@ import {
ContentAddedToDigitalTextPage,
} from '../../../domain/models/digital-text/commands/add-content-to-digital-text-page';
import { AddPageToDigitalText } from '../../../domain/models/digital-text/commands/add-page-to-digital-text/add-page-to-digital-text.command';
import {
AddPhotographToDigitalTextPage,
AddPhotographToDigitalTextPageCommandHandler,
PhotographAddedToDigitalTextPage,
} from '../../../domain/models/digital-text/commands/add-photograph-to-digital-text-page';
import { DigitalText } from '../../../domain/models/digital-text/entities/digital-text.entity';
import { CreateMediaItem } from '../../../domain/models/media-item/commands/create-media-item/create-media-item.command';
import { CreateMediaItemCommandHandler } from '../../../domain/models/media-item/commands/create-media-item/create-media-item.command-handler';
@@ -284,6 +289,7 @@ export const buildAllDataClassProviders = () =>
DigitalTextPageContentTranslated,
DigitalTextTitleTranslated,
AudioAddedForDigitalTextPage,
PhotographAddedToDigitalTextPage,
SongCreated,
SongTitleTranslated,
LyricsAddedForSong,
@@ -578,6 +584,8 @@ export default async (
CreateDigitalTextCommandHandler,
AddPageToDigitalText,
AddPageToDigitalTextCommandHandler,
AddPhotographToDigitalTextPage,
AddPhotographToDigitalTextPageCommandHandler,
TranslateDigitalTextPageContent,
TranslateDigitalTextPageContentCommandHandler,
TranslateDigitalTextPageContent,
Original file line number Diff line number Diff line change
@@ -870,6 +870,59 @@ exports[`command payload schemas Command payload schema should match the snapsho
},
"type": "ADD_PAGE_TO_DIGITAL_TEXT",
},
{
"description": "Add a photograph to a digital text page",
"label": "Add Photograph to Page",
"schema": {
"aggregateCompositeIdentifier": {
"complexDataType": "NESTED_TYPE",
"description": "system-wide unique identifier",
"isArray": false,
"isOptional": false,
"label": "Composite Identifier",
"schema": {
"id": {
"coscradDataType": "UUID",
"description": "unique identifier",
"isArray": false,
"isOptional": false,
"label": "ID",
},
"type": {
"complexDataType": "ENUM",
"description": "must be: digitalText",
"enumLabel": "type",
"enumName": "type",
"isArray": false,
"isOptional": false,
"label": "type",
"labelsAndValues": [
{
"label": "digitalText",
"value": "digitalText",
},
],
},
},
},
"pageIdentifier": {
"coscradDataType": "NON_EMPTY_STRING",
"description": "the page to which you are adding the photograph",
"isArray": false,
"isOptional": false,
"label": "page identifier",
},
"photographId": {
"coscradDataType": "UUID",
"description": "system reference to the photograph",
"isArray": false,
"isOptional": false,
"label": "photograph ID",
"referenceTo": "photograph",
},
},
"type": "ADD_PHOTOGRAPH_TO_DIGITAL_TEXT_PAGE",
},
{
"description": "Tranlate the digital text page content to another language",
"label": "Translate Digital Text Page Content",
Original file line number Diff line number Diff line change
@@ -569,6 +569,13 @@ exports[`Coscrad Data Schemas for aggregate root domain models the COSCRAD data
"isOptional": false,
"label": "identifier",
},
"photographId": {
"coscradDataType": "UUID",
"description": "a reference to the main photograph for this page",
"isArray": false,
"isOptional": true,
"label": "photograph ID",
},
},
},
"title": {
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { AggregateType } from '@coscrad/api-interfaces';
import { CommandHandler } from '@coscrad/commands';
import { Valid } from '../../../../../domain/domainModelValidators/Valid';
import { DeluxeInMemoryStore } from '../../../../../domain/types/DeluxeInMemoryStore';
import { InMemorySnapshot } from '../../../../../domain/types/ResourceType';
import { InternalError, isInternalError } from '../../../../../lib/errors/InternalError';
import { isNotFound } from '../../../../../lib/types/not-found';
import { ResultOrError } from '../../../../../types/ResultOrError';
import { BaseUpdateCommandHandler } from '../../../shared/command-handlers/base-update-command-handler';
import { BaseEvent, IEventPayload } from '../../../shared/events/base-event.entity';
import { EventRecordMetadata } from '../../../shared/events/types/EventRecordMetadata';
import { DigitalText } from '../../entities';
import { AddPhotographToDigitalTextPage } from './add-photograph-to-digital-text-page.command';
import { PhotographAddedToDigitalTextPage } from './photograph-added-to-digital-text-page.event';

@CommandHandler(AddPhotographToDigitalTextPage)
export class AddPhotographToDigitalTextPageCommandHandler extends BaseUpdateCommandHandler<DigitalText> {
protected async fetchRequiredExternalState({
photographId,
}: AddPhotographToDigitalTextPage): Promise<InMemorySnapshot> {
const photographSearchResult = await this.repositoryProvider
.forResource(AggregateType.photograph)
.fetchById(photographId);

if (isInternalError(photographSearchResult)) {
throw new InternalError(
`Failed to ADD_PHOTOGRAPH_TO_DIGITAL_TEXT due to invalid existing state`,
[photographSearchResult]
);
}

return new DeluxeInMemoryStore({
[AggregateType.photograph]: isNotFound(photographSearchResult)
? []
: [photographSearchResult],
}).fetchFullSnapshotInLegacyFormat();
}

protected actOnInstance(
digitalText: DigitalText,
{ pageIdentifier, photographId }: AddPhotographToDigitalTextPage
): ResultOrError<DigitalText> {
return digitalText.addPhotographToPage(pageIdentifier, photographId);
}

protected validateExternalState(
_state: InMemorySnapshot,
_instance: DigitalText
): InternalError | Valid {
return Valid;
}

protected buildEvent(
payload: AddPhotographToDigitalTextPage,
eventMeta: EventRecordMetadata
): BaseEvent<IEventPayload> {
return new PhotographAddedToDigitalTextPage(payload, eventMeta);
}
}
Loading