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

Validierung für Module-Settings integrieren #66

Open
twobiers opened this issue Oct 1, 2021 · 0 comments
Open

Validierung für Module-Settings integrieren #66

twobiers opened this issue Oct 1, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@twobiers
Copy link
Collaborator

twobiers commented Oct 1, 2021

Die Module Settings sind super, wir sollten aber eine Funktion einbauen, die (insbesondere bei Freitextfeldern) die Eingaben validieren. Sollte auch Custom aus dem Modul heraus möglich sein. Ungefähr so:

getSettings() {
  return [
    {
      id: 'sfw_filter',
      title: 'SFW Filter',
      description: 'Standardfilter für SFW (ohne führendes !)',
      type: 'text',
      validator: this.sfwValidator
    }
  ];
}

/**
 * @returns {boolean} 
 */
sfwValidator(content) {
  return !content.startsWith('!');
}

Cool wäre es, wenn wir die validator Signatur so hinbekommen, dass RegEx ODER Validator Function verwendet werden kann.

@twobiers twobiers added the enhancement New feature or request label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant