mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 07:23:34 +01:00
fix(webui): display custom roles in book edit dialog
This commit is contained in:
parent
2d14e698e6
commit
055fb1c827
1 changed files with 9 additions and 3 deletions
|
|
@ -376,9 +376,15 @@ export default Vue.extend({
|
|||
},
|
||||
computed: {
|
||||
authorRoles(): NameValue[] {
|
||||
return authorRoles.map((x: string) => ({
|
||||
name: this.$t(`author_roles.${x}`).toString(),
|
||||
value: x,
|
||||
let remoteRoles = []
|
||||
if (Array.isArray(this.books))
|
||||
remoteRoles = this.books.flatMap(b => b.metadata.authors).map(a => a.role)
|
||||
else
|
||||
remoteRoles = this.books.metadata.authors.map(a => a.role)
|
||||
const allRoles = this.$_.uniq([...authorRoles, ...remoteRoles])
|
||||
return allRoles.map((role: string) => ({
|
||||
name: this.$te(`author_roles.${role}`) ? this.$t(`author_roles.${role}`).toString() : role,
|
||||
value: role,
|
||||
}))
|
||||
},
|
||||
single(): boolean {
|
||||
|
|
|
|||
Loading…
Reference in a new issue