Skip to content

Conversation

lenshinoda
Copy link
Collaborator

@lenshinoda lenshinoda commented May 14, 2021

Hi Team, I solved the problem by creating a new method to show the project type in the table. The problem is solved and the project type is displaying in the project-list table in the customers-management.

@codecov
Copy link

codecov bot commented May 14, 2021

Codecov Report

Merging #685 (3e2fb25) into master (13de42e) will increase coverage by 1.12%.
The diff coverage is 94.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #685      +/-   ##
==========================================
+ Coverage   93.09%   94.22%   +1.12%     
==========================================
  Files          85      103      +18     
  Lines        1564     2042     +478     
  Branches      107      148      +41     
==========================================
+ Hits         1456     1924     +468     
- Misses         67       76       +9     
- Partials       41       42       +1     
Impacted Files Coverage Δ
...nents/time-range-form/time-range-form.component.ts 100.00% <ø> (ø)
...er-management/store/customer-management.effects.ts 83.78% <14.28%> (-16.22%) ⬇️
...ared/components/input-date/input-date.component.ts 64.28% <50.00%> (-4.95%) ⬇️
...time-entries-table/time-entries-table.component.ts 61.90% <60.00%> (+6.34%) ⬆️
src/app/modules/user/store/user.reducer.ts 62.50% <62.50%> (ø)
src/app/modules/user/services/user-info.service.ts 66.66% <66.66%> (ø)
src/app/modules/user/services/user.service.ts 75.00% <75.00%> (ø)
.../components/project-list/project-list.component.ts 84.21% <82.60%> (ø)
...dules/time-entries/pages/time-entries.component.ts 85.33% <82.60%> (+2.52%) ⬆️
...es-management/store/activity-management.effects.ts 94.59% <83.33%> (-5.41%) ⬇️
... and 76 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f239ab1...3e2fb25. Read the comment docs.

component.projectsTypes = [nameType];
component.ngOnInit();
const nameTest = component.getProjectType(id);
expect(nameTest).toBe('BK');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nameTest get the id of the project.
and in the expect should compare the id
expect(idTest).toBe('1223');

and you can create another expect for name
NAME: expect(nameTest).toBe('BK');

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nameTest gets the name of the projectType to print it in the table, that's why I changed the getPProjectType function to getProjectTypeName in the next commit.

}

getProjectType(typeId: string) {
const typeName = this.projectsTypes.find(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change typeName for typeProject

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

component.ngOnInit();

const projectNameTest = component.getProjectTypeName(id);
expect(projectNameTest).toBe('BK');
Copy link
Collaborator Author

@lenshinoda lenshinoda May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am testing ('BK') here because the input of function getProjectTypeName is the project_type_id and it returns the name of the project type to render it on the table.

@scastillo-jp scastillo-jp merged commit 73f2127 into master May 19, 2021
@scastillo-jp scastillo-jp deleted the TT-24-Display-project-type-in-projects-table branch May 19, 2021 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants