chore: remove broken feedback form and all entrypoints
The feedback form relies on instance SMTP being configured, which MapleDeploy customers won't do. Without SMTP it silently logs to the server and shows a misleading success message. Removed the navbar button, onboarding modal, subscription page link, API endpoint, and all associated dead code.
This commit is contained in:
parent
7f3772d7ad
commit
41c15a240f
9 changed files with 1 additions and 116 deletions
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use OpenApi\Attributes as OA;
|
||||
|
||||
class OtherController extends Controller
|
||||
|
|
@ -145,19 +144,6 @@ public function disable_api(Request $request)
|
|||
return response()->json(['message' => 'API disabled.'], 200);
|
||||
}
|
||||
|
||||
public function feedback(Request $request)
|
||||
{
|
||||
$content = $request->input('content');
|
||||
$webhook_url = config('constants.webhooks.feedback_discord_webhook');
|
||||
if ($webhook_url) {
|
||||
Http::post($webhook_url, [
|
||||
'content' => $content,
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json(['message' => 'Feedback sent.'], 200);
|
||||
}
|
||||
|
||||
#[OA\Get(
|
||||
summary: 'Healthcheck',
|
||||
description: 'Healthcheck endpoint.',
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
class Help extends Component
|
||||
{
|
||||
use WithRateLimiting;
|
||||
|
||||
#[Validate(['required', 'min:10', 'max:1000'])]
|
||||
public string $description;
|
||||
|
||||
#[Validate(['required', 'min:3'])]
|
||||
public string $subject;
|
||||
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
$this->validate();
|
||||
$this->rateLimit(3, 30);
|
||||
|
||||
$settings = instanceSettings();
|
||||
$mail = new MailMessage;
|
||||
$mail->view(
|
||||
'emails.help',
|
||||
[
|
||||
'description' => $this->description,
|
||||
]
|
||||
);
|
||||
$mail->subject("[HELP]: {$this->subject}");
|
||||
$type = set_transanctional_email_settings($settings);
|
||||
|
||||
// MapleDeploy branding: feedback sent to MapleDeploy support
|
||||
if (blank($type)) {
|
||||
// No external API — log locally when SMTP not configured
|
||||
\Illuminate\Support\Facades\Log::info('Feedback from '.auth()->user()?->email.': '.$this->subject.' — '.$this->description);
|
||||
} else {
|
||||
send_user_an_email($mail, auth()->user()?->email, 'support@mapledeploy.ca');
|
||||
}
|
||||
$this->dispatch('success', 'Feedback sent.', 'We will get in touch with you as soon as possible.');
|
||||
$this->reset('description', 'subject');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.help')->layout('layouts.app');
|
||||
}
|
||||
}
|
||||
|
|
@ -92,7 +92,6 @@
|
|||
],
|
||||
|
||||
'webhooks' => [
|
||||
'feedback_discord_webhook' => null,
|
||||
'dev_webhook' => env('SERVEO_URL'),
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -348,21 +348,6 @@ class="{{ request()->is('onboarding*') ? 'menu-item-active menu-item' : 'menu-it
|
|||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li>
|
||||
<x-modal-input title="How can we help?">
|
||||
<x-slot:content>
|
||||
<div title="Send us feedback or get help!" class="cursor-pointer menu-item"
|
||||
wire:click="help">
|
||||
<svg class="menu-item-icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor"
|
||||
d="M140 180a12 12 0 1 1-12-12a12 12 0 0 1 12 12M128 72c-22.06 0-40 16.15-40 36v4a8 8 0 0 0 16 0v-4c0-11 10.77-20 24-20s24 9 24 20s-10.77 20-24 20a8 8 0 0 0-8 8v8a8 8 0 0 0 16 0v-.72c18.24-3.35 32-17.9 32-35.28c0-19.85-17.94-36-40-36m104 56A104 104 0 1 1 128 24a104.11 104.11 0 0 1 104 104m-16 0a88 88 0 1 0-88 88a88.1 88.1 0 0 0 88-88" />
|
||||
</svg>
|
||||
<span class="menu-item-label">Feedback</span>
|
||||
</div>
|
||||
</x-slot:content>
|
||||
<livewire:help />
|
||||
</x-modal-input>
|
||||
</li>
|
||||
<li>
|
||||
<form action="/logout" method="POST">
|
||||
@csrf
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
{{ $description }}
|
||||
|
||||
{{ Illuminate\Mail\Markdown::parse('---') }}
|
||||
|
||||
{{-- {{ Illuminate\Mail\Markdown::parse($debug) }} --}}
|
||||
|
|
@ -706,15 +706,6 @@ class="dark:text-neutral-400 hover:text-coollabs dark:hover:text-warning hover:u
|
|||
Restart
|
||||
</button>
|
||||
</div>
|
||||
<x-modal-input title="Need Help?">
|
||||
<x-slot:content>
|
||||
<button
|
||||
class="text-sm dark:text-neutral-400 hover:text-coollabs dark:hover:text-warning hover:underline transition-colors">
|
||||
Contact Support
|
||||
</button>
|
||||
</x-slot:content>
|
||||
<livewire:help />
|
||||
</x-modal-input>
|
||||
</div>
|
||||
@endif
|
||||
</section>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<div class="flex flex-col w-full gap-2">
|
||||
{{-- MapleDeploy branding --}}
|
||||
<div>Your feedback helps us improve MapleDeploy. Thank you!</div>
|
||||
<form wire:submit="submit" class="flex flex-col gap-4 pt-4">
|
||||
<x-forms.input minlength="3" required id="subject" label="Subject" placeholder="Help with..."></x-forms.input>
|
||||
<x-forms.textarea minlength="10" maxlength="1000" required rows="10" id="description" label="Description"
|
||||
class="font-sans" spellcheck
|
||||
placeholder="Having trouble with... Please provide as much information as possible."></x-forms.textarea>
|
||||
<div></div>
|
||||
<x-forms.button class="w-full mt-4" type="submit">Send</x-forms.button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -55,8 +55,7 @@
|
|||
<h1>Subscription</h1>
|
||||
</div>
|
||||
<x-callout type="warning" title="Permission Required">
|
||||
You are not an admin so you cannot manage your Team's subscription. If this does not make sense, please
|
||||
<span class="underline cursor-pointer dark:text-white" wire:click="help">contact us</span>.
|
||||
You are not an admin so you cannot manage your team's subscription. Please contact your team admin.
|
||||
</x-callout>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@
|
|||
Route::get('/health', [OtherController::class, 'healthcheck']);
|
||||
});
|
||||
|
||||
Route::post('/feedback', [OtherController::class, 'feedback']);
|
||||
|
||||
Route::group([
|
||||
'middleware' => ['auth:sanctum', 'api.ability:write'],
|
||||
'prefix' => 'v1',
|
||||
|
|
|
|||
Loading…
Reference in a new issue