Commit 1f66fc82 authored by Kristjan Kruus's avatar Kristjan Kruus Committed by GitHub

Merge pull request #76 from e-gov/release/v7.5

Release/v7.5
parents 193dd20c 7a40d93d
......@@ -37,7 +37,7 @@ import static org.springframework.util.StringUtils.hasText;
@Service
public class IssueService {
private static final int WORK_DAYS_UNTIL_DEADLINE = 20;
public static final int WORK_DAYS_UNTIL_DEADLINE = 20;
public static final Function<Comment, Issue> COMMENT_TO_ISSUE = comment -> {
if (comment == null) {
......
package ee.ria.riha.service.util;
import ee.ria.riha.domain.model.NationalHoliday;
import ee.ria.riha.domain.model.NationalHolidays;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.ZoneId;
......@@ -8,9 +11,6 @@ import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;
import ee.ria.riha.domain.model.NationalHoliday;
import ee.ria.riha.domain.model.NationalHolidays;
public class DateUtils {
public static final Set<LocalDate> daysOffWork = NationalHolidays.get().stream()
......@@ -25,7 +25,7 @@ public class DateUtils {
LocalDate date = from.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
int dayCount = 0;
while (dayCount <= workDaysToAdd) {
while (dayCount < workDaysToAdd) {
date = date.plusDays(1);
if (isWorkDay(date)) {
dayCount++;
......
package ee.ria.riha.service.util;
import ee.ria.riha.service.IssueService;
import org.junit.Test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class DateUtilsTest {
@Test
public void getDecisionDeadline() throws ParseException {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
LocalDate decisionDeadline = DateUtils.getDecisionDeadline(dateFormat.parse("28-01-2019"), IssueService.WORK_DAYS_UNTIL_DEADLINE);
assertThat(decisionDeadline.format(dateTimeFormatter), is("25-02-2019"));
decisionDeadline = DateUtils.getDecisionDeadline(dateFormat.parse("11-03-2019"), IssueService.WORK_DAYS_UNTIL_DEADLINE);
assertThat(decisionDeadline.format(dateTimeFormatter), is("08-04-2019"));
}
}
\ No newline at end of file
......@@ -21,7 +21,9 @@
</div>
<div *ngIf="isAuditVisible() && system.hasAuditInfo()" class="form-group">
<strong>Auditeeritud viimati {{ system.getLatestAuditDate() | date:'y-MM-dd'}}</strong>
<strong>(<span *ngIf="system.getLatestAuditResolution() && classifiers.security_level[system.getLatestAuditResolution()]" class="text-success">{{classifiers.audit_resolution_type[system.getLatestAuditResolution()].value}}</span>)</strong>
<strong>
(<span *ngIf="system.getLatestAuditResolution() && classifiers.audit_resolution_type[system.getLatestAuditResolution()]"
class="{{getLatestAuditionCssClass(system.getLatestAuditResolution())}}">{{classifiers.audit_resolution_type[system.getLatestAuditResolution()].value}}</span>)</strong>
</div>
<div *ngIf="allowEdit && !system.hasAuditInfo()" class="form-group">
Auditeerimise info puudub
......
import { Component, EventEmitter, OnInit, Input, Output } from '@angular/core';
import { ModalHelperService } from '../../../services/modal-helper.service';
import { System } from '../../../models/system';
import { GeneralHelperService } from '../../../services/general-helper.service';
import { SystemsService } from '../../../services/systems.service';
import { ToastrService } from 'ngx-toastr';
import { ProducerEditSecurityComponent } from '../../producer-edit/producer-edit-security/producer-edit-security.component';
import { EnvironmentService, classifiers } from '../../../services/environment.service';
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {ModalHelperService} from '../../../services/modal-helper.service';
import {System} from '../../../models/system';
import {GeneralHelperService} from '../../../services/general-helper.service';
import {SystemsService} from '../../../services/systems.service';
import {ToastrService} from 'ngx-toastr';
import {ProducerEditSecurityComponent} from '../../producer-edit/producer-edit-security/producer-edit-security.component';
import {classifiers, EnvironmentService} from '../../../services/environment.service';
@Component({
selector: 'app-producer-details-security',
......@@ -24,6 +24,19 @@ export class ProducerDetailsSecurityComponent implements OnInit {
return this.environmentService.getUserMatrix().hasApproverRole || this.allowEdit;
}
getLatestAuditionCssClass(auditionCode) {
if (auditionCode === 'PASSED_WITHOUT_REMARKS') {
return 'text-success';
} else if (auditionCode === 'PASSED_WITH_REMARKS') {
return 'text-primary';
} else if (auditionCode === 'DID_NOT_PASS') {
return 'text-danger';
} else {
return '';
}
}
openSecurityEdit(content) {
this.systemsService.getSystem(this.system.details.short_name).then( res => {
let system = new System(res.json());
......
......@@ -71,7 +71,7 @@
#linkType="ngModel"
[(ngModel)]="data.type"
name="linkType" required>
<option [value]="''" disabled selected>Vali veebiviide liik...</option>
<option [value]="''" disabled selected>Vali veebiviite liik...</option>
<option *ngFor="let type of generalHelperService.toArray(classifiers.document_types)" [value]="type.code" selected>{{ type.value }}</option>
</select>
</div>
......@@ -121,7 +121,7 @@
#linkTypeEdit="ngModel"
[(ngModel)]="documents[i].type"
name="{{'linkType' + i}}" required>
<option [value]="''" disabled selected>Vali veebiviide liik...</option>
<option [value]="''" disabled selected>Vali veebiviite liik...</option>
<option *ngFor="let type of generalHelperService.toArray(classifiers.document_types)" [value]="type.code" selected>{{ type.value }}</option>
</select>
</div>
......
......@@ -56,7 +56,7 @@
<div class="col-12">
<button class="btn btn-success pull-right" (click)="createStandardRealisationSystem(addForm)">
<i class="fa fa-pencil fa-fw" aria-hidden="true"></i>&nbsp;Salvesta</button>
<button class="btn btn-default pull-right" (click)="closeModal()">Tühista</button>
<button class="btn btn-default pull-right margin-right-20" (click)="closeModal()">Tühista</button>
</div>
</div>
</form>
......
......@@ -4,12 +4,12 @@
<div class="col-lg-3 col-md-3 col-sm-6 col-12">
<div class="form-group">
<label for="name-input">Nimi</label>
<input class="form-control" (keyup.enter)="getOwnSystems()" [(ngModel)]="filters.name" type="text" id="name-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.name" type="text" id="name-input">
</div>
<div class="form-group">
<label for="x-road-status-input">X-teega liidestumine</label>
<select id="x-road-status-input" class="form-control"
(keyup.enter)="getOwnSystems()"
(keyup.enter)="search()"
[(ngModel)]="filters.xRoadStatus">
<option [value]="''">kõik</option>
<option [value]="'null'">määramata</option>
......@@ -40,12 +40,12 @@
<div class="col-lg-3 col-md-3 col-sm-6 col-12">
<div class="form-group">
<label for="name-input">Lühinimi</label>
<input class="form-control" (keyup.enter)="getOwnSystems()" [(ngModel)]="filters.shortName" type="text" id="short-name-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.shortName" type="text" id="short-name-input">
</div>
<div class="form-group">
<label for="development-status-input">Arendamise staatus</label>
<select id="development-status-input" class="form-control"
(keyup.enter)="getOwnSystems()"
(keyup.enter)="search()"
[(ngModel)]="filters.developmentStatus">
<option [value]="''">kõik</option>
<option [value]="'null'">määramata</option>
......@@ -76,20 +76,20 @@
<div class="col-lg-3 col-md-3 col-sm-6 col-12">
<div class="form-group">
<label for="topics-input">Märksõna</label>
<input class="form-control" (keyup.enter)="getOwnSystems()" [(ngModel)]="filters.topic" type="text" id="topics-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.topic" type="text" id="topics-input">
</div>
<div class="form-group">
<label for="purpose-input">Eesmärk</label>
<input class="form-control" (keyup.enter)="getOwnSystems()" [(ngModel)]="filters.purpose" type="text" id="purpose-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.purpose" type="text" id="purpose-input">
</div>
<div class="form-group" *ngIf="showUserAndOrganizationFilters">
<label for="owner-name-input">Omaniku nimi</label>
<input class="form-control" (keyup.enter)="getSystems()" [(ngModel)]="filters.ownerName" type="text" id="owner-name-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.ownerName" type="text" id="owner-name-input">
</div>
<div class="form-group">
<label for="approval-status">Kooskõlastamise staatus</label>
<select id="approval-status" class="form-control"
(keyup.enter)="getOwnSystems()"
(keyup.enter)="search()"
[(ngModel)]="filters.lastPositiveApprovalRequestType">
<option [value]="''">kõik</option>
<option [value]="classifiers.issue_type.AUTOMATICALLY_REGISTERED.code">registreeritud</option>
......@@ -107,7 +107,7 @@
<div class="form-group">
<label for="system-status-input">Infosüsteemi staatus</label>
<select id="system-status-input" class="form-control"
(keyup.enter)="getOwnSystems()"
(keyup.enter)="search()"
[(ngModel)]="filters.systemStatus">
<option [value]="''">kõik</option>
<option [value]="'null'">määramata</option><option *ngFor="let type of generalHelperService.toArray(classifiers.system_status)" [value]="type.code" selected>{{ type.value }}</option>
......@@ -115,18 +115,18 @@
</div>
<div class="form-group">
<label for="stored-data-input">Põhiandmed</label>
<input class="form-control" (keyup.enter)="getOwnSystems()" [(ngModel)]="filters.storedData" type="text" id="stored-data-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.storedData" type="text" id="stored-data-input">
</div>
<div class="form-group" *ngIf="showUserAndOrganizationFilters">
<label for="owner-code-input">Omaniku registrikood</label>
<input class="form-control" (keyup.enter)="getSystems()" [(ngModel)]="filters.ownerCode" type="text" id="owner-code-input">
<input class="form-control" (keyup.enter)="search()" [(ngModel)]="filters.ownerCode" type="text" id="owner-code-input">
</div>
</div>
</div>
<div class="actions-bar mt-2 mb-1">
<div class="buttons pull-right">
<button type="button" class="btn btn-default" (click)="clearFiltersAndRefresh()">Tühjenda</button>
<button type="button" class="btn btn-primary" (click)="getOwnSystems()"><i class="fa fa-search" aria-hidden="true"></i> Otsi</button>
<button type="button" class="btn btn-primary" (click)="search()"><i class="fa fa-search" aria-hidden="true"></i> Otsi</button>
</div>
</div>
</div>
......@@ -24,7 +24,9 @@ export class ProducerSearchFilterComponent implements OnInit {
dateCreatedFrom: string,
dateCreatedTo: string,
dateUpdatedFrom: string,
dateUpdatedTo: string
dateUpdatedTo: string,
ownerName: string,
ownerCode: string
};
classifiers = classifiers;
......@@ -42,7 +44,7 @@ export class ProducerSearchFilterComponent implements OnInit {
performSearch = new EventEmitter();
getOwnSystems() {
search() {
this.performSearch.next(this.filters);
}
......@@ -53,8 +55,7 @@ export class ProducerSearchFilterComponent implements OnInit {
getFilters(): any {
let params = this.generalHelperService.cloneObject(this.filters);
delete params.ownerName;
delete params.ownerCode;
if (params.dateCreatedFrom) {
params.dateCreatedFrom = this.systemsService.dateObjToTimestamp(params.dateCreatedFrom, true);
}
......@@ -94,7 +95,9 @@ export class ProducerSearchFilterComponent implements OnInit {
dateCreatedFrom: '',
dateCreatedTo: '',
dateUpdatedFrom: '',
dateUpdatedTo: ''
dateUpdatedTo: '',
ownerName: '',
ownerCode: '',
};
}
......@@ -124,7 +127,10 @@ export class ProducerSearchFilterComponent implements OnInit {
dateCreatedFrom: this.systemsService.timestampToDateObj(params['dateCreatedFrom']),
dateCreatedTo: this.systemsService.timestampToDateObj(params['dateCreatedTo']),
dateUpdatedFrom: this.systemsService.timestampToDateObj(params['dateUpdatedFrom']),
dateUpdatedTo: this.systemsService.timestampToDateObj(params['dateUpdatedTo'])
dateUpdatedTo: this.systemsService.timestampToDateObj(params['dateUpdatedTo']),
ownerName: params['ownerName'] || '',
ownerCode: params['ownerCode'] || ''
};
});
}
......
......@@ -18,3 +18,7 @@
.margin-right-10 {
margin-right: 10px;
}
.margin-right-20 {
margin-right: 20px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment