Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(history): add history-version content type (#19316)
* feat: add history version content type * chore: disable i18n and review workflows * fix: i18n * chore: use Schema.CollectionType
- Loading branch information
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
packages/core/content-manager/server/src/history/content-types/history-version.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { Schema } from '@strapi/types'; | ||
|
||
const historyVersion: { schema: Schema.CollectionType } = { | ||
schema: { | ||
uid: 'plugin::content-manager.history-version', | ||
modelName: 'history-version', | ||
globalId: 'ContentManagerHistoryVersion', | ||
kind: 'collectionType', | ||
modelType: 'contentType', | ||
collectionName: 'strapi_history_versions', | ||
info: { | ||
singularName: 'history-version', | ||
pluralName: 'history-versions', | ||
displayName: 'History Version', | ||
}, | ||
pluginOptions: { | ||
'content-manager': { | ||
visible: false, | ||
}, | ||
'content-type-builder': { | ||
visible: false, | ||
}, | ||
i18n: { | ||
localized: false, | ||
}, | ||
}, | ||
attributes: { | ||
contentType: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
// documentId is a reserved attribute name | ||
relatedDocumentId: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
locale: { | ||
type: 'string', | ||
required: false, | ||
}, | ||
status: { | ||
type: 'enumeration', | ||
enum: ['draft', 'published', 'modified'], | ||
}, | ||
data: { | ||
type: 'json', | ||
}, | ||
schema: { | ||
type: 'json', | ||
}, | ||
createdAt: { | ||
type: 'date', | ||
}, | ||
createdBy: { | ||
type: 'relation', | ||
relation: 'oneToOne', | ||
target: 'admin::user', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export { historyVersion }; |
5 changes: 5 additions & 0 deletions
5
packages/core/content-manager/server/src/history/content-types/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { historyVersion } from './history-version'; | ||
|
||
export const contentTypes = { | ||
'history-version': historyVersion, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters