Skip to content

Commit 291d4ba

Browse files
Mattia VianelliMattia Vianelli
authored andcommitted
DSC-1817 Provided small rendering component for cclicense
1 parent ccc93b8 commit 291d4ba

4 files changed

Lines changed: 60 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ds-item-page-cc-license-field
2+
[item]="item"
3+
[variant]="variant"
4+
[ccLicenseNameField]="ccLicenseNameField"
5+
[showName]="showName">
6+
</ds-item-page-cc-license-field>

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/cc-license-small/cc-license-small.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { CcLicenseSmallComponent } from './cc-license-small.component';
4+
5+
describe('CcLicenseSmallComponent', () => {
6+
let component: CcLicenseSmallComponent;
7+
let fixture: ComponentFixture<CcLicenseSmallComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [CcLicenseSmallComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(CcLicenseSmallComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {Component, Input} from '@angular/core';
2+
import {
3+
ItemPageCcLicenseFieldComponent
4+
} from "../../../../../../../item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component";
5+
import {RenderingTypeValueModelComponent} from "../rendering-type-value.model";
6+
7+
@Component({
8+
selector: 'ds-cc-license-small',
9+
standalone: true,
10+
imports: [ItemPageCcLicenseFieldComponent],
11+
templateUrl: './cc-license-small.component.html',
12+
styleUrl: './cc-license-small.component.scss'
13+
})
14+
export class CcLicenseSmallComponent extends RenderingTypeValueModelComponent {
15+
/**
16+
* 'full' variant shows image, a disclaimer (optional) and name (always), better for the item page content.
17+
* 'small' variant shows image and name (optional), better for the item page sidebar
18+
*/
19+
@Input() variant = 'small';
20+
21+
/**
22+
* Shows the CC license name with the image. Always show if image fails to load
23+
*/
24+
@Input() showName? = true;
25+
26+
/**
27+
* Filed name containing the CC license name, as configured in the back-end, in the 'dspace.cfg' file, propertie
28+
* 'cc.license.name'
29+
*/
30+
@Input() ccLicenseNameField? = 'dc.rights';
31+
}

0 commit comments

Comments
 (0)