mirror of
https://github.com/web3privacy/explorer-app.git
synced 2024-10-15 16:46:26 +02:00
refact(rating): label interface and usage
This commit is contained in:
parent
da00ab91c2
commit
c35e1cf99a
2 changed files with 10 additions and 8 deletions
|
@ -224,7 +224,7 @@ export const useData = defineStore('data', () => {
|
|||
value = (field as any[])?.length
|
||||
if (value) {
|
||||
isValid = value >= ref.condition.minLength
|
||||
positive = `${value} ${ref.positive}${value > 1 ? 's' : ''}`
|
||||
positive = `${value} ${ref.label.positive}${value > 1 ? 's' : ''}`
|
||||
}
|
||||
}
|
||||
if (ref.condition.equals) {
|
||||
|
@ -241,11 +241,11 @@ export const useData = defineStore('data', () => {
|
|||
rankPoints += isValid ? ref.points : 0
|
||||
return {
|
||||
isValid,
|
||||
label: ref.label,
|
||||
positive: positive ? positive : ref.positive,
|
||||
negative: ref.negative,
|
||||
label: ref.label.name,
|
||||
positive: positive ? positive : ref.label.positive,
|
||||
negative: ref.label.negative,
|
||||
value,
|
||||
}
|
||||
} as ProjectRatingItem
|
||||
})
|
||||
return {
|
||||
type: rank.id,
|
||||
|
|
|
@ -8,9 +8,11 @@ export interface Rank {
|
|||
|
||||
interface Reference {
|
||||
field: keyof Project
|
||||
label: string
|
||||
label: {
|
||||
name: string
|
||||
positive: string
|
||||
negative: string
|
||||
}
|
||||
condition: Condition
|
||||
points: number
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue