Problems description: Trailing and leading spaces are not removed from the following fields that are in some way related to API tokens:
1 - "Expires at" field in the API token create/edit form. Exactly the same type of field is trimmed in other places in frontend, for example in Maintenance configuration form fields "Active since" and "Active till".
2 - Filter field "Name" in the API tokens list. In other places in frontend trailing and leading spaces are removed from such fields, for example in the "Name" filter field in host/template items list.
Steps to reproduce problem #1:
- Open API token configuration form (in create of edit mode)
- fill in all mandatory parameters - make sure that the "Set expiration date and time" option is set
- Enter a value with trailing or leading space in "Expires at" field
- Submit the form
Result: An error is displayed, specifying that the time format is not correct.
Expected: The trailing/leading space should've been removed automatically and token configuration should've been successfully saved.
Steps to reproduce problem #2:
- Create a couple of API tokens
- Open the list of API tokens
- Specify the name of one of the tokens in filter field "Name" - make sure to add trailing and leading spaces to this value.
- Apply the filter
Result: Filter is applied, value in field "Name" still has trailing and leading spaces, no entries are returned in the list of API tokens.
Expected: Trailing and leading spaces should've been automatically removed from the value in filter field "Name" before applying the filter. At least 1 entry should be returned in the list of API tokens.