Add the !filter and !warn imperative labels (#580)
This commit is contained in:
parent
33bf9c3869
commit
ab3074fdee
5 changed files with 99 additions and 3 deletions
|
@ -6,7 +6,23 @@ export const ILLEGAL_LABEL_GROUP: LabelValGroup = {
|
|||
title: 'Illegal Content',
|
||||
warning: 'Illegal Content',
|
||||
values: ['csam', 'dmca-violation', 'nudity-nonconsentual'],
|
||||
imagesOnly: false, // not applicable
|
||||
imagesOnly: false,
|
||||
}
|
||||
|
||||
export const ALWAYS_FILTER_LABEL_GROUP: LabelValGroup = {
|
||||
id: 'always-filter',
|
||||
title: 'Content Warning',
|
||||
warning: 'Content Warning',
|
||||
values: ['!filter'],
|
||||
imagesOnly: false,
|
||||
}
|
||||
|
||||
export const ALWAYS_WARN_LABEL_GROUP: LabelValGroup = {
|
||||
id: 'always-warn',
|
||||
title: 'Content Warning',
|
||||
warning: 'Content Warning',
|
||||
values: ['!warn'],
|
||||
imagesOnly: false,
|
||||
}
|
||||
|
||||
export const UNKNOWN_LABEL_GROUP: LabelValGroup = {
|
||||
|
|
|
@ -8,6 +8,8 @@ import {
|
|||
import {
|
||||
CONFIGURABLE_LABEL_GROUPS,
|
||||
ILLEGAL_LABEL_GROUP,
|
||||
ALWAYS_FILTER_LABEL_GROUP,
|
||||
ALWAYS_WARN_LABEL_GROUP,
|
||||
UNKNOWN_LABEL_GROUP,
|
||||
} from './const'
|
||||
import {
|
||||
|
@ -34,6 +36,12 @@ export function getLabelValueGroup(labelVal: string): LabelValGroup {
|
|||
if (ILLEGAL_LABEL_GROUP.values.includes(labelVal)) {
|
||||
return ILLEGAL_LABEL_GROUP
|
||||
}
|
||||
if (ALWAYS_FILTER_LABEL_GROUP.values.includes(labelVal)) {
|
||||
return ALWAYS_FILTER_LABEL_GROUP
|
||||
}
|
||||
if (ALWAYS_WARN_LABEL_GROUP.values.includes(labelVal)) {
|
||||
return ALWAYS_WARN_LABEL_GROUP
|
||||
}
|
||||
if (CONFIGURABLE_LABEL_GROUPS[id].values.includes(labelVal)) {
|
||||
return CONFIGURABLE_LABEL_GROUPS[id]
|
||||
}
|
||||
|
|
|
@ -4,7 +4,12 @@ import {LabelPreferencesModel} from 'state/models/ui/preferences'
|
|||
export type Label = ComAtprotoLabelDefs.Label
|
||||
|
||||
export interface LabelValGroup {
|
||||
id: keyof LabelPreferencesModel | 'illegal' | 'unknown'
|
||||
id:
|
||||
| keyof LabelPreferencesModel
|
||||
| 'illegal'
|
||||
| 'always-filter'
|
||||
| 'always-warn'
|
||||
| 'unknown'
|
||||
title: string
|
||||
imagesOnly: boolean
|
||||
subtitle?: string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue