-
Notifications
You must be signed in to change notification settings - Fork 0
release/v0.1.11: Phase 11 — Convert UI Flow #162
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
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
06106a4
CONV-147: Add convert button test
menvil c3b18fc
Merge pull request #145 from menvil/feature/CONV-147-add-convert-butt…
menvil 4dfed27
CONV-148: Connect convert button to CreateConversionJobAction
menvil 8e7e0b1
Merge pull request #146 from menvil/feature/CONV-148-connect-convert-…
menvil a2678a7
CONV-149: Add duplicate convert protection
menvil 2b4596f
Merge pull request #147 from menvil/feature/CONV-149-add-duplicate-co…
menvil f1393c7
CONV-150: Add converting state test
menvil 8a0cdb7
Merge pull request #148 from menvil/feature/CONV-150-add-converting-s…
menvil 959c322
CONV-151: Implement converting state UI
menvil f5ea45a
Merge pull request #149 from menvil/feature/CONV-151-implement-conver…
menvil 36f370c
CONV-152: Add job status polling test
menvil a74c427
Merge pull request #150 from menvil/feature/CONV-152-add-job-status-p…
menvil 20b309a
CONV-153: Implement job status polling
menvil b414475
Merge pull request #151 from menvil/feature/CONV-153-implement-job-st…
menvil 0ee44c6
CONV-154: Add completed state test
menvil ea6b4d8
Merge pull request #152 from menvil/feature/CONV-154-add-completed-st…
menvil b13154d
CONV-155: Implement completed state UI
menvil 65cf1db
Merge pull request #153 from menvil/feature/CONV-155-implement-comple…
menvil e8864f4
CONV-156: Add failed state test
menvil 64b1c61
Merge pull request #154 from menvil/feature/CONV-156-add-failed-state…
menvil f901c14
CONV-157: Implement failed state UI
menvil 741579c
Merge pull request #155 from menvil/feature/CONV-157-implement-failed…
menvil dc41406
CONV-158: Add result download route test
menvil ad4b878
Merge pull request #156 from menvil/feature/CONV-158-add-result-downl…
menvil 5d93e38
CONV-159: Implement result download route
menvil be2a9a2
Merge pull request #157 from menvil/feature/CONV-159-implement-result…
menvil 100ec73
CONV-160: Add convert another action
menvil 2468e3d
Merge pull request #158 from menvil/feature/CONV-160-add-convert-anot…
menvil 3d9bd65
CONV-161: Add convert with different settings action
menvil 6f44a38
Merge pull request #159 from menvil/feature/CONV-161-add-convert-with…
menvil b9daf0f
CONV-162: Add result expired UI handling
menvil 41589c4
Merge pull request #160 from menvil/feature/CONV-162-add-result-expir…
menvil c42c9e2
CONV-163: Add convert flow integration test
menvil 90e1934
Merge pull request #161 from menvil/feature/CONV-163-add-convert-flow…
menvil 63c7984
Phase 11 review fixes: convert error handling, stale job ID, type saf…
menvil 32e23ba
Merge pull request #163 from menvil/fix/phase11-review-fixes
menvil 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
32 changes: 32 additions & 0 deletions
32
app/Http/Controllers/DownloadConversionResultController.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,32 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Http\Controllers; | ||
|
|
||
| use App\Enums\ConversionStatus; | ||
| use App\Models\ConversionJob; | ||
| use Illuminate\Http\Request; | ||
| use Illuminate\Support\Facades\Storage; | ||
|
|
||
| final class DownloadConversionResultController extends Controller | ||
| { | ||
| public function __invoke(Request $request, ConversionJob $conversion) | ||
| { | ||
| abort_unless((int) $conversion->user_id === (int) $request->user()->id, 403); | ||
| abort_unless($conversion->status === ConversionStatus::Completed, 404); | ||
| abort_unless($conversion->resultFile !== null, 404); | ||
|
|
||
| $file = $conversion->resultFile; | ||
|
|
||
| abort_if($file->isExpired(), 410); | ||
|
|
||
| abort_unless(Storage::disk('local')->exists($file->stored_path), 404); | ||
|
|
||
| return Storage::disk('local')->download( | ||
| $file->stored_path, | ||
| $file->original_name, | ||
| ['Content-Type' => $file->mime_type], | ||
| ); | ||
| } | ||
| } | ||
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
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
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
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
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
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.