-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(account): adiciona habilidades para usuários
closed #76
- Loading branch information
Showing
24 changed files
with
375 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,16 @@ | ||
import { UserSkill } from '@devmx/shared-api-interfaces'; | ||
import { IsNotEmpty, IsNumber } from 'class-validator'; | ||
import { SkillDto } from '@devmx/learn-data-source'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from 'class-transformer'; | ||
|
||
export class UserSkillDto implements UserSkill { | ||
@IsNumber() | ||
@IsNotEmpty() | ||
@ApiProperty() | ||
weight: number; | ||
|
||
@Type(() => SkillDto) | ||
@ApiProperty({ type: () => SkillDto }) | ||
skill: SkillDto; | ||
} |
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
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
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
45 changes: 45 additions & 0 deletions
45
packages/account/feature-shell/src/lib/containers/account/skills/skills.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,45 @@ | ||
<div formArrayName="skills"> | ||
<ol class="skill-list" cdkDropList (cdkDropListDropped)="drop($event)"> | ||
@for (item of form.skills.controls; track item.value.skill?.id; let index = | ||
$index) { | ||
<li cdkDrag [cdkDragData]="item" [formGroupName]="index"> | ||
<devmx-icon name="drag/handle" cdkDragHandle /> | ||
|
||
<div> | ||
<div> | ||
{{ item.value.skill?.name }} | ||
</div> | ||
|
||
<mat-slider | ||
min="0" | ||
max="100" | ||
step="10" | ||
discrete | ||
color="primary" | ||
showTickMarks | ||
[displayWith]="formatLabel" | ||
> | ||
<input matSliderThumb formControlName="weight" /> | ||
</mat-slider> | ||
</div> | ||
|
||
<strong> {{ item.value.weight }}% </strong> | ||
</li> | ||
} | ||
</ol> | ||
</div> | ||
|
||
<mat-form-field> | ||
<mat-label>Adicionar habilidade</mat-label> | ||
<input matInput [formControl]="searchControl" [matAutocomplete]="auto" /> | ||
<mat-autocomplete | ||
#auto="matAutocomplete" | ||
[displayWith]="displayFn" | ||
(optionSelected)="onOptionSelected($event.option.value)" | ||
> | ||
@if (skillFacade.response$ | async; as response) { @for (option of | ||
response.data; track option.id) { | ||
<mat-option [value]="option">{{ option.name }}</mat-option> | ||
} } | ||
</mat-autocomplete> | ||
</mat-form-field> |
68 changes: 68 additions & 0 deletions
68
packages/account/feature-shell/src/lib/containers/account/skills/skills.component.scss
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,68 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
.skill-list { | ||
padding: 0; | ||
|
||
gap: 1em; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
devmx-icon { | ||
cursor: grab; | ||
|
||
&:active { | ||
cursor: grabbing; | ||
} | ||
} | ||
|
||
li { | ||
gap: 1.2em; | ||
display: flex; | ||
align-items: center; | ||
|
||
& > div { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
div { | ||
padding-left: 0.5em; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.skills-list { | ||
width: 500px; | ||
max-width: 100%; | ||
overflow: hidden; | ||
|
||
|
||
li { | ||
min-height: 3em; | ||
box-sizing: border-box; | ||
cursor: move; | ||
} | ||
} | ||
|
||
.cdk-drag-preview { | ||
border: none; | ||
box-sizing: border-box; | ||
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), | ||
0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12); | ||
} | ||
|
||
.cdk-drag-placeholder { | ||
opacity: 0; | ||
} | ||
|
||
.cdk-drag-animating { | ||
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); | ||
} | ||
|
||
.skills-list.cdk-drop-list-dragging .skills-list li:not(.cdk-drag-placeholder) { | ||
transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); | ||
} | ||
} |
Oops, something went wrong.