Skip to content

Commit 456e3d6

Browse files
authored
revert: "feat: adds new experimental.localizeStatus option (#13207)" (#13928)
This reverts commit 0f6d748. # Conflicts: # docs/configuration/overview.mdx # docs/experimental/overview.mdx # packages/ui/src/elements/Status/index.tsx
1 parent c230005 commit 456e3d6

27 files changed

Lines changed: 51 additions & 338 deletions

File tree

docs/configuration/localization.mdx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,29 +131,6 @@ localization: {
131131

132132
Since the filtering happens at the root level of the application and its result is not calculated every time you navigate to a new page, you may want to call `router.refresh` in a custom component that watches when values that affect the result change. In the example above, you would want to do this when `supportedLocales` changes on the tenant document.
133133

134-
## Experimental Options
135-
136-
Experimental options are features that may not be fully stable and may change or be removed in future releases.
137-
138-
These options can be enabled in your Payload Config under the `experimental` key. You can set them like this:
139-
140-
```ts
141-
import { buildConfig } from 'payload'
142-
143-
export default buildConfig({
144-
// ...
145-
experimental: {
146-
localizeStatus: true,
147-
},
148-
})
149-
```
150-
151-
The following experimental options are available related to localization:
152-
153-
| Option | Description |
154-
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
155-
| **`localizeStatus`** | **Boolean.** When `true`, shows document status per locale in the admin panel instead of always showing the latest overall status. Opt-in for backwards compatibility. Defaults to `false`. |
156-
157134
## Field Localization
158135

159136
Payload Localization works on a **field** level—not a document level. In addition to configuring the base Payload Config to support Localization, you need to specify each field that you would like to localize.

docs/configuration/overview.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ The following options are available:
7070
| **`admin`** | The configuration options for the Admin Panel, including Custom Components, Live Preview, etc. [More details](../admin/overview#admin-options). |
7171
| **`bin`** | Register custom bin scripts for Payload to execute. [More Details](#custom-bin-scripts). |
7272
| **`editor`** | The Rich Text Editor which will be used by `richText` fields. [More details](../rich-text/overview). |
73-
| **`experimental`** | Configure experimental features for Payload. These may be unstable and may change or be removed in future releases. [More details](../experimental/overview). |
7473
| **`db`** \* | The Database Adapter which will be used by Payload. [More details](../database/overview). |
7574
| **`serverURL`** | A string used to define the absolute URL of your app. This includes the protocol, for example `https://example.com`. No paths allowed, only protocol, domain and (optionally) port. |
7675
| **`collections`** | An array of Collections for Payload to manage. [More details](./collections). |

docs/experimental/overview.mdx

Lines changed: 0 additions & 66 deletions
This file was deleted.

packages/db-mongodb/src/createGlobalVersion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const createGlobalVersion: CreateGlobalVersion = async function createGlo
1212
autosave,
1313
createdAt,
1414
globalSlug,
15-
localeStatus,
1615
parent,
1716
publishedLocale,
1817
req,
@@ -34,7 +33,6 @@ export const createGlobalVersion: CreateGlobalVersion = async function createGlo
3433
autosave,
3534
createdAt,
3635
latest: true,
37-
localeStatus,
3836
parent,
3937
publishedLocale,
4038
snapshot,

packages/db-mongodb/src/createVersion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const createVersion: CreateVersion = async function createVersion(
1212
autosave,
1313
collectionSlug,
1414
createdAt,
15-
localeStatus,
1615
parent,
1716
publishedLocale,
1817
req,
@@ -38,7 +37,6 @@ export const createVersion: CreateVersion = async function createVersion(
3837
autosave,
3938
createdAt,
4039
latest: true,
41-
localeStatus,
4240
parent,
4341
publishedLocale,
4442
snapshot,

packages/db-mongodb/src/queryDrafts.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,6 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
179179

180180
for (let i = 0; i < result.docs.length; i++) {
181181
const id = result.docs[i].parent
182-
183-
const localeStatus = result.docs[i].localeStatus || {}
184-
if (locale && localeStatus[locale]) {
185-
result.docs[i].status = localeStatus[locale]
186-
result.docs[i].version._status = localeStatus[locale]
187-
}
188-
189182
result.docs[i] = result.docs[i].version ?? {}
190183
result.docs[i].id = id
191184
}

packages/drizzle/src/createGlobalVersion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export async function createGlobalVersion<T extends TypeWithID>(
1515
autosave,
1616
createdAt,
1717
globalSlug,
18-
localeStatus,
1918
publishedLocale,
2019
req,
2120
returning,
@@ -36,7 +35,6 @@ export async function createGlobalVersion<T extends TypeWithID>(
3635
autosave,
3736
createdAt,
3837
latest: true,
39-
localeStatus,
4038
publishedLocale,
4139
snapshot,
4240
updatedAt,

packages/drizzle/src/createVersion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export async function createVersion<T extends TypeWithID>(
1515
autosave,
1616
collectionSlug,
1717
createdAt,
18-
localeStatus,
1918
parent,
2019
publishedLocale,
2120
req,
@@ -41,7 +40,6 @@ export async function createVersion<T extends TypeWithID>(
4140
autosave,
4241
createdAt,
4342
latest: true,
44-
localeStatus,
4543
parent,
4644
publishedLocale,
4745
snapshot,

packages/drizzle/src/queryDrafts.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,15 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
3636
where: combinedWhere,
3737
})
3838

39-
for (let i = 0; i < result.docs.length; i++) {
40-
const id = result.docs[i].parent
41-
const localeStatus = result.docs[i].localeStatus || {}
42-
if (locale && localeStatus[locale]) {
43-
result.docs[i].status = localeStatus[locale]
44-
result.docs[i].version._status = localeStatus[locale]
45-
}
46-
47-
result.docs[i] = result.docs[i].version ?? {}
48-
result.docs[i].id = id
39+
return {
40+
...result,
41+
docs: result.docs.map((doc) => {
42+
doc = {
43+
id: doc.parent,
44+
...doc.version,
45+
}
46+
47+
return doc
48+
}),
4949
}
50-
51-
return result
5250
}

packages/next/src/views/Versions/cells/AutosaveCell/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ type AutosaveCellProps = {
1919
rowData: {
2020
autosave?: boolean
2121
id: number | string
22-
localeStatus?: Record<string, 'draft' | 'published'>
2322
publishedLocale?: string
2423
version: {
2524
_status: string

0 commit comments

Comments
 (0)