Skip to content

fix: Add Warning Messages About Invalid License Key and Usage Exceed - #19

Merged
Artem-Okladov merged 2 commits into
mainfrom
fix/add-warning-messages
Aug 11, 2026
Merged

fix: Add Warning Messages About Invalid License Key and Usage Exceed#19
Artem-Okladov merged 2 commits into
mainfrom
fix/add-warning-messages

Conversation

@Artem-Okladov

Copy link
Copy Markdown
Collaborator

Summary

  • Added two branded warning messages on the WProofreader settings page: usage limit exceeded and invalid license key, shown when the WebSpellChecker service returns a 403 while fetching the live language list.
  • Both messages render as Moodle warning notifications and are prefixed with a warning emoji.
  • The live service check, and the warnings it can trigger, only runs on the WProofreader settings page itself, not on other Site administration pages.

Changes

  • lang/en/local_wproofreader.php: added usage_limit_exceeded and service_id_invalid strings.
  • classes/local/config_builder.php: pass usageLimitExceededMessage and serviceIdInvalidMessage through to the JS config.
  • amd/src/settings_page.js: on a 403 from the service, show the usage-limit message when the error mentions quota, otherwise show the invalid-license message.
  • classes/local/settings_page_heading.php (new): admin_setting_heading subclass whose output_html() queues the settings-page AMD module only when the WProofreader settings page is the one being rendered.
  • settings.php: gate the setting definitions behind $ADMIN->fulltree (matches the pattern used by Moodle core plugins, e.g. blocks/rss_client) and use the new heading class to trigger the language-list check.
  • amd/build/settings_page.min.js and .map: rebuilt via Moodle's grunt task.

Testing

Manual testing on Moodle 4.5 & 5.2 setups.
01-license-id
02-usage-quota

@Artem-Okladov
Artem-Okladov merged commit 369471a into main Aug 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant