Fixing Missing Hints In Workshop Creation: Building And Street Fields
Introduction
Hey guys! Today, we're diving into an issue found in the workshop creation process, specifically within the Contacts tab, where some hints are missing or incorrect for the Building and Street fields. This is a crucial part of ensuring a smooth user experience, and we need to address it. This article will walk you through the problem, the steps to reproduce it, and the expected versus actual results. So, let's jump right in and get this sorted out!
Background and Environment
This issue was identified in a test environment with the following setup:
- Operating System: Windows 10 (v.:1809)
- Browser: Google Chrome (v.: 138.0.7204.185)
- Reproducibility: Always
- Build Found: Commit 84e583a
To understand the problem better, let's look at the preconditions and the scenarios where the issue occurs. It's essential to ensure we're all on the same page before diving into the specifics. Making sure the environment is well-defined helps in replicating the issue and verifying the fix later on.
Preconditions
Before we can reproduce the issue, we need to set up a few things:
- Navigate to the test environment: https://pozashkillia-test.iea.gov.ua/#/
- Log in as a Service Provider (SP).
- Ensure the workshop draft creation window is open. This is where we'll be testing the input fields.
These preconditions ensure that we're starting from the same point, making the reproduction steps consistent and reliable. With these in place, we can move on to the specific scenarios where the problem arises. Now, let's see what those scenarios look like and how they highlight the issue.
Scenario 1: Incorrect Hint for the 'Street' Field
Steps to Reproduce
In this scenario, we'll focus on the 'Street' field within the 'Contacts' tab. Here’s how to reproduce the issue:
- First, enter valid information in all the required fields on the 'About the workshop', 'Addition', 'Description', and 'Contacts' tabs.
- Next, enter invalid data specifically into the 'Street' field.
- For instance, try entering just special characters like "-" or numbers.
Actual Result
Currently, the system allows you to enter invalid data in the 'Street' field without any immediate validation or warning. The entered information is displayed, and surprisingly, the user can still proceed to the next tab. This is not the intended behavior. The screenshots provided in the original report clearly show that the invalid input is accepted, and no error message is displayed.
Expected Result
Ideally, the system should prevent the entry of invalid data in the 'Street' field. Here’s what should happen:
- The system should highlight the 'Street' field in red to indicate an error.
- An error message should appear, stating: ‘This field must contain at least one letter.’
- The user should not be able to navigate to the next tab until the field contains valid input.
Postconditions
To maintain a clean testing environment, the following postcondition should be applied:
- Cancel the creation of the workshop draft. If a draft is partially completed, it should be deleted to avoid clutter.
By ensuring these postconditions, we keep the system tidy and ready for the next round of testing. Now, let’s move on to the second scenario, which focuses on the 'Building' field.
Scenario 2: Incorrect Hint for the 'Building' Field
Steps to Reproduce
In this scenario, we shift our focus to the 'Building' field. Follow these steps to reproduce the issue:
- Begin by entering valid information in all required fields on the 'About the workshop', 'Addition', 'Description', and 'Contacts' tabs, just like in the previous scenario.
- Then, enter invalid data into the 'Building' field. Some examples of invalid data include:
- Only special characters, such as "/"
- Only Cyrillic characters without any numbers, such as "А"
Actual Result
Currently, the system partially validates the 'Building' field, but the error message is incorrect. When invalid data is entered:
- The 'Building' field is highlighted in red, indicating an error.
- An error message does appear, but it states: ‘Please check the entered data. Use numbers, Cyrillic characters, and the symbols ( / - . ) only.’
- Despite the error, the user can still navigate to the next tab, which should not be the case.
The actual result shows that there's some validation in place, but the message is misleading, and the navigation should be blocked until the input is corrected.
Expected Result
The expected behavior for the 'Building' field is more specific and helpful:
- The 'Building' field should be highlighted in red when invalid data is entered.
- The error message should clearly state: 'Field must contain at least one digit.'
- The user should not be able to proceed to the next tab until valid data is entered.
This precise error message guides the user on the correct format, enhancing the user experience and reducing frustration. The inability to navigate further with invalid data ensures data integrity.
Postconditions
Just like in the first scenario, we need to maintain a clean environment after testing:
- Cancel the creation of the workshop draft.
- Delete the workshop draft if it has not been fully completed.
These steps ensure that our testing environment remains uncluttered and ready for further tests. Now that we've examined both scenarios, let's discuss the underlying user story and how this issue affects it.
User Story
This issue is directly related to a specific user story, which can be found here: https://github.com/ita-social-projects/OoS-Backend/issues/1544. Understanding the user story helps us appreciate the broader context and the impact of this bug on the overall functionality.
By addressing this issue, we're ensuring that the system behaves as expected and provides a better experience for our users. It's not just about fixing a bug; it's about making the system more user-friendly and reliable. So, what's the next step? Let's wrap up with a summary of the problem and the steps to resolution.
Summary of the Issue and Resolution
In summary, we've identified that the 'Street' and 'Building' fields in the 'Contacts' tab of the workshop creation form are not providing the correct hints or validation. This can lead to user frustration and incorrect data entry. The key issues are:
- The 'Street' field does not prevent the entry of invalid data (data without letters) and does not display an error message.
- The 'Building' field displays an incorrect error message and allows navigation to the next tab despite the error.
To resolve this, the following steps need to be taken:
- Implement proper validation for the 'Street' field to ensure it contains at least one letter.
- Display the correct error message for the 'Street' field: ‘This field must contain at least one letter.’
- Modify the validation for the 'Building' field to ensure it contains at least one digit.
- Update the error message for the 'Building' field to: 'Field must contain at least one digit.'
- Prevent navigation to the next tab until the fields contain valid data.
By addressing these points, we can ensure that the workshop creation process is smooth and user-friendly. It's all about providing clear guidance and preventing errors before they happen. So, let's get these fixes implemented and make the system better for everyone! This wraps up our deep dive into the missing hints issue. Thanks for following along, and let's keep making our systems better, one bug fix at a time!