Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
uses: saucebase-dev/saucebase/.github/workflows/test-module.yml@main
with:
module: Demo
dependencies: saucebase/auth saucebase/settings saucebase/billing saucebase/announcements saucebase/blog saucebase/roadmap saucebase/themes
12 changes: 12 additions & 0 deletions app/Http/Controllers/DemoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Inertia\Inertia;
use Modules\Billing\Models\Product;
use Modules\Blog\Data\PostData;
use Modules\Blog\Models\Post;

class DemoController
{
Expand All @@ -18,6 +20,16 @@ public function __invoke()
$data['products'] = Product::displayable()->get();
}

if (app('modules')->isEnabled('Blog')) {
$posts = Post::published()
->with(['category', 'author'])
->orderByDesc('published_at')
->limit(3)
->get();

$data['latestPosts'] = $posts->map(fn (Post $post) => PostData::fromPost($post));
}
Comment on lines +23 to +31

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior fetches and renders latest posts, but there are no assertions covering this path. Consider extending the existing Playwright test (or adding a new one) to verify that when the Blog module is enabled and posts exist, the latest posts section is rendered (and that it stays hidden when there are no posts / Blog is disabled).

Copilot uses AI. Check for mistakes.

return Inertia::render('Demo::Index', $data)->withSSR();
}
}
3 changes: 3 additions & 0 deletions resources/js/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import { Head } from '@inertiajs/vue3';

import ProductSection from '@modules/Billing/resources/js/components/ProductSection.vue';
import type { Product } from '@modules/Billing/resources/js/types';
import LatestPostsSection from '@modules/Blog/resources/js/components/LatestPostsSection.vue';
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';

defineProps<{
products?: Product[];
latestPosts?: Modules.Blog.Data.PostData[];
Comment on lines 13 to +18

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latestPosts prop is typed as Modules.Blog.Data.PostData[], but this module doesn’t define that ambient Modules.* TypeScript namespace anywhere (and the existing products prop uses an explicit import). This is likely to break TS type-checking unless a global declaration is guaranteed. Prefer importing a PostData (or Post) type from the Blog module’s TS types (or add an explicit declare namespace Modules type definition that’s reliably present when Demo is built).

Suggested change
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';
defineProps<{
products?: Product[];
latestPosts?: Modules.Blog.Data.PostData[];
import type { PostData } from '@modules/Blog/resources/js/types';
import HeroSection from './sections/HeroSection.vue';
import Testimonial from './sections/Testimonial.vue';
defineProps<{
products?: Product[];
latestPosts?: PostData[];

Copilot uses AI. Check for mistakes.
}>();
</script>

Expand Down Expand Up @@ -81,6 +83,7 @@ defineProps<{
</div>
</template>
</ProductSection>
<LatestPostsSection v-if="latestPosts?.length" :posts="latestPosts" />
<Footer />
</div>
</template>
4 changes: 2 additions & 2 deletions routes/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function (Section $section) {
'slug' => 'documentation',
'external' => true,
'newPage' => true,
'order' => 1,
'order' => 10,
]);
}
);
Expand All @@ -64,7 +64,7 @@ function (Section $section) {
'slug' => 'github',
'external' => true,
'newPage' => true,
'order' => 2,
'order' => 20,
]);
}
);
Loading