mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Change some type names
This commit is contained in:
Vendored
+50
-52
@@ -29,11 +29,6 @@ export type FixBigInt<T> = {
|
||||
: T[K]
|
||||
}
|
||||
|
||||
export type LocalityReference = Prisma.now_lr & { ref_ref: ReferenceDetailsType } & {
|
||||
ref_authors: Prisma.ref_authors
|
||||
ref_journal: Prisma.ref_journal
|
||||
}
|
||||
|
||||
export type SpeciesType = FixBigInt<Prisma.com_species>
|
||||
export type RowState = 'new' | 'removed' | 'cancelled' | 'clean'
|
||||
export type UpdateComment = { update_comment: string }
|
||||
@@ -103,6 +98,52 @@ export type Species = {
|
||||
sp_status: boolean | null
|
||||
}
|
||||
|
||||
export type RegionDetails = Prisma.now_reg_coord & { now_reg_coord_people: Array<RegionCoordinator> } & {
|
||||
now_reg_coord_country: Array<RegionCountry>
|
||||
}
|
||||
|
||||
export type TimeBound = {
|
||||
bid: number
|
||||
b_name: string
|
||||
age: number
|
||||
b_comment: string
|
||||
}
|
||||
|
||||
export type TimeBoundDetailsType = Prisma.now_tu_bound & { now_bau: Prisma.now_bau }
|
||||
|
||||
export type TimeBoundUpdate = Prisma.now_bau & { now_br: Prisma.now_br }
|
||||
|
||||
/* Time Unit */
|
||||
export type TimeUnitSequence = Prisma.now_tu_sequence
|
||||
|
||||
export type TimeUnitUpdate = Prisma.now_time_update & {
|
||||
now_tr: Prisma.now_tr & { ref_ref: { ref_authors: string; ref_journal: string }[] }
|
||||
}
|
||||
export type TimeUnitDetailsType = Prisma.now_time_unit & { now_tu_sequence: SequenceDetailsType } & {
|
||||
now_tau: Array<TimeUnitUpdate>
|
||||
} & {
|
||||
low_bound: Prisma.now_tu_bound
|
||||
up_bound: Prisma.now_tu_bound
|
||||
}
|
||||
|
||||
export type TimeUnit = {
|
||||
low_bound: number
|
||||
up_bound: number
|
||||
seq_name: string
|
||||
tu_name: string
|
||||
tu_display_name: string
|
||||
rank: string
|
||||
}
|
||||
|
||||
export type EditMetaData = { comment?: string; references?: Reference[] }
|
||||
|
||||
/* Reference */
|
||||
export type ReferenceDetailsType = Prisma.ref_ref
|
||||
|
||||
export type ReferenceType = Prisma.ref_ref_type & { ref_field_name: Prisma.ref_field_name[] }
|
||||
|
||||
export type ReferenceField = Prisma.ref_field_name
|
||||
|
||||
export type Reference = {
|
||||
ref_authors: {
|
||||
au_num: number
|
||||
@@ -121,52 +162,9 @@ export type Reference = {
|
||||
title_secondary: string
|
||||
}
|
||||
|
||||
export type ReferenceDetailsType = Prisma.ref_ref
|
||||
|
||||
export type RegionDetails = Prisma.now_reg_coord & { now_reg_coord_people: Array<RegionCoordinator> } & {
|
||||
now_reg_coord_country: Array<RegionCountry>
|
||||
}
|
||||
|
||||
export type TimeBound = {
|
||||
bid: number
|
||||
b_name: string
|
||||
age: number
|
||||
b_comment: string
|
||||
}
|
||||
|
||||
export type TimeBoundDetailsType = Prisma.now_tu_bound & { now_bau: Prisma.now_bau }
|
||||
|
||||
export type TimeUnit = {
|
||||
low_bound: number
|
||||
up_bound: number
|
||||
seq_name: string
|
||||
tu_name: string
|
||||
tu_display_name: string
|
||||
rank: string
|
||||
}
|
||||
|
||||
export type TimeBoundUpdate = Prisma.now_bau & { now_br: Prisma.now_br }
|
||||
|
||||
export type TimeUnitSequence = Prisma.now_tu_sequence
|
||||
|
||||
export type TimeUnitUpdate = Prisma.now_time_update & {
|
||||
now_tr: Prisma.now_tr & { ref_ref: { ref_authors: string; ref_journal: string }[] }
|
||||
}
|
||||
export type TimeUnitDetailsType = Prisma.now_time_unit & { now_tu_sequence: SequenceDetailsType } & {
|
||||
now_tau: Array<TimeUnitUpdate>
|
||||
} & {
|
||||
low_bound: Prisma.now_tu_bound
|
||||
up_bound: Prisma.now_tu_bound
|
||||
}
|
||||
|
||||
export type ReferenceType = Prisma.ref_ref & {
|
||||
ref_field_name: Prisma.ref_field_name
|
||||
ref_ref_type: Prisma.ref_ref_type
|
||||
export type ReferenceOfUpdate = Prisma.ref_ref & {
|
||||
ref_authors: Prisma.ref_authors[]
|
||||
} & { ref_journal: Pick<Prisma.ref_journal, 'journal_title'> }
|
||||
ref_journal: Prisma.ref_journal
|
||||
}
|
||||
|
||||
export type ReferenceTypeType = Prisma.ref_ref_type & { ref_field_name: Prisma.ref_field_name[] }
|
||||
|
||||
export type ReferenceField = Prisma.ref_field_name
|
||||
|
||||
export type EditMetaData = { comment?: string; references?: Reference[] }
|
||||
export type LocalityReference = Prisma.now_lr & ReferenceOfUpdate
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReferenceType, UpdateLog } from '@/backendTypes'
|
||||
import { ReferenceOfUpdate, UpdateLog } from '@/backendTypes'
|
||||
import { useDetailContext } from '@/components/DetailView/Context/DetailContext'
|
||||
import { EditingModal } from '@/components/DetailView/common/EditingModal'
|
||||
import { SimpleTable } from '@/components/DetailView/common/SimpleTable'
|
||||
@@ -18,8 +18,8 @@ const makeNameList = (names: Array<string | null>) => {
|
||||
return names[0] ?? ''
|
||||
}
|
||||
|
||||
const ReferenceList = ({ references, big }: { references: ReferenceType[]; big: boolean }) => {
|
||||
const getReferenceText = (ref: ReferenceType) => {
|
||||
const ReferenceList = ({ references, big }: { references: ReferenceOfUpdate[]; big: boolean }) => {
|
||||
const getReferenceText = (ref: ReferenceOfUpdate) => {
|
||||
// php version: html/include/database.php -> referenceCitation()
|
||||
const authors = makeNameList(ref.ref_authors.map(author => author.author_surname))
|
||||
const issue = ref.issue ? ` (${ref.issue}) ` : ''
|
||||
@@ -91,7 +91,7 @@ export const UpdateTab = <T, UpdateType extends MRT_RowData & { updates: UpdateL
|
||||
header: 'Reference',
|
||||
Cell: ({ row }: { row: MRT_Row<UpdateType> }) => (
|
||||
<ReferenceList
|
||||
references={(row.original[refFieldName] as { ref_ref: ReferenceType }[]).map(item => item.ref_ref)}
|
||||
references={(row.original[refFieldName] as { ref_ref: ReferenceOfUpdate }[]).map(item => item.ref_ref)}
|
||||
big={false}
|
||||
/>
|
||||
),
|
||||
@@ -105,7 +105,7 @@ export const UpdateTab = <T, UpdateType extends MRT_RowData & { updates: UpdateL
|
||||
coordinator={row.original[`${prefix}_coordinator`] as string}
|
||||
updates={row.original.updates}
|
||||
comment={row.original[`${prefix}_comment` as keyof UpdateType] as string}
|
||||
references={row.original[refFieldName] as { ref_ref: ReferenceType }[]}
|
||||
references={row.original[refFieldName] as { ref_ref: ReferenceOfUpdate }[]}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -118,7 +118,7 @@ export const UpdateTab = <T, UpdateType extends MRT_RowData & { updates: UpdateL
|
||||
)
|
||||
}
|
||||
|
||||
const DetailsModal = <RefType extends { ref_ref: ReferenceType }>({
|
||||
const DetailsModal = <RefType extends { ref_ref: ReferenceOfUpdate }>({
|
||||
updates,
|
||||
references,
|
||||
comment,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { api } from './api'
|
||||
import { EditDataType, Reference, ReferenceDetailsType, ReferenceTypeType } from '@/backendTypes'
|
||||
import { EditDataType, Reference, ReferenceDetailsType, ReferenceType } from '@/backendTypes'
|
||||
|
||||
const referencesApi = api.injectEndpoints({
|
||||
endpoints: builder => ({
|
||||
@@ -15,7 +15,7 @@ const referencesApi = api.injectEndpoints({
|
||||
}),
|
||||
providesTags: result => (result ? [{ type: 'reference', id: result.rid }] : []),
|
||||
}),
|
||||
getReferenceTypes: builder.query<ReferenceTypeType[], void>({
|
||||
getReferenceTypes: builder.query<ReferenceType[], void>({
|
||||
query: () => ({
|
||||
url: 'reference/types',
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user