Michael created this task.
Michael added projects: Wikidata Lexicographical data, Wikidata, 
Special:NewLexeme revival (Special:NewLexeme revival - sprint 1).

TASK DESCRIPTION
  The current form implements validation by using specialized form fields that 
have this built in:
  
    private function getFormFields(): array {
                return [
                        self::FIELD_LEMMA => [
                                'name' => self::FIELD_LEMMA,
                                'class' => HTMLTrimmedTextField::class,
                                'id' => 'wb-newlexeme-lemma',
                                'required' => true,
                                'placeholder-message' => 
'wikibaselexeme-lemma-edit-placeholder',
                                'label-message' => 
'wikibaselexeme-newlexeme-lemma'
                        ],
                        self::FIELD_LEMMA_LANGUAGE => [
                                'name' => self::FIELD_LEMMA_LANGUAGE,
                                'class' => LemmaLanguageField::class,
                                'cssclass' => 'lemma-language',
                                'id' => 'wb-newlexeme-lemma-language',
                                'label-message' => 
'wikibaselexeme-newlexeme-lemma-language',
                        ],
                        self::FIELD_LEXEME_LANGUAGE => [
                                'name' => self::FIELD_LEXEME_LANGUAGE,
                                'labelFieldName' => self::FIELD_LEXEME_LANGUAGE 
. '-label',
                                'class' => ItemSelectorWidgetField::class,
                                'id' => 'wb-newlexeme-lexeme-language',
                                'label-message' => 
'wikibaselexeme-newlexeme-language',
                                'required' => true,
                                'placeholder-message' => 
'wikibaselexeme-newlexeme-language-placeholder'
                        ],
                        self::FIELD_LEXICAL_CATEGORY => [
                                'name' => self::FIELD_LEXICAL_CATEGORY,
                                'labelFieldName' => 
self::FIELD_LEXICAL_CATEGORY . '-label',
                                'class' => ItemSelectorWidgetField::class,
                                'id' => 'wb-newlexeme-lexicalCategory',
                                'label-message' => 
'wikibaselexeme-newlexeme-lexicalcategory',
                                'required' => true,
                                'placeholder-message' => 
'wikibaselexeme-newlexeme-lexicalcategory-placeholder'
                        ]
                ];
        }
  
  see the `ItemSelectorWidgetField` above. We can reuse these fields for the 
no-js page and if we stick to the same field names for the js-version as well, 
then the validation will work there too. The remaining open question is how to 
get the validation result back into our frontend.

TASK DETAIL
  https://phabricator.wikimedia.org/T302070

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Michael
Cc: Michael, karapayneWMDE, Invadibot, maantietaja, Akuckartz, Nandana, Lahi, 
Gq86, GoranSMilovanovic, Mahir256, QZanden, LawExplorer, _jensen, rosalieper, 
Bodhisattwa, Scott_WUaS, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to