Demo reset + dev banner suppression for DEMO company
- DemoController: company-code-gated reset action (DEMO only, CSRF protected) - SeedDataService.Remove: FK-safe topological pre-sweep, all deletes scoped to companyId - SeedDataService: clock entries, extra seed data, updated customer/worker/job-status seeders - CompanySettingsController + Index.cshtml: Reset Demo Data button for DEMO company users - ReportsController + FinancialReportService: supporting report fixes - _Layout.cshtml: suppress env banner when current company is DEMO (all auth paths) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2679,6 +2679,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (ViewBag.IsDemoCompany == true)
|
||||
{
|
||||
<div class="container-fluid mt-4">
|
||||
<div class="card border-warning">
|
||||
<div class="card-header bg-warning bg-opacity-10 d-flex align-items-center gap-2">
|
||||
<i class="bi bi-arrow-clockwise text-warning fs-5"></i>
|
||||
<strong>Demo Environment</strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="mb-2">
|
||||
This is the <strong>DEMO</strong> company. Use the button below to wipe and re-seed all
|
||||
demo data with fresh dates. Workers and system configuration are preserved.
|
||||
</p>
|
||||
<p class="text-muted small mb-3">
|
||||
Reset takes 10–30 seconds. You will be redirected here when complete.
|
||||
</p>
|
||||
<form asp-controller="Demo" asp-action="ResetDemoData" method="post"
|
||||
onsubmit="this.querySelector('button').disabled=true; this.querySelector('button').innerHTML='<span class=\'spinner-border spinner-border-sm me-2\'></span>Resetting…';">
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-warning">
|
||||
<i class="bi bi-arrow-clockwise me-1"></i>Reset Demo Data
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
Reference in New Issue
Block a user