Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
e-gov
RIHA-Browser
Commits
1f66fc82
Unverified
Commit
1f66fc82
authored
Mar 14, 2019
by
Kristjan Kruus
Committed by
GitHub
Mar 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76 from e-gov/release/v7.5
Release/v7.5
parents
193dd20c
7a40d93d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
89 additions
and
35 deletions
+89
-35
backend/src/main/java/ee/ria/riha/service/IssueService.java
backend/src/main/java/ee/ria/riha/service/IssueService.java
+1
-1
backend/src/main/java/ee/ria/riha/service/util/DateUtils.java
...end/src/main/java/ee/ria/riha/service/util/DateUtils.java
+4
-4
backend/src/test/java/ee/ria/riha/service/util/DateUtilsTest.java
...src/test/java/ee/ria/riha/service/util/DateUtilsTest.java
+29
-0
frontend/src/app/components/producer-details/producer-details-security/producer-details-security.component.html
...details-security/producer-details-security.component.html
+3
-1
frontend/src/app/components/producer-details/producer-details-security/producer-details-security.component.ts
...r-details-security/producer-details-security.component.ts
+21
-8
frontend/src/app/components/producer-edit/producer-edit-documents/producer-edit-documents.component.html
...cer-edit-documents/producer-edit-documents.component.html
+2
-2
frontend/src/app/components/producer-edit/producer-edit-standard-realisations/producer-edit-standard-realisations.component.html
...ations/producer-edit-standard-realisations.component.html
+1
-1
frontend/src/app/components/producer-search-filter/producer-search-filter-component.html
...ducer-search-filter/producer-search-filter-component.html
+12
-12
frontend/src/app/components/producer-search-filter/producer-search-filter-component.ts
...roducer-search-filter/producer-search-filter-component.ts
+12
-6
frontend/src/styles.css
frontend/src/styles.css
+4
-0
No files found.
backend/src/main/java/ee/ria/riha/service/IssueService.java
View file @
1f66fc82
...
...
@@ -37,7 +37,7 @@ import static org.springframework.util.StringUtils.hasText;
@Service
public
class
IssueService
{
p
rivate
static
final
int
WORK_DAYS_UNTIL_DEADLINE
=
20
;
p
ublic
static
final
int
WORK_DAYS_UNTIL_DEADLINE
=
20
;
public
static
final
Function
<
Comment
,
Issue
>
COMMENT_TO_ISSUE
=
comment
->
{
if
(
comment
==
null
)
{
...
...
backend/src/main/java/ee/ria/riha/service/util/DateUtils.java
View file @
1f66fc82
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
++;
...
...
backend/src/test/java/ee/ria/riha/service/util/DateUtilsTest.java
0 → 100644
View file @
1f66fc82
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
frontend/src/app/components/producer-details/producer-details-security/producer-details-security.component.html
View file @
1f66fc82
...
...
@@ -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
...
...
frontend/src/app/components/producer-details/producer-details-security/producer-details-security.component.ts
View file @
1f66fc82
import
{
Component
,
EventEmitter
,
OnInit
,
Inpu
t
,
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
,
OnIni
t
,
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
());
...
...
frontend/src/app/components/producer-edit/producer-edit-documents/producer-edit-documents.component.html
View file @
1f66fc82
...
...
@@ -71,7 +71,7 @@
#linkType
="
ngModel
"
[(ngModel)]=
"data.type"
name=
"linkType"
required
>
<option
[value]=
"''"
disabled
selected
>
Vali veebivii
d
e liik...
</option>
<option
[value]=
"''"
disabled
selected
>
Vali veebivii
t
e 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 veebivii
d
e liik...
</option>
<option
[value]=
"''"
disabled
selected
>
Vali veebivii
t
e liik...
</option>
<option
*ngFor=
"let type of generalHelperService.toArray(classifiers.document_types)"
[value]=
"type.code"
selected
>
{{ type.value }}
</option>
</select>
</div>
...
...
frontend/src/app/components/producer-edit/producer-edit-standard-realisations/producer-edit-standard-realisations.component.html
View file @
1f66fc82
...
...
@@ -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>
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>
...
...
frontend/src/app/components/producer-search-filter/producer-search-filter-component.html
View file @
1f66fc82
...
...
@@ -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>
frontend/src/app/components/producer-search-filter/producer-search-filter-component.ts
View file @
1f66fc82
...
...
@@ -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
'
]
||
''
};
});
}
...
...
frontend/src/styles.css
View file @
1f66fc82
...
...
@@ -18,3 +18,7 @@
.margin-right-10
{
margin-right
:
10px
;
}
.margin-right-20
{
margin-right
:
20px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment