-
Notifications
You must be signed in to change notification settings - Fork 279
π style: update design system and UI components #4307
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
base: develop
Are you sure you want to change the base?
Changes from all commits
eb7cdd8
b8ce809
d73d918
a9d180a
99e4bfe
ee2a0aa
8b1cbf3
44e289c
76f79a9
8076165
7ec8715
d29be24
95acec1
c561aed
13322e8
8cfd1a5
fed2ff3
452c1ae
ed879a8
cc58aea
2acc606
ea92e2f
216f1ac
f944a2f
afec518
434e4f6
6e50a1b
ec80b4d
f47fc75
ac34df1
6736c04
686b8cd
0f41afe
0a49724
2b616c6
d45fb94
51edea1
7061ad0
134dfff
614714f
cf54d70
3ea8e73
d591480
8ce16f2
845a99d
320b245
9b1fb7d
33f2850
df698ab
7da661d
ee49db4
9b2ac3d
e6cb52f
72fb6d5
5765dc5
5d1df79
e8fc436
456f39a
dd8d2ee
9e9ec13
37fbf6e
81de77f
000397b
949418f
70a91d7
808de77
c9efc01
c212c98
71e927a
c3dce0f
3820238
e68e42c
89f402b
9d9fadf
a4cf2db
9806e8d
a0b7bd4
eaec914
1ce6a96
f6495d4
ba923be
8294cfa
d5f8ff3
75d3469
fe96e59
0ff6726
6ee8edf
debcb82
dd80cd1
a1b02b1
46100b9
0abc1ab
8bec629
659ae21
04f1707
3df8a66
d662e55
9d69dc6
6429b32
d4655c0
4de50e3
6701297
8d41ae7
493ab6f
774d4e5
db43af1
a853eab
0e28b3d
95d9e77
1e71608
c25622d
b894513
160a719
2584450
e1e4bb5
7791a09
53994f4
c2dfb6c
1bde4dd
5361281
497b02f
dab80e8
5b10673
72aca9d
9b47e2e
25bf443
ef55af7
b07d0eb
f9d5c37
0b36c3d
355d0d6
279f2fa
6d082e9
73f48c5
572c342
8ba3551
246ef9b
cdee7a8
4231e74
35e1a7a
67cb178
ec82ea7
913984a
a358731
d537960
b472c7b
b199032
345e9ca
e25384c
be2e92c
fa563d2
6df9b29
74f5f49
63c1dae
5bfce7e
fd9b8d2
81927c3
4039aee
e574af5
30c9431
b0e22a0
6331040
fbac24e
f4ede36
0214704
252c077
93590a6
1fb0738
088bc29
18b8124
4950caf
9f7ae41
8977969
454f384
977176f
066d54e
d2db84b
ed7fa22
52e7c5e
7ae5a83
5f3637b
d7154cf
4ec0735
fe24255
68edcbe
7d8488c
371d35c
398d60a
015677d
0eb5258
540f0c4
d406fa6
013f8a2
0566731
d049051
f90ecd0
4f2dcc3
0ffea61
19bf99c
6b962bf
0e24fca
37da0ab
573fc58
d11daea
13e0158
ffb1088
5ea257f
22a3f38
30a40a0
e22b172
c967574
099bbc2
8192be0
fd954a2
29fe1a4
ff3a33f
6e81ebd
35bbc34
31b9dc4
76b5fc7
ac43587
a0b7c39
d889bb6
5ba01d0
46ddf7b
af4a233
d737bc5
d69ea6c
846a55b
7e85130
ecf7cea
b25a29f
7e51347
040c1fa
0922a3e
830d2be
943f920
7cc0dab
9e6902d
7e5eaa6
bdb7a0c
a9b6b5a
7fe5539
3a3e957
17c39ad
c7d3c91
3b71841
a523160
81d72b3
594c29b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| .* | ||
| !/.gitignore | ||
| !/.stylelintrc.json | ||
| # IDE stuffs | ||
| .settings | ||
| .idea | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| { | ||
| "extends": ["stylelint-config-standard-scss"], | ||
| "plugins": ["stylelint-selector-bem-pattern"], | ||
| "rules": { | ||
| "max-nesting-depth": [ | ||
| 3, | ||
| { | ||
| "ignoreAtRules": ["media", "supports", "include", "each", "if", "else"], | ||
| "ignoreRules": ["/^&/"], | ||
| "severity": "warning" | ||
| } | ||
| ], | ||
| "declaration-no-important": [ | ||
| true, | ||
| { | ||
| "severity": "warning" | ||
| } | ||
| ], | ||
| "selector-class-pattern": null, | ||
| "scss/at-rule-no-unknown": true, | ||
| "scss/dollar-variable-pattern": null, | ||
| "no-descending-specificity": null, | ||
| "color-function-notation": null, | ||
| "color-function-alias-notation": null, | ||
| "alpha-value-notation": null, | ||
| "shorthand-property-no-redundant-values": null, | ||
| "declaration-block-no-redundant-longhand-properties": null, | ||
| "value-keyword-case": null, | ||
| "rule-empty-line-before": null, | ||
| "at-rule-empty-line-before": null, | ||
| "comment-empty-line-before": null, | ||
| "comment-whitespace-inside": null, | ||
| "custom-property-empty-line-before": null, | ||
| "declaration-empty-line-before": null, | ||
| "custom-property-pattern": null, | ||
| "length-zero-no-unit": null, | ||
| "selector-pseudo-element-colon-notation": null, | ||
| "property-no-vendor-prefix": null, | ||
| "value-no-vendor-prefix": null, | ||
| "media-feature-range-notation": null, | ||
| "declaration-block-single-line-max-declarations": null, | ||
| "scss/double-slash-comment-whitespace-inside": null, | ||
| "scss/double-slash-comment-empty-line-before": null, | ||
| "function-url-quotes": null, | ||
| "property-no-deprecated": null, | ||
| "block-no-empty": null, | ||
| "declaration-block-no-duplicate-properties": null, | ||
| "selector-not-notation": null, | ||
| "font-family-name-quotes": null, | ||
| "selector-id-pattern": null, | ||
| "selector-no-vendor-prefix": null, | ||
| "scss/load-partial-extension": null, | ||
| "number-max-precision": null, | ||
| "font-family-no-missing-generic-family-keyword": null, | ||
| "selector-type-no-unknown": null, | ||
| "selector-attribute-quotes": null, | ||
| "property-no-unknown": null, | ||
| "no-irregular-whitespace": null, | ||
| "keyframes-name-pattern": null, | ||
| "declaration-property-value-keyword-no-deprecated": null, | ||
| "scss/dollar-variable-empty-line-before": null, | ||
| "scss/operator-no-unspaced": null, | ||
| "scss/dollar-variable-colon-space-after": null, | ||
| "scss/dollar-variable-colon-space-before": null, | ||
| "at-rule-no-vendor-prefix": null, | ||
| "media-feature-name-no-vendor-prefix": null, | ||
| "declaration-block-no-shorthand-property-overrides": null, | ||
| "media-feature-name-no-unknown": null, | ||
| "no-empty-source": null, | ||
| "color-hex-length": null, | ||
| "scss/load-no-partial-leading-underscore": null, | ||
| "scss/comment-no-empty": null | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.module.scss"], | ||
| "plugins": ["stylelint-selector-bem-pattern"], | ||
| "rules": { | ||
| "max-nesting-depth": 3, | ||
| "declaration-no-important": true, | ||
| "plugin/selector-bem-pattern": { | ||
| "preset": "bem", | ||
| "componentSelectors": { | ||
| "initial": "^\\.{componentName}(?:__[a-z][a-z0-9-]*)?(?:--[a-z][a-z0-9-]*)?$" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "files": [ | ||
| "public/css/sass/style.scss", | ||
| "public/css/sass/commons/_manage.scss", | ||
| "public/css/sass/commons/_outsource.scss", | ||
| "public/css/sass/commons/_analyze.scss", | ||
| "public/css/sass/mbc-style.scss" | ||
| ], | ||
| "rules": { | ||
| "max-nesting-depth": null, | ||
| "declaration-no-important": null | ||
| } | ||
| }, | ||
| { | ||
| "files": ["public/css/sass/vendor_mc/**"], | ||
| "rules": { | ||
| "max-nesting-depth": null, | ||
| "declaration-no-important": null, | ||
| "no-duplicate-selectors": null | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -60,7 +60,7 @@ version: | |||||
| b) under the GNU GPL, with none of the additional permissions of | ||||||
| this License applicable to that copy. | ||||||
|
|
||||||
| 3. Object Code Incorporating Material from Library Header Files. | ||||||
| 3. Object Code Incorporating Material from Library Header GoToIcon. | ||||||
|
||||||
| 3. Object Code Incorporating Material from Library Header GoToIcon. | |
| 3. Object Code Incorporating Material from Library Header Files. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,6 +223,7 @@ private function _formatSegments(array $segments, array $ttlArray, array $filesI | |
| $seg['ice_modified'] = $segment->ice_modified; | ||
| $seg['is_pre_translated'] = $segment->is_pre_translated; | ||
| $seg['issues'] = $segment->issues; | ||
| $seg['history'] = $segment->history; | ||
|
||
| $seg['last_revisions'] = $segment->last_revisions; | ||
| $seg['last_translation'] = $segment->last_translation; | ||
| $seg['locked'] = $segment->locked; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?php | ||
|
|
||
| namespace Model\QualityReport; | ||
|
|
||
| use Model\DataAccess\AbstractDaoObjectStruct; | ||
| use Model\DataAccess\IDaoStruct; | ||
|
|
||
| /** | ||
| * @property int $id_segment | ||
| * @property string $translation | ||
| * @property int $version_number | ||
| * @property int $source_page | ||
| */ | ||
| class HistoryElementStruct extends AbstractDaoObjectStruct implements IDaoStruct | ||
| { | ||
| public int $id_segment; | ||
| public string $translation; | ||
| public int $version_number; | ||
| public ?int $source_page = null; | ||
| public ?string $status = null; | ||
| public ?string $create_date = null; | ||
| public ?string $creation_date = null; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -220,6 +220,7 @@ public function getSegmentsForQR(array $segment_ids, $isForUI = false) | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $translationVersionDao = new TranslationVersionDao($this->database); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $all_events = $translationVersionDao->getAllRelevantEvents($segmentIds, $chunkId); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $history_events = $translationVersionDao->historyEvents($segment_ids, $chunkId); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $segments = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -241,7 +242,8 @@ public function getSegmentsForQR(array $segment_ids, $isForUI = false) | |||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_commonSegmentAssignments($seg, $Filter, $featureSet, $this->chunk, $isForUI); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_assignIssues($seg, $issues, $issue_comments); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_assignComments($seg, $comments); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_populateLastTranslationAndRevision($seg, $Filter, $all_events, $isForUI); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_populateLastTranslationAndRevision($seg, $Filter, $all_events, $isForUI); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $this->_populateHistory($seg, $Filter, $history_events, $issues, $isForUI); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $seg->pee_translation_revise = $seg->getPEEBwtTranslationRevise(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $seg->pee_translation_suggestion = $seg->getPEEBwtTranslationSuggestion(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -252,6 +254,57 @@ public function getSegmentsForQR(array $segment_ids, $isForUI = false) | |||||||||||||||||||||||||||||||||||||||||||||||||
| return $segments; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * Populates the history for a given quality report segment by organizing events and associated issues. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @param QualityReportSegmentStruct $seg The segment structure where the history will be populated. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @param MateCatFilter $Filter The filter used to process translations for UI rendering. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @param HistoryElementStruct[] $events An array of SegmentEventsStruct objects representing the events related to the segment. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @param ShapelessConcreteStruct[] $issues An array of issue objects to associate with the events, filtered by segment and version. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @param bool $isForUI Indicates whether the translation should be processed for UI display purposes. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @throws Exception | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @return void | ||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+257
to
+269
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| protected function _populateHistory( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| QualityReportSegmentStruct $seg, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| MateCatFilter $Filter, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| array $events = [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| array $issues = [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| bool $isForUI = false | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ): void | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $elements = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $eventsForThisSegment = array_filter($events, function (HistoryElementStruct $event) use ($seg) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return $event->id_segment == $seg->sid; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| /** @var HistoryElementStruct $event */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($eventsForThisSegment as $event) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $translation = ($isForUI) ? $Filter->fromLayer0ToLayer2($event->translation) : $event->translation; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $elements[] = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'status' => $event->status, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'date' => $event->creation_date ?? $event->create_date, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'revision_number' => ReviewUtils::sourcePageToRevisionNumber($event->source_page), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'source_page' => $event->source_page, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'version_number' => $event->version_number, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'translation' => $translation, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'issues' => array_filter($issues, function ($issue) use ($event) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $issue->deleted_at === null && | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $event->id_segment == $issue->segment_id && | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $event->version_number == $issue->translation_version | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+295
to
+301
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| 'issues' => array_filter($issues, function ($issue) use ($event) { | |
| return | |
| $issue->deleted_at === null && | |
| $event->id_segment == $issue->segment_id && | |
| $event->version_number == $issue->translation_version | |
| ; | |
| }) | |
| 'issues' => array_values(array_filter($issues, function ($issue) use ($event) { | |
| return | |
| $issue->deleted_at === null && | |
| $event->id_segment == $issue->segment_id && | |
| $event->version_number == $issue->translation_version | |
| ; | |
| })) |
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array_filter($issues, ...) runs for every history event, making history building O(events Γ issues). If segments can have many events/issues, consider indexing issues once (e.g., by [segment_id][translation_version]) before the loop, then do O(1) lookups per event.
Copilot
AI
Apr 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description states the history is a chronological audit trail, but historyEvents() does not enforce a stable ordering across the UNION, and _populateHistory does not sort. To guarantee chronology, explicitly sort $elements by the computed 'date' (ascending) or add a deterministic ORDER BY in the SQL (and ensure the date column is consistently named/typed).
| usort($elements, function (array $left, array $right) { | |
| $leftDate = (string)($left['date'] ?? ''); | |
| $rightDate = (string)($right['date'] ?? ''); | |
| if ($leftDate !== $rightDate) { | |
| return strcmp($leftDate, $rightDate); | |
| } | |
| $leftVersion = (int)($left['version_number'] ?? 0); | |
| $rightVersion = (int)($right['version_number'] ?? 0); | |
| if ($leftVersion !== $rightVersion) { | |
| return $leftVersion <=> $rightVersion; | |
| } | |
| $leftRevision = (int)($left['revision_number'] ?? 0); | |
| $rightRevision = (int)($right['revision_number'] ?? 0); | |
| if ($leftRevision !== $rightRevision) { | |
| return $leftRevision <=> $rightRevision; | |
| } | |
| return strcmp((string)($left['source_page'] ?? ''), (string)($right['source_page'] ?? '')); | |
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| use Matecat\SubFiltering\MateCatFilter; | ||
| use Model\DataAccess\AbstractDaoObjectStruct; | ||
| use Model\DataAccess\IDaoStruct; | ||
| use Model\DataAccess\ShapelessConcreteStruct; | ||
| use Model\FeaturesBase\FeatureSet; | ||
| use Model\Jobs\JobStruct; | ||
| use Utils\LQA\QA; | ||
|
|
@@ -106,6 +107,11 @@ public function __construct(array $array_params = []) | |
|
|
||
| protected string $tm_analysis_status; | ||
|
|
||
| /** | ||
| * @var array<mixed> | ||
| */ | ||
| public array $history = []; | ||
|
||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |||||||||||||||||||||||||||||||
| use Model\DataAccess\AbstractDaoObjectStruct; | ||||||||||||||||||||||||||||||||
| use Model\DataAccess\ShapelessConcreteStruct; | ||||||||||||||||||||||||||||||||
| use Model\Jobs\JobStruct; | ||||||||||||||||||||||||||||||||
| use Model\QualityReport\HistoryElementStruct; | ||||||||||||||||||||||||||||||||
| use Model\QualityReport\SegmentEventsStruct; | ||||||||||||||||||||||||||||||||
| use Model\Translations\SegmentTranslationStruct; | ||||||||||||||||||||||||||||||||
| use PDO; | ||||||||||||||||||||||||||||||||
|
|
@@ -248,6 +249,49 @@ public function getVersionsForRevision(int|string $id_job, int|string $id_segmen | |||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * @param array<int|string> $segments_id | ||||||||||||||||||||||||||||||||
| * @param int $job_id | ||||||||||||||||||||||||||||||||
| * @return array<HistoryElementStruct> | ||||||||||||||||||||||||||||||||
| * @throws PDOException | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| public function historyEvents(array $segments_id, int $job_id): array | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| $conn = $this->database->getConnection(); | ||||||||||||||||||||||||||||||||
| $prepare_str_segments_id = implode(', ', array_fill(0, count($segments_id), '?')); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| $query = "SELECT | ||||||||||||||||||||||||||||||||
| id_segment, | ||||||||||||||||||||||||||||||||
| first_sv.version_number, | ||||||||||||||||||||||||||||||||
| null as source_page, | ||||||||||||||||||||||||||||||||
| null as status, | ||||||||||||||||||||||||||||||||
| null as create_date, | ||||||||||||||||||||||||||||||||
| first_sv.creation_date, | ||||||||||||||||||||||||||||||||
| first_sv.translation | ||||||||||||||||||||||||||||||||
| FROM segment_translation_versions first_sv WHERE id_segment IN ( $prepare_str_segments_id ) AND id_job = ? AND version_number = 0 | ||||||||||||||||||||||||||||||||
| UNION | ||||||||||||||||||||||||||||||||
| SELECT ste.id_segment, ste.version_number, ste.source_page, ste.status, ste.create_date, stv.creation_date, stv.translation FROM segment_translation_events ste | ||||||||||||||||||||||||||||||||
| INNER JOIN ( | ||||||||||||||||||||||||||||||||
| SELECT creation_date, id_segment, translation, version_number, id_job | ||||||||||||||||||||||||||||||||
| FROM segment_translation_versions | ||||||||||||||||||||||||||||||||
| WHERE id_segment IN ( $prepare_str_segments_id ) | ||||||||||||||||||||||||||||||||
| AND id_job = ? | ||||||||||||||||||||||||||||||||
| UNION | ||||||||||||||||||||||||||||||||
| SELECT null as creation_date, id_segment, translation, version_number, id_job | ||||||||||||||||||||||||||||||||
| FROM segment_translations | ||||||||||||||||||||||||||||||||
| WHERE id_segment IN ( $prepare_str_segments_id ) | ||||||||||||||||||||||||||||||||
| AND id_job = ? | ||||||||||||||||||||||||||||||||
| ) AS stv ON stv.version_number = ste.version_number AND stv.id_segment = ste.id_segment | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| WHERE ste.id_segment IN ( $prepare_str_segments_id ) GROUP BY version_number, source_page;"; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| $stmt = $conn->prepare($query); | ||||||||||||||||||||||||||||||||
| $stmt->setFetchMode(PDO::FETCH_CLASS, HistoryElementStruct::class); | ||||||||||||||||||||||||||||||||
| $stmt->execute(array_merge($segments_id, [$job_id], $segments_id, [$job_id], $segments_id, [$job_id], $segments_id)); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+284
to
+290
|
||||||||||||||||||||||||||||||||
| ) AS stv ON stv.version_number = ste.version_number AND stv.id_segment = ste.id_segment | |
| WHERE ste.id_segment IN ( $prepare_str_segments_id ) GROUP BY version_number, source_page;"; | |
| $stmt = $db->prepare($query); | |
| $stmt->setFetchMode(PDO::FETCH_CLASS, HistoryElementStruct::class); | |
| $stmt->execute(array_merge($segments_id, [$job_id], $segments_id, [$job_id], $segments_id, [$job_id], $segments_id)); | |
| ) AS stv ON stv.version_number = ste.version_number AND stv.id_segment = ste.id_segment AND stv.id_job = ste.id_job | |
| WHERE ste.id_segment IN ( $prepare_str_segments_id ) AND ste.id_job = ? | |
| ORDER BY id_segment, COALESCE(create_date, creation_date), version_number, source_page;"; | |
| $stmt = $db->prepare($query); | |
| $stmt->setFetchMode(PDO::FETCH_CLASS, HistoryElementStruct::class); | |
| $stmt->execute(array_merge($segments_id, [$job_id], $segments_id, [$job_id], $segments_id, [$job_id], $segments_id, [$job_id])); |
Copilot
AI
Apr 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This SELECT mixes an aggregate (MAX(version_number)) with non-aggregated columns (ste.id, ste.id_segment, ste.source_page). If the query groups by segment/page, ste.id will be nondeterministic (or rejected with ONLY_FULL_GROUP_BY). Consider either removing ste.id from the projection or selecting an aggregate like MAX(ste.id) AS id that matches the grouping semantics.
| SELECT MAX(version_number) AS version_number, ste.id, ste.id_segment, ste.source_page | |
| SELECT MAX(version_number) AS version_number, ste.id_segment, ste.source_page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the LGPL license text (βLibrary Header Filesβ) into βLibrary Header GoToIcon.β, which appears unintended and alters the legal terms text. Licenses should typically remain verbatim. Please revert this line to the original license wording unless there is a deliberate, legally-reviewed reason to modify it.