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 lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
'form_fields_instructions_instructions' => 'Additional field instructions like this.',
'form_navigation' => 'Form navigation',
'form_summary_add_chart_instructions' => 'Add a chart to start summarizing responses.',
'form_summary_checked_insight' => 'of users checked the toggle',
'form_summary_checked_insight_count' => 'respondent checked the toggle|respondents checked the toggle',
'form_summary_checked_insight_percent' => 'of respondents checked the toggle',
'form_summary_other_breakdown' => ':field: Other breakdown: :values',
'form_export_filtered_description' => 'Exports only the submissions matching the current search and filters.',
'getting_started_widget_collections' => 'Collections hold the different content types that make up your site, helping you stay organized.',
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/summary/Summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ defineExpose({ refresh: fetchSummary });
/>
</ToggleGroup>
<p v-if="summary" class="ms-1 text-sm text-gray-500 dark:text-gray-500">
{{ __(':count responses', { count: $number.format(summary.total) }) }}
{{ __n(':total response|:total responses', summary.total, { total: $number.format(summary.total) }) }}
</p>
<div class="ms-auto flex items-center gap-2">
<template v-if="editing">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ withDefaults(
<template>
<div class="inline-flex items-center gap-2 px-2 py-1 rounded-md border border-gray-200 dark:border-gray-700">
<Metric :metric :count :percent class="text-xs font-semibold st-text-trim-cap tabular-nums" />
<span class="text-[0.75rem] text-gray-500 dark:text-gray-300">{{ __('statamic::messages.form_summary_checked_insight') }}</span>
<span class="text-[0.75rem] text-gray-500 dark:text-gray-300">
{{
metric === 'count'
? __n('statamic::messages.form_summary_checked_insight_count', count)
: __('statamic::messages.form_summary_checked_insight_percent')
}}
</span>
</div>
</template>
8 changes: 7 additions & 1 deletion resources/js/tests/components/forms/Summary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ async function mountEditing(fields = [field('color', 'horizontal_bar')]) {

const wrapper = shallowMount(Summary, {
props: { form: 'survey', summaryUrl: '/summary', chartsUpdateUrl: '/charts' },
global: { mocks: { __: (key) => key, $number: { format: (value) => value } } },
global: {
mocks: {
__: (key) => key,
__n: (key) => key,
$number: { format: (value) => value },
},
},
});

await flushPromises();
Expand Down
Loading