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

Add audio Speaker #2795

Merged
merged 71 commits into from
Jan 9, 2024
Merged

Add audio Speaker #2795

merged 71 commits into from
Jan 9, 2024

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Nov 16, 2023

Resolves #719
Resolves #2146
Fixes #2829 by preventing deletion/modification of imported audio.

Will require a database update, as Word.Audio moves from string to Pronunciation.
Use maintenance/scripts/db_update_audio_type.py.


This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2023

Codecov Report

Attention: 206 lines in your changes are missing coverage. Please review.

Comparison is base (965112d) 62.56% compared to head (f92115b) 72.49%.

Files Patch % Lines
src/components/Pronunciations/AudioPlayer.tsx 25.00% 30 Missing and 6 partials ⚠️
Backend/Services/LiftService.cs 34.00% 29 Missing and 4 partials ⚠️
src/components/DataEntry/DataEntryTable/index.tsx 32.35% 20 Missing and 3 partials ⚠️
...onents/ProjectUsers/SpeakerConsentListItemIcon.tsx 60.00% 18 Missing ⚠️
src/components/Dialogs/SubmitTextDialog.tsx 23.80% 16 Missing ⚠️
...s/ReviewEntries/ReviewEntriesTable/CellColumns.tsx 0.00% 14 Missing ⚠️
Backend/Controllers/SpeakerController.cs 90.90% 8 Missing and 5 partials ⚠️
...rc/components/ProjectUsers/ProjectSpeakersList.tsx 67.64% 10 Missing and 1 partial ⚠️
src/components/AppBar/SpeakerMenu.tsx 74.07% 6 Missing and 1 partial ⚠️
src/components/Pronunciations/utilities.ts 0.00% 7 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2795      +/-   ##
==========================================
+ Coverage   62.56%   72.49%   +9.92%     
==========================================
  Files         211      262      +51     
  Lines        4961     9958    +4997     
  Branches      563     1157     +594     
==========================================
+ Hits         3104     7219    +4115     
- Misses       1663     2400     +737     
- Partials      194      339     +145     
Flag Coverage Δ
backend 83.25% <83.97%> (?)
frontend 62.44% <45.20%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 14 files at r1, 7 of 85 files at r3, 6 of 54 files at r4, all commit messages.
Reviewable status: 15 of 102 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 14 files at r1, 3 of 7 files at r2, 33 of 85 files at r3, 48 of 54 files at r4, 4 of 4 files at r5, 1 of 1 files at r6, 2 of 3 files at r7, 1 of 1 files at r8, 1 of 1 files at r9.
Reviewable status: all files reviewed (commit messages unreviewed), 2 unresolved discussions (waiting on @imnasnainaec)


Backend.Tests/Models/SpeakerTests.cs line 18 at r5 (raw file):

            var speakerA = new Speaker { Id = Id, ProjectId = ProjectId, Name = Name, Consent = ConsentType.Audio };
            Assert.That(speakerA.Equals(speakerA.Clone()), Is.True);
        }

Not sure if we have done this elsewhere, but it might be worth asserting that ReferenceEquals is false.


src/components/Dialogs/ViewImageDialog.tsx line 30 at r9 (raw file):

      <DialogTitle>
        {props.title}
        <Icon />

What does an Icon with no attributes or icon name in the text do?

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @Github-advanced-security[bot])


Backend.Tests/Models/SpeakerTests.cs line 18 at r5 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Not sure if we have done this elsewhere, but it might be worth asserting that ReferenceEquals is false.

We haven't done that anywhere. Shall I open an issue to add that to our backend model testing?


src/components/Dialogs/ViewImageDialog.tsx line 30 at r9 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

What does an Icon with no attributes or icon name in the text do?

It's an icon-sized spacer, to prevent the title from being overlapped by the CloseButton, which has absolute positioning into the upper-right corner (or upper-left for rtl).

@jasonleenaylor
Copy link
Contributor

Backend.Tests/Models/SpeakerTests.cs line 18 at r5 (raw file):

Previously, imnasnainaec (D. Ror.) wrote…

We haven't done that anywhere. Shall I open an issue to add that to our backend model testing?

No, it is just a paranoia check. I wouldn't open an issue for it. Any cursory review of a clone method should catch the mistake that this assertion would catch. I think I did add this once to a test suite where someone had made that error but I just checked and can see that we don't do that in our other projects either. Disregard.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r10.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @Github-advanced-security[bot])

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @Github-advanced-security[bot] from a discussion.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @imnasnainaec)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

@jmgrady jmgrady merged commit 6d03bc3 into master Jan 9, 2024
17 checks passed
@jmgrady jmgrady deleted the speaker branch January 9, 2024 15:02
jmgrady pushed a commit that referenced this pull request Mar 6, 2024
* Add Backend model/repo/controller for speaker
* Add audio consent api; Add speaker to project state
* Add Speaker types to Startup.cs
* Add skeleton setting for project speakers
* Enable add/edit/delete speaker
* Add consent image upload interface
* Enable hearing/seeing speaker consent
* Add speaker menu
* Consolidate consent icon
* Add Pronunciation model for audio
* Export audio speaker in pronunciation label
* Protect audio with English label to prevent overwriting
* Implement FileWithSpeakerId extends File
* Enable changing audio speaker
* Include consent files in export
* Add py script for db update
* Remove old one-shot script
* Update db script: protect audio; add execute permission
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants