forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in DSC-629 (pull request DSpace#584)
DSC-629 Approved-by: Giuseppe Digilio
- Loading branch information
Showing
22 changed files
with
592 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 1 addition & 75 deletions
76
...ner/boxes/metadata/rendering-types/advanced-attachment/advanced-attachment.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,10 @@ | ||
<div class="{{valueStyle}}"> | ||
<ng-container *ngFor="let attachment of (bitstreams$ | async); let last = last;"> | ||
<ng-template #tipContent> | ||
<span [innerHTML]="('checksum-tooltip.info.' + attachment.checkSum.checkSumAlgorithm | translate)"></span> | ||
</ng-template> | ||
<div class="row mt-1 mb-2" data-test="attachment-info"> | ||
<div class="col-3"> | ||
<ds-thumbnail [thumbnail]="attachment.thumbnail | async"></ds-thumbnail> | ||
</div> | ||
<div class="col-5"> | ||
|
||
<ng-container *ngFor="let attachmentConf of envMetadata"> | ||
|
||
<div class="content" [attr.data-test]="attachmentConf.name" | ||
*ngIf="attachment.firstMetadataValue(attachmentConf.name) || attachmentConf.type == AdvancedAttachmentElementType.Attribute"> | ||
<strong *ngIf="attachmentConf.type != AdvancedAttachmentElementType.Attribute"> | ||
{{ 'cris-layout.advanced-attachment.'+attachmentConf.name | translate }} | ||
</strong> | ||
|
||
<ng-container *ngIf="attachmentConf.type == AdvancedAttachmentElementType.Metadata"> | ||
|
||
<p class="text-break m-0" data-test="attachment-name" *ngIf="!attachmentConf.truncatable"> | ||
{{attachment.firstMetadataValue(attachmentConf.name)}} | ||
</p> | ||
|
||
<ds-truncatable *ngIf="attachmentConf.truncatable" [id]=" attachment.id"> | ||
<ds-truncatable-part [id]="attachment.id" [minLines]="1"> | ||
{{attachment.firstMetadataValue(attachmentConf.name)}} | ||
</ds-truncatable-part> | ||
</ds-truncatable> | ||
|
||
</ng-container> | ||
|
||
<ng-container *ngIf="attachmentConf.type == AdvancedAttachmentElementType.Attribute"> | ||
<ng-container *ngIf="attachmentConf.name == 'format' && (getFormat(attachment) | async)"> | ||
<strong> | ||
{{ 'cris-layout.advanced-attachment.'+attachmentConf.name | translate }} | ||
</strong> | ||
<p class="word-break m-0">{{getFormat(attachment) | async}}</p> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="attachmentConf.name == 'size' && getSize(attachment)"> | ||
<strong> | ||
{{ 'cris-layout.advanced-attachment.'+attachmentConf.name | translate }} | ||
</strong> | ||
<p class="word-break m-0">{{getSize(attachment) | dsFileSize}}</p> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="attachmentConf.name == 'checksum' && getChecksum(attachment)"> | ||
<ng-container *ngVar="getChecksum(attachment) as checksum"> | ||
<strong> | ||
{{ 'cris-layout.advanced-attachment.'+ attachmentConf.name | translate }} | ||
({{checksum.checkSumAlgorithm}}) <i class="far fa-question-circle text-info hint" #hint="ngbTooltip" | ||
container="body" | ||
placement="top" | ||
[ngbTooltip]="tipContent" | ||
triggers="manual" | ||
[autoClose]="false" | ||
(click)="hint.toggle();$event.preventDefault();"></i> | ||
</strong> | ||
<p class="word-break m-0">{{checksum.value}}</p> | ||
</ng-container> | ||
</ng-container> | ||
</ng-container> | ||
|
||
</div> | ||
</ng-container> | ||
|
||
</div> | ||
<div class="col-4 text-right"> | ||
<ds-file-download-button [bitstream]="attachment" [enableRequestACopy]="true" [item]="item"> | ||
</ds-file-download-button> | ||
</div> | ||
</div> | ||
<hr *ngIf="!last"> | ||
<ds-bitstream-attachment data-test="attachment-info" [attachment]="attachment"></ds-bitstream-attachment> | ||
</ng-container> | ||
<div *ngIf="canViewMore" class="w-100 text-center my-3"> | ||
<button class="btn btn-outline-primary" data-test="view-more" (click)="viewMore()"> | ||
{{'cris-layout.advanced-attachment.viewMore' | translate}} | ||
</button> | ||
</div> | ||
</div> | ||
|
||
|
10 changes: 0 additions & 10 deletions
10
...ner/boxes/metadata/rendering-types/advanced-attachment/advanced-attachment.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...vanced-attachment/bitstream-attachment/attachment-render/attachment-render.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ng-template #attachmentValue dsCrisLayoutLoader></ng-template> |
Empty file.
34 changes: 34 additions & 0 deletions
34
...ced-attachment/bitstream-attachment/attachment-render/attachment-render.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AttachmentRenderComponent } from './attachment-render.component'; | ||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | ||
import { | ||
AuthorizationDataService | ||
} from '../../../../../../../../../core/data/feature-authorization/authorization-data.service'; | ||
import { AuthorizationDataServiceStub } from '../../../../../../../../../shared/testing/authorization-service.stub'; | ||
|
||
describe('AttachmentRenderComponent', () => { | ||
let component: AttachmentRenderComponent; | ||
let fixture: ComponentFixture<AttachmentRenderComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ AttachmentRenderComponent ], | ||
providers: [ | ||
{provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub} | ||
], | ||
schemas: [ NO_ERRORS_SCHEMA ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AttachmentRenderComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.