Skip to content

Commit

Permalink
Merge branch 'develop' into feature/projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppekroghitk authored Jan 4, 2024
2 parents 4e28c21 + d573673 commit 256d7c2
Show file tree
Hide file tree
Showing 68 changed files with 2,956 additions and 1,903 deletions.
13 changes: 7 additions & 6 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@ LEANTIME_PROJECT_TRACKER_TOKEN=LEANTIME_PROJECT_TRACKER_TOKEN
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=mariadb-10.6.7&charset=utf8mb4"
#DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=14&charset=utf8"
DATABASE_URL="mysql://db:db@mariadb:3306/db?serverVersion=10.9.3-MariaDB&charset=utf8mb4"
###< doctrine/doctrine-bundle ###

###> App ###
JIRA_API_SERVICE_CUSTOM_FIELD_EPIC_LINK=JIRA_API_SERVICE_CUSTOM_FIELD_EPIC_LINK
JIRA_API_SERVICE_CUSTOM_FIELD_ACCOUNT=JIRA_API_SERVICE_CUSTOM_FIELD_ACCOUNT
JIRA_API_SERVICE_CUSTOM_FIELD_SPRINT=JIRA_API_SERVICE_CUSTOM_FIELD_SPRINT
JIRA_API_SERVICE_DEFAULT_BOARD=JIRA_API_SERVICE_DEFAULT_BOARD
JIRA_API_SERVICE_SPRINT_NAME_REGEX="/(?<weeks>(?:-?\d+-?)*)\.(?<year>\d+)$/"

API_SERVICE_SPRINT_NAME_REGEX="/(?<weeks>(?:-?\d+-?)*)\.(?<year>\d+)$/"

APP_WEEK_GOAL_LOW=25.0
APP_WEEK_GOAL_HIGH=34.5
APP_INVOICE_RECEIVER_ACCOUNT=APP_INVOICE_RECEIVER_ACCOUNT
APP_INVOICE_DEFAULT_DESCRIPTION=APP_INVOICE_DEFAULT_DESCRIPTION
APP_INVOICE_SUPPLIER_ACCOUNT=APP_INVOICE_SUPPLIER_ACCOUNT
APP_INVOICE_RECEIVER_DEFAULT_ACCOUNT=APP_INVOICE_DEFAULT_RECEIVER_ACCOUNT
APP_INVOICE_DESCRIPTION_TEMPLATE="Spørgsmål vedrørende fakturaen rettes til %name%, %email%."
APP_PROJECT_BILLING_DEFAULT_DESCRIPTION=
###< Planning ###

###> itk-dev/openid-connect-bundle ###
Expand Down
92 changes: 72 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,71 @@
# CHANGELOG
<!-- markdownlint-disable MD024 -->
# Changelog

All notable changes to this project will be documented in this file.

See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information about writing changes to this log.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* Updated api source to use Leantime
* Modified getPlanningData to work with Leantime data
* Modified getSprintReportData to work with Leantime data
* Added project lead to client when syncing projects.
* Remove description from create invoice page.
* Added generate description button to invoice when client is set.
* Fixed texts.
* Fixed classes for choices.js fields and disabled state.
* Added project lead to invoice edit page.
* Changed InvoiceEntry material number and account to be set only at the invoice level.
* Added default account to invoices from environment variable.
* Added check for invoice entries with amount 0 when putting invoice on record.
* Fixed issue with receiver account for project billing.
* Fixed invoices overview sorting. Changed default sorting for invoices on record as by exportedDate.
* Changed monolog config to ignore deprecations.
* Added Leantime specific header to api service.
* Added option to only export internal or external invoices from project billing.
* Added checks for errors before allowing putting project billing on record
* Added error check for invoice entries with 0 amounts
* Make sure all issues are selected in project billing period.
* Refactored error handling.


* RELEASE NOTES:
* Change name APP_INVOICE_RECEIVER_ACCOUNT to APP_INVOICE_SUPPLIER_ACCOUNT in `.env.local`
* Set APP_INVOICE_DESCRIPTION_TEMPLATE in `.env.local`
* Set APP_INVOICE_RECEIVER_DEFAULT_ACCOUNT in `.env.local`
* Set APP_PROJECT_BILLING_DEFAULT_DESCRIPTION in `.env.local`

## [1.1.2]

* Changed how project billing is put on record, to allow for finishing a partially
complete process.
* Added exported date to invoices overview.
* Changed project billing period to date fields.
* Aligned date formats.
* Added total amount to invoice.

## [1.1.1]

* Added choices.js to dropdowns with many options.
* Added epic filter to worklog selection page.
* Removed time from period selections on worklog selection page.
* Optimized sync memory usage.
* Composer update to Symfony 6.4.

## [1.1.0]

## 1.0.4
* Updated api source to use Leantime
* Modified getPlanningData to work with Leantime data
* Changed amount and price field to NumberType instead of IntegerType.
* Added export more options to recorded invoices overview.
* Fixed issue with issue version sync.

## [1.0.4]

* Fixed command to recalculate sums for all invoices by first calculating invoice entries.
* Fixed command to recalculate sums for all invoices by first calculating
invoice entries.

## 1.0.3
## [1.0.3]

* Changed redirect after create a manual invoice entry.
* Removed export options when client is not set.
Expand All @@ -24,22 +74,16 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo
* Changed datetime form fields to date.
* Fixed select all on worklog list.

## 1.0.2

## Changed
## [1.0.2]

* Updated package-lock.json.

## 1.0.1

### Changed
## [1.0.1]

* Updated openid-connect to newest version.
* Updated docker-compose files to newest version.

## 1.0.0

### Added
## [1.0.0]

* Added Billing.
* Added migration path from JiraEconomics.
Expand All @@ -53,9 +97,6 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo
* Added help text to invoice entry (worklog) type.
* Added publiccode.yml
* Added OpenID Connect Controller

### Changed

* Updated docker files to the newest version.
* Fixed path bugs.
* Added filtering to lists.
Expand All @@ -73,6 +114,17 @@ See [keep a changelog](https://keepachangelog.com/en/1.0.0/) for information abo
* Changed sprint report form to GET method.
* Fixed worklog select path.
* Optimized worklog select javascript.
* Fixed issues with create project. Javascript has been changed to use stimulus. Changed how session is accessed.
* Fixed issues with create project. Javascript has been changed to use stimulus.
Changed how session is accessed.
* Updated to authorization code flow.
* Changed worklog save button styling to be sticky.

[Unreleased]: https://github.com/itk-dev/economics/compare/1.1.2...HEAD
[1.1.2]: https://github.com/itk-dev/economics/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/itk-dev/economics/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/itk-dev/economics/compare/1.0.4...1.1.0
[1.0.4]: https://github.com/itk-dev/economics/compare/1.0.3...1.0.4
[1.0.3]: https://github.com/itk-dev/economics/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/itk-dev/economics/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/itk-dev/economics/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/itk-dev/economics/releases/tag/1.0.0
20 changes: 20 additions & 0 deletions assets/controllers/choices_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {Controller} from '@hotwired/stimulus';
import Choices from "choices.js";
import 'choices.js/src/styles/choices.scss';

/**
* Activates choices.js for each element with choices target.
*/
export default class extends Controller {
static targets = ['choices'];

connect() {
this.choicesTargets.forEach((target) => {
const notDisabled = !target.disabled;

if (notDisabled) {
new Choices(target, {allowHTML: true, itemSelectText: ''});
}
})
}
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
import {Controller} from '@hotwired/stimulus';

/**
* Worklog select controller.
* Entry select controller.
*/
export default class extends Controller {
static targets = ['checkbox', 'toggleAll', 'spinner', 'result', 'submitButton'];
selectWorklogsEndpoint = null;
submitEndpoint = null;
selectAll = true;
submitting = false;
dirtyWorklogs = new Set();
dirtyEntrys = new Set();

connect() {
this.selectWorklogsEndpoint = this.element.dataset.selectWorklogsEndpoint;
this.submitEndpoint = this.element.dataset.submitEndpoint;
}

toggleAll() {
this.checkboxTargets.forEach((target) => {
target.checked = this.selectAll;
this.dirtyWorklogs.add(target.dataset.id);
this.dirtyEntrys.add(target.dataset.id);
});

this.selectAll = !this.selectAll;
}

checkboxClick(event) {
const worklogId = event.params.id;
this.dirtyWorklogs.add(worklogId.toString());
const entryId = event.params.id;
this.dirtyEntrys.add(entryId.toString());
}

async submitFormRedirectWithIds(event) {
event.preventDefault();
event.stopPropagation();

const values = this.checkboxTargets.reduce((accumulator, target) => {
const id = target.dataset.id;
const checked = target.checked;

if (this.dirtyEntrys.has(id) && checked) {
accumulator.push(id);
}

return accumulator;
}, []);

let params = new URLSearchParams({
ids: values
})

window.location.href = (this.submitEndpoint + "?" + params);
}

async submitForm(event) {
Expand All @@ -43,7 +65,7 @@ export default class extends Controller {
const id = target.dataset.id;
const checked = target.checked;

if (this.dirtyWorklogs.has(id)) {
if (this.dirtyEntrys.has(id)) {
accumulator.push({id, checked});
}

Expand All @@ -53,7 +75,7 @@ export default class extends Controller {
this.spinnerTarget.classList.remove('hidden');
this.resultTarget.classList = ['hidden'];

fetch(this.selectWorklogsEndpoint, {
fetch(this.submitEndpoint, {
method: 'POST',
mode: 'same-origin',
cache: 'no-cache',
Expand Down
35 changes: 35 additions & 0 deletions assets/controllers/generate-description_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {Controller} from '@hotwired/stimulus';

export default class extends Controller {
static targets = ['description'];

endpoint;

connect() {
this.endpoint = this.element.dataset.endpoint;
}

generate() {
fetch(this.endpoint, {
method: 'GET',
mode: 'same-origin',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrerPolicy: 'no-referrer',
}).then(async (resp) => {
if (resp.ok) {
const target = this.descriptionTarget;

resp.json().then((data) => {
if (data.description !== null) {
target.value = data.description;
}
});
}
});
}
}
40 changes: 20 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@
"gedmo/doctrine-extensions": "^3.9",
"itk-dev/openid-connect-bundle": "^3.0",
"knplabs/knp-paginator-bundle": "^6.1",
"mpdf/mpdf": "^v8.1.2",
"mpdf/mpdf": "^8.1.2",
"phpoffice/phpspreadsheet": "^1.25",
"stof/doctrine-extensions-bundle": "^1.7",
"symfony/console": "~6.3.0",
"symfony/doctrine-messenger": "~6.3.0",
"symfony/dotenv": "~6.3.0",
"symfony/console": "~6.4.0",
"symfony/doctrine-messenger": "~6.4.0",
"symfony/dotenv": "~6.4.0",
"symfony/flex": "^2",
"symfony/form": "~6.3.0",
"symfony/framework-bundle": "~6.3.0",
"symfony/http-client": "~6.3.0",
"symfony/messenger": "~6.3.0",
"symfony/form": "~6.4.0",
"symfony/framework-bundle": "~6.4.0",
"symfony/http-client": "~6.4.0",
"symfony/messenger": "~6.4.0",
"symfony/monolog-bundle": "^3.8",
"symfony/proxy-manager-bridge": "~6.3.0",
"symfony/runtime": "~6.3.0",
"symfony/security-bundle": "~6.3.0",
"symfony/proxy-manager-bridge": "~6.4.0",
"symfony/runtime": "~6.4.0",
"symfony/security-bundle": "~6.4.0",
"symfony/stimulus-bundle": "^2.10",
"symfony/translation": "~6.3.0",
"symfony/twig-bundle": "~6.3.0",
"symfony/validator": "~6.3.0",
"symfony/translation": "~6.4.0",
"symfony/twig-bundle": "~6.4.0",
"symfony/validator": "~6.4.0",
"symfony/webpack-encore-bundle": "^2.0",
"symfony/yaml": "~6.3.0"
"symfony/yaml": "~6.4.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.28",
"friendsofphp/php-cs-fixer": "^3.13",
"friendsoftwig/twigcs": "^6.0",
"phpunit/phpunit": "^10.2",
"symfony/debug-bundle": "~6.3.0",
"symfony/debug-bundle": "~6.4.0",
"symfony/maker-bundle": "^1.48",
"symfony/phpunit-bridge": "~6.3.0",
"symfony/phpunit-bridge": "~6.4.0",
"vimeo/psalm": "^5.0"
},
"replace": {
Expand Down Expand Up @@ -72,9 +72,9 @@
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"ergebnis/composer-normalize": true,
"symfony/flex": true,
"symfony/runtime": true,
"ergebnis/composer-normalize": true
"symfony/runtime": true
},
"optimize-autoloader": true,
"preferred-install": {
Expand All @@ -85,7 +85,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.3.*"
"require": "6.4.*"
}
},
"scripts": {
Expand Down
Loading

0 comments on commit 256d7c2

Please sign in to comment.