mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.2 KiB
70 lines
1.2 KiB
// Rules for project label.
|
|
export const colorRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1
|
|
]
|
|
}
|
|
|
|
export const labelNameRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => (v && v.length <= 30) || msg.rule2
|
|
]
|
|
}
|
|
|
|
// Rules for project member.
|
|
export const userNameRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => (v && v.length <= 30) || msg.rule2
|
|
]
|
|
}
|
|
|
|
export const roleRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1
|
|
]
|
|
}
|
|
|
|
// Rules for a project.
|
|
export const projectNameRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => (v && v.length <= 30) || msg.rule2
|
|
]
|
|
}
|
|
|
|
export const descriptionRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => (v && v.length <= 100) || msg.rule2
|
|
]
|
|
}
|
|
|
|
export const projectTypeRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1
|
|
]
|
|
}
|
|
|
|
// Rules for Document.
|
|
export const fileFormatRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1
|
|
]
|
|
}
|
|
|
|
export const uploadFileRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => !v || v.size < 1000000 || msg.rule2
|
|
]
|
|
}
|
|
|
|
// Rules for user.
|
|
export const passwordRules = (msg) => {
|
|
return [
|
|
v => !!v || msg.rule1,
|
|
v => (v && v.length <= 30) || msg.rule2
|
|
]
|
|
}
|