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
3 changes: 2 additions & 1 deletion resources/js/components/assets/GalleryBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { destroy as assetsDestroy, search as assetsSearch, storeChunked as asset
import { search as giphySearch, trending as giphyTrending } from '@/routes/app/assets/giphy';
import { search as unsplashSearch, trending as unsplashTrending } from '@/routes/app/assets/unsplash';
import { store as storePost } from '@/routes/app/posts';
import type { SourceMetaValue } from '@/types/media';
import { uploadChunked } from '@/utils/chunkedUpload';

interface AssetMedia {
Expand Down Expand Up @@ -74,7 +75,7 @@ interface PickedMedia {
size?: number;
meta?: { width?: number; height?: number; duration?: number };
source?: 'ai' | 'unsplash' | 'giphy';
source_meta?: Record<string, unknown>;
source_meta?: Record<string, SourceMetaValue>;
}

const props = defineProps<{
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/posts/PostPlatformMetrics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ onMounted(async () => {
<Tooltip>
<TooltipTrigger as-child>
<span class="inline-flex items-center gap-1 text-xs text-muted-foreground">
<IconUsers class="size-4" :stroke="1.75" />
<IconUsers class="size-4" stroke-width="1.75" />
<span class="font-semibold tabular-nums text-foreground">{{
formatNumberCompact(subscribers.value)
}}</span>
Expand All @@ -126,7 +126,7 @@ onMounted(async () => {
<Tooltip>
<TooltipTrigger as-child>
<span class="inline-flex items-center gap-1 text-xs text-muted-foreground">
<IconMessageCircle class="size-4" :stroke="1.75" />
<IconMessageCircle class="size-4" stroke-width="1.75" />
<span class="font-semibold tabular-nums text-foreground">{{
formatNumberCompact(comments.value)
}}</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/composables/useWebhookLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const useWebhookLogs = (
selectedLog.value = next;
}

router.reload({ only: ['logs'], preserveScroll: true });
router.reload({ only: ['logs'] });
};

useWebhookEcho(toValue(webhookId), '.webhook.log.updated', applyLogUpdate);
Expand Down
6 changes: 5 additions & 1 deletion resources/js/pages/welcome/Connect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import NetworkConnectGrid, {
} from '@/components/accounts/NetworkConnectGrid.vue';
import InputError from '@/components/InputError.vue';
import { Button } from '@/components/ui/button';
import { usePageErrors } from '@/composables/usePageErrors';
import WelcomeLayout from '@/layouts/WelcomeLayout.vue';
import { store } from '@/routes/app/welcome/connect';
import { SocialAccountStatus } from '@/types/social-account-status';
Expand All @@ -19,6 +20,8 @@ const props = defineProps<{

const form = useForm({});

const errors = usePageErrors();

const hasConnectedAccount = computed((): boolean =>
props.accounts.some(
(account) => account.status === SocialAccountStatus.Connected,
Expand Down Expand Up @@ -53,7 +56,8 @@ const submit = (): void => {

<div class="mx-auto flex w-full max-w-sm flex-col items-center gap-3">
<InputError
:message="form.errors.connect"
data-testid="welcome-connect-error"
:message="errors.connect"
/>
<Button as-child size="lg" class="w-full rounded-full">
<button
Expand Down
4 changes: 3 additions & 1 deletion resources/js/types/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { MediaType } from '@/lib/mediaType';

export type MediaSource = 'ai' | 'unsplash' | 'giphy';

export type SourceMetaValue = string | number | boolean | null | SourceMetaValue[];

export interface MediaItem {
id: string;
url: string;
Expand All @@ -11,7 +13,7 @@ export interface MediaItem {
original_filename?: string;
size?: number;
source?: MediaSource;
source_meta?: Record<string, unknown>;
source_meta?: Record<string, SourceMetaValue>;
meta?: {
width?: number;
height?: number;
Expand Down
27 changes: 27 additions & 0 deletions tests/Browser/WelcomeConnectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,30 @@ function welcomeOwnerOnConnectStep(): User
$page->assertRoute('app.welcome.persona')
->assertNoJavaScriptErrors();
});

test('connect step shows the backend error when the account disappears before submitting', function () {
config(['trypost.self_hosted' => false]);

$user = welcomeOwnerOnConnectStep();
$account = SocialAccount::factory()->linkedin()->create([
'workspace_id' => $user->current_workspace_id,
]);

$this->actingAs($user->fresh());

$page = visit(route('app.welcome.connect'));

waitForWelcomeTestId($page, 'welcome-start-checkout');

$page->assertEnabled('@welcome-start-checkout');

$account->delete();

$page->click('@welcome-start-checkout');

waitForWelcomeTestId($page, 'welcome-connect-error');

$page->assertVisible('@welcome-connect-error')
->assertSee(trans('welcome.connect.required'))
->assertNoJavaScriptErrors();
});