feat: change version view modifiedOnly default to true (#11794)
Replaces a more elaborate approach from https://github.com/payloadcms/payload/pull/11520 with the simplest solution, just changing the default.
This commit is contained in:
committed by
GitHub
parent
b863fd0915
commit
21f7ba7b9d
@@ -83,10 +83,10 @@ export const DefaultVersionView: React.FC<DefaultVersionsViewProps> = ({
|
||||
current.set('localeCodes', JSON.stringify(selectedLocales.map((locale) => locale.value)))
|
||||
}
|
||||
|
||||
if (!modifiedOnly) {
|
||||
current.delete('modifiedOnly')
|
||||
if (modifiedOnly === false) {
|
||||
current.set('modifiedOnly', 'false')
|
||||
} else {
|
||||
current.set('modifiedOnly', 'true')
|
||||
current.delete('modifiedOnly')
|
||||
}
|
||||
|
||||
const search = current.toString()
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function VersionView(props: DocumentViewServerProps) {
|
||||
|
||||
const comparisonVersionIDFromParams: string = searchParams.compareValue as string
|
||||
|
||||
const modifiedOnly: boolean = searchParams.modifiedOnly === 'true'
|
||||
const modifiedOnly: boolean = searchParams.modifiedOnly === 'false' ? false : true
|
||||
|
||||
const { localization } = config
|
||||
|
||||
|
||||
@@ -1197,11 +1197,11 @@ describe('Versions', () => {
|
||||
|
||||
const textInArrayES = page.locator('[data-field-path="arrayLocalized"][data-locale="es"]')
|
||||
|
||||
await expect(textInArrayES).toContainText('No Array Localizeds found')
|
||||
await expect(textInArrayES).toBeHidden()
|
||||
|
||||
await page.locator('#modifiedOnly').click()
|
||||
|
||||
await expect(textInArrayES).toBeHidden()
|
||||
await expect(textInArrayES).toContainText('No Array Localizeds found')
|
||||
})
|
||||
|
||||
test('correctly renders diff for block fields', async () => {
|
||||
|
||||
Reference in New Issue
Block a user