You recently joined a company that uses an internal system to monitor the performance of its sales team. They are currently use Vuejs and Angularjs, and they need to implement some requirements
The application consists of two pages
-
On the home page, there is a table that names all members of the sales team.
-
the performance-chart page, which provides a simple chart showing the team's performance during the previous week.
below are the steps to install the dashboard and a the list of requirements.
- copy the content of compressed file, then navigate to the output folder.
- run
yarn install
- run
yarn start
- Create a github repository and commit the sent task files as the first commit.
- Use git and the commit messages that make sense
- Make a single Pull Request (PR) for each of the requirements listed. The title of the requirement should be used to name the pull request.
Using Vuejs we need to create a filter component
-
Given I'm a user When I type a string inside the filter text input Then I should see the matching string highlighted in the employees table "Employee" and "About" columns.
-
Given I'm a user When I modify the filter text input Then I should see the changes reflected in the page url. for example, normal page url
http://localhost:8080/
, when add search string, url should behttp://localhost:8080/?filter=[YOUR_SEARCH_STRING]
-
Given I'm a user When I modify the filter text input and copy the page url Then I should see the search string highlighted in the employees table "Employee", "Address" and "About" columns. (Refeer to below animated screenshot)
-
Given I'm a user When I click on the
Clear
button Then the filter text input and page url should reset to the inital state.
- Integrate the built filter component with empoylees table - built in angularjs and uses ng-repeat to render all tables rows - using ngVue (you can refer to about page as it has same logic).
- use angularjs custom filter to implement the highlight functionality.
- A chart built with echarts library can be found on the page
/team-performance
.
-
Current chart implementation uses static data, use Axios and Vuex to fetch team performance data from endpoint https://fe-task.getsandbox.com/performance, and replace it with the static data already set.
-
To select a specific range on the chart, use browser default date range input to filter the fetched data.
-
Write a unit test for the filter function you just implemented above (jest is already included in dependencies)
endpoint: https://fe-task.getsandbox.com/performance method: GET
Response:
[{ date_ms: DATE_IN_UNIX_FORMAT, performance: PERFORMANCE_INDEX }, ... ]
- The chart line should be styled to reflect the design below, and the graph line should indicate the performance ranges. (you can pick the correct color codes from below screenshot)
- Red: For a score of less than 50%
- Yellow: for a score of 50% to 80%
- Green: For a score of more than 80%
- Match the tooltip to the design; it should provide the point's date as well as the relative performance index colour and value.
To implement the following, check the library documentation:
- Create a not-found page with vuejs, as shown on the 'about' page.
- To handle unknown routes, use ui-router, which should redirect to the not found page you just created.
- First Scenario
- open home page
- mock the employees request
- assert employees data is apearing
- assert on team perofrmance page link text and href
- Second Scenario
- open home page
- mock the employees request
- click load more button
- assert on request is sent with correct params
- assert on data appended to table correctly
-
Implement the logic of the load more button.
-
While loading data, add a loader indicator to the button and disable it to prevent multiple clicks.
-
When there are no more pages to load, hide the button.
-
The 'total pages' count can be seen in the request of employees.
endpoint:https://fe-task.getsandbox.com/employees method: GET params:
?page
[int]: number of current page, if not passed will return the first page?isPartTime
[bool]: return only part time employees, if not passed, will return all employees
Response:
{ pages: TOTAL_PAGES_COUNT, current_page: CURRENT_PAGE_NUMBER, employees: LIST_OF_EMPLOYEES }
- Fix any CSS, and javascript be consistent in the way of writing your code
- Follow the guidelines mentioned bellow or your own guidelines
- Vuejs v2 style guide
- BEM & SMACSS in writing you scss code.