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

Merge old master into main #409

Merged
merged 7 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `ignition` will be documented in this file

## 2.11.3 - 2021-08-16

- fix issues with circular dependencies in model route parameters (#408)
- remove notice about dirty git state in context
- wrap `AddGitInformation` middleware in try-catch

## 2.11.2 - 2021-07-20

- fix issues introduced in 2.11.1 (#403)
Expand Down
6 changes: 3 additions & 3 deletions config/flare.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
*/

'send_logs_as_events' => true,

/*
|--------------------------------------------------------------------------
| Censor request body fields
|--------------------------------------------------------------------------
|
| These fields will be censored from your request when sent to Flare.
| These fields will be censored from your request when sent to Flare.
|
*/

'censor_request_body_fields' => ['password'],
];
8 changes: 4 additions & 4 deletions resources/compiled/ignition.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions resources/js/components/Shared/editorUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default function editorUrl(config, file, lineNumber) {
'vscode-insiders': 'vscode-insiders://file/%path:%line',
atom: 'atom://core/open/file?filename=%path&line=%line',
nova: 'nova://core/open/file?filename=%path&line=%line',
netbeans: "netbeans://open/?f=%path:%line",
xdebug: "xdebug://%path@%line",
netbeans: 'netbeans://open/?f=%path:%line',
xdebug: 'xdebug://%path@%line',
};

file =
Expand Down
6 changes: 0 additions & 6 deletions resources/js/components/Tabs/ContextTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
</a>
</DefinitionListRow>
<DefinitionListRow v-if="git.tag" label="Tag">{{ git.tag }}</DefinitionListRow>
<div class="mt-4 sm:start-2" v-if="git.isDirty">
<div class="inline-block alert alert-warning min-h-0">
This commit is dirty. (Un)staged changes have been made since this
commit.
</div>
</div>
</DefinitionList>
</section>

Expand Down
5 changes: 4 additions & 1 deletion src/Context/LaravelRequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Facade\Ignition\Context;

use Facade\FlareClient\Context\RequestContext;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Throwable;

Expand Down Expand Up @@ -70,7 +71,9 @@ public function getRequest(): array
protected function getRouteParameters(): array
{
try {
return collect(optional($this->request->route())->parameters ?? [])->toArray();
return collect(optional($this->request->route())->parameters ?? [])
->map(fn ($parameter) => $parameter instanceof Model ? $parameter->withoutRelations() : $parameter)
->toArray();
} catch (Throwable $e) {
return [];
}
Expand Down
22 changes: 10 additions & 12 deletions src/Middleware/AddGitInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@

use Facade\FlareClient\Report;
use ReflectionClass;
use Symfony\Component\Process\Exception\RuntimeException;
use Symfony\Component\Process\Process;

class AddGitInformation
{
public function handle(Report $report, $next)
{
$report->group('git', [
'hash' => $this->hash(),
'message' => $this->message(),
'tag' => $this->tag(),
'remote' => $this->remote(),
'isDirty' => ! $this->isClean(),
]);
try {
$report->group('git', [
'hash' => $this->hash(),
'message' => $this->message(),
'tag' => $this->tag(),
'remote' => $this->remote(),
]);
} catch (RuntimeException $exception) {
}

return $next($report);
}
Expand All @@ -41,11 +44,6 @@ public function remote(): ?string
return $this->command('git config --get remote.origin.url');
}

public function isClean(): bool
{
return empty($this->command('git status -s'));
}

protected function command($command)
{
$process = (new ReflectionClass(Process::class))->hasMethod('fromShellCommandline')
Expand Down