feat: add publish specific locale (#7669)

## Description

1. Adds ability to publish a specific individual locale (collections and
globals)
2. Shows published locale in versions list and version comparison
3. Adds new int tests to `versions` test suite

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] New feature (non-breaking change which adds functionality)
- [ ] This change requires a documentation update

## Checklist:

- [X] I have added tests that prove my fix is effective or that my
feature works
- [X] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation

---------

Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
This commit is contained in:
Jessica Chowdhury
2024-09-16 16:15:29 -04:00
committed by GitHub
parent aee76cb793
commit b7a0b15786
87 changed files with 1324 additions and 141 deletions

View File

@@ -16,6 +16,7 @@ export interface Config {
'autosave-posts': AutosavePost;
'draft-posts': DraftPost;
'draft-with-max-posts': DraftWithMaxPost;
'localized-posts': LocalizedPost;
'version-posts': VersionPost;
'custom-ids': CustomId;
users: User;
@@ -30,8 +31,9 @@ export interface Config {
'draft-global': DraftGlobal;
'draft-with-max-global': DraftWithMaxGlobal;
'disable-publish-global': DisablePublishGlobal;
'localized-global': LocalizedGlobal;
};
locale: 'en' | 'es';
locale: 'en' | 'es' | 'de';
user: User & {
collection: 'users';
};
@@ -148,6 +150,22 @@ export interface DraftWithMaxPost {
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "localized-posts".
*/
type LocalizedString = {
[k: string]: string;
};
export interface LocalizedPost {
id: string;
text?: string | LocalizedString | null;
description?: string | LocalizedString | null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "custom-ids".
@@ -253,6 +271,18 @@ export interface DisablePublishGlobal {
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "localized-global".
*/
export interface LocalizedGlobal {
id: string;
title?: string | null;
content?: string | null;
_status?: ('draft' | 'published') | null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "auth".
@@ -263,6 +293,6 @@ export interface Auth {
declare module 'payload' {
// @ts-ignore
// @ts-ignore
export interface GeneratedTypes extends Config {}
}
}