Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/alchemy-fr/phrasea into P…
Browse files Browse the repository at this point in the history
…S-635-filter-and-configure-field
  • Loading branch information
aynsix committed Sep 25, 2024
2 parents d48758b + c8a623e commit fc050cd
Show file tree
Hide file tree
Showing 40 changed files with 540 additions and 410 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@ public function configure(OutputInterface $output, array $presets): void
}
}

$defaultAdminUsername = getenv('DEFAULT_ADMIN_USERNAME');
$defaultAdminEmail = $defaultAdminUsername;
if (!str_contains($defaultAdminEmail, '@')) {
$defaultAdminEmail .= '@'.(getenv('PHRASEA_DOMAIN') ?: 'phrasea.io');
}

$defaultAdmin = $this->keycloakManager->createUser([
'username' => getenv('DEFAULT_ADMIN_USERNAME'),
'email' => getenv('DEFAULT_ADMIN_USERNAME').'@'.getenv('PHRASEA_DOMAIN'),
'username' => $defaultAdminUsername,
'email' => $defaultAdminEmail,
'enabled' => true,
'firstName' => 'Admin',
'lastName' => 'Admin',
Expand Down
2 changes: 1 addition & 1 deletion databox/api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"ext-imagick": "*",
"ext-json": "*",
"ext-sodium": "*",
"alchemy/acl-bundle": "dev-main",
"alchemy/acl-bundle": "^0.2.1",
"alchemy/admin-bundle": "@dev",
"alchemy/auth-bundle": "*",
"alchemy/core-bundle": "@dev",
Expand Down
46 changes: 22 additions & 24 deletions databox/api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 38 additions & 17 deletions databox/api/fixtures/Newspaper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,51 @@ App\Entity\Core\RenditionDefinition:
name: preview
class: '@n_rc_public'
useAsPreview: true
parent: '@n_rd_original'
definition: |
image:
transformations: &image_transformations
-
module: imagine
options:
filters:
auto_rotate: ~
thumbnail:
size: \[ 600, 600 ]
mode: inset
animation:
transformations: *image_transformations
document:
transformations:
- module: document_to_pdf
n_rd_thumbnail (extends rendition_definition_n):
name: thumbnail
class: '@n_rc_public'
useAsThumbnail: true
n_rd_preview_mobile (extends rendition_definition_n):
name: preview_mobile
class: '@n_rc_public'
useAsPreview: true
priority: 1
n_rd_thumbnail_mobile (extends rendition_definition_n):
name: thumbnail_mobile
class: '@n_rc_public'
useAsThumbnail: true
priority: 1
parent: '@n_rd_preview'
definition: |
image:
transformations: &image_transformations
-
module: imagine
options:
filters:
auto_rotate: ~
thumbnail:
size: \[ 150, 150 ]
mode: inset
animation:
transformations: *image_transformations
document:
transformations:
- module: pdf_to_image
n_rd_thumbnailActive (extends rendition_definition_n):
name: thumbnailActive
class: '@n_rc_public'
useAsThumbnailActive: true
parent: '@n_rd_thumbnail'

# Groups:
# reporter_sport_football_league
Expand Down Expand Up @@ -463,14 +490,8 @@ App\Entity\Integration\WorkspaceIntegration:
integration: tui.photo-editor
workspace: '@w_newspaper'
wi_renditions:
integration: phraseanet.renditions
integration: core.rendition
workspace: '@w_newspaper'
config:
databoxId: 1
method: api
renditions:
- thumbnail
- preview
wi_watermark:
integration: core.watermark
workspace: '@w_newspaper'
Expand Down
7 changes: 6 additions & 1 deletion databox/api/src/Asset/RenditionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public function buildRendition(RenditionDefinition $renditionDefinition, Asset $
return;
}

$buildDef = $renditionDefinition->getDefinition();
if (empty($buildDef)) {
return;
}

if (null !== $parentDefinition = $renditionDefinition->getParent()) {
$parentRendition = $this->renditionManager->getAssetRenditionByDefinition($asset, $parentDefinition);
if (null === $parentRendition) {
Expand All @@ -66,7 +71,7 @@ public function buildRendition(RenditionDefinition $renditionDefinition, Asset $
$metadataContainer = new AssetMetadataContainer($asset, $this->attributesResolver, $this->assetTitleResolver);

try {
$outputFile = $this->createRendition($source, $renditionDefinition->getDefinition(), $metadataContainer);
$outputFile = $this->createRendition($source, $buildDef, $metadataContainer);

if (null !== $outputFile) {
$file = $this->fileManager->createFileFromPath(
Expand Down
1 change: 0 additions & 1 deletion databox/api/src/Border/BorderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Border;

use Alchemy\StorageBundle\Storage\FileStorageManager;
use App\Border\Exception\FileInputValidationException;
use App\Border\Model\FileContent;
use App\Border\Model\InputFile;
use App\Entity\Core\File;
Expand Down
1 change: 0 additions & 1 deletion databox/api/src/Workflow/Action/AcceptFileAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use App\Border\Model\InputFile;
use App\Border\UploaderClient;
use App\Entity\Core\Asset;
use App\Entity\Core\File;
use Doctrine\ORM\EntityManagerInterface;

readonly class AcceptFileAction implements ActionInterface
Expand Down
6 changes: 5 additions & 1 deletion databox/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
ignorePatterns: [
'dist',
'.eslintrc.cjs',
'src/TestMorph.tsx',
],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', 'unused-imports'],
rules: {
Expand Down
Loading

0 comments on commit fc050cd

Please sign in to comment.