Skip to content

Commit 21f7ba7

Browse files
feat: change version view modifiedOnly default to true (#11794)
Replaces a more elaborate approach from #11520 with the simplest solution, just changing the default.
1 parent b863fd0 commit 21f7ba7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/next/src/views/Version/Default/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export const DefaultVersionView: React.FC<DefaultVersionsViewProps> = ({
8383
current.set('localeCodes', JSON.stringify(selectedLocales.map((locale) => locale.value)))
8484
}
8585

86-
if (!modifiedOnly) {
87-
current.delete('modifiedOnly')
86+
if (modifiedOnly === false) {
87+
current.set('modifiedOnly', 'false')
8888
} else {
89-
current.set('modifiedOnly', 'true')
89+
current.delete('modifiedOnly')
9090
}
9191

9292
const search = current.toString()

packages/next/src/views/Version/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function VersionView(props: DocumentViewServerProps) {
4040

4141
const comparisonVersionIDFromParams: string = searchParams.compareValue as string
4242

43-
const modifiedOnly: boolean = searchParams.modifiedOnly === 'true'
43+
const modifiedOnly: boolean = searchParams.modifiedOnly === 'false' ? false : true
4444

4545
const { localization } = config
4646

test/versions/e2e.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1197,11 +1197,11 @@ describe('Versions', () => {
11971197

11981198
const textInArrayES = page.locator('[data-field-path="arrayLocalized"][data-locale="es"]')
11991199

1200-
await expect(textInArrayES).toContainText('No Array Localizeds found')
1200+
await expect(textInArrayES).toBeHidden()
12011201

12021202
await page.locator('#modifiedOnly').click()
12031203

1204-
await expect(textInArrayES).toBeHidden()
1204+
await expect(textInArrayES).toContainText('No Array Localizeds found')
12051205
})
12061206

12071207
test('correctly renders diff for block fields', async () => {

0 commit comments

Comments
 (0)