Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add images use generic search index only #7

Merged
merged 33 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2558c3a
Add images use generic search index only
alexz707 Feb 28, 2024
94cff6f
Apply php-cs-fixer changes
alexz707 Feb 28, 2024
32f45a6
Fix issues, update to new generic data index version
alexz707 Feb 28, 2024
3be0baa
Apply php-cs-fixer changes
alexz707 Feb 28, 2024
dc23c1b
Fix issues, update to new generic data index version
alexz707 Feb 28, 2024
c17950a
Add folder filter
alexz707 Feb 28, 2024
5f5db7c
Apply php-cs-fixer changes
alexz707 Feb 28, 2024
697d3e6
Add issue template
alexz707 Feb 28, 2024
6230cd1
Merge branch '1.x' into 0x-First-Prototype
alexz707 Feb 28, 2024
2c9c940
Add icon to serializer
alexz707 Feb 29, 2024
4c15c69
Add csv icon, fix default icons
alexz707 Feb 29, 2024
f1d7a1e
Update min php version to 8.2
alexz707 Feb 29, 2024
719305d
Update min php version to 8.2
alexz707 Feb 29, 2024
be61c50
Update min php version to 8.2
alexz707 Feb 29, 2024
8bd9ef7
Update min php version to 8.2
alexz707 Feb 29, 2024
b2f85ca
Add AssetPathFilter, add Search object
alexz707 Mar 4, 2024
78c47ad
Apply php-cs-fixer changes
alexz707 Mar 4, 2024
73d0ca5
qodana fixes
alexz707 Mar 4, 2024
32492cf
Update License Information (#11)
mattamon Mar 4, 2024
c20d2d8
Authentication / Authorization (#9)
mattamon Mar 5, 2024
91fe9ad
Translation endpoint (#10)
mattamon Mar 5, 2024
06d3c87
Fix generic data index changes
alexz707 Mar 5, 2024
d365809
Fix generic data index changes
alexz707 Mar 5, 2024
0cb80a3
Apply php-cs-fixer changes
alexz707 Mar 5, 2024
8443d8e
Set reporting level to 6
mattamon Mar 5, 2024
7e8b19f
Update to getBoolean
mattamon Mar 5, 2024
4ca7584
Adding version node
mattamon Mar 5, 2024
4e0dda4
Cleanup
alexz707 Mar 6, 2024
2c21f92
Remove type from metadata
mattamon Mar 6, 2024
b997cec
Remove type from serialization
mattamon Mar 6, 2024
b444d32
Add exceptions
mattamon Mar 6, 2024
0951625
Refactor runtimexceptions to exceptions
mattamon Mar 6, 2024
b59dfa4
Add high efferent coupling and code duplication to baseline
mattamon Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug-Report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: [Bug]
body:
- type: input
attributes:
label: Studio API version
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
validations:
required: true
3 changes: 1 addition & 2 deletions .github/workflows/codeception.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
strategy:
matrix:
include:
- { php-version: 8.1, dependencies: lowest, pimcore_version: "", experimental: false }
- { php-version: 8.2, dependencies: highest, pimcore_version: "", experimental: false }
- { php-version: 8.2, dependencies: lowest, pimcore_version: "", experimental: false }

steps:
- name: "Checkout code"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: "PHP-CS-Fixer"
on:
pull_request:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "feature-*"
- "*"
push:
branches:
- "[0-9]+.[0-9]+"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- '*'
- '**'

version: 1.0
jobs:
qodana:
timeout-minutes: 15
Expand All @@ -37,7 +38,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
ini-values: memory_limit=-1, date.timezone='UTC'
coverage: xdebug
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
strategy:
matrix:
include:
- { php-version: "8.1", dependencies: "lowest", experimental: false }
- { php-version: "8.2", dependencies: "highest", experimental: false }
- { php-version: "8.2", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true }
steps:
Expand Down
7 changes: 5 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => 'Pimcore' . PHP_EOL . PHP_EOL .
'This source file is available under following license:' . PHP_EOL .
'This source file is available under two different licenses:' . PHP_EOL .
'- GNU General Public License version 3 (GPLv3)' . PHP_EOL .
'- Pimcore Commercial License (PCL)' . PHP_EOL .
'Full copyright and license information is available in' . PHP_EOL .
'LICENSE.md which is distributed with this source code.' . PHP_EOL .
PHP_EOL .
' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL .
' @license http://www.pimcore.org/license PCL'
' @license http://www.pimcore.org/license GPLv3 and PCL'
],

'blank_line_before_statement' => true,
Expand Down
31 changes: 28 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
# License
Copyright (C) Pimcore GmbH

This software is available under following license:
This software is available under two different licenses:
* GNU General Public License version 3 (GPLv3) as Pimcore Community Edition
* Pimcore Commercial License (PCL)

The default Pimcore license, without a valid Pimcore Commercial License agreement, is the Open-Source GPLv3 license.

## GNU General Public License version 3 (GPLv3)
If you decide to choose the GPLv3 license, you must comply with the following terms:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

## Pimcore Commercial License (PCL)
Commercial and supported versions of the program - also known as
Alternatively, commercial and supported versions of the program - also known as
Commercial Distributions - must be used in accordance with the terms and conditions
contained in a separate written agreement between you and Pimcore GmbH.
For more information about the Pimcore Commercial License (PCL) please contact info@pimcore.com.
For more information about the Pimcore Commercial License (PCL) please contact info@pimcore.com.



Please see also (files in this directory):
- [Licensing FAQ - license-faq.md](https://github.com/pimcore/pimcore/blob/master/license-faq.md)
- [GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - gpl-3.0.txt](gpl-3.0.txt)
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": "~8.1.0 || ~8.2.0",
"php": "~8.2",
"pimcore/static-resolver-bundle": "^1.3",
"pimcore/generic-data-index-bundle": "1.x-dev",
"pimcore/pimcore": "^11.0",
Expand All @@ -30,7 +30,7 @@
"codeception/phpunit-wrapper": "^9",
"codeception/module-asserts": "^2",
"codeception/module-symfony": "^3.1.1",
"phpstan/phpstan": "^1.10.5",
"phpstan/phpstan": "1.10.5",
"phpstan/phpstan-symfony": "^1.2.20",
"phpunit/phpunit": "10.2.7",
"nyholm/psr7": "^1",
Expand Down
11 changes: 8 additions & 3 deletions config/api_platform/resources/asset.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Asset:
#security: 'is_granted("API_PLATFORM")'
operations:
ApiPlatform\Metadata\GetCollection:
filters: [ Pimcore\Bundle\StudioApiBundle\Filter\AssetParentIdFilter ]
filters:
- Pimcore\Bundle\StudioApiBundle\Filter\AssetParentIdFilter
- Pimcore\Bundle\StudioApiBundle\Filter\AssetIdSearchFilter
- Pimcore\Bundle\StudioApiBundle\Filter\AssetExcludeFolderFilter
- Pimcore\Bundle\StudioApiBundle\Filter\AssetPathFilter
paginationClientItemsPerPage: true
ApiPlatform\Metadata\Get:
normalizationContext:
groups: [ 'asset:read', 'asset:item:get', 'dependency:read', 'property:read']
groups: [ 'asset:read', 'asset:item:get', 'dependency:read', 'property:read', 'element:read', 'element:item:get']
ApiPlatform\Metadata\Put:
ApiPlatform\Metadata\Post:
ApiPlatform\Metadata\Delete:
ApiPlatform\Metadata\Patch:
provider: Pimcore\Bundle\StudioApiBundle\State\AssetProvider
normalizationContext:
groups: ['asset:read', 'dependency:read', 'property:read']
groups: ['asset:read', 'dependency:read', 'property:read', 'element:read']
denormalizationContext:
groups: ['asset:write']
properties:
Expand Down
14 changes: 14 additions & 0 deletions config/api_platform/resources/asset/document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Asset\Document:
provider: Pimcore\Bundle\StudioApiBundle\State\AssetProvider
operations:
ApiPlatform\Metadata\Get:
normalizationContext:
groups: ['document:read', 'asset:read', 'asset:item:get', 'dependency:read', 'property:read', 'element:read', 'element:item:get' ]
properties:
id:
identifier: true
normalizationContext:
groups: ['document:read', 'asset:read', 'dependency:read', 'property:read', 'element:read']
denormalizationContext:
groups: ['document:write', 'asset:write']
8 changes: 6 additions & 2 deletions config/api_platform/resources/asset/image.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Asset\Image:
provider: Pimcore\Bundle\StudioApiBundle\State\AssetProvider
operations:
ApiPlatform\Metadata\Get:
normalizationContext:
groups: ['image:read', 'asset:read', 'asset:item:get', 'dependency:read', 'property:read', 'element:read', 'element:item:get' ]
properties:
id:
identifier: true
normalizationContext:
groups: ['image:read', 'asset:read', 'task:read', 'dependency:read', 'property:read', 'version:read']
groups: ['image:read', 'asset:read', 'dependency:read', 'property:read', 'element:read']
denormalizationContext:
groups: ['image:write', 'asset:write']
groups: ['image:write', 'asset:write']
14 changes: 14 additions & 0 deletions config/api_platform/resources/asset/video.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Asset\Video:
provider: Pimcore\Bundle\StudioApiBundle\State\AssetProvider
operations:
ApiPlatform\Metadata\Get:
normalizationContext:
groups: ['video:read', 'asset:read', 'asset:item:get', 'dependency:read', 'property:read', 'element:read', 'element:item:get' ]
properties:
id:
identifier: true
normalizationContext:
groups: ['video:read', 'asset:read', 'dependency:read', 'property:read', 'element:read']
denormalizationContext:
groups: ['video:write', 'asset:write']
13 changes: 13 additions & 0 deletions config/api_platform/resources/token/create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Token\Create:
shortName: Token-Create
operations:
ApiPlatform\Metadata\Post:
processor: Pimcore\Bundle\StudioApiBundle\State\Token\Create\Processor
output: Pimcore\Bundle\StudioApiBundle\Dto\Token\Output
uriTemplate: '/token/create'
openapiContext:
summary: 'Creates and returns a token'

normalizationContext:
groups: [ 'token:read' ]
13 changes: 13 additions & 0 deletions config/api_platform/resources/token/refresh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Token\Refresh:
shortName: Token-Refresh
operations:
ApiPlatform\Metadata\Post:
processor: Pimcore\Bundle\StudioApiBundle\State\Token\Refresh\Processor
output: Pimcore\Bundle\StudioApiBundle\Dto\Token\Output
uriTemplate: '/token/refresh'
openapiContext:
summary: 'Refreshes an existing token'

normalizationContext:
groups: [ 'tokenrefresh:read' ]
12 changes: 12 additions & 0 deletions config/api_platform/resources/translation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Translation:
#security: 'is_granted("PUBLIC_API_PLATFORM", "translation")'
operations:
ApiPlatform\Metadata\Post:
processor: Pimcore\Bundle\StudioApiBundle\State\TranslationProcessor
uriTemplate: '/translations'
openapiContext:
summary: 'Getting translations based on context'

normalizationContext:
groups: [ 'translation:read' ]
5 changes: 4 additions & 1 deletion config/api_platform/resources/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ resources:
input: Pimcore\Bundle\StudioApiBundle\Dto\ResetPasswordRequest
output: false
uriTemplate: '/users/reset-password'

ApiPlatform\Metadata\Get:
normalizationContext:
groups: [ 'user:read' ]
provider: Pimcore\Bundle\StudioApiBundle\State\UserProvider
normalizationContext:
groups: [ 'get' ]
denormalizationContext:
Expand Down
20 changes: 20 additions & 0 deletions config/pimcore/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
api_platform:
title: 'Pimcore Studio API'
description: 'API for Pimcore Studio UI'
version: 0.0.1
graphql:
graphql_playground: false
graphiql:
enabled: false
event_listeners_backward_compatibility_layer: false
keep_legacy_inflector: false
enable_docs: true
enable_entrypoint: false
enable_swagger_ui: false
enable_re_doc: false
show_webby: false
swagger:
api_keys:
access_token:
name: 'Authorization'
type: 'header'
6 changes: 3 additions & 3 deletions config/pimcore/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api_platform:
resource: .
type: api_platform
prefix: /api
resource: .
type: api_platform
prefix: /api
36 changes: 4 additions & 32 deletions config/serialization/asset.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
Pimcore\Bundle\StudioApiBundle\Dto\Asset:
attributes:
id:
groups: ['asset:read']
parentId:
groups: ['asset:read']
permissions:
groups: [ 'asset:read' ]
type:
groups: ['asset:read']
iconName:
groups: [ 'asset:read' ]
children:
groups: ['asset:read']
filename:
groups: ['asset:read']
path:
groups: ['asset:read']
mimetype:
groups: ['asset:read']
creationDate:
groups: ['asset:read']
modificationDate:
groups: ['asset:read']
userOwner:
groups: ['asset:read']
userModification:
groups: ['asset:read']
properties:
groups: ['asset:item:get']
versions:
groups: ['asset:read']
metadata:
groups: ['asset:read']
locked:
groups: ['asset:read']
lock:
groups: ['asset:read']
customSettings:
groups: ['asset:item:get']
hasMetaData:
groups: ['asset:read']
dependencies:
groups: ['asset:item:get']
scheduledTasks:
groups: ['asset:item:get']
versionCount:
groups: ['asset:item:get']
fullPath:
groups: ['asset:read']
userPermissions:
groups: ['asset:read']
6 changes: 6 additions & 0 deletions config/serialization/asset/document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Pimcore\Bundle\StudioApiBundle\Dto\Asset\Document:
attributes:
pageCount:
groups: ['document:read', 'asset:read']
imageThumbnailPath:
groups: ['document:read', 'asset:read']
Loading
Loading