Skip to content

Commit 8b03d9d

Browse files
author
nejc
committed
feat: enhance version platform manager with import/export and markdown rendering
- Add import/export functionality to version show page - Implement markdown rendering for feature content - Remove emoji icons for cleaner UI - Fix import validation and error handling - Add Tailwind Typography plugin for better markdown styling - Improve feature display with proper markdown support - Add comprehensive import/export dropdown with help section - Fix CSRF token issues in import functionality - Add proper validation for status and type fields - Enhance user experience with better error messages
1 parent 22f2c06 commit 8b03d9d

File tree

15 files changed

+964
-632
lines changed

15 files changed

+964
-632
lines changed

config/version-platform-manager.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@
9090
'icon' => '<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 9V7a5 5 0 0110 0v2m-1 4h-8" /></svg>',
9191
'target' => '_blank', // Optional: open in new tab
9292
],
93+
94+
[
95+
'label' => 'What\'s new preview',
96+
// You can use either 'route' or 'url' for custom links:
97+
// 'route' => 'admin.logs',
98+
'url' => '/whats-new',
99+
'icon' => '<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 17v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 9V7a5 5 0 0110 0v2m-1 4h-8" /></svg>',
100+
'target' => '_blank', // Optional: open in new tab
101+
],
93102
// Example custom link:
94103
// [
95104
// 'label' => 'Logs',
@@ -152,10 +161,10 @@
152161

153162
/*
154163
|--------------------------------------------------------------------------
155-
| Public What's New Page
164+
| What's New Page
156165
|--------------------------------------------------------------------------
157166
|
158-
| Configuration for the standalone public 'What's New' page.
167+
| Configuration for the standalone 'What's New' page (requires authentication).
159168
|
160169
*/
161170
'public_whats_new' => [

resources/views/admin/dashboard.blade.php

Lines changed: 63 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@section('title', 'Version Manager Dashboard')
66

77
@section('content')
8-
<div id="dashboard-app" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
8+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
99
<!-- Page Header -->
1010
<div class="mb-8">
1111
<div class="flex items-center justify-between">
@@ -37,7 +37,7 @@
3737
<div class="ml-5 w-0 flex-1">
3838
<dl>
3939
<dt class="text-sm font-medium text-gray-500 truncate">Total Versions</dt>
40-
<dd class="text-lg font-medium text-gray-900">@{{ statistics.total_versions }}</dd>
40+
<dd class="text-lg font-medium text-gray-900">{{ $statistics['total_versions'] ?? 0 }}</dd>
4141
</dl>
4242
</div>
4343
</div>
@@ -55,7 +55,7 @@
5555
<div class="ml-5 w-0 flex-1">
5656
<dl>
5757
<dt class="text-sm font-medium text-gray-500 truncate">Active Versions</dt>
58-
<dd class="text-lg font-medium text-gray-900">@{{ statistics.active_versions }}</dd>
58+
<dd class="text-lg font-medium text-gray-900">{{ $statistics['active_versions'] ?? 0 }}</dd>
5959
</dl>
6060
</div>
6161
</div>
@@ -73,7 +73,7 @@
7373
<div class="ml-5 w-0 flex-1">
7474
<dl>
7575
<dt class="text-sm font-medium text-gray-500 truncate">Total Users</dt>
76-
<dd class="text-lg font-medium text-gray-900">@{{ statistics.total_users }}</dd>
76+
<dd class="text-lg font-medium text-gray-900">{{ $statistics['total_users'] ?? 0 }}</dd>
7777
</dl>
7878
</div>
7979
</div>
@@ -91,7 +91,7 @@
9191
<div class="ml-5 w-0 flex-1">
9292
<dl>
9393
<dt class="text-sm font-medium text-gray-500 truncate">This Month</dt>
94-
<dd class="text-lg font-medium text-gray-900">@{{ statistics.versions_this_month }}</dd>
94+
<dd class="text-lg font-medium text-gray-900">{{ $statistics['versions_this_month'] ?? 0 }}</dd>
9595
</dl>
9696
</div>
9797
</div>
@@ -109,55 +109,69 @@
109109
</a>
110110
</div>
111111
<div class="flow-root">
112-
<ul class="-mb-8">
113-
<li v-for="version in recentVersions" :key="version.id">
114-
<div class="relative pb-8">
115-
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true"></span>
116-
<div class="relative flex space-x-3">
117-
<div>
118-
<span class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white">
119-
<svg class="h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
120-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
121-
</svg>
122-
</span>
123-
</div>
124-
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
125-
<div>
126-
<p class="text-sm text-gray-500">
127-
Version <span class="font-medium text-gray-900">@{{ version.version }}</span>
128-
<span class="font-medium text-gray-900">@{{ version.title }}</span>
129-
</p>
130-
<p class="text-sm text-gray-500">@{{ version.description }}</p>
131-
</div>
132-
<div class="text-right text-sm whitespace-nowrap text-gray-500">
133-
<time :datetime="version.released_at">@{{ formatDate(version.released_at) }}</time>
112+
@if($recentVersions->count() > 0)
113+
<ul class="-mb-8">
114+
@foreach($recentVersions as $index => $version)
115+
<li>
116+
<div class="relative pb-8">
117+
@if($index < $recentVersions->count() - 1)
118+
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true"></span>
119+
@endif
120+
<div class="relative flex space-x-3">
121+
<div>
122+
<span class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white">
123+
<svg class="h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
124+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
125+
</svg>
126+
</span>
127+
</div>
128+
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4">
129+
<div>
130+
<p class="text-sm text-gray-500">
131+
Version <span class="font-medium text-gray-900">{{ $version->version }}</span>
132+
<span class="font-medium text-gray-900">{{ $version->title }}</span>
133+
</p>
134+
<p class="text-sm text-gray-500">
135+
{{ $version->whatsNew->count() }} features
136+
@if($version->is_active)
137+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
138+
Active
139+
</span>
140+
@else
141+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800">
142+
Draft
143+
</span>
144+
@endif
145+
</p>
146+
</div>
147+
<div class="text-right text-sm whitespace-nowrap text-gray-500">
148+
<time datetime="{{ $version->released_at }}">{{ $version->released_at ? $version->released_at->format('M j, Y') : 'No date' }}</time>
149+
</div>
150+
</div>
134151
</div>
135152
</div>
136-
</div>
153+
</li>
154+
@endforeach
155+
</ul>
156+
@else
157+
<div class="text-center py-8">
158+
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
159+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
160+
</svg>
161+
<h3 class="mt-2 text-sm font-medium text-gray-900">No versions yet</h3>
162+
<p class="mt-1 text-sm text-gray-500">Get started by creating your first version.</p>
163+
<div class="mt-6">
164+
<a href="{{ route('version-manager.versions.create') }}" class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
165+
<svg class="w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
166+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
167+
</svg>
168+
Create Version
169+
</a>
137170
</div>
138-
</li>
139-
</ul>
171+
</div>
172+
@endif
140173
</div>
141174
</div>
142175
</div>
143176
</div>
144-
145-
<script>
146-
const { createApp } = Vue;
147-
148-
createApp({
149-
data() {
150-
return {
151-
statistics: @json($statistics ?? []),
152-
recentVersions: @json($recentVersions ?? []),
153-
}
154-
},
155-
methods: {
156-
formatDate(dateString) {
157-
if (!dateString) return '';
158-
return new Date(dateString).toLocaleDateString();
159-
}
160-
}
161-
}).mount('#dashboard-app');
162-
</script>
163177
@endsection

0 commit comments

Comments
 (0)