Skip to content

Commit 8627c45

Browse files
[PersonCard] Added Files section and updated Profile section (#669)
* Fixed file icons and updated profile section * Improved missing data states in profile * Updated missing ddata state for profile languages * Removed commented code
1 parent b5c6960 commit 8627c45

File tree

11 files changed

+237
-302
lines changed

11 files changed

+237
-302
lines changed

packages/mgt/src/components/mgt-person-card/mgt-person-card.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ $person-card-background-color: var(--person-card-background-color, #ffffff);
2525
width: var(--mgt-flyout-set-width, 340px);
2626
font-family: var(--default-font-family);
2727
overflow: hidden;
28+
user-select: none;
2829

2930
.nav {
3031
display: flex;

packages/mgt/src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { MgtPerson } from '../mgt-person/mgt-person';
1818
import { styles } from './mgt-person-card-css';
1919
import { BasePersonCardSection } from './sections/BasePersonCardSection';
2020
import { MgtPersonCardContact } from './sections/mgt-person-card-contact/mgt-person-card-contact';
21-
// import { MgtPersonCardFiles } from './sections/mgt-person-card-files/mgt-person-card-files';
21+
import { MgtPersonCardFiles } from './sections/mgt-person-card-files/mgt-person-card-files';
2222
import { MgtPersonCardMessages } from './sections/mgt-person-card-messages/mgt-person-card-messages';
2323
import { MgtPersonCardOrganization } from './sections/mgt-person-card-organization/mgt-person-card-organization';
2424
import { MgtPersonCardProfile } from './sections/mgt-person-card-profile/mgt-person-card-profile';
@@ -193,7 +193,7 @@ export class MgtPersonCard extends MgtTemplatedComponent {
193193
new MgtPersonCardContact(),
194194
new MgtPersonCardOrganization(),
195195
new MgtPersonCardMessages(),
196-
// new MgtPersonCardFiles(),
196+
new MgtPersonCardFiles(),
197197
new MgtPersonCardProfile()
198198
];
199199
}

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-contact/mgt-person-card-contact.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
:host {
1111
position: relative;
12+
user-select: none;
1213

1314
.root {
1415
padding: 20px 0;

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-files/mgt-person-card-files.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
:host {
1111
position: relative;
12+
user-select: none;
1213

1314
.root {
1415
padding: 20px 0;
@@ -43,7 +44,9 @@
4344
min-width: 28px;
4445
height: 28px;
4546
margin-right: 12px;
46-
background-color: #797775;
47+
display: flex;
48+
align-items: center;
49+
justify-content: center;
4750
}
4851

4952
.file__details {

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-files/mgt-person-card-files.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ export class MgtPersonCardFiles extends BasePersonCardSection {
129129
* @memberof MgtPersonCardFiles
130130
*/
131131
protected renderFile(file: IFile): TemplateResult {
132-
const iconSource = file.thumbnails ? file.thumbnails[0].small.url : null;
133-
134132
const lastModifiedTemplate = file.lastModifiedDateTime
135133
? html`
136134
<div class="file__last-modified">Modified ${getRelativeDisplayDate(new Date(file.lastModifiedDateTime))}</div>
@@ -140,7 +138,7 @@ export class MgtPersonCardFiles extends BasePersonCardSection {
140138
return html`
141139
<div class="file">
142140
<div class="file__icon">
143-
<img src="${iconSource}" />
141+
${getSvg(SvgIcon.File)}
144142
</div>
145143
<div class="file__details">
146144
<div class="file__name">${file.name}</div>

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-messages/mgt-person-card-messages.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
:host {
1111
position: relative;
12+
user-select: none;
1213

1314
.root {
1415
padding: 20px 0;

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-organization/mgt-person-card-organization.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
:host {
1111
position: relative;
12+
user-select: none;
1213

1314
.root {
1415
padding: 20px 0;

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-profile/graph.profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ export interface IProfile {
473473
}
474474

475475
/**
476-
* TODO: Figure out the correct graph call
476+
* Get user profile data
477477
*
478478
* @export
479479
* @param {IGraph} graph

packages/mgt/src/components/mgt-person-card/sections/mgt-person-card-profile/mgt-person-card-profile.scss

Lines changed: 95 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
:host {
1111
position: relative;
12+
user-select: none;
1213

1314
.root {
1415
padding: 20px 0;
@@ -24,142 +25,137 @@
2425
margin: 0 20px 12px 20px;
2526
}
2627

27-
.section__title {
28-
font-size: 16px;
29-
color: #797775;
30-
}
31-
32-
.section__content {
33-
display: flex;
34-
flex-direction: column;
35-
margin-top: 10px;
36-
}
37-
3828
section {
3929
margin-bottom: 24px;
4030
padding: 0 20px;
41-
}
4231

43-
section:last-child {
44-
margin: 0;
32+
&:last-child {
33+
margin: 0;
34+
}
35+
36+
.section__title {
37+
font-size: 16px;
38+
color: #797775;
39+
}
40+
41+
.section__content {
42+
display: flex;
43+
flex-direction: column;
44+
margin-top: 10px;
45+
}
4546
}
4647

4748
.token-list {
4849
display: flex;
4950
flex-direction: row;
5051
flex-wrap: wrap;
5152
margin-top: -10px;
52-
}
5353

54-
.token-list__item {
55-
text-overflow: ellipsis;
56-
white-space: nowrap;
57-
display: inline-block;
58-
overflow: hidden;
59-
font-size: 14px;
60-
align-items: center;
61-
background: #f3f2f1;
62-
border-radius: 2px;
63-
max-height: 28px;
64-
padding: 4px 8px;
65-
margin-right: 10px;
66-
margin-top: 10px;
67-
color: rgba(50, 49, 48, 0.7);
68-
69-
&.overflow {
70-
display: none;
71-
}
72-
73-
&:hover {
74-
background-color: #e1dfdd;
75-
color: rgba(50, 49, 48, 0.9);
76-
cursor: pointer;
54+
.token-list__item {
55+
text-overflow: ellipsis;
56+
white-space: nowrap;
57+
display: inline-block;
58+
overflow: hidden;
59+
font-size: 14px;
60+
align-items: center;
61+
background: #f3f2f1;
62+
border-radius: 2px;
63+
max-height: 28px;
64+
padding: 4px 8px;
65+
margin-right: 10px;
66+
margin-top: 10px;
67+
color: rgba(50, 49, 48, 0.7);
68+
69+
&:last-child {
70+
margin-right: initial;
71+
}
72+
73+
&.overflow {
74+
display: none;
75+
}
76+
77+
&:hover {
78+
background-color: #e1dfdd;
79+
color: rgba(50, 49, 48, 0.9);
80+
}
81+
82+
&.token-list__item--show-overflow {
83+
cursor: pointer;
84+
user-select: unset;
85+
}
7786
}
7887
}
7988

80-
.token-list__item:last-child {
81-
margin-right: initial;
82-
}
83-
8489
.data-list__item {
8590
margin-bottom: 20px;
86-
}
8791

88-
.data-list__item:last-child {
89-
margin-bottom: initial;
90-
}
92+
&:last-child {
93+
margin-bottom: initial;
94+
}
9195

92-
.data-list__item__title {
93-
font-size: 14px;
94-
font-weight: 600;
95-
line-height: 16px;
96-
color: #323130;
97-
}
96+
.data-list__item__header {
97+
display: flex;
98+
justify-content: space-between;
99+
align-items: center;
100+
}
101+
102+
.data-list__item__content {
103+
font-size: 12px;
104+
line-height: 16px;
105+
color: #605e5c;
106+
margin-top: 4px;
107+
}
98108

99-
.data-list__item__content {
100-
font-size: 12px;
101-
line-height: 16px;
102-
color: #605e5c;
103-
margin-top: 4px;
109+
.data-list__item__title {
110+
font-size: 14px;
111+
line-height: 16px;
112+
color: #323130;
113+
}
114+
115+
.data-list__item__date-range {
116+
color: #605e5c;
117+
font-size: 10px;
118+
line-height: 12px;
119+
}
104120
}
105121

106122
.language__proficiency {
107123
opacity: 0.77;
108124
}
109125

110-
.work-position__company {
111-
color: #69afe5;
112-
cursor: pointer;
113-
}
126+
.work-position {
127+
.work-position__company {
128+
color: #0078d4;
129+
}
114130

115-
.work-position__location {
116-
font-size: 10px;
131+
.work-position__location {
132+
font-size: 10px;
133+
color: #605e5c;
134+
line-height: 16px;
135+
}
117136
}
118137

119-
.educational-activity__degree {
120-
font-size: 12px;
121-
line-height: 14px;
138+
.educational-activity {
139+
.educational-activity__degree {
140+
font-size: 12px;
141+
line-height: 14px;
142+
color: #605e5c;
143+
}
122144
}
123145

124146
.birthday {
125147
display: flex;
126148
align-items: center;
127149
margin-top: -6px;
128-
}
129-
130-
.birthday__icon {
131-
margin-right: 8px;
132-
}
133150

134-
.birthday__date {
135-
font-size: 12px;
136-
color: #201f1e;
137-
}
138-
139-
.flex-rows {
140-
display: flex;
141-
flex-direction: row;
142-
justify-content: space-between;
143-
}
144-
145-
.date-range {
146-
display: flex;
147-
align-items: flex-start;
148-
}
149-
150-
.date-range__circle {
151-
height: 10px;
152-
width: 10px;
153-
border-radius: 10px;
154-
border: 2px solid #c4c4c4;
155-
display: inline-block;
156-
margin-left: 8px;
157-
}
151+
.birthday__icon {
152+
margin-right: 8px;
153+
}
158154

159-
.date-range__line {
160-
position: absolute;
161-
width: 2px;
162-
background-color: #c4c4c4;
155+
.birthday__date {
156+
font-size: 12px;
157+
color: #201f1e;
158+
}
163159
}
164160
}
165161
}

0 commit comments

Comments
 (0)