Skip to content

Commit

Permalink
Merge pull request #966 from adfinis/staging
Browse files Browse the repository at this point in the history
Next production
  • Loading branch information
open-dynaMIX authored Nov 6, 2023
2 parents 44f02fc + a68485f commit 01c36ca
Show file tree
Hide file tree
Showing 11 changed files with 894 additions and 796 deletions.
5 changes: 5 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# general software maintenance
**/Dockerfile @open-dynaMIX @Yelinz
docker-compose.yml @open-dynaMIX @Yelinz
ember/* @Yelinz
api/* @open-dynaMIX
4 changes: 2 additions & 2 deletions api/mysagw/case/tests/__snapshots__/test_case_views.ambr

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions api/mysagw/pdf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
from django.conf import settings
from pypdf import PdfWriter
from pypdf.errors import DependencyError, PdfReadError
from pypdf.errors import FileNotDecryptedError, PdfReadError
from reportlab.lib.pagesizes import A4, mm
from reportlab.lib.utils import ImageReader
from reportlab.pdfgen import canvas
Expand Down Expand Up @@ -78,16 +78,15 @@ def add_caluma_files_to_pdf(pdf, urls):
for file in prepare_files_for_merge(files):
try:
merger.append(file)
except PdfReadError: # pragma: no cover
## faulty pdf
pass
except DependencyError as e:
except FileNotDecryptedError as e:
# we don't support AES encrypted PDFs
if (
not e.args
or not e.args[0] == "PyCryptodome is required for AES algorithm"
not e.args or not e.args[0] == "File has not been decrypted"
): # pragma: no cover
raise
except PdfReadError: # pragma: no cover
## faulty pdf
pass

result = io.BytesIO()

Expand Down
Binary file modified api/mysagw/test_files/test_encrypted.pdf
Binary file not shown.
1,340 changes: 709 additions & 631 deletions api/poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ readme = "../README.md"

[tool.poetry.dependencies]
python = "^3.9"
django = "^3.2.19"
django = "^3.2.23"
django-countries = "^7.5.1"
django-environ = "^0.10.0"
django-environ = "^0.11.2"
django-excel = "^0.0.10"
django-filter = "^23.2"
django-localized-fields = "^6.6"
django-phonenumber-field = {extras = ["phonenumberslite"], version = "^7.1.0"}
django-postgres-extra = "^2.0.8"
django-simple-history = "^3.3.0"
django-simple-history = "^3.4.0"
django-watchman = "^1.3.0"
djangorestframework = "^3.14.0"
djangorestframework-jsonapi = "^6.0.0"
Expand All @@ -27,7 +27,7 @@ openpyxl = "3.0.10" # TODO: dependency of `pyexcel-xlsx`. Remove as soon as htt
psycopg2-binary = "^2.9.6"
pyexcel = "^0.7.0"
pyexcel-xlsx = "^0.6.0"
pypdf = "^3.12.1"
pypdf = "^3.17.0"
requests = "^2.31.0"
reportlab = "^4.0.4"
uwsgi = "^2.0.22"
Expand All @@ -43,14 +43,14 @@ psycopg2-binary = "^2.9.6"
pytest = "^7.3.1"
pytest-cov = "^4.1.0"
pytest-django = "^4.5.2"
pytest-env = "^0.8.1"
pytest-env = "^1.1.1"
pytest-factoryboy = "^2.5.1"
pytest-freezegun = "^0.4.2"
pytest-mock = "^3.10.0"
pytest-randomly = "^3.12.0"
requests-mock = "^1.10.0"
syrupy = "^4.0.2"
ruff = "^0.0.284"
ruff = "^0.1.3"

[tool.ruff]
exclude = [
Expand Down Expand Up @@ -124,7 +124,7 @@ filterwarnings = [
"error::DeprecationWarning",
"error::PendingDeprecationWarning",
"ignore:invalid escape sequence", # needed for deprecation == "2.0.7" (dependency of localized-fields)
"ignore:pkg_resources is deprecated as an API:DeprecationWarning", # needed for simple-history: https://github.com/jazzband/django-simple-history/blob/master/simple_history/__init__.py#L1
"ignore:pkg_resources is deprecated as an API:DeprecationWarning", # needed until this is resolved: https://github.com/SmileyChris/django-countries/issues/439
"ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning", # issue in pytest-freezegun
"ignore:LocalizedAutoSlug is deprecated and will be removed in the next major version:DeprecationWarning",
"ignore:'django_extensions' defines default_app_config:PendingDeprecationWarning", # deprecation in django_extensions
Expand Down
9 changes: 8 additions & 1 deletion ember/app/services/filtered-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ export default class FilteredFormsService extends Service {
@queryManager apollo;

@tracked value = null;
@tracked previousQuery = null;

async fetch(queryVariables = {}) {
if (this.value !== null) return this.value;
if (
this.value !== null &&
JSON.stringify(queryVariables) === JSON.stringify(this.previousQuery)
) {
return this.value;
}

this.value = await this.mainForms(queryVariables);
this.previousQuery = queryVariables;

if (this.abilities.can("filter all forms case")) {
return this.value;
Expand Down
1 change: 0 additions & 1 deletion ember/app/ui/cases/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default class CasesIndexController extends TableController {
@service store;
@service notification;
@service intl;
@service filteredForms;

@queryManager apollo;

Expand Down
1 change: 0 additions & 1 deletion ember/app/ui/work-items/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import TableController from "mysagw/utils/table-controller";
export default class WorkItemsIndexController extends TableController {
@service session;
@service store;
@service filteredForms;
@service can;

@queryManager apollo;
Expand Down
3 changes: 3 additions & 0 deletions ember/app/utils/table-controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Controller from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { tracked } from "@glimmer/tracking";
import {
lastValue,
Expand All @@ -12,6 +13,8 @@ import { TrackedObject } from "tracked-built-ins";
import { stringFromArray } from "mysagw/utils/query-params";

export default class TableController extends Controller {
@service filteredForms;

queryParams = ["order", "filter"];

// Filters
Expand Down
Loading

0 comments on commit 01c36ca

Please sign in to comment.