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

Webpack build optimization #3640

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bcd4670
Update Sentry config
riccio82 Oct 17, 2024
d4761ab
Improve webpack
riccio82 Oct 18, 2024
157fd42
Merge remote-tracking branch 'origin/login-required' into sentry-conf…
riccio82 Oct 18, 2024
4fa49a9
Update webpack
riccio82 Oct 18, 2024
6b37ce4
Merge branch 'login-required' into sentry-config-update
riccio82 Oct 21, 2024
6a7fd8d
Webpack optimizations
riccio82 Oct 21, 2024
b59cc19
Sentry: set release name
riccio82 Oct 21, 2024
61cb7e5
Clean common.scss
riccio82 Oct 22, 2024
0195f88
CSS: update css pages
riccio82 Oct 22, 2024
8c002ff
Merge remote-tracking branch 'origin/login-required' into sentry-conf…
riccio82 Oct 29, 2024
9b8af89
Refactoring css
riccio82 Oct 29, 2024
40a1866
Merge branch 'login-required' into sentry-config-update
riccio82 Nov 4, 2024
eb773f6
Merge branch 'develop' into sentry-config-update
riccio82 Nov 4, 2024
c4ab12c
update submodule
riccio82 Nov 4, 2024
1ad21a1
Merge branch 'develop' into sentry-config-update
riccio82 Nov 4, 2024
00b9827
refactoring css - wip
riccio82 Nov 4, 2024
c7d0005
Css refactoring: style.scss
riccio82 Nov 5, 2024
6c221bf
Refactoring css: upload_page.scss
riccio82 Nov 5, 2024
72da63a
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 5, 2024
2663c29
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 6, 2024
2eac222
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 6, 2024
04450bd
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 12, 2024
90354b6
Update yarn.lock
riccio82 Nov 12, 2024
3a8ff36
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 15, 2024
6a8fe66
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 19, 2024
ad4f2ff
Fix: Analyze button
riccio82 Nov 19, 2024
0df0c47
Fix: Analyze button
riccio82 Nov 19, 2024
1c880d6
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Nov 26, 2024
7207ed9
Fix: show supported files
riccio82 Nov 26, 2024
4b88ae8
Fix: comments tagging
riccio82 Nov 26, 2024
6328e4e
Update dependency webpack to v5.96.1 (#3710)
renovate[bot] Dec 2, 2024
9b43447
Update dependency react-hotkeys-hook to v4.6.1 (#3709)
renovate[bot] Dec 2, 2024
51040ae
Update dependency eslint-plugin-testing-library to v7 (#3711)
renovate[bot] Dec 2, 2024
ce48ca7
yarn.lock update
riccio82 Dec 2, 2024
0ab52c3
Merge remote-tracking branch 'origin/develop' into sentry-config-update
riccio82 Dec 4, 2024
5a35167
Update yarn lock
riccio82 Dec 4, 2024
22f4788
Css fix: profile modal
riccio82 Dec 4, 2024
1ef3cea
Fixed show tooltip dropdown
piedicianni Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/login-required' into sentry-conf…
…ig-update
  • Loading branch information
riccio82 committed Oct 29, 2024
commit 8c002ffb6b56cc0946df3a7187c4beb61f22cf54
2 changes: 1 addition & 1 deletion INSTALL/matecat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ CREATE TABLE `comments`
`uid` bigint(20) DEFAULT NULL,
`resolve_date` datetime DEFAULT NULL,
`source_page` tinyint(4) DEFAULT NULL,
`is_owner` tinyint(4) NOT NULL,
`is_anonymous` tinyint(4) NOT NULL DEFAULT 0,
`message_type` tinyint(4) DEFAULT NULL,
`message` text,
PRIMARY KEY (`id`),
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"ext-mbstring": "*",
"ext-zlib": "*",
"ext-gd": "*",
"ext-iconv": "*",
"orhanerday/open-ai": "^4.7",
"ext-openssl": "*",
"league/oauth2-linkedin": "^5.1",
Expand Down
2 changes: 1 addition & 1 deletion docker
6 changes: 3 additions & 3 deletions inc/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function notifyBootCompleted() {
$this->autoLoadedFeatureSet->run( 'bootstrapCompleted' );
}

public static function exceptionHandler( $exception ) {
public static function exceptionHandler( Throwable $exception ) {

Log::$fileName = 'fatal_errors.txt';

Expand All @@ -190,7 +190,7 @@ public static function exceptionHandler( $exception ) {
$message = "Conflict";
$response_message = $exception->getMessage();
Log::doJsonLog( [ "error" => 'The request could not be completed due to a conflict with the current state of the resource. - ' . "{$exception->getMessage()} ", "trace" => $exception->getTrace() ] );
} catch ( \PDOException $e ) {
} catch ( PDOException $e ) {
$code = 503;
$message = "Service Unavailable";
// \Utils::sendErrMailReport( $exception->getMessage() . "" . $exception->getTraceAsString(), 'Generic error' );
Expand All @@ -199,7 +199,7 @@ public static function exceptionHandler( $exception ) {
$code = 500;
$message = "Internal Server Error";
// \Utils::sendErrMailReport( $exception->getMessage() . "" . $exception->getTraceAsString(), 'Generic error' );
Log::doJsonLog( [ "error" => $exception->getMessage(), "trace" => $exception->getTrace() ] );
Log::doJsonLog( [ "ExceptionType" => get_class( $e ), "error" => $exception->getMessage(), "trace" => $exception->getTrace() ] );
}

if ( stripos( PHP_SAPI, 'cli' ) === false ) {
Expand Down
5 changes: 0 additions & 5 deletions inc/validation/schema/filters_extraction_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@
"yaml": {
"type": "object",
"properties": {
"extract_arrays": {
"type": "boolean",
"nullable": true,
"default": false
},
"translate_keys": {
"type": "array",
"nullable": true
Expand Down
37 changes: 11 additions & 26 deletions inc/validation/schema/project_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
"id_team": {
"type": ["integer", "string"]
},
"speech2text": {
"type": "boolean"
},
"lexica": {
"type": "boolean"
},
"tag_projection": {
"type": "boolean"
},
"pretranslate_100": {
"type": "boolean"
},
Expand All @@ -29,9 +20,17 @@
"get_public_matches": {
"type": "boolean"
},
"cross_language_matches": {
"type": ["null", "object"],
"$ref": "#/definitions/cross_language_matches"
"team_id": {
"type": ["null", "integer", "string"]
},
"subject": {
"type": ["null", "string"]
},
"source_language": {
"type": ["null", "string"]
},
"target_language": {
"type": ["null", "array"]
},
"segmentation_rule": {
"type": ["null", "object"]
Expand Down Expand Up @@ -63,24 +62,10 @@
"required": [
"name",
"id_team",
"speech2text",
"lexica",
"tag_projection",
"pretranslate_100",
"get_public_matches"
],
"definitions": {
"cross_language_matches": {
"type": ["null", "object"],
"properties": {
"primary": {
"type": ["null", "string"]
},
"secondary": {
"type": ["null", "string"]
}
}
},
"tm": {
"type": "object",
"properties": {
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/API/App/FilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
use API\Commons\AbstractStatefulKleinController;
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\LoginValidator;
use Chunks_ChunkStruct;
use Jobs_JobStruct;
use Files\FilesPartsDao;

class FilesController extends AbstractStatefulKleinController {

/**
* @var Chunks_ChunkStruct
* @var Jobs_JobStruct
*/
protected $chunk ;

public function setChunk( Chunks_ChunkStruct $chunk ){
public function setChunk( Jobs_JobStruct $chunk ){
$this->chunk = $chunk;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/API/App/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\LoginValidator;
use CatUtils;
use Chunks_ChunkStruct;
use Jobs_JobStruct;
use WordCount\WordCountStruct;

/**
Expand All @@ -19,11 +19,11 @@
class StatsController extends KleinController {

/**
* @var Chunks_ChunkStruct
* @var Jobs_JobStruct
*/
protected $chunk;

public function setChunk( Chunks_ChunkStruct $chunk ) {
public function setChunk( Jobs_JobStruct $chunk ) {
$this->chunk = $chunk;
}

Expand Down
12 changes: 6 additions & 6 deletions lib/Controller/API/Commons/KleinController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ abstract class KleinController implements IController {
/**
* @var array
*/
public $params;
public array $params = [];

/**
* @var FeatureSet
* @var ?FeatureSet
*/
protected $featureSet;
protected ?FeatureSet $featureSet = null;

/**
* @return FeatureSet
*/
public function getFeatureSet() {
public function getFeatureSet(): FeatureSet {
return $this->featureSet;
}

Expand All @@ -74,7 +74,7 @@ public function getFeatureSet() {
*
* @return $this
*/
public function setFeatureSet( FeatureSet $featureSet ) {
public function setFeatureSet( FeatureSet $featureSet ): KleinController {
$this->featureSet = $featureSet;

return $this;
Expand Down Expand Up @@ -121,7 +121,7 @@ public function __construct( $request, $response, $service, $app ) {
* @throws ReflectionException
* @throws Exception
*/
public function refreshClientSessionIfNotApi(){
public function refreshClientSessionIfNotApi() {
if ( empty( $this->api_key ) ) {
Bootstrap::sessionStart();
AuthenticationHelper::refreshSession( $_SESSION );
Expand Down
11 changes: 6 additions & 5 deletions lib/Controller/API/Commons/Validators/ChunkPasswordValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
namespace API\Commons\Validators;

use API\Commons\KleinController;
use Chunks_ChunkStruct;
use Jobs_JobStruct;
use Exceptions\NotFoundException;
use Jobs_JobDao;
use LQA\ChunkReviewDao;
use LQA\ChunkReviewStruct;
use ReflectionException;

class ChunkPasswordValidator extends Base {
/**
* @var \Chunks_ChunkStruct
* @var \Jobs_JobStruct
*/
protected $chunk;

Expand Down Expand Up @@ -95,12 +96,12 @@ protected function getChunkFromRevisePassword() {
}

/**
* @throws NotFoundException
* @throws ReflectionException
*/
protected function getChunkFromTranslatePassword() {
$this->chunk = Jobs_JobDao::getByIdAndPassword( $this->request->id_job, $this->request->password, 0, new Chunks_ChunkStruct );
$this->chunk = Jobs_JobDao::getByIdAndPassword( $this->request->id_job, $this->request->password, 0, new Jobs_JobStruct );
if ( !empty( $this->chunk ) ) {
$this->chunkReview = @( new ChunkReviewDao() )->findChunkReviews( $this->chunk )[ 0 ];
$this->chunkReview = ( new ChunkReviewDao() )->findChunkReviews( $this->chunk )[ 0 ] ?? null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

class JobPasswordValidator extends Base {
/**
* @var \Jobs_JobStruct
* @var Jobs_JobStruct
*/
private $jStruct;
private Jobs_JobStruct $jStruct;

/**
* @var KleinController
Expand Down
42 changes: 34 additions & 8 deletions lib/Controller/API/NewController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

use API\Commons\Exceptions\AuthenticationError;
use Constants\ConversionHandlerStatus;
use Conversion\ConvertedFileModel;
use Exceptions\NotFoundException;
use Exceptions\ValidationError;
use FilesStorage\AbstractFilesStorage;
use FilesStorage\FilesStorageFactory;
use Filters\FiltersConfigTemplateDao;
Expand All @@ -14,6 +17,8 @@
use ProjectQueue\Queue;
use QAModelTemplate\QAModelTemplateDao;
use QAModelTemplate\QAModelTemplateStruct;
use TaskRunner\Exceptions\EndQueueException;
use TaskRunner\Exceptions\ReQueueException;
use Teams\MembershipDao;
use TMS\TMSService;
use Validator\EngineValidator;
Expand Down Expand Up @@ -128,6 +133,11 @@ class NewController extends ajaxController {

private $xliff_parameters;

private $dictation;
private $show_whitespace;
private $character_counter;
private $ai_assistant;

private function setBadRequestHeader() {
$this->httpHeader = 'HTTP/1.0 400 Bad Request';
}
Expand Down Expand Up @@ -203,6 +213,10 @@ public function __construct() {
'tag_projection' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'project_completion' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'get_public_matches' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ], // disable public TM matches
'dictation' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'show_whitespace' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'character_counter' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'ai_assistant' => [ 'filter' => FILTER_VALIDATE_BOOLEAN ],
'instructions' => [
'filter' => FILTER_SANITIZE_STRING,
'flags' => FILTER_REQUIRE_ARRAY,
Expand Down Expand Up @@ -370,6 +384,15 @@ public function finalize() {
echo $toJson;
}

/**
* @throws ReQueueException
* @throws AuthenticationError
* @throws ValidationError
* @throws NotFoundException
* @throws EndQueueException
* @throws ReflectionException
* @throws Exception
*/
public function doAction() {

$fs = FilesStorageFactory::create();
Expand Down Expand Up @@ -578,9 +601,7 @@ public function doAction() {
if ( isset( $this->result[ 'data' ] ) && !empty( $this->result[ 'data' ] ) ) {
foreach ( $this->result[ 'data' ] as $zipFileName => $zipFiles ) {
$zipFiles = json_decode( $zipFiles, true );


$fileNames = Utils::array_column( $zipFiles, 'name' );
$fileNames = array_column( $zipFiles, 'name' );
$arFiles = array_merge( $arFiles, $fileNames );
}
}
Expand Down Expand Up @@ -650,6 +671,11 @@ public function doAction() {
$projectStructure[ 'pretranslate_100' ] = (int)!!$this->postInput[ 'pretranslate_100' ]; // Force pretranslate_100 to be 0 or 1
$projectStructure[ 'pretranslate_101' ] = isset( $this->postInput[ 'pretranslate_101' ] ) ? (int)$this->postInput[ 'pretranslate_101' ] : 1;

$projectStructure['dictation'] = $this->postInput['dictation'] ?? null;
$projectStructure['show_whitespace'] = $this->postInput['show_whitespace'] ?? null;
$projectStructure['character_counter'] = $this->postInput['character_counter'] ?? null;
$projectStructure['ai_assistant'] = $this->postInput['ai_assistant'] ?? null;

//default get all public matches from TM
$projectStructure[ 'only_private' ] = ( !isset( $this->postInput[ 'get_public_matches' ] ) ? false : !$this->postInput[ 'get_public_matches' ] );

Expand Down Expand Up @@ -746,11 +772,11 @@ public function doAction() {
* @param $filename
*
* @return array
* @throws \API\Commons\Exceptions\AuthenticationError
* @throws \Exceptions\NotFoundException
* @throws \Exceptions\ValidationError
* @throws \TaskRunner\Exceptions\EndQueueException
* @throws \TaskRunner\Exceptions\ReQueueException
* @throws AuthenticationError
* @throws NotFoundException
* @throws ValidationError
* @throws EndQueueException
* @throws ReQueueException
*/
private function getFileMetadata( $filename ) {
$info = XliffProprietaryDetect::getInfo( $filename );
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/API/V1/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
use API\Commons\Validators\ChunkPasswordValidator;
use CatUtils;
use API\V2\Validators\LoginValidator;
use Chunks_ChunkStruct;
use Jobs_JobStruct;
use WordCount\WordCountStruct;

class StatsController extends KleinController {

/**
* @var Chunks_ChunkStruct
* @var Jobs_JobStruct
*/
protected $chunk ;

public function setChunk( Chunks_ChunkStruct $chunk ){
public function setChunk( Jobs_JobStruct $chunk ){
$this->chunk = $chunk;
}

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.