refactor(directory): ♻ rm 'language' prefix on list vm's languages

This commit is contained in:
Collin M. Barrett 2020-09-08 11:24:38 -05:00
parent 3f0fd02eb6
commit 8cc3063df0
6 changed files with 15 additions and 16 deletions

View file

@ -53,7 +53,7 @@ public ListViewModelProfile()
.ForMember(fl => fl.SyntaxIds,
o => o.MapFrom(fl =>
fl.FilterListSyntaxes.Select(fls => fls.SyntaxId).OrderBy(sid => sid)))
.ForMember(fl => fl.LanguageIso6391s,
.ForMember(fl => fl.Iso6391s,
o => o.MapFrom(fl =>
fl.FilterListLanguages.Select(fls => fls.Iso6391).OrderBy(i => i)))
.ForMember(fl => fl.TagIds,
@ -101,7 +101,7 @@ public class ListViewModel
public string? Description { get; private set; }
public int? LicenseId { get; private set; }
public IEnumerable<int>? SyntaxIds { get; private set; }
public IEnumerable<string>? LanguageIso6391s { get; private set; }
public IEnumerable<string>? Iso6391s { get; private set; }
public IEnumerable<int>? TagIds { get; private set; }
public IEnumerable<ViewUrlViewModel>? ViewUrls { get; private set; }
public Uri? HomeUrl { get; private set; }

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@ -48,7 +47,7 @@ public ListViewModelProfile()
.ForMember(fl => fl.SyntaxIds,
o => o.MapFrom(fl =>
fl.FilterListSyntaxes.Select(fls => fls.SyntaxId).OrderBy(sid => sid)))
.ForMember(fl => fl.LanguageIso6391s,
.ForMember(fl => fl.Iso6391s,
o => o.MapFrom(fl =>
fl.FilterListLanguages.Select(fls => fls.Iso6391).OrderBy(i => i)))
.ForMember(fl => fl.TagIds,
@ -67,7 +66,7 @@ public class ListViewModel
public string? Description { get; private set; }
public int? LicenseId { get; private set; }
public IEnumerable<int>? SyntaxIds { get; private set; }
public IEnumerable<string>? LanguageIso6391s { get; private set; }
public IEnumerable<string>? Iso6391s { get; private set; }
public IEnumerable<int>? TagIds { get; private set; }
public IEnumerable<int>? MaintainerIds { get; private set; }
}

View file

@ -47,7 +47,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
const list = useListDetails(props.listId);
const listLanguage = props.languages.filter((l) =>
list?.languageIso6391s.includes(l.iso6391)
list?.iso6391s.includes(l.iso6391)
);
const listTags = props.tags.filter((t) => list?.tagIds.includes(t.id));
const listLicense = props.licenses.find((l) => l.id === list?.id);

View file

@ -227,11 +227,11 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
<Table.Column<List>
title="Languages"
key="Languages"
dataIndex={nameof<List>("languageIso6391s")}
dataIndex={nameof<List>("iso6391s")}
sorter={(a, b) =>
languageArraySorter(
a.languageIso6391s,
b.languageIso6391s,
a.iso6391s,
b.iso6391s,
languages
)
}
@ -245,8 +245,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
{
visibleLists.filter(
(li) =>
li.languageIso6391s &&
li.languageIso6391s.includes(l.iso6391)
li.iso6391s &&
li.iso6391s.includes(l.iso6391)
).length
}
)
@ -255,8 +255,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
value: l.iso6391.toString(),
}))}
onFilter={(value, record) =>
record.languageIso6391s
? record.languageIso6391s.includes(value as string)
record.iso6391s
? record.iso6391s.includes(value as string)
: false
}
render={(languageIds: string[]) =>

View file

@ -4,7 +4,7 @@
description: string;
licenseId: number;
syntaxIds: number[];
languageIso6391s: string[];
iso6391s: string[];
tagIds: number[];
maintainerIds: number[];

View file

@ -4,7 +4,7 @@
description: string;
licenseId: number;
syntaxIds: number[];
languageIso6391s: string[];
iso6391s: string[];
tagIds: number[];
viewUrls: ViewUrl[];
homeUrl: string;