Skip to content

Commit f887127

Browse files
committed
Refactoring
1 parent 28b2caf commit f887127

4 files changed

Lines changed: 10 additions & 22 deletions

File tree

src/app/item-page/simple/field-components/clarin-item-versions-field/clarin-item-versions-field.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<div class="col-lg-3 col-2-5 d-flex align-self-start">
33
<div><i [class]="'fas ' + iconName + ' fa-xs'"></i></div>
44
<!-- Toggle Header -->
5-
<div class="pl-1 d-flex align-items-center cursor-pointer" (click)="toggleVersionHistory()">
5+
<div
6+
class="pl-1 d-flex align-items-center"
7+
(click)="toggleVersionHistory()"
8+
role="button"
9+
tabindex="0"
10+
[attr.aria-expanded]="showVersionHistory">
611
<b class="mr-1">{{ "item.version.history.head" | translate }}</b>
712
<i class="fas" [ngClass]="showVersionHistory ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
813
</div>

src/app/item-page/simple/field-components/clarin-item-versions-field/clarin-item-versions-field.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
border-radius: 4px;
1313
padding: 2%;
1414

15-
max-height: 200px;
16-
overflow-y: scroll;
15+
max-height: var(--ds-dso-selector-list-max-height) / 2;
16+
overflow-y: auto;
1717
}

src/app/item-page/simple/field-components/clarin-item-versions-field/clarin-item-versions-field.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class ClarinItemVersionsFieldComponent implements OnDestroy, OnInit {
157157
* Get the ID of the workspace item, if present, otherwise return undefined
158158
* @param versionItem the item for which retrieve the workspace item id
159159
*/
160-
getWorkspaceId(versionItem): Observable<string> {
160+
getWorkspaceId(versionItem: Observable<RemoteData<Item>>): Observable<string> {
161161
return versionItem.pipe(
162162
getFirstSucceededRemoteDataPayload(),
163163
map((item: Item) => item.uuid),
@@ -171,7 +171,7 @@ export class ClarinItemVersionsFieldComponent implements OnDestroy, OnInit {
171171
* Get the ID of the workflow item, if present, otherwise return undefined
172172
* @param versionItem the item for which retrieve the workspace item id
173173
*/
174-
getWorkflowId(versionItem): Observable<string> {
174+
getWorkflowId(versionItem: Observable<RemoteData<Item>>): Observable<string> {
175175
return versionItem.pipe(
176176
getFirstSucceededRemoteDataPayload(),
177177
map((item: Item) => item.uuid),
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
@import '../simple/item-page.component.scss';
2-
3-
@media (min-width: 992px) {
4-
.col-2-5 {
5-
flex: 0 0 20%;
6-
max-width: 20%;
7-
}
8-
}
9-
10-
.dropdown-versions {
11-
background-color: #f8f9fa;
12-
border-radius: 4px;
13-
padding: 2%;
14-
15-
max-height: 200px;
16-
overflow-y: scroll;
17-
}

0 commit comments

Comments
 (0)