Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"requestwiki-error-invalidcomment": "Your wiki request contains an invalid character. Please correct that and try again.",
"requestwiki-error-minlength": "Please lengthen this text to $1 {{PLURAL:$1|character|characters}} or more (you are currently using $2 {{PLURAL:$2|character|characters}}).",
"requestwiki-error-patient": "You have already requested a wiki! Please be patient, your request is being reviewed. If you need to request another wiki, try again later.",
"requestwiki-header": "Submit a wiki request",
"requestwiki-header-comment-withtimestamp": "Comment given by $1 at $2",
"requestwiki-info-guidance": "Provide clear and detailed information to help reviewers understand the purpose and scope of your request.",
"requestwiki-info-guidance-post": "Thank you for choosing our service!",
Expand Down Expand Up @@ -152,6 +153,8 @@
"requestwikiqueue-request-info-submission": "Here you can modify the visibility of the request, approve or decline the request, and provide additional comments when doing so. If you mark the wiki as approved, it will be created automatically.",
"requestwikiqueue-request-label-action": "What do you want to do?",
"requestwikiqueue-request-label-comment": "Comment:",
"requestwikiqueue-request-label-handle-ai": "Handle with AI",
"requestwikiqueue-request-label-handle-ai-success": "This request has been queued for AI evaluation. Check back in a few minutes.",
"requestwikiqueue-request-label-language": "Language",
"requestwikiqueue-request-label-reason": "Reason for request",
"requestwikiqueue-request-label-requested-date": "Requested At",
Expand Down
3 changes: 3 additions & 0 deletions i18n/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"requestwiki-error-invalidcomment": "Invalid comment/character based on disallowed error message.",
"requestwiki-error-minlength": "Error message shown when the given reason is too short. $1 is the minlength; $2 is the current length.",
"requestwiki-error-patient": "Multiple wiki requests in the same hour error message.\n\nWiki creator is a users with a userright.",
"requestwiki-header": "Legend header for the wiki request form.",
"requestwiki-header-comment-withtimestamp": "Timestamp for comment.",
"requestwiki-info-guidance": "Introductory guidance text displayed at the top of the wiki request form.",
"requestwiki-info-guidance-post": "Additional guidance displayed after the 'reason' field in the wiki request form.",
Expand Down Expand Up @@ -159,6 +160,8 @@
"requestwikiqueue-request-info-submission": "Instructional text about handling the submission of a wiki request.",
"requestwikiqueue-request-label-action": "Label for the 'Action' selection in the request handling form.",
"requestwikiqueue-request-label-comment": "Used as a label for 'comment'\n{{Identical|Comment}}",
"requestwikiqueue-request-label-handle-ai": "Label used for 'Handle with AI' button in the request handling form.",
"requestwikiqueue-request-label-handle-ai-success": "Message after a request has been queued for AI handling.",
"requestwikiqueue-request-label-language": "Used as a label for 'language'\n{{Identical|Language}}",
"requestwikiqueue-request-label-reason": "Label for the 'reason' field in the request details section.",
"requestwikiqueue-request-label-requested-date": "Used as a label for 'requested at'.",
Expand Down
2 changes: 1 addition & 1 deletion includes/RequestWiki/Specials/SpecialRequestWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function execute( $par ): void {
'ext.createwiki.requestwiki.oouiform.styles',
] );

$form = $this->getForm();
$form = $this->getForm()->setWrapperLegendMsg( 'requestwiki-header' );
if ( $form && $form->show() ) {
$this->onSuccess();
}
Expand Down
19 changes: 19 additions & 0 deletions includes/Services/WikiRequestViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,18 @@ public function getFormDescriptor(): array {
],
];

if (
$this->options->get( ConfigNames::AIConfig )['baseurl'] &&
$this->options->get( ConfigNames::AIConfig )['model']
) {
$formDescriptor['handle-ai'] = [
'type' => 'submit',
'flags' => [ 'progressive', 'primary' ],
'buttonlabel-message' => 'requestwikiqueue-request-label-handle-ai',
'section' => 'handling',
];
}

if ( $this->options->get( ConfigNames::CannedResponses ) ) {
$formDescriptor['handle-comment']['type'] = 'selectorother';
$formDescriptor['handle-comment']['options'] = $this->options->get( ConfigNames::CannedResponses );
Expand Down Expand Up @@ -485,6 +497,13 @@ protected function submitForm(
$out = $form->getContext()->getOutput();
$session = $form->getRequest()->getSession();

if ( isset( $formData['handle-ai'] ) ) {
$this->wikiRequestManager->evaluateWithOllama();

$out->addHTML( Html::successBox( $this->context->msg( 'requestwikiqueue-request-label-handle-ai-success' )->escaped() ) );
return;
}

if ( isset( $formData['submit-comment'] ) ) {
// Don't want to mess with some generic comments across requests.
// If it is a different request it is not a duplicate comment.
Expand Down
Loading