Skip to content
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
@@ -1,4 +1,4 @@
import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NewHandlePageComponent } from './new-handle-page.component';
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
import { of as observableOf } from 'rxjs';
Expand All @@ -7,12 +7,13 @@ import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { RouterTestingModule } from '@angular/router/testing';
import { RequestService } from '../../core/data/request.service';
import { NotificationsService } from '../../shared/notifications/notifications.service';
import { getMockTranslateService } from '../../shared/mocks/translate.service.mock';
import { Store } from '@ngrx/store';
import { HandleDataService } from '../../core/data/handle-data.service';
import { mockCreatedHandleRD$ } from '../../shared/mocks/handle-mock';
import { PaginationService } from '../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';

/**
* The test class for the NewHandlePageComponent.
Expand All @@ -23,6 +24,7 @@ describe('NewHandlePageComponent', () => {

let notificationService: NotificationsServiceStub;
let handleDataService: HandleDataService;
let paginationService: PaginationServiceStub;

const successfulResponse = {
response: {
Expand All @@ -31,6 +33,7 @@ describe('NewHandlePageComponent', () => {

beforeEach(async () => {
notificationService = new NotificationsServiceStub();
paginationService = new PaginationServiceStub();

handleDataService = jasmine.createSpyObj('handleDataService', {
create: mockCreatedHandleRD$,
Expand All @@ -49,6 +52,8 @@ describe('NewHandlePageComponent', () => {
providers: [
{ provide: NotificationsService, useValue: notificationService },
{ provide: HandleDataService, useValue: handleDataService },
{ provide: PaginationService, useValue: paginationService },
{ provide: TranslateService, useValue: getMockTranslateService() },
{
provide: Store, useValue: {
// tslint:disable-next-line:no-empty
Expand Down Expand Up @@ -77,12 +82,12 @@ describe('NewHandlePageComponent', () => {
});

// TODO fix this failing test later. It fails in the Github but locally it works.
// it('should notify after successful request', () => {
// it('should notify after successful request',waitForAsync(() => {
// component.onClickSubmit('new handle');
//
// fixture.whenStable().then(() => {
// expect((component as any).notificationsService.success).toHaveBeenCalled();
// expect((component as any).notificationsService.error).not.toHaveBeenCalled();
// });
// });
// }));
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
</div>
</div>
<div class="row justify-content-end pt-3">
<span [ngClass]="'label label-license' + ' label-' + licenseLabel + ' rounded text-white'">
<div [ngClass]="'d-inline py-1 px-1 label label-license' + ' label-' + licenseLabel + ' rounded text-white'">
<span>
{{licenseType }}
</span>
<div class="d-inline" *ngFor="let icon of licenseLabelIcons">
<img [src]="secureImageData(icon)" alt="" width="24px">
<img [src]="secureImageData(icon)" alt="" width="16px">
</div>
</div>

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,27 @@
color: #fff;
border-radius: 0 0.25em 0.25em 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
border: 1px solid #ddd;
border-bottom: none;
}

.label-icon {
border-radius: 0.25em 0 0 0.25em;
}

.label-PUB {
background-color: #5cb811;
background-color: #dff0d8 !important;
color: #5cb811 !important;;
}

.label-RES {
background-color: #c62d1f;
color: #c62d1f !important;
background-color: #f2dede !important;
}

.label-ACA, .label-PDT {
background-color: #ffab23;
color: #ffab23 !important;
background-color: #fcf8e3 !important;
}

.label-license {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ export class ClarinItemBoxViewComponent implements OnInit {
clarinLicense.extendedClarinLicenseLabels.forEach(extendedCll => {
this.licenseLabelIcons.push(extendedCll?.icon);
});
this.licenseLabelIcons.push(clarinLicense?.clarinLicenseLabel?.icon);
// For now show only extended CLL icons
// this.licenseLabelIcons.push(clarinLicense?.clarinLicenseLabel?.icon);
});
}

Expand Down