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

Feature/corpus doc order #1626

Merged
merged 6 commits into from
Jul 5, 2024
Merged

Conversation

JeltevanBoheemen
Copy link
Contributor

Resolves #1607

Takes the choices of the type field in the backend as canonical order, to make it easy to extend the types at a later stages.
I realize using .index() as key is not the most efficient way to sort, but it's a small amount of pages.

@JeltevanBoheemen JeltevanBoheemen marked this pull request as ready for review July 5, 2024 08:52
Copy link
Contributor

@lukavdplas lukavdplas left a comment

Choose a reason for hiding this comment

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

Looks good!

I think the more proper solution would be to make the underlying values of the type field integers instead of strings, but I agree that efficiency isn't relevant given the small number of objects.

Looks like 2 unrelated files snuck into your branch, but I see no issue with merging them.

Comment on lines -455 to +456
LICENSE = ('license', 'Licence')
LICENSE = ('license', 'License')
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a difference between British and American spelling; in American spelling, "license" is both a noun and a verb. In UK spelling, "license" is the verb, and "licence" the noun.

Since I-analyzer normally follows British spelling, I had used that here.

Comment on lines 5 to +13
import * as _ from 'lodash';
import { Router } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
import { Subject } from 'rxjs';

@Component({
selector: 'ia-create-definition',
templateUrl: './create-definition.component.html',
styleUrls: ['./create-definition.component.scss']
styleUrls: ['./create-definition.component.scss'],
Copy link
Contributor

Choose a reason for hiding this comment

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

?

@JeltevanBoheemen
Copy link
Contributor Author

I think the more proper solution would be to make the underlying values of the type field integers instead of strings, but I agree that efficiency isn't relevant given the small number of objects.

I considered making the types a proper Enum, but that would make adding more documentation pages between existing ones more difficult (read: requiring data migrations).

@JeltevanBoheemen JeltevanBoheemen merged commit c5eca61 into develop Jul 5, 2024
1 check passed
@JeltevanBoheemen JeltevanBoheemen deleted the feature/corpus-doc-order branch July 5, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Corpus documentation pages are sorted alphabetically (?)
2 participants