Skip to content

Commit 2db87ff

Browse files
committed
feat(account): adiciona configuração de informações públicas
1 parent 3e57f08 commit 2db87ff

File tree

27 files changed

+312
-66
lines changed

27 files changed

+312
-66
lines changed

apps/devmx/src/scss/component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@forward './components/stepper.theme';
22
@forward './components/layout.theme';
33
@forward './components/dialog.theme';
4+
@forward './components/links.theme';
45
@forward './components/form.theme';
56
@forward './components/fab.theme';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@use '@angular/material' as mat;
2+
3+
@mixin links-theme($theme) {
4+
body {
5+
a:link:not(.mdc-button):not(.mdc-icon-button):not(.mdc-fab),
6+
a:active:not(.mdc-button):not(.mdc-icon-button):not(.mdc-fab),
7+
a:visited:not(.mdc-button):not(.mdc-icon-button):not(.mdc-fab) {
8+
color: mat.get-theme-color($theme, secondary, 70);
9+
}
10+
11+
.mdc-icon-button:not(.mdc-fab):hover,
12+
.mdc-icon-button:not(.mdc-fab):hover,
13+
.mdc-icon-button:not(.mdc-fab):hover {
14+
color: mat.get-theme-color($theme, secondary, 70);
15+
}
16+
}
17+
}

apps/devmx/src/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@include component.stepper-theme(theme.$light);
1717
@include component.layout-theme(theme.$light);
1818
@include component.dialog-theme(theme.$light);
19+
@include component.links-theme(theme.$light);
1920
@include component.form-theme(theme.$light);
2021
@include component.fab-theme(theme.$light);
2122

packages/account/data-access/src/lib/infrastructure/user.http.service.impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class UserHttpServiceImpl
3737
form.append('photo', data.photo);
3838
form.append('gender', data.gender ?? '');
3939
form.append('minibio', data.minibio ?? '');
40-
form.append('birthday', data.birthday ?? '');
40+
form.append('birthday', data.birthday?.toString() ?? '');
4141

4242
const url = [this.url, id, 'photo'];
4343

packages/account/data-source/src/lib/dtos/update-profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class UpdateProfileDto implements UpdateProfile {
2222

2323
@IsOptional()
2424
@ApiPropertyOptional()
25-
birthday?: string;
25+
birthday?: Date;
2626

2727
@IsOptional()
2828
@ApiPropertyOptional()

packages/account/data-source/src/lib/dtos/user-profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class UserProfileDto implements UserProfile {
2525
minibio?: string;
2626

2727
@ApiPropertyOptional()
28-
birthday?: string;
28+
birthday?: Date;
2929

3030
@Type(() => CityDto)
3131
@ApiPropertyOptional({ type: () => [CityDto] })

packages/account/data-source/src/lib/schemas/user-profile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class UserProfileCollection implements UserProfile {
2727
@Prop({ default: '' })
2828
minibio?: string;
2929

30-
@Prop({ default: '' })
31-
birthday?: string;
30+
@Prop({ default: '', type: Date })
31+
birthday?: Date;
3232

3333
@Prop({
3434
type: mongoose.Schema.Types.ObjectId,

packages/account/data-source/src/lib/schemas/user.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import { UserPasswordCollection, UserPasswordSchema } from './user-password';
22
import { UserContactCollection, UserContactSchema } from './user-contact';
33
import { UserProfileCollection, UserProfileSchema } from './user-profile';
44
import { UserSocialCollection, UserSocialSchema } from './user-social';
5+
import { DEFAULT_ROLES, DEFAULT_VISIBILITY } from '@devmx/shared-util-data';
56
import { UserCodeCollection, UserCodeSchema } from './user-code';
6-
import { Roles, User, UserSkill } from '@devmx/shared-api-interfaces';
77
import { createSchema } from '@devmx/shared-data-source';
8-
import { DEFAULT_ROLES } from '@devmx/shared-util-data';
98
import { SkillSchema } from '@devmx/learn-data-source';
109
import { Prop, raw, Schema } from '@nestjs/mongoose';
1110
import { Document } from 'mongoose';
11+
import {
12+
User,
13+
Roles,
14+
UserSkill,
15+
UserVisibility,
16+
} from '@devmx/shared-api-interfaces';
1217

1318
@Schema()
1419
export class UserCollection extends Document implements User {
@@ -26,6 +31,13 @@ export class UserCollection extends Document implements User {
2631
@Prop({ required: true, type: Object, default: DEFAULT_ROLES })
2732
roles: Roles;
2833

34+
@Prop({
35+
type: Object,
36+
required: true,
37+
default: DEFAULT_VISIBILITY,
38+
})
39+
visibility: UserVisibility;
40+
2941
@Prop([
3042
{
3143
type: raw({

packages/account/feature-about/src/lib/containers/about-user/about-user.container.html

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,84 @@
22
<header>
33
<h2>{{user.displayName}}</h2>
44
<h3>{{'@' + user.name}}</h3>
5-
</header>
65

7-
@if (user.profile && user.profile.minibio) {
8-
<mat-card>
9-
<mat-card-content>
10-
<devmx-markdown [content]="user.profile.minibio" />
11-
</mat-card-content>
12-
</mat-card>
13-
}
14-
<!-- -->
6+
<div class="user-contact">
7+
@if (user.contact.email && user.visibility?.email) {
8+
<p>
9+
<devmx-icon name="message/mail" />
10+
<span>{{user.contact.email}}</span>
11+
</p>
12+
}
13+
<!-- -->
14+
@if (user.contact.phone && user.visibility?.phone) {
15+
<p>
16+
<devmx-icon name="tech/phone" />
17+
<span>{{user.contact.phone}}</span>
18+
</p>
19+
}
20+
</div>
21+
</header>
1522

16-
@if (user.skills?.length) {
17-
<mat-card>
18-
<mat-card-content>
19-
<ol>
20-
@for (item of user.skills; track item.skill.id) {
21-
<li>
22-
<p>{{item.skill.name}}</p>
23-
<mat-progress-bar [value]="item.weight" />
24-
</li>
25-
}
26-
</ol>
27-
</mat-card-content>
28-
</mat-card>
23+
@if (user.visibility?.roles) {
24+
<div>
25+
<mat-chip-set>
26+
@for (role of user.roles | keyvalue; track role) {
27+
<!-- -->
28+
@if (role.value) {
29+
<mat-chip>{{role.key | role}}</mat-chip>
30+
}
31+
<!-- -->
32+
}
33+
</mat-chip-set>
34+
</div>
2935
}
3036

31-
<!-- -->
32-
}
37+
<section>
38+
@if (user.profile && user.profile.minibio) {
39+
<mat-card>
40+
<mat-card-content>
41+
<devmx-markdown [content]="user.profile.minibio" />
42+
</mat-card-content>
43+
</mat-card>
44+
}
45+
<!-- -->
3346

47+
@if (user.skills?.length && user.visibility?.skills) {
48+
<mat-card>
49+
<mat-card-content>
50+
<ol>
51+
@for (item of user.skills; track item.skill.id) {
52+
<li>
53+
<p>{{item.skill.name}}</p>
54+
<mat-progress-bar [value]="item.weight" />
55+
</li>
56+
}
57+
</ol>
58+
</mat-card-content>
59+
</mat-card>
60+
}
61+
</section>
3462
<!-- -->
3563

3664
<section>
65+
@if (user.visibility?.events) {
66+
<!-- -->
3767
@if (eventFacade.response$ | async; as response) {
3868
<devmx-event-card-list [data]="response.data" />
3969
}
70+
<!-- -->
71+
}
4072

4173
<!-- -->
4274

75+
@if (user.visibility?.presentations) {
76+
<!-- -->
4377
@if (presentationFacade.response$ | async; as response) {
4478
<devmx-presentation-card-list [data]="response.data" />
4579
}
80+
<!-- -->
81+
}
4682
</section>
83+
84+
<!-- -->
85+
}

packages/account/feature-about/src/lib/containers/about-user/about-user.container.scss

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,26 @@
88

99
& > section {
1010
gap: 1em;
11+
display: grid;
12+
grid-auto-flow: dense;
13+
14+
grid-template-columns: repeat(2, 1fr);
15+
16+
@media (max-width: 1278px) {
17+
grid-template-columns: repeat(1, 1fr);
18+
}
19+
}
20+
21+
.user-contact {
22+
gap: 2em;
1123
display: flex;
12-
flex-direction: column;
24+
flex-flow: row wrap;
25+
26+
p {
27+
gap: 0.4em;
28+
display: flex;
29+
align-items: center;
30+
}
1331
}
1432

1533
ol {

0 commit comments

Comments
 (0)