Skip to content

Commit

Permalink
Merge pull request #113 from itk-dev/feature/1213-worklog-period-filter
Browse files Browse the repository at this point in the history
Worklog period filter
  • Loading branch information
rimi-itk authored May 2, 2024
2 parents bcc9536 + 6a122c1 commit e2d6773
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .docker/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!Readme.md
6 changes: 2 additions & 4 deletions .docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
worker_processes auto;

error_log /var/log/nginx/error.log notice;
error_log /dev/stderr notice;
pid /tmp/nginx.pid;

events {
Expand All @@ -26,11 +26,9 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
access_log /dev/stdout main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

gzip on;
Expand Down
40 changes: 40 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
server {
listen ${NGINX_PORT};
server_name localhost;

root ${NGINX_WEB_ROOT};

location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}

# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
deny all;
return 404;
}

location ~ ^/index\.php(/|$) {
fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;

fastcgi_pass ${NGINX_FPM_SERVICE};
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

internal;
}

location ~ \.php$ {
return 404;
}

# Send log message to files symlinked to stdout/stderr.
error_log /dev/stderr;
access_log /dev/stdout main;
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* [PR-113](https://github.com/itk-dev/economics/pull/113)
Worklog period filter
* [PR-110](https://github.com/itk-dev/economics/pull/110)
1209: No cost invoices
* [PR-111](https://github.com/itk-dev/economics/pull/111)
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
services:
phpfpm:
environment:
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.redirect.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
services:
nginx:
labels:
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.server.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
networks:
frontend:
external: true
Expand Down Expand Up @@ -31,12 +29,14 @@ services:
- frontend
depends_on:
- phpfpm
ports:
- '8080'
volumes:
- ./.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro
- ./.docker/templates:/etc/nginx/templates:ro
- ./.docker/nginx.conf:/etc/nginx/nginx.conf:ro
- ./:/app:rw
- .:/app
environment:
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
NGINX_WEB_ROOT: /app/public
NGINX_PORT: 8080
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
Expand Down
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# itk-version: 3.1.0
version: "3"

# itk-version: 3.2.1
networks:
frontend:
external: true
Expand Down Expand Up @@ -32,7 +30,7 @@ services:
- PHP_XDEBUG_MODE=${PHP_XDEBUG_MODE:-off}
- PHP_MAX_EXECUTION_TIME=30
- PHP_MEMORY_LIMIT=256M
# Depending on the setup you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
# Depending on the setup, you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
- PHP_SENDMAIL_PATH=/usr/bin/msmtp --host=mail --port=1025 --read-recipients --read-envelope-from
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
- COMPOSER_VERSION=2
Expand All @@ -52,8 +50,12 @@ services:
ports:
- '8080'
volumes:
- ./.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro
- ./.docker/templates:/etc/nginx/templates:ro
- .:/app
environment:
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
NGINX_WEB_ROOT: /app/public
NGINX_PORT: 8080
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
Expand Down
4 changes: 3 additions & 1 deletion src/Repository/WorklogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public function findByFilterData(Project $project, InvoiceEntry $invoiceEntry, I
}

if (!empty($filterData->periodTo)) {
$qb->andWhere('worklog.started <= :periodTo')->setParameter('periodTo', $filterData->periodTo);
// Period to must include the selected day.
$periodTo = $filterData->periodTo->modify('tomorrow');
$qb->andWhere('worklog.started < :periodTo')->setParameter('periodTo', $periodTo);
}

if (!empty($filterData->version) || !empty($filterData->epic)) {
Expand Down

0 comments on commit e2d6773

Please sign in to comment.