Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add content char counter, improve invalid form handling #59

Merged
merged 5 commits into from
Jan 4, 2024

Conversation

Xpirix
Copy link
Collaborator

@Xpirix Xpirix commented Dec 8, 2023

Changes summary

  • Add characters counter in TinyMCE. It counts the total of characters of the field content value including HTML tags.
  • Stop editing when the max characters are exceeded
  • Disallow paste that exceeds max charters
  • Disable the buttons Submit for review / Save changes / Approve and publish when the form is not valid (including content field max characters exceeded)
  • Set error styles to red and bigger font size

Please find bellow a GIF demonstrating these changes:

Form_validation

@haubourg
Copy link
Member

haubourg commented Dec 8, 2023

Looks good to me from your specifications and screen cast 👍

Thanks !

@@ -268,12 +268,19 @@ def get(self, request):
user_is_approver = user.has_perm("qgisfeed.publish_qgisfeedentry")
form = self.form_class()

try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xpirix, could you please create a function for this? That way, you won't need to call it every time. Alos please create a test for the function.

Copy link
Collaborator

@dimasciput dimasciput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check my comment

@Xpirix
Copy link
Collaborator Author

Xpirix commented Jan 3, 2024

@dimasciput , I've made the changes.

@dimasciput dimasciput merged commit 4ef0269 into qgis:master Jan 4, 2024
2 checks passed
@Xpirix Xpirix deleted the improve_error_handling branch January 30, 2024 11:38
@Xpirix
Copy link
Collaborator Author

Xpirix commented Jan 30, 2024

This PR has been deployed.

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.

None yet

3 participants