Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschuppi81 committed Jul 12, 2024
2 parents 6924616 + 47267ee commit e754307
Show file tree
Hide file tree
Showing 106 changed files with 3,983 additions and 491 deletions.
144 changes: 91 additions & 53 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,98 @@
# Changes

## 2024.39

`2024-07-11` | [26aad8fd14...15b0142f61](https://github.com/OneGov/onegov-cloud/compare/26aad8fd14^...15b0142f61)

### Docker

##### Fix nginx cache buster.

`Bugfix` | [OGC-1734](https://linear.app/onegovcloud/issue/OGC-1734) | [d11dd89666](https://github.com/onegov/onegov-cloud/commit/d11dd89666180a2b5e13c3662138ca7b9aca3aab)

### Docs

##### Resolve various warnings.

`Bugfix` | [e45c8c878d](https://github.com/onegov/onegov-cloud/commit/e45c8c878de29612394bf1e0095f9184ad8f631e)

### Election Day

##### Fix search hint rendering.

`Bugfix` | [53c96917ca](https://github.com/onegov/onegov-cloud/commit/53c96917cab9f61d36a2709fb6d5c91a3877e942)

### Feriennet

##### Replace Banners

`Feature` | [PRO-1300](https://linear.app/projuventute/issue/PRO-1300) | [a0458ba8ac](https://github.com/onegov/onegov-cloud/commit/a0458ba8ac1e39da1d7b2e4eedc8fda797520b0a)

##### Fix bug when there is no prebooking phase

`Bugfix` | [PRO-1296](https://linear.app/projuventute/issue/PRO-1296) | [c4fe859a94](https://github.com/onegov/onegov-cloud/commit/c4fe859a94eb7b854c0804703d22a91d2b481a4c)

##### Read QR-Payments

Some entries have no "TxDtls" instead they have their information in "AddtlNtryInf".

`Bugfix` | [OGC-1198](https://linear.app/onegovcloud/issue/OGC-1198) | [dbf8a6afc2](https://github.com/onegov/onegov-cloud/commit/dbf8a6afc225ed98807207148b8b4b59ddca528f)

### Form

##### Fix broken rendering

`Bugfix` | [OGC-1738](https://linear.app/onegovcloud/issue/OGC-1738) | [55bbad189a](https://github.com/onegov/onegov-cloud/commit/55bbad189a2dc9faac1dd6c7bac240fcd81ba565)

### Landsgemeinde

##### Remove YouTube recommendations

`Feature` | [OGC-1651](https://linear.app/onegovcloud/issue/OGC-1651) | [2f561e8c85](https://github.com/onegov/onegov-cloud/commit/2f561e8c85fffa2d9b15b77673b4fb3e670c898e)

### Org

##### Surveys

Add option to create and view results of surveys

`Feature` | [OGC-1612](https://linear.app/onegovcloud/issue/OGC-1612) | [15b0142f61](https://github.com/onegov/onegov-cloud/commit/15b0142f6197ad607b5174f1e1e9184748464611)

### People

##### Fix vcard export.

`Bugfix` | [31d27201e3](https://github.com/onegov/onegov-cloud/commit/31d27201e373b67906cb91973bfb9d29855f3a3a)

### Resource

##### Allow deleting resources with future reservations. Deletes related payments

`Feature` | [OGC-1701](https://linear.app/onegovcloud/issue/OGC-1701) | [b4a9b75838](https://github.com/onegov/onegov-cloud/commit/b4a9b75838352da1713bc4ab6ce23ce70cff7a91)

### Town6

##### Move tracking code into header

`Feature` | [OGC-1700](https://linear.app/onegovcloud/issue/OGC-1700) | [c8b94b2202](https://github.com/onegov/onegov-cloud/commit/c8b94b2202ee5a0e1eac748e91b58e9ad02fec62)

##### Allow scrolling in side-navigation

`Feature` | [OGC-1703](https://linear.app/onegovcloud/issue/OGC-1703) | [ec2ee37558](https://github.com/onegov/onegov-cloud/commit/ec2ee375586d49297d1d98f4728810db53cfac08)

##### Editmode People

Add "save" and "cancel" to Edit-bar when editing people.

`Feature` | [7412046ffb](https://github.com/onegov/onegov-cloud/commit/7412046ffb37facb8560660e5bddfc6a3632db9b)

##### Rename Buttons

`Feature` | [OGC-1697](https://linear.app/onegovcloud/issue/OGC-1697) | [cf1e9033cb](https://github.com/onegov/onegov-cloud/commit/cf1e9033cb1d097944ff69d9ede69def04f35d58)

## 2024.38

`2024-07-05` | [72c07c37c0...238d714f7a](https://github.com/OneGov/onegov-cloud/compare/72c07c37c0^...238d714f7a)
`2024-07-05` | [72c07c37c0...485c773b87](https://github.com/OneGov/onegov-cloud/compare/72c07c37c0^...485c773b87)

### Agency

Expand Down Expand Up @@ -1870,55 +1960,3 @@ optionally be limited as well as the duration of a mTAN session.

`Bugfix` | [OGC-1047](https://linear.app/onegovcloud/issue/OGC-1047) | [92984a8279](https://github.com/onegov/onegov-cloud/commit/92984a8279b4ca7f8256bdd06e679887539b2300)

## 2023.52

`2023-10-23` | [d8d88e831a...f1d513bda8](https://github.com/OneGov/onegov-cloud/compare/d8d88e831a^...f1d513bda8)

### Ballot

##### Fixes various hybrid properties.

`Bugfix` | [OGC-533](https://linear.app/onegovcloud/issue/OGC-533) | [d8d88e831a](https://github.com/onegov/onegov-cloud/commit/d8d88e831adecb0a4a604711aa1c4a4e6df279c4)

### Core

##### Adds compatibility with arrow 1.3.

`Feature` | [OGC-122](https://linear.app/onegovcloud/issue/OGC-122) | [eb573a8efc](https://github.com/onegov/onegov-cloud/commit/eb573a8efc03205eb6321ded262b55bcae1e86fb)

### Election Day

##### Fixes election-candidates-table widget.

`Bugfix` | [9133404a16](https://github.com/onegov/onegov-cloud/commit/9133404a160f8e7d4bfce01afe926e31ee0ebcb2)

##### Fixes screen deletion message.

`Bugfix` | [5811a56f85](https://github.com/onegov/onegov-cloud/commit/5811a56f851b9af06b467fd46b3ae93425873271)

##### Fixes column classes.

`Bugfix` | [20b0ec15a9](https://github.com/onegov/onegov-cloud/commit/20b0ec15a90da0b76f9b45e19e2356f15738ba87)

##### Fixes missing expats in counted-entities widget.

`Bugfix` | [OGC-1302](https://linear.app/onegovcloud/issue/OGC-1302) | [da715fb62f](https://github.com/onegov/onegov-cloud/commit/da715fb62ffcb7a3fb239372673885093d4fba05)

##### Try to bypass browser cache when reloading screens.

`Bugfix` | [4a516b8bba](https://github.com/onegov/onegov-cloud/commit/4a516b8bbaf1d0b59a3aa09724cd1ccc893c64cf)

##### Relax vote sanity checks for uncounted results.

`Bugfix` | [c37c98c379](https://github.com/onegov/onegov-cloud/commit/c37c98c379660ebabbfe867d8dd66ced9128562d)

##### Fixes vote statistics sorting.

`Bugfix` | [427a528340](https://github.com/onegov/onegov-cloud/commit/427a5283407005de457e805b91b883a5905752f4)

### Org

##### Fixes the directory import for edge case.

`Bugfix` | [OGC-338](https://linear.app/onegovcloud/issue/OGC-338) | [c62f9fcaa2](https://github.com/onegov/onegov-cloud/commit/c62f9fcaa297d5883c8e8d16c6d409441160ba31)

57 changes: 17 additions & 40 deletions docker/nginx-cache-buster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@
//
// The default cache path is '/var/cache/nginx'. All subfolders of the cache
// path are searched and any corresponding files are deleted.

// Note that the domain part of the URL is ignored, so this is equivalent to
// the example given above:

// nginx-cache-buster https://my-site/assets/cached.js

// The full URL would often not match anything since nginx caches by proxy
// backend and not by publicly visible URL.

// Also note that this deletes all cached resources independent of request method,
//
// Note that this deletes all cached resources independent of request method,
// so GET/PUT/POST etc. are all deleted.

//
// This CLI is meant to be run with setuid/sticky bit. That is, we run with
// root permissions under an unprivileged account. Therefore this CLI needs
// to be as minimal as possible to not expose an attack surface.
Expand All @@ -25,20 +17,20 @@ import (
"flag"
"fmt"
"log"
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
)

var banner = `
Usage: nginx-cache-buster /assets/cached.js --dir /var/cache/nginx
Usage: nginx-cache-buster <file-id> --dir /var/cache/nginx
Parameters:
`

var lineURL = regexp.MustCompile(`KEY: (http|https)(GET|HEAD)(.*)`)
var lineURL = regexp.MustCompile(`KEY: [^/]*(/.*)`)


func mustBeADirectory(d string) {
if i, err := os.Stat(d); err != nil {
Expand All @@ -48,16 +40,6 @@ func mustBeADirectory(d string) {
}
}

func mustParseURLPath(u string) string {
parsed, err := url.Parse("http://" + u)

if err != nil {
log.Fatalf("error parsing %s: %v", u, err)
}

return parsed.Path
}

func mustPassArgument(count int, name string) {
if args := flag.NArg(); args == 0 {
log.Fatalf("missing argument: %s", name)
Expand Down Expand Up @@ -102,14 +84,14 @@ func findLine(path string, prefix string) (string, error) {
return "", sc.Err()
}

func parseProxyLine(line string) (method, protocol, url string) {
func parseProxyLine(line string) (url string) {
matches := lineURL.FindStringSubmatch(line)

if len(matches) < 3 {
return "", "", ""
if len(matches) < 1 {
return ""
}

return matches[1], matches[2], matches[3]
return matches[1]
}

func main() {
Expand All @@ -121,8 +103,11 @@ func main() {
mustBeADirectory(directory)

// get the URL fragment
mustPassArgument(1, "url")
requestedURLPath := mustParseURLPath(flag.Arg(0))
mustPassArgument(1, "fileid")
fileid := flag.Arg(0)
if len(fileid) < 1 {
log.Fatal("fileid empty")
}

// files that are going to be deleted
var files []string
Expand All @@ -149,22 +134,14 @@ func main() {
}

// it contains a method, protocol and URL
_, _, u := parseProxyLine(line)
u := parseProxyLine(line)

if u == "" {
return fmt.Errorf("could not parse line %s", line)
}

// we want only the actual path of the URL
urlPath := mustParseURLPath(u)

// if the path is empty we have nothing to do
if urlPath == "" {
return nil
}

// finally we can match the URL
if strings.Contains(urlPath, requestedURLPath) {
if strings.Contains(u, fileid) {
files = append(files, path)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
]

intersphinx_mapping = {
"libres": ("http://libres.readthedocs.org/en/latest/", None)
"libres": ("https://libres.readthedocs.io/en/latest/", None)
}

autodoc_member_order = "bysource"
Expand Down
2 changes: 1 addition & 1 deletion docs/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ OneGov Reservation

Libres integration for OneGov Cloud. Libres is a python library to reserve stuff.

`Libres Documentation <https://libres.readthedocs.org/en/latest/>`_
`Libres Documentation <https://libres.readthedocs.io/en/latest/>`_

OneGov Search
^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/org.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Through Stripe we support payments in any module that supports formcode:
* Reservations

As Stripe is just a payment provider, we are able to add additional payment
providers, though it is certainly a lot of work.
providers, though it is certainly a lot of work.

User-Management
^^^^^^^^^^^^^^^
Expand Down
36 changes: 32 additions & 4 deletions src/onegov/activity/iso20022.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ def as_date(text: str | None) -> date | None:
valuta_date = as_date(first(entry, 'ValDt/Dt/text()'))
booking_text = first(entry, 'AddtlNtryInf/text()')

# Usually there are multiple TxDtls per Ntry
for d in entry.xpath('NtryDtls/TxDtls'):
tid = first(d, 'Refs/AcctSvcrRef/text()')
assert tid

yield Transaction(
booking_date=booking_date,
valuta_date=valuta_date,
booking_text=booking_text,
tid=first(d, 'Refs/AcctSvcrRef/text()'),
tid=tid,
amount=as_decimal(first(d, 'Amt/text()')),
currency=first(d, 'Amt/@Ccy'),
reference=first(d, 'RmtInf/Strd/CdtrRefInf/Ref/text()'),
Expand All @@ -168,6 +172,30 @@ def as_date(text: str | None) -> date | None:
invoice_schema=invoice_schema
)

# Postfinance QR entries have no TxDtls, but there reference number is
# in AddtlNtryInf
if not entry.xpath('NtryDtls/TxDtls') and entry.xpath('AddtlNtryInf'):
ref = re.search(
r'\b\d{27}\b', str(booking_text))
assert ref
reference = ref.group()

yield Transaction(
booking_date=booking_date,
valuta_date=valuta_date,
booking_text=booking_text,
tid=reference,
amount=as_decimal(first(entry, 'Amt/text()')),
currency=first(entry, 'Amt/@Ccy'),
reference=reference,
note=joined(entry, 'RmtInf/Ustrd/text()'),
credit=first(entry, 'CdtDbtInd/text()') == 'CRDT',
debitor=first(entry, 'RltdPties/Dbtr/Nm/text()'),
debitor_account=first(
entry, 'RltdPties/DbtrAcct/Id/IBAN/text()'),
invoice_schema=invoice_schema
)


def match_iso_20022_to_usernames(
xml: str,
Expand All @@ -182,9 +210,9 @@ def match_iso_20022_to_usernames(
Raises an error if the given xml cannot be processed.
:return: An iterator of transactions found in the xml file, together with
the matching username and a confidence attribute indicating how
certain the match is (1.0 indicating a sure match, 0.5 a possible match
and 0.0 a non-match).
the matching username and a confidence attribute indicating how
certain the match is (1.0 indicating a sure match, 0.5 a possible match
and 0.0 a non-match).
"""

Expand Down
2 changes: 1 addition & 1 deletion src/onegov/agency/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def filter_for_updated(
Refer to UPDATE_FILTER_PARAMS for all filter keywords.
:param filter_operation: the updated filter operation to be applied. For
allowed filters refer to UPDATE_FILTER_PARAMS
allowed filters refer to UPDATE_FILTER_PARAMS
:param filter_value: the updated filter value to filter for
:param result: the results to apply the filters on
:return: filter result
Expand Down
6 changes: 4 additions & 2 deletions src/onegov/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ def batch(self) -> dict['ApiEndpointItem[_M]', _M]:
def item_data(self, item: _M) -> dict[str, Any]:
""" Return the data properties of the collection item as a dictionary.
For example:
For example::
{
'name': 'Paul',
'age': 40
Expand All @@ -300,7 +301,8 @@ def item_links(self, item: _M) -> dict[str, Any]:
""" Return the link properties of the collection item as a dictionary.
Links can either be string or a linkable object.
For example:
For example::
{
'website': 'https://onegov.ch',
'friends': FriendsApiEndpoint(app).for_item(paul),
Expand Down
Loading

0 comments on commit e754307

Please sign in to comment.