Skip to content

Commit 6b6b455

Browse files
committed
PD-3704
1 parent 1119682 commit 6b6b455

15 files changed

Lines changed: 835 additions & 185 deletions

File tree

projects/orcid-ui-docs/src/app/pages/panel-page.component.html

Lines changed: 389 additions & 31 deletions
Large diffs are not rendered by default.

projects/orcid-ui-docs/src/app/pages/panel-page.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
letter-spacing: 0.5px;
6161
}
6262

63+
.example-description {
64+
margin: 4px 0 12px 0;
65+
color: var(--orcid-color-text-secondary, #666);
66+
font-size: 0.875rem;
67+
font-style: italic;
68+
}
69+
6370
// For mobile examples, ensure containers are centered in grid
6471
.example-container.mobile {
6572
margin: 0 auto;

projects/orcid-ui-docs/src/app/pages/panel-page.component.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'
88
import { MatInputModule } from '@angular/material/input'
99
import { MatCheckboxModule } from '@angular/material/checkbox'
1010
import { MatSelectModule } from '@angular/material/select'
11+
import { MatTooltipModule } from '@angular/material/tooltip'
1112
import { DocumentationPageComponent } from '../components/documentation-page/documentation-page.component'
1213

1314
@Component({
@@ -23,6 +24,7 @@ import { DocumentationPageComponent } from '../components/documentation-page/doc
2324
MatInputModule,
2425
MatCheckboxModule,
2526
MatSelectModule,
27+
MatTooltipModule,
2628
DocumentationPageComponent,
2729
],
2830
templateUrl: './panel-page.component.html',
@@ -35,10 +37,23 @@ export class PanelPageComponent {
3537
content:
3638
'<div>University of Example, Research Scientist</div>\n<div>2020 - Present</div>',
3739
footerText: 'Source: Self-asserted',
38-
openState: true,
3940
isMobile: false,
4041
isPreferred: false,
41-
isFeatured: false,
42+
startToggleOn: false,
43+
enableStartToggl: false,
44+
startToggleDisabled: false,
45+
startToggleTooltip: 'Click to highlight this affiliation',
46+
hasExternalIds: false,
47+
userVersionPresent: false,
48+
showContent: true,
49+
}
50+
51+
get showStackToggle(): boolean {
52+
return (
53+
this.config.hasExternalIds &&
54+
this.config.userVersionPresent &&
55+
!this.config.isPublicRecord
56+
)
4257
}
4358

4459
iconOptions = [
@@ -51,4 +66,8 @@ export class PanelPageComponent {
5166
{ value: 'fitness_center', label: 'fitness_center' },
5267
{ value: 'local_hospital', label: 'local_hospital' },
5368
]
69+
70+
onToggleFeatured() {
71+
console.log('Toggle button pressed')
72+
}
5473
}

projects/orcid-ui/src/lib/components/panel/panel.component.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
<div class="orcid-panel" [class.orcid-panel--preferred]="isPreferred">
22
<div class="orcid-panel__header">
33
<div class="orcid-panel__header-main">
4-
<div class="featured-affiliation-star" *ngIf="isAffiliation" (click)="toggleFeatured.emit()">
5-
<mat-icon *ngIf="isFeatured" class="star-filled">star</mat-icon>
6-
<mat-icon *ngIf="!isFeatured" class="star-outline">star_outline</mat-icon>
7-
</div>
4+
<button
5+
mat-icon-button
6+
class="featured-affiliation-star"
7+
*ngIf="enableStartToggl"
8+
[disabled]="startToggleDisabled"
9+
[matTooltip]="startToggleTooltip"
10+
(click)="toggleFeatured.emit()"
11+
>
12+
<mat-icon *ngIf="startToggleOn" class="star-filled">star</mat-icon>
13+
<mat-icon *ngIf="!startToggleOn" class="star-outline"
14+
>star_outline</mat-icon
15+
>
16+
</button>
817
<ng-container *ngIf="showIcon">
918
<mat-icon [class]="iconClass">{{ icon }}</mat-icon>
1019
<div class="vl"></div>
@@ -20,11 +29,11 @@ <h4 *ngIf="title" class="orc-font-body" [ngClass]="{ mobile: isMobile }">
2029
</div>
2130
</div>
2231

23-
<div class="orcid-panel__body" [id]="panelId + '-body'" *ngIf="openState">
32+
<div class="orcid-panel__body" [id]="panelId + '-body'">
2433
<ng-content></ng-content>
2534
</div>
2635

2736
<div class="orcid-panel__footer">
2837
<ng-content select="[panel-footer]"></ng-content>
2938
</div>
30-
</div>
39+
</div>

projects/orcid-ui/src/lib/components/panel/panel.component.scss

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
min-width: 0;
2626
display: flex;
2727
align-items: center;
28-
gap: 16px;
2928

3029
mat-icon {
3130
flex-shrink: 0;
@@ -35,6 +34,7 @@
3534
border-left: 2px solid #bdbdbd;
3635
height: 32px;
3736
flex-shrink: 0;
37+
margin: 0 16px;
3838
}
3939

4040
h4 {
@@ -63,6 +63,12 @@
6363

6464
.orcid-panel__body {
6565
padding: 16px;
66+
67+
&:empty {
68+
padding: 0;
69+
min-height: 0;
70+
height: 0;
71+
}
6672
}
6773

6874
.orcid-panel__footer {
@@ -82,14 +88,19 @@
8288
}
8389

8490
.featured-affiliation-star {
85-
display: flex;
91+
margin-inline-start: -12px;
92+
width: 40px;
93+
height: 40px;
94+
display: flex !important;
8695
align-items: center;
87-
margin-right: 8px;
88-
cursor: pointer;
96+
justify-content: center;
97+
line-height: normal;
8998

9099
mat-icon {
100+
line-height: inherit;
101+
91102
&.star-filled {
92103
color: #ffc814;
93104
}
94105
}
95-
}
106+
}
Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,31 @@
11
import { CommonModule } from '@angular/common'
22
import { Component, EventEmitter, Input, Output } from '@angular/core'
33
import { MatIconModule } from '@angular/material/icon'
4+
import { MatButtonModule } from '@angular/material/button'
5+
import { MatTooltipModule } from '@angular/material/tooltip'
46

57
@Component({
68
selector: 'orcid-panel',
79
standalone: true,
8-
imports: [CommonModule, MatIconModule],
10+
imports: [CommonModule, MatIconModule, MatButtonModule, MatTooltipModule],
911
templateUrl: './panel.component.html',
1012
styleUrls: ['./panel.component.scss'],
1113
})
1214
export class OrcidPanelComponent {
1315
@Input() panelId!: string
14-
@Input() type:
15-
| 'affiliations'
16-
| 'employment'
17-
| 'professional-activities'
18-
| 'invited-position'
19-
| 'distinction'
20-
| 'membership'
21-
| 'service'
22-
| 'editorial-service' = 'affiliations'
23-
@Input() openState = true
2416
@Input() isPreferred = false
25-
@Input() isFeatured = false
26-
@Input() isPublicRecord = false
27-
@Input() hasExternalIds = false
28-
@Input() userVersionPresent = false
29-
@Input() displayTheStack = false
17+
@Input() startToggleOn = false
18+
@Input() enableStartToggl = false
19+
@Input() startToggleDisabled = false
20+
@Input() startToggleTooltip = ''
3021
@Input() icon?: string
3122
@Input() iconClass?: string
3223
@Input() title?: string
3324
@Input() isMobile = false
3425

35-
get isAffiliation(): boolean {
36-
return (
37-
this.type === 'employment' ||
38-
this.type === 'affiliations' ||
39-
this.type === 'invited-position' ||
40-
this.type === 'distinction' ||
41-
this.type === 'membership' ||
42-
this.type === 'service' ||
43-
this.type === 'editorial-service' ||
44-
this.type === 'professional-activities'
45-
)
46-
}
47-
48-
@Output() displayTheStackChange = new EventEmitter<boolean>()
49-
@Output() openStateChange = new EventEmitter<boolean>()
5026
@Output() toggleFeatured = new EventEmitter<void>()
5127

5228
get showIcon(): boolean {
5329
return !!this.icon
5430
}
55-
56-
toggle() {
57-
this.openState = !this.openState
58-
this.openStateChange.emit(this.openState)
59-
}
60-
61-
showStackToggle(): boolean {
62-
return (
63-
this.hasExternalIds && this.userVersionPresent && !this.isPublicRecord
64-
)
65-
}
6631
}

projects/orcid-ui/src/lib/components/record-header/record-header.component.scss

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

33
:host {
44
display: block;
5+
background: var(--orcid-color-brand-secondary-darkest, #003449);
56
}
67

78
.record-header {

0 commit comments

Comments
 (0)