Add custom fragment to the device details

Hi Melanie,

as a temporary workaround you can also patch the underlying validation within the properties library. Probably the easiest solution if you can’t wait for a fix.

  1. Create a clone of the administration application: c8ycli new administration administration
  2. Install patch-package as a dev dependency to your project: npm install patch-package --save-dev
  3. Within your project update the template, which is used to create a new property: \node_modules\@c8y\ng1-modules\core\ui\schemaForm\schemaPropertyEditor.html. Specifically, modify the regular expression in line 12 to allow the _ character, e.g. ng-pattern="/^[A-Za-z0-9_]+$/"
  4. Run your app locally and test your changes.
  5. Create the corresponding patch npx patch-package @c8y/ng1-modules
  6. Build the application and deploy it to the target tenant. In addition, add the postinstall script patch-package to install the patch after libraries have been installed in case the project is checked out by another developer. Of course also version control your patch.

Best regards
Christian

1 Like