-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tech to experience items from projects (#512)
- Loading branch information
Showing
17 changed files
with
226 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...perience-section/experience-item/experience-item-tech/experience-item-tech.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<p> | ||
Extracted from {{ _projectCount }} | ||
{{ _projectCount > 1 ? 'projects' : 'project' }}: {{ _projectNames }} | ||
</p> | ||
<br /> | ||
<app-content-chip-list> | ||
<app-content-chip *ngFor="let item of technologies"> | ||
<app-technology [item]="item"></app-technology> | ||
</app-content-chip> | ||
</app-content-chip-list> |
Empty file.
46 changes: 46 additions & 0 deletions
46
...ience-section/experience-item/experience-item-tech/experience-item-tech.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { ComponentFixture } from '@angular/core/testing' | ||
|
||
import { ExperienceItemTechComponent } from './experience-item-tech.component' | ||
import { componentTestSetup } from '@/test/helpers/component-test-setup' | ||
import { byComponent } from '@/test/helpers/component-query-predicates' | ||
import { TechnologyComponent } from '../../../technology/technology.component' | ||
import { makeTechnologyItem } from '../../../technology/__tests__/make-technology-item' | ||
|
||
describe('ExperienceItemTechComponent', () => { | ||
let component: ExperienceItemTechComponent | ||
let fixture: ComponentFixture<ExperienceItemTechComponent> | ||
const technologies = [ | ||
makeTechnologyItem(), | ||
makeTechnologyItem(), | ||
makeTechnologyItem(), | ||
] | ||
const projectNames = ['Project A', 'Project B', 'Project C'] | ||
|
||
beforeEach(async () => { | ||
;[fixture, component] = makeSut() | ||
|
||
component.technologies = technologies | ||
component.projectNames = projectNames | ||
|
||
fixture.detectChanges() | ||
}) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
|
||
it('should display all techs', () => { | ||
const techElements = fixture.debugElement.queryAll( | ||
byComponent(TechnologyComponent), | ||
) | ||
expect(techElements.length).toEqual(technologies.length) | ||
}) | ||
|
||
it('should display all project names', () => { | ||
expect(fixture.debugElement.nativeElement.textContent).toContain( | ||
'Project A, Project B, and Project C', | ||
) | ||
}) | ||
}) | ||
|
||
const makeSut = () => componentTestSetup(ExperienceItemTechComponent) |
30 changes: 30 additions & 0 deletions
30
...experience-section/experience-item/experience-item-tech/experience-item-tech.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Component, Input } from '@angular/core' | ||
import { TechnologyItem } from '../../../technology/technology-item' | ||
import { ContentChipComponent } from '../../../content-chip/content-chip.component' | ||
import { ContentChipListComponent } from '../../../content-chip-list/content-chip-list.component' | ||
import { NgForOf } from '@angular/common' | ||
import { TechnologyComponent } from '../../../technology/technology.component' | ||
|
||
@Component({ | ||
selector: 'app-experience-item-tech', | ||
standalone: true, | ||
imports: [ | ||
ContentChipComponent, | ||
ContentChipListComponent, | ||
NgForOf, | ||
TechnologyComponent, | ||
], | ||
templateUrl: './experience-item-tech.component.html', | ||
styleUrl: './experience-item-tech.component.scss', | ||
}) | ||
export class ExperienceItemTechComponent { | ||
@Input({ required: true }) public technologies!: ReadonlyArray<TechnologyItem> | ||
@Input({ required: true }) public set projectNames( | ||
names: ReadonlyArray<string>, | ||
) { | ||
this._projectCount = names.length | ||
this._projectNames = new Intl.ListFormat('en').format(names) | ||
} | ||
protected _projectNames!: string | ||
protected _projectCount!: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/resume-page/projects-section/__tests__/make-json-resume-project.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
src/app/resume-page/projects-section/get-project-items.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.