Skip to content

Commit db6441d

Browse files
Merged dspace-cris-2023_02_x into task/dspace-cris-2023_02_x/DSC-2529
2 parents 823f725 + bd1b808 commit db6441d

File tree

62 files changed

+798
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+798
-77
lines changed

config/config.example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ auth:
133133
# This is independent from the idle warning.
134134
timeLeftBeforeTokenRefresh: 120000 # 2 minutes
135135
# Standard login enabled
136-
disableStandardLogin: false
136+
isPasswordLoginEnabledForAdminsOnly: false
137137

138138
# Form settings
139139
form:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"markdown-it-mathjax3": "^4.3.2",
134134
"mirador": "^3.4.3",
135135
"mirador-dl-plugin": "^0.13.0",
136+
"mirador-imagecropper": "^0.1.9",
136137
"mirador-share-plugin": "^0.16.0",
137138
"morgan": "^1.10.0",
138139
"ng2-file-upload": "1.4.0",
@@ -205,8 +206,8 @@
205206
"karma-jasmine": "~4.0.0",
206207
"karma-jasmine-html-reporter": "^1.5.0",
207208
"karma-mocha-reporter": "2.2.5",
208-
"ngx-export-as": "~1.15.1",
209209
"ng-mocks": "^14.13.2",
210+
"ngx-export-as": "~1.15.1",
210211
"ngx-mask": "13.1.7",
211212
"nodemon": "^2.0.22",
212213
"postcss": "^8.5",

src/app/app-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ import {
179179
canActivate: [GenericAdministratorGuard, EndUserAgreementCurrentUserGuard]
180180
},
181181
{
182-
path: 'standard-login',
182+
path: 'admin-only-login',
183183
loadChildren: () => import('./login-page/login-page.module').then((m) => m.LoginPageModule),
184184
data: {
185185
isBackDoor: true,
186186
},
187-
canMatch: [() => !environment.auth.disableStandardLogin],
187+
canMatch: [() => environment.auth.isPasswordLoginEnabledForAdminsOnly],
188188
},
189189
{
190190
path: 'login',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ds-item-page-cc-license-field
2+
[item]="item"
3+
[variant]="'full'"
4+
[ccLicenseUriField]="dcRightsUri"
5+
[ccLicenseNameField]="dcRights"
6+
[showLabel]="false"
7+
[showUrl]="true">
8+
</ds-item-page-cc-license-field>

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

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { TranslateModule } from '@ngx-translate/core';
3+
import { CcLicenseLargeComponent } from './cc-license-large.component';
4+
5+
describe('CcLicenseLargeComponent', () => {
6+
let component: CcLicenseLargeComponent;
7+
let fixture: ComponentFixture<CcLicenseLargeComponent>;
8+
9+
const mockItem = {
10+
firstMetadataValue: jasmine.createSpy('firstMetadataValue').and.returnValue(''),
11+
metadata: {},
12+
findMetadataSortedByPlace: jasmine.createSpy('findMetadataSortedByPlace').and.returnValue([]),
13+
};
14+
15+
const mockField = {
16+
metadataGroup: { elements: [] },
17+
styleValue: '',
18+
};
19+
20+
beforeEach(async () => {
21+
await TestBed.configureTestingModule({
22+
imports: [TranslateModule.forRoot()],
23+
declarations: [CcLicenseLargeComponent],
24+
providers: [
25+
{ provide: 'fieldProvider', useValue: mockField },
26+
{ provide: 'itemProvider', useValue: mockItem },
27+
{ provide: 'metadataValueProvider', useValue: {} },
28+
{ provide: 'renderingSubTypeProvider', useValue: '' },
29+
{ provide: 'tabNameProvider', useValue: '' },
30+
],
31+
}).compileComponents();
32+
33+
fixture = TestBed.createComponent(CcLicenseLargeComponent);
34+
component = fixture.componentInstance;
35+
36+
component.componentsToBeRenderedMap.set(0, [
37+
{ field: { metadata: 'dc.rights' } as any, value: {} as any },
38+
{ field: { metadata: 'dc.rights.uri' } as any, value: {} as any },
39+
] as any);
40+
41+
fixture.detectChanges();
42+
});
43+
44+
it('should create', () => {
45+
expect(component).toBeTruthy();
46+
});
47+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {Component, Inject, OnInit} from '@angular/core';
2+
import {FieldRenderingType, MetadataBoxFieldRendering} from '../metadata-box.decorator';
3+
import {MetadataGroupComponent} from '../metadataGroup/metadata-group.component';
4+
import {LayoutField} from '../../../../../../../core/layout/models/box.model';
5+
import {Item} from '../../../../../../../core/shared/item.model';
6+
import {TranslateService} from '@ngx-translate/core';
7+
8+
@Component({
9+
selector: 'ds-cc-license-large',
10+
templateUrl: './cc-license-large.component.html',
11+
styleUrls: ['./cc-license-large.component.scss']
12+
})
13+
@MetadataBoxFieldRendering(FieldRenderingType.CCLICENSEFULL)
14+
export class CcLicenseLargeComponent extends MetadataGroupComponent implements OnInit {
15+
16+
dcRights: any;
17+
dcRightsUri: any;
18+
19+
constructor(
20+
@Inject('fieldProvider') public fieldProvider: LayoutField,
21+
@Inject('itemProvider') public itemProvider: Item,
22+
@Inject('renderingSubTypeProvider') public renderingSubTypeProvider: string,
23+
@Inject('tabNameProvider') public tabNameProvider: string,
24+
protected translateService: TranslateService,
25+
) {
26+
super(fieldProvider, itemProvider, renderingSubTypeProvider, tabNameProvider, translateService);
27+
}
28+
ngOnInit(): void {
29+
super.ngOnInit();
30+
const ccLicenseEntryMetadata = this.componentsToBeRenderedMap.get(0);
31+
[this.dcRights, this.dcRightsUri] = ccLicenseEntryMetadata.map((entryMeta) => entryMeta.field.metadata);
32+
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ds-item-page-cc-license-field
2+
[item]="item"
3+
[variant]="'small'"
4+
[ccLicenseUriField]="dcRightsUri"
5+
[ccLicenseNameField]="dcRights"
6+
[showLabel]="false"
7+
[showUrl]="false">
8+
</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,49 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { TranslateModule } from '@ngx-translate/core';
3+
4+
import { CcLicenseSmallComponent } from './cc-license-small.component';
5+
6+
describe('CcLicenseSmallComponent', () => {
7+
let component: CcLicenseSmallComponent;
8+
let fixture: ComponentFixture<CcLicenseSmallComponent>;
9+
10+
const mockItem = {
11+
firstMetadataValue: jasmine.createSpy('firstMetadataValue').and.returnValue(''),
12+
metadata: {},
13+
findMetadataSortedByPlace: jasmine.createSpy('findMetadataSortedByPlace').and.returnValue([]),
14+
};
15+
16+
const mockField = {
17+
metadataGroup: { elements: [] },
18+
styleValue: '',
19+
};
20+
21+
beforeEach(async () => {
22+
await TestBed.configureTestingModule({
23+
imports: [TranslateModule.forRoot()],
24+
declarations: [CcLicenseSmallComponent],
25+
providers: [
26+
{ provide: 'fieldProvider', useValue: mockField },
27+
{ provide: 'itemProvider', useValue: mockItem },
28+
{ provide: 'metadataValueProvider', useValue: {} },
29+
{ provide: 'renderingSubTypeProvider', useValue: '' },
30+
{ provide: 'tabNameProvider', useValue: '' },
31+
],
32+
}).compileComponents();
33+
34+
fixture = TestBed.createComponent(CcLicenseSmallComponent);
35+
component = fixture.componentInstance;
36+
37+
component.componentsToBeRenderedMap.set(0, [
38+
{ field: { metadata: 'dc.rights' } as any, value: {} as any },
39+
{ field: { metadata: 'dc.rights.uri' } as any, value: {} as any },
40+
] as any);
41+
42+
fixture.detectChanges();
43+
44+
});
45+
46+
it('should create', () => {
47+
expect(component).toBeTruthy();
48+
});
49+
});

0 commit comments

Comments
 (0)