Commit 9fc6dd4d authored by Lukasz Waskiewicz's avatar Lukasz Waskiewicz
Browse files

refs #1204 poprawki w statystykach

zmiana działania repeat, zmiana labelek, poprawa stylów
parent 390e1ddf
......@@ -12,4 +12,8 @@ public interface ColumnValuesDataProvider<I, V> {
String printableValue(Object obj);
String getPath();
default String labelPathPrefix() {
return null;
}
}
......@@ -35,13 +35,11 @@ public class UserDomainProvider implements ColumnValuesDataProvider<Long, String
@Authenticated
public Collection<Object> transform(Collection<String> filters) {
return new HashSet<>(filters);
// return filters.stream().map(filter -> domainService.fetchDomainByName(filter)).collect(Collectors.toList());
}
@Override
public String printableValue(Object obj) {
return (String) obj;
// return ((CocosUserDomain) obj).getDomainName();
}
@Override
......
......@@ -28,5 +28,10 @@ public class UserRoleProvider implements ColumnValuesDataProvider<String, String
public String getPath() {
return "userRole";
}
@Override
public String labelPathPrefix() {
return "cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.";
}
}
update user_domain set domain = 'other' where domain ='*';
\ No newline at end of file
update user_domain set domain = 'other' where domain ='*';
\ No newline at end of file
......@@ -93,8 +93,8 @@ public class AdministrationStatisticsControler {
response.setStatus(HttpServletResponse.SC_OK);
}
@RequestMapping(path = "/reportRepeat", method = RequestMethod.POST)
public void reportRepeat(@RequestParam Long id, HttpServletResponse response) {
@RequestMapping(path = "/reportRepeat")
public ModelAndView reportRepeat(@RequestParam Long id) {
CocosReportRequest requestToRepeat = statisticsService.fetchReportRequest(id);
CocosReportRequest request = new CocosReportRequest();
......@@ -104,8 +104,12 @@ public class AdministrationStatisticsControler {
final List<ReportRequestColumn> processedColumns = columns.stream().map(col -> processColumnToNewRequest(request, col)).collect(Collectors.toList());
request.setColumns(new TreeSet<>(processedColumns));
statisticsService.submitReportRequest(request);
response.setStatus(HttpServletResponse.SC_OK);
ModelAndView modelAndView = new ModelAndView("administration/statistics/reportRequestsNew.xhtml");
modelAndView.addObject("reportRequest", request);
modelAndView.addObject("reportDefinition", statisticsService.fetchReportDefinition(request.getReportType()));
return modelAndView;
}
private ReportRequestColumn processColumnToNewRequest(CocosReportRequest request, ReportRequestColumn col) {
......
......@@ -26,7 +26,10 @@ TableFilters.prototype = {
$(".multiValueFilter").multiselect({
columns : 1,
search : false,
selectAll : true
selectAll : true,
texts: {
placeholder: 'Select'
}
});
$(".filteredInput").select2({dropdownAutoWidth:true});
......
......@@ -25,18 +25,11 @@ ReportRequestsPage.prototype.bindUiActions = function() {
page.tableWrapper.find(".reportRepeat").click(function() {
var elementRow = $(this).closest(".manageableElement");
$.ajax({
method : "POST",
url: page.settings.repeatUrl,
data : {
id : elementRow.data('id')
},
success : function(response) {
window.location = that.settings.listUrl;
}
}).error(function() {
console.error("reportRepeat");
});
var data = {
id : elementRow.data('id')
};
$(document.body).mask();
window.location = page.settings.repeatUrl + "?" + jQuery.param(data);
});
}
......@@ -13,8 +13,11 @@ ReportRequestsNew.prototype.init = function() {
ReportRequestsNew.prototype.reinit = function() {
$(".multiValueFilter").multiselect({
columns : 1,
search : false,
selectAll : true
search : true,
selectAll : true,
texts: {
placeholder: 'Select'
}
});
initBootstrapJSFeatures();
},
......
select.form-control {
height: auto;
font-size: 12px;
padding: {
left: 5px;
right: 1.6px;
top: 1.6px;
bottom: 1.6px;
}
}
.ms-options-wrap {
> button, button:focus {
overflow: hidden;
font-size: 12px;
padding: {
left: 5px;
right: 1.6px;
top: 1.6px;
bottom: 1.6px;
}
}
> .ms-options {
min-width: 80px;
> ul {
list-style: none;
margin: 0;
padding: 0;
li label {
font: {
size: 12px;
weight: normal;
}
}
input[type="checkbox"] {
top: 1px !important;
}
}
}
}
......@@ -75,19 +75,24 @@ cocos.portal.administration.requests.status.PENDING = Pending
cocos.portal.administration.requests.status.REJECTED = Rejected
cocos.portal.administration.statistics.reportRequests.columns.createdBy = Created by
cocos.portal.administration.statistics.reportRequests.columns.creationDate = Creation date
cocos.portal.administration.statistics.reportRequests.columns.description = Description
cocos.portal.administration.statistics.reportRequests.columns.endDate = End date
cocos.portal.administration.statistics.reportRequests.columns.startDate = Start date
cocos.portal.administration.statistics.reportRequests.columns.description = Name
cocos.portal.administration.statistics.reportRequests.columns.endDate = Date to
cocos.portal.administration.statistics.reportRequests.columns.startDate = Date from
cocos.portal.administration.statistics.reportRequests.columns.status = Status
cocos.portal.administration.statistics.reportRequests.columns.type = Type
cocos.portal.administration.statistics.reportRequests.field.dateRange = Date range
cocos.portal.administration.statistics.reportRequests.field.description = Description
cocos.portal.administration.statistics.reportRequests.field.description = Name
cocos.portal.administration.statistics.reportRequests.noData = No data
cocos.portal.administration.statistics.reportRequests.report.queries.columns.domain.label = Query user domain
cocos.portal.administration.statistics.reportRequests.report.queries.columns.simulation.label = Simulation business id
cocos.portal.administration.statistics.reportRequests.report.queries.columns.status.label = Query status
cocos.portal.administration.statistics.reportRequests.report.queries.columns.type.label = Query type
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.label = Query user role
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.ROLE_ADMIN = Admin
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.ROLE_ANONYMOUS = Anonymous
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.ROLE_POWER_USER = Power user
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.ROLE_SYSTEM = System
cocos.portal.administration.statistics.reportRequests.report.queries.columns.userRole.value.ROLE_USER = User
cocos.portal.administration.statistics.reportRequests.report.queries.columns.users.label = Query users
cocos.portal.administration.statistics.reportRequests.report.queries.label = Queries statistics
cocos.portal.administration.statistics.reportRequests.report.quotes.columns.domain.label = User domain
......
......@@ -9,7 +9,8 @@
<div class="list-group" >
<div class="list-group-item ">
<label th:for="reportDescription" th:text="#{cocos.portal.administration.statistics.reportRequests.field.description}" />
<input id="reportDescription" th:type="text" class="form-control" th:placeholder="#{cocos.portal.administration.statistics.reportRequests.columns.description}"/>
<input id="reportDescription" th:type="text" class="form-control" th:value="${reportRequest==null?'':reportRequest.reportDescription}"
th:placeholder="#{cocos.portal.administration.statistics.reportRequests.columns.description}"/>
</div>
</div>
......@@ -24,16 +25,23 @@
</div>
<div class="list-group">
<div class="list-group-item definitionColumnWrapper" th:each="column : *{columns}" data:columnname="${column.name}">
<div class="list-group-item definitionColumnWrapper" th:each="column : *{columns}" data:columnname="${column.name}"
th:with="checked = ${reportRequest==null}?false:${reportRequest.columns.?[name == '__${column.name}__'].size()==1}">
<div class="checkbox-inline">
<input th:id="|${reportType}_${column.name}|" class="reportColumnEnabled" type="checkbox" th:name="${column.name}" />
<input th:id="|${reportType}_${column.name}|" class="reportColumnEnabled" type="checkbox" th:name="${column.name}" th:checked="${checked}"/>
<label th:for="|${reportType}_${column.name}|" th:text="#{__${column.descriptionLabel}__}" />
</div>
<div>
<select class="form-control filter-control multiValueFilter" th:name="${column.name}" multiple="multiple" disabled="disabled">
<div >
<select class="form-control filter-control multiValueFilter" th:name="${column.name}" multiple="multiple" disabled="disabled" >
<th:block th:each="entry : ${column.getDataProvider().fetchData().entrySet()}">
<option th:text="${entry.value}" th:value="${entry.key}">value</option>
<option th:if="${column.getDataProvider().labelPathPrefix()==null}" th:text="${entry.value}"
th:value="${entry.key}"
th:selected="${checked}?${reportRequest.columns.?[name == '__${column.name}__'].get(0).filters.contains('__${entry.key}__')}"
>value</option>
<option th:if="${column.getDataProvider().labelPathPrefix()!=null}" th:text="#{__|${column.getDataProvider().labelPathPrefix()}${entry.value}|__}"
th:value="${entry.key}"
>value</option>
</th:block>
</select>
</div>
......
......@@ -33,7 +33,7 @@
<div class="panel-body ">
<form>
<div class="form-group">
<select id="reportTypeSelect" class="form-control " name="reportType">
<select id="reportTypeSelect" class="form-control" name="reportType" th:disabled="${reportRequest!=null}">
<th:block th:each="loopType : ${T(pl.edu.icm.cocos.services.api.model.statistics.ReportType).values()}">
<option value="type" th:text="#{cocos.portal.administration.statistics.reportRequests.report.__${#strings.toLowerCase(loopType.name())}__.label}" th:value="${loopType.name()}">type</option>
</th:block>
......
......@@ -30,12 +30,12 @@
<th:block layout:fragment="pageFragment">
<table class="table table-striped table-hover table-condensed resultsContainer">
<tr>
<th th:text="#{cocos.portal.administration.statistics.reportRequests.columns.description}" />
<th th:text="#{cocos.portal.administration.statistics.reportRequests.columns.type}" />
<th th:text="#{cocos.portal.administration.statistics.reportRequests.columns.status}" />
<th th:text="#{cocos.portal.administration.statistics.reportRequests.columns.description}" />
<th:block layout:replace="utils/sorting.xhtml :: tableColumnWrapper (label='cocos.portal.administration.statistics.reportRequests.columns.creationDate')">
<th:block layout:fragment="nestedContent" layout:include="administration/statistics/reportRequestsPageContent.xhtml :: dateSortFragment('creationDate')"/>
</th:block>
......@@ -56,6 +56,9 @@
</tr>
<tr class="row-filters">
<td>
<div layout:replace="utils/sorting.xhtml:: filterComponent(field='reportDescription', type='text', currentValue=${paginationRequestHolder.filter.reportDescription}, placeholder='cocos.portal.administration.statistics.reportRequests.field.description')" />
</td>
<td>
<div layout:replace="utils/sorting.xhtml:: filterComponent(field='reportType', type='other')">
<th:block layout:fragment="customFilter" layout:include="administration/statistics/reportRequestsPageContent.xhtml :: typeFilterFragment"/>
......@@ -66,9 +69,6 @@
<th:block layout:fragment="customFilter" layout:include="administration/statistics/reportRequestsPageContent.xhtml :: statusFilterFragment"/>
</div>
</td>
<td>
<div layout:replace="utils/sorting.xhtml:: filterComponent(field='reportDescription', type='text', currentValue=${paginationRequestHolder.filter.reportDescription}, placeholder='cocos.portal.administration.statistics.reportRequests.field.description')" />
</td>
<td>
<div layout:replace="utils/sorting.xhtml:: filterComponent(field='creationDate', type='date', currentRangeValue=${paginationRequestHolder.filter.creationDate})" />
</td>
......@@ -109,9 +109,9 @@
<th:block th:remove="all">
<tr class="resultElement manageableElement" layout:fragment="reportRequestsRowTemplate (row)" th:object="${row}" data:id="*{id}">
<td class="elipsisable" th:text="*{reportDescription}" />
<td th:text="*{reportType}" />
<td th:text="*{reportStatus}" />
<td class="elipsisable" th:text="*{reportDescription}" />
<td th:text="${#calendars.format(row.creationDate, userSettingsHolder.dateFormat)}" />
<td th:text="${row.startDate==null?'':#calendars.format(row.startDate, userSettingsHolder.dateFormat)}" />
<td th:text="${row.endDate==null?'':#calendars.format(row.endDate, userSettingsHolder.dateFormat)}" />
......
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