Commit Graph

55 Commits

Author SHA1 Message Date
Oliver Günther 6f63faeed1 Extract and use charset to properly encode attachments 2026-05-29 10:26:43 +02:00
Oliver Günther 00b53996f1 Add tests 2026-01-09 11:55:38 +01:00
ulferts 0ecd09b06b rename to allowlist 2025-06-24 11:19:26 +02:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Kabiru Mwenja cf950cc75f Add attachment by activity comment API spec
Support contaner aliasing needed from "journal" to "activity"
2025-04-11 13:17:15 +03:00
Oliver Günther 12ee9e6b83 Merge remote-tracking branch 'origin/idea/56781-remove-years-from-copyrights' into dev 2024-08-06 10:17:59 +02:00
jenenliu 69f4cc2ff3 [#41852] fix undefined method path for nil class when click attachment
- bug: return 404 if local attachment file has been deleted
- https://community.openproject.org/wp/41852
2024-08-06 07:26:38 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther aec8632d38 Add spec 2024-05-22 11:31:10 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 2e1ebb827f Allow preparing WP attachment with only :add_work_package_attachments permission 2023-10-13 14:16:20 +02:00
Christophe Bliard 73a461c9a6 Make rubocop happier 2023-10-13 14:16:17 +02:00
Christophe Bliard efe2674851 Make attachment specs faster 2023-10-13 14:16:16 +02:00
ulferts 5b2bc41f41 Merge remote-tracking branch 'origin/dev' into easier-factory-role-setup 2023-10-12 12:09:27 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther 4a5a9050b6 [39561] Improve translation of whitelist error
This makes the error more user friendly

https://community.openproject.org/wp/39561
2021-11-02 11:27:00 +01:00
Markus Kahl 96e7f858c9 rubocop 2021-10-26 14:29:05 +01:00
Markus Kahl d86e2787c7 Merge branch 'release/11.4' into dev 2021-10-20 13:44:48 +01:00
Markus Kahl 320d1e77de fix direct upload for all content types 2021-10-14 21:00:38 +01:00
Oliver Günther 94e2d81201 Remove unused properties of not found example 2021-10-13 08:39:14 +02:00
Oliver Günther 0ed37a6e8a Fix specs 2021-09-20 09:22:44 +02:00
Oliver Günther f60b86da2d Add parser error if invalid metadata json 2021-09-20 09:22:40 +02:00
Oliver Günther b94b0e630d Fix filesize validation on prepared uploads 2021-09-20 09:22:39 +02:00
Oliver Günther 087360bad0 We no longer raise a multipart error when metadata is empty 2021-09-20 09:22:38 +02:00
Oliver Günther 2a8bb15d80 Fix expected validation message 2021-09-20 09:22:38 +02:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Oliver Günther e9d7c374cc [37868] Whitelist for attachment mime types and extensions on upload (#9431)
* Add setting for whitelist

* Make attachments API BaseServices compatible

* Add prepare service and contract

* Correctly pass the filename to the UploadedFile

* Add presence check to filename

* Fix expected validation message

* We no longer raise a multipart error when metadata is empty

* Fix filesize validation on prepared uploads

* Add parser error if invalid metadata json

* When attachment is not saved, use filename property

* Return correct error message on JSON parser erroro

* Fix specs

* Use attachment upload representer

* Fix direct uploads mocks with new service layer

* Lint

* Fix export job using attachment service

* Fix IFC controller using attachment prepare service

* Fix export job

* RenameRename params_getter to params_source

* Fix mail handler using attachment service

* Fix usage of attachment create service in documents

* Reuse shared examples for document attachment spec

* Fix stubbed attachment service in export job spec

* Use admin user in backup spec

* Fix export job for bim

* Fix attachment integration spec

* Fix issues_controller spec

* Make budget resource spec reuse common examples

* Fix attachment parsing representer spec

* Replace prepare part of attachment spec into separate service spec

* Clear cache for login spec

* Convert document create/update into services

* Budget services

* Allow options to be passed to property twin

* Remove setting author on budget initialize

* Replace meetings update with services

* Replace ifc models attachment handling with services

* Don't check uploader if changed by system

* Fix uploader being changed by system

* Replace wiki page attach_files with attachable services

* Replace avatar  saving

* Replace snapshot attach_files

* Skip double validation when container present

* Set snapshot through attachment service

* Remove attach_files

* Validate content type in contract

* Enforce writing the content type without accepting user input

* Expect changed content_type

* Fix content of viewpoint image to get correct content type

* Fix tsv spec

* Add create contract spec

* Bypass whitelist in internal services when conflicting with user

* Fix expects in specs after whitelist bypass

* Render contract errors for wiki

* Add before_hook to bodied to allow to pre-authorize permissions

* Budget errors from contract

* Document errors from contract
2021-07-14 14:43:19 +02:00
Oliver Günther 8df966abff Use the configured variable for expiry (#8985)
https://github.com/opf/openproject/pull/8941
2021-02-12 12:26:17 +00:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 3f8bf00aeb Merge branch 'release/11.1' into dev 2021-01-25 14:46:55 +01:00
Markus Kahl 51a40c97eb set content type of attachments in S3 (#8938)
* set content type of attachments in S3

* refactoring to allow amending and reading given metadata more easily

* confirm attachment content type is sent to S3
2021-01-25 09:33:05 +00:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Markus Kahl c1b82bad00 direct uploads to S3 for attachments including IFC models
Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2020-08-07 15:28:09 +01:00
ulferts 4cb0d0ff91 Feature/delayed bcf export (#8275)
* delayed bcf export

* remove unnecessary eager loading

* Update rxjs polling statement with loading indicator

* Avoid error handling due to JSON parsing

* delay all wp list exports

Co-authored-by: Oliver Günther <mail@oliverguenther.de>

[ci skip]
2020-04-20 16:16:01 +02:00
Oliver Günther 1255aff56a [32825] Cache external URLs for at max 604799 seconds (#8268)
Caching the redirect causes AWS links for more than that causes the
links to expire if they are still cached by the browser

https://community.openproject.com/wp/32825
2020-04-16 13:47:57 +02:00
ulferts 0b6d82c632 cache non avatar attachments for a year 2020-03-05 14:49:33 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Wieland Lindenthal 61c6bf5ec2 Fix for downloading attachments that are JSON files.
https://community.openproject.com/projects/openproject/work_packages/31661
2019-11-13 18:26:55 +01:00
ulferts 69883d86b5 Merge branch 'dev' into feature/extend_project_by_status 2019-09-30 10:27:44 +02:00