mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
Merge pull request #4119 from jumpserver/pr@dev@fix_tips_show
fixed: tip message show
This commit is contained in:
@@ -161,6 +161,7 @@ export class FormFieldGenerator {
|
||||
|
||||
setHelpText(field, remoteFieldMeta) {
|
||||
let helpText = toSentenceCase(remoteFieldMeta['help_text'])
|
||||
|
||||
if (!helpText) {
|
||||
return field
|
||||
}
|
||||
@@ -177,11 +178,12 @@ export class FormFieldGenerator {
|
||||
const placeholderType = ['input', 'select', 'm2m_related_field']
|
||||
const placeholderComponent = [ObjectSelect2]
|
||||
|
||||
const systemLang = document.cookie.django_language
|
||||
if (helpTextAsPlaceholder !== undefined) {
|
||||
helpTextAsPlaceholder = !!helpTextAsPlaceholder
|
||||
} else if (placeholderType.indexOf(field.type) === -1 && placeholderComponent.indexOf(field.component) === -1) {
|
||||
helpTextAsPlaceholder = false
|
||||
} else if (helpTextWordLength <= 5 || helpText.length <= 10) {
|
||||
} else if ((helpTextWordLength <= 5 || helpText.length <= 10) && systemLang === 'en') {
|
||||
helpTextAsPlaceholder = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user