Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add limit to manually grouping works #2275

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,44 @@
<span class="action" i18n="@@shared.actions"> Actions </span>
<mat-icon class="large-material-icon">arrow_drop_down</mat-icon>
</button>
<mat-menu #menu="matMenu">
<mat-menu #menu="matMenu" class="menu-buttons">
<button
mat-menu-item
(click)="combine()"
[disabled]="selectedWorks.length === 0"
[disabled]="
selectedWorks.length === 0 || selectedWorks.length > 5
"
>
<mat-icon>merge_type</mat-icon>
<span i18n="@@shared.combineWorks">Combine works</span>
<div>
<mat-icon *ngIf="selectedWorks.length <= 5"
>merge_type</mat-icon
>
<mat-icon class="error-icon" *ngIf="selectedWorks.length > 5"
>error_outline</mat-icon
>
</div>
<div>
<div
[ngClass]="{
'group-selected-works-label': selectedWorks.length > 5
}"
>
<ng-container i18n="@@shared.combineWorks"
auumgn marked this conversation as resolved.
Show resolved Hide resolved
>Group selected works</ng-container
>
({{ selectedWorks.length }})
</div>
<div
class="orc-font-small-print"
*ngIf="selectedWorks.length > 5"
>
<ng-container i18n="@@works.fiveWorksMax"
>5 works maximum,</ng-container
>
{{ selectedWorks.length }}
<ng-container i18n="@@works.selected">selected</ng-container>
</div>
</div>
</button>
<button
mat-menu-item
Expand All @@ -92,18 +122,18 @@
>
<mat-icon>file_download</mat-icon>
<span>
<ng-container i18n="@@shared.exportWorks">
Export works
</ng-container>
<ng-container i18n="@@shared.exportWorks"
>Export works</ng-container
>
({{ selectedWorks.length }})
</span>
</button>
<button mat-menu-item (click)="exportAllWorks()">
<mat-icon>file_download</mat-icon>
<span>
<ng-container i18n="@@shared.exportAllWorks">
Export all works
</ng-container>
<ng-container i18n="@@shared.exportAllWorks"
>Export all works</ng-container
>
({{ this.workGroup.totalGroups }})
</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ app-work-stack:last-child {
margin-bottom: 0;
}

.orc-font-small-print {
line-height: 18px;
}

.group-selected-works-label {
line-height: 21px;
letter-spacing: 0.25px;
}

p.empty {
margin-bottom: 0;
}
Expand Down Expand Up @@ -75,7 +84,20 @@ button {
}

button.mat-menu-item {
& > div {
& > mat-icon {
display: flex;
align-items: center;
}
display: inline-block;
vertical-align: middle;
}

max-width: 350px;
white-space: normal;
height: auto !important;
height: 48px !important;
padding: 0 16px 0 16px;
margin-left: 0;
display: flex;
align-items: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
) !important;
}
}
.error-icon {
color: rgba($state-warning-dark, 0.38) !important;
}
}

@include work-stack-group-theme($orcid-app-theme);
3 changes: 3 additions & 0 deletions src/locale/properties/works/works.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@ works.lead=Lead
works.coLead=Co-lead
works.supportedBy=Supported by
works.otherContribution=Other contribution
works.selected=selected
works.fiveWorksMax=5 works maximum,
shared.combineWorks=Group selected works
Loading