Skip to content

Commit 1119682

Browse files
committed
PD-3704
1 parent f6f0bba commit 1119682

10 files changed

Lines changed: 191 additions & 242 deletions

File tree

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

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<app-documentation-page
2-
title="Panel"
3-
description="The orcid-panel component is a versatile container used in the ORCID record UI to render affiliation stacks, professional activities, and other collapsible content. It supports multiple content projection slots, optional icon and title display, and provides built-in expand/collapse functionality. Key Features: Icon support, customizable title, content projection slots, preferred styling, collapsible body, and stack management."
4-
>
1+
<app-documentation-page title="Panel"
2+
description="The orcid-panel component is a versatile container used in the ORCID record UI to render affiliation stacks, professional activities, and other collapsible content. It supports multiple content projection slots, optional icon and title display, and provides built-in expand/collapse functionality. Key Features: Icon support, customizable title, content projection slots, preferred styling, collapsible body, and stack management.">
53
<div controls>
64
<p>Modify these values to see how they affect all examples below:</p>
75
<div class="controls-grid">
@@ -21,12 +19,7 @@
2119

2220
<mat-form-field appearance="outline" class="full-width">
2321
<mat-label>Content (HTML)</mat-label>
24-
<textarea
25-
matInput
26-
[(ngModel)]="config.content"
27-
rows="4"
28-
placeholder="<div>Line 1</div>"
29-
></textarea>
22+
<textarea matInput [(ngModel)]="config.content" rows="4" placeholder="<div>Line 1</div>"></textarea>
3023
</mat-form-field>
3124

3225
<mat-form-field appearance="outline">
@@ -44,6 +37,9 @@ <h4>Stack management</h4>
4437
<mat-checkbox [(ngModel)]="config.isPreferred">
4538
Is Preferred
4639
</mat-checkbox>
40+
<mat-checkbox [(ngModel)]="config.isFeatured">
41+
Is Featured
42+
</mat-checkbox>
4743
</div>
4844
</div>
4945

@@ -55,15 +51,9 @@ <h4>Desktop View</h4>
5551
<div class="example-stack">
5652
<div class="example-item">
5753
<div class="example-container desktop">
58-
<orcid-panel
59-
panelId="desktop-panel"
60-
[openState]="config.openState"
61-
(openStateChange)="config.openState = $event"
62-
[title]="config.title"
63-
[icon]="config.icon || undefined"
64-
[isPreferred]="config.isPreferred"
65-
[isMobile]="false"
66-
>
54+
<orcid-panel panelId="desktop-panel" [openState]="config.openState"
55+
(openStateChange)="config.openState = $event" [title]="config.title" [icon]="config.icon || undefined"
56+
[isPreferred]="config.isPreferred" [isFeatured]="config.isFeatured" [isMobile]="false" type="employment">
6757
<div [innerHTML]="config.content"></div>
6858
<div panel-footer>{{ config.footerText }}</div>
6959
</orcid-panel>
@@ -77,15 +67,9 @@ <h4>Mobile View</h4>
7767
<div class="example-stack">
7868
<div class="example-item">
7969
<div class="example-container mobile">
80-
<orcid-panel
81-
panelId="mobile-panel"
82-
[openState]="config.openState"
83-
(openStateChange)="config.openState = $event"
84-
[title]="config.title"
85-
[icon]="config.icon || undefined"
86-
[isPreferred]="config.isPreferred"
87-
[isMobile]="true"
88-
>
70+
<orcid-panel panelId="mobile-panel" [openState]="config.openState"
71+
(openStateChange)="config.openState = $event" [title]="config.title" [icon]="config.icon || undefined"
72+
[isPreferred]="config.isPreferred" [isFeatured]="config.isFeatured" [isMobile]="true" type="employment">
8973
<div [innerHTML]="config.content"></div>
9074
<div panel-footer>{{ config.footerText }}</div>
9175
</orcid-panel>
@@ -129,4 +113,4 @@ <h3>Content Projection Slots</h3>
129113
<li><code>panel-footer</code>: Footer area for sources or actions</li>
130114
</ul>
131115
</div>
132-
</app-documentation-page>
116+
</app-documentation-page>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class PanelPageComponent {
3838
openState: true,
3939
isMobile: false,
4040
isPreferred: false,
41+
isFeatured: false,
4142
}
4243

4344
iconOptions = [

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
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>
48
<ng-container *ngIf="showIcon">
59
<mat-icon [class]="iconClass">{{ icon }}</mat-icon>
610
<div class="vl"></div>
@@ -23,4 +27,4 @@ <h4 *ngIf="title" class="orc-font-body" [ngClass]="{ mobile: isMobile }">
2327
<div class="orcid-panel__footer">
2428
<ng-content select="[panel-footer]"></ng-content>
2529
</div>
26-
</div>
30+
</div>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,16 @@
8080
cursor: pointer;
8181
font: inherit;
8282
}
83+
84+
.featured-affiliation-star {
85+
display: flex;
86+
align-items: center;
87+
margin-right: 8px;
88+
cursor: pointer;
89+
90+
mat-icon {
91+
&.star-filled {
92+
color: #ffc814;
93+
}
94+
}
95+
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class OrcidPanelComponent {
1313
@Input() panelId!: string
1414
@Input() type:
1515
| 'affiliations'
16+
| 'employment'
1617
| 'professional-activities'
1718
| 'invited-position'
1819
| 'distinction'
@@ -21,6 +22,7 @@ export class OrcidPanelComponent {
2122
| 'editorial-service' = 'affiliations'
2223
@Input() openState = true
2324
@Input() isPreferred = false
25+
@Input() isFeatured = false
2426
@Input() isPublicRecord = false
2527
@Input() hasExternalIds = false
2628
@Input() userVersionPresent = false
@@ -30,8 +32,22 @@ export class OrcidPanelComponent {
3032
@Input() title?: string
3133
@Input() isMobile = false
3234

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+
3348
@Output() displayTheStackChange = new EventEmitter<boolean>()
3449
@Output() openStateChange = new EventEmitter<boolean>()
50+
@Output() toggleFeatured = new EventEmitter<void>()
3551

3652
get showIcon(): boolean {
3753
return !!this.icon

0 commit comments

Comments
 (0)