-
Notifications
You must be signed in to change notification settings - Fork 44
Release v0.21.0 #256
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
Merged
Merged
Release v0.21.0 #256
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1a47b52
translation: sync Vietnamese translations with develop and standardiz…
SoiBien-AI 1a67467
translation: address CodeRabbit review on #249 (work order terms + MR…
SoiBien-AI b96c136
translation: update Vietnamese translations after sync with develop
SoiBien-AI a3a0e55
fix(lines): match product-types sync route to the URL the UI posts to
jakub-przepiora 549de1a
feat(steps): equipment key:value parameters per process-template step
jakub-przepiora 1a6a70e
feat(steps): typed operator outputs (text/number/bool/select/date/pic…
jakub-przepiora 6b1b385
Merge pull request #251 from Mes-Open/feat/step-equipment-parameters
jakub-przepiora f527566
chore(ci): enable CodeRabbit auto-review for develop/main
jakub-przepiora eba61a7
Merge pull request #253 from Mes-Open/chore/coderabbit-config
jakub-przepiora 47e2eff
Merge pull request #249 from SoiBien-AI/feat/translate-develop
jakub-przepiora af89d3d
Merge remote-tracking branch 'origin/develop' into fix/line-product-t…
jakub-przepiora e5e28b4
Merge pull request #250 from Mes-Open/fix/line-product-types-sync-route
jakub-przepiora 091ba90
Merge pull request #254 from Mes-Open/feat/step-typed-outputs
jakub-przepiora 5e44c8b
chore(release): v0.21.0
jakub-przepiora 8ddbc8c
Merge pull request #255 from Mes-Open/chore/release-0.21.0
jakub-przepiora 2a5262f
fix(steps): address CodeRabbit review on typed outputs & parameters
jakub-przepiora beb1cbf
Merge pull request #257 from Mes-Open/fix/step-outputs-coderabbit
jakub-przepiora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # CodeRabbit configuration — https://docs.coderabbit.ai/reference/yaml-template | ||
| # Schema: https://coderabbit.ai/integrations/schema.v2.json | ||
| # | ||
| # Auto-review is enabled for the branches OpenMES actually merges into: `develop` | ||
| # (where all feature/fix PRs land) and `main` (release merges). Without listing | ||
| # them here CodeRabbit reports "reviews are disabled for this base branch" and | ||
| # skips the PR, which is what was happening on PRs targeting develop. | ||
| language: en-US | ||
| early_access: false | ||
|
|
||
| reviews: | ||
| # Balanced signal — flags real issues without nitpicking every style choice. | ||
| profile: chill | ||
| # Don't post a blocking "changes requested" review; leave the merge decision to us. | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| poem: false | ||
| review_status: true | ||
| auto_review: | ||
| enabled: true | ||
| drafts: false | ||
| # The base branches CodeRabbit auto-reviews (regex). This is the key setting. | ||
| base_branches: | ||
| - develop | ||
| - main | ||
| - "feat/.*" | ||
| - "fix/.*" | ||
| # Keep generated assets and dependency lockfiles out of the review. | ||
| path_filters: | ||
| - "!**/*.lock" | ||
| - "!**/package-lock.json" | ||
| - "!**/composer.lock" | ||
| - "!backend/public/build/**" | ||
| - "!**/vendor/**" | ||
| - "!**/node_modules/**" | ||
|
|
||
| chat: | ||
| auto_reply: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
backend/app/Http/Controllers/Api/V1/StepOutputController.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <?php | ||
|
|
||
| namespace App\Http\Controllers\Api\V1; | ||
|
|
||
| use App\Http\Controllers\Controller; | ||
| use App\Models\BatchStepOutputValue; | ||
| use App\Models\WorkOrder; | ||
| use Illuminate\Http\JsonResponse; | ||
| use Illuminate\Support\Facades\Storage; | ||
|
|
||
| /** | ||
| * Read API for operator-recorded typed step outputs (#B), so an external system | ||
| * (ERP, reporting) can pull the values + pictures a shop floor recorded against a | ||
| * work order. Read-only; gated by the work-order view policy. | ||
| */ | ||
| class StepOutputController extends Controller | ||
| { | ||
| /** All recorded output values for a work order, grouped by batch step. */ | ||
| public function forWorkOrder(WorkOrder $workOrder): JsonResponse | ||
| { | ||
| $this->authorize('view', $workOrder); | ||
|
|
||
| $values = BatchStepOutputValue::query() | ||
| ->whereHas('batchStep.batch', fn ($q) => $q->where('work_order_id', $workOrder->id)) | ||
| ->with(['output:id,key,label,value_type,unit', 'recordedBy:id,name', 'batchStep:id,step_number,name']) | ||
| ->orderBy('batch_step_id') | ||
| ->get() | ||
| ->map(fn (BatchStepOutputValue $v) => [ | ||
| 'id' => $v->id, | ||
| 'step_number' => $v->batchStep?->step_number, | ||
| 'batch_step_id' => $v->batch_step_id, | ||
| 'key' => $v->output?->key, | ||
| 'label' => $v->output?->label, | ||
| 'value_type' => $v->output?->value_type, | ||
| 'unit' => $v->output?->unit, | ||
| 'value' => $v->typedValue(), | ||
| 'file_url' => $v->file_path | ||
| ? route('api.v1.batch-step-outputs.file', $v) | ||
| : null, | ||
| 'recorded_by' => $v->recordedBy?->name, | ||
| 'recorded_at' => $v->recorded_at?->toISOString(), | ||
| ]); | ||
|
|
||
| return response()->json([ | ||
| 'data' => $values, | ||
| 'meta' => ['work_order_id' => $workOrder->id], | ||
| ]); | ||
| } | ||
|
|
||
| /** Serve a recorded output picture (safe inline mime + nosniff). */ | ||
| public function file(BatchStepOutputValue $batchStepOutputValue) | ||
| { | ||
| $batchStepOutputValue->loadMissing('batchStep.batch.workOrder'); | ||
| $workOrder = $batchStepOutputValue->batchStep?->batch?->workOrder; | ||
| abort_unless($workOrder !== null, 404); | ||
| $this->authorize('view', $workOrder); | ||
|
|
||
| abort_unless($batchStepOutputValue->file_path && Storage::exists($batchStepOutputValue->file_path), 404); | ||
|
|
||
| $inlineSafe = ['image/png', 'image/jpeg', 'image/webp']; | ||
| $mime = $batchStepOutputValue->mime_type ?? 'application/octet-stream'; | ||
| $disposition = in_array($mime, $inlineSafe, true) ? 'inline' : 'attachment'; | ||
|
|
||
| return response()->file(Storage::path($batchStepOutputValue->file_path), [ | ||
| 'Content-Type' => $mime, | ||
| 'Content-Disposition' => $disposition.'; filename="'.addslashes($batchStepOutputValue->original_name ?? 'output').'"', | ||
| 'X-Content-Type-Options' => 'nosniff', | ||
| 'Cache-Control' => 'private, max-age=3600', | ||
| ]); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
backend/app/Http/Controllers/Web/Admin/TemplateStepOutputController.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <?php | ||
|
|
||
| namespace App\Http\Controllers\Web\Admin; | ||
|
|
||
| use App\Http\Controllers\Controller; | ||
| use App\Http\Requests\StoreTemplateStepOutputRequest; | ||
| use App\Models\ProcessTemplate; | ||
| use App\Models\ProductType; | ||
| use App\Models\TemplateStepOutput; | ||
|
|
||
| /** | ||
| * Typed operator-output definitions on process template steps (admin authoring). | ||
| * Reusable definition; operators record a value per batch step at the | ||
| * workstation. Routes are scoped to their template/product-type (mismatch = 404). | ||
| */ | ||
| class TemplateStepOutputController extends Controller | ||
| { | ||
| public function store( | ||
| StoreTemplateStepOutputRequest $request, | ||
| ProductType $productType, | ||
| ProcessTemplate $processTemplate, | ||
| ) { | ||
| $this->ensureBelongs($productType, $processTemplate); | ||
|
|
||
| $stepId = $request->validated('template_step_id'); | ||
| abort_unless($processTemplate->steps()->whereKey($stepId)->exists(), 404); | ||
|
|
||
| $processTemplate->outputs()->create([ | ||
| 'template_step_id' => $stepId, | ||
| 'key' => $request->validated('key'), | ||
| 'label' => $request->validated('label'), | ||
| 'value_type' => $request->validated('value_type'), | ||
| 'unit' => $request->validated('unit'), | ||
| 'options' => $request->validated('options'), | ||
| 'is_required' => $request->boolean('is_required'), | ||
| 'sort_order' => ($processTemplate->outputs()->where('template_step_id', $stepId)->max('sort_order') ?? 0) + 1, | ||
| ]); | ||
|
|
||
| return back()->with('success', __('Output added.')); | ||
| } | ||
|
|
||
| public function destroy( | ||
| ProductType $productType, | ||
| ProcessTemplate $processTemplate, | ||
| TemplateStepOutput $output, | ||
| ) { | ||
| $this->ensureBelongs($productType, $processTemplate); | ||
| abort_unless($output->process_template_id === $processTemplate->id, 404); | ||
|
|
||
| $output->delete(); | ||
|
|
||
| return back()->with('success', __('Output removed.')); | ||
| } | ||
|
|
||
| private function ensureBelongs(ProductType $productType, ProcessTemplate $processTemplate): void | ||
| { | ||
| abort_unless($processTemplate->product_type_id === $productType->id, 404); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.