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

feat(double-check): Allow validation of imported annotations [ADEV-10] #191

Merged
merged 116 commits into from
Jun 24, 2024

Conversation

ElodieENSTA
Copy link
Member

  • New styled form components for APLOSE
  • Update of the campaign creation form
    • New organisation of the fields
    • Remove files distribution select (random/sequential) in favor of a constent "sequential" distribution
    • Remove annotation scope select (box/whole files) in favor of a constent "whole file" mode
    • New annotation mode select (create annotations / check annotations). The "create annotation" is the common, existing, one ; The "check annotations" mode allows to import a resuts.csv file in order to validate them in the annotator page
  • Update the style of the edit campaign form
  • Update of the annotator to take in account the new "Check annotations" mode. In this mode:
    • annotations cannot be created, edited or deleted
    • annotations can be validated or invalidated. By default, all annotations are considered as valid

Automatic testing:

  • The new form components have their component tests
  • E2E tests:
    • Update of the campaign creation tests
    • New update campaign test

rvovard and others added 30 commits February 1, 2024 11:36
…ecated create-react-app (create / move / delete files)
Redirect login already logged
Copy link
Member

@rvovard rvovard left a comment

Choose a reason for hiding this comment

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

As I'm afraid to lose my comments: first part of the review (110 files viewed over 186).
Really good work, many things are cleaner than before! 👍
Most of my comments are questions or remarks, some things can be done later, don't feel that you have to change everything in this PR 🙂

Comment on lines 19 to 21
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Exo+2&display=swap" rel="stylesheet">
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to download the fonts you want to use and to include them in our fonts directory.
We don't want to depend on another website (which can be down or slow, even if it's Google), and people who don't want to be tracked by Google (fonts come with associated cookies) might filter Google CDN.

(Though, the "Roboto" folder might be cleaned, I don't think we need all those versions of the font)

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand, I'll will add it to the repo.

For "Roboto" I didn't find any use of this font files (in @font-face) so maybe all of it should be removed?

Comment on lines +30 to +34
return <div id="aplose-input" className="chips" aria-disabled={ disabled }>
{ label && <p id="label"
className={ required ? 'required' : '' }>
{ label }{ required ? '*' : '' }
</p> }
Copy link
Member

Choose a reason for hiding this comment

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

General comments as it applies to several files:

  • You used id attribute which is supposed to appear only one time on a HTML document. As inputs can be used many times, I think the page won't be syntactically correct.
  • Why don't use label tag instead of p? It's semantically better.

Copy link
Member Author

Choose a reason for hiding this comment

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

  • I understand your concern about id attribute. I'll update it over time.
  • I'm not used to the label, that's why i didn't though of it. I'll change it.

- include Exo 2 font files
- clean commented code
- Use appropriate html tags instead of generic ones
Copy link
Member

@rvovard rvovard left a comment

Choose a reason for hiding this comment

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

End of the review, but very few things to add 🙂
Once again, well done!

})
));
} catch (e) {
console.debug('unrecognized file', e)
Copy link
Member

Choose a reason for hiding this comment

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

You used console.warn earlier in the file, I think we can use it too here?

Copy link
Member Author

Choose a reason for hiding this comment

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

For sure, and even better I should send the exact error to the view. I used it to debug the code but the original error could be useful for users too, to understand what went wrong precisely (ticket created for that)

Comment on lines 1 to 20
// export class User {
// id: number;
// username: string;
// email: string;
// first_name: string;
// last_name: string;
//
// constructor(data: { id: number, username: string, email: string, first_name: string, last_name: string }) {
// this.id = data.id;
// this.username = data.username;
// this.email = data.email;
// this.first_name = data.first_name;
// this.last_name = data.last_name;
// }
//
// get display_name(): string {
// if (this.first_name && this.last_name) return `${ this.first_name } ${ this.last_name }`;
// else return this.username;
// }
// }
Copy link
Member

Choose a reason for hiding this comment

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

You know the drill: is this still useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the remind ^^
I removed the interface to use this class. Globally, I'd like to replace a lot of interfaces that reprensent API data by object to simplify its use and common data transformation used around the app.

…k campaign

[ADEV-100] Add detector name in detections list bloc (annotator)
request-checks: true
# Conflicts:
#	backend/api/admin/__init__.py
#	frontend/index.html
#	frontend/package-lock.json
#	frontend/package.json
#	frontend/src/App.tsx
#	frontend/src/css/ionic-override.css
#	frontend/src/fonts/Exo_2/OFL.txt
#	frontend/src/fonts/Exo_2/README.txt
#	frontend/src/view/annotation-campaign-update/edit-annotation-campaign.page.tsx
#	frontend/src/view/audio-annotator/components/bloc/confidence-indicator-bloc.component.tsx
#	frontend/src/view/login.page.tsx
#	frontend/vite.config.ts
@ElodieENSTA ElodieENSTA merged commit 7cf0a87 into master Jun 24, 2024
3 checks passed
@ElodieENSTA ElodieENSTA deleted the feature/double_check branch June 24, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix annotator mode Allow precalculated annotations at campaign start
2 participants