-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from calimania/fix/strapi-schema
Added schema plugin and fix to category content type
- Loading branch information
Showing
11 changed files
with
5,519 additions
and
5,129 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
}, | ||
"slug": { | ||
"type": "string", | ||
"unique": true, | ||
"unique": false, | ||
"required": true | ||
}, | ||
"SEO": { | ||
|
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 |
---|---|---|
@@ -1,10 +1,39 @@ | ||
import { Event } from '@strapi/database/dist/lifecycles'; | ||
|
||
import { v4 as uuid } from 'uuid'; | ||
/* | ||
* | ||
* ============================================================ | ||
* WARNING: THIS FILE HAS BEEN COMMENTED OUT | ||
* ============================================================ | ||
* | ||
* CONTEXT: | ||
* | ||
* The lifecycles.js file has been commented out to prevent unintended side effects when starting Strapi 5 for the first time after migrating to the document service. | ||
* | ||
* STRAPI 5 introduces a new document service that handles lifecycles differently compared to previous versions. Without migrating your lifecycles to document service middlewares, you may experience issues such as: | ||
* | ||
* - `unpublish` actions triggering `delete` lifecycles for every locale with a published entity, which differs from the expected behavior in v4. | ||
* - `discardDraft` actions triggering both `create` and `delete` lifecycles, leading to potential confusion. | ||
* | ||
* MIGRATION GUIDE: | ||
* | ||
* For a thorough guide on migrating your lifecycles to document service middlewares, please refer to the following link: | ||
* [Document Services Middlewares Migration Guide](https://docs.strapi.io/dev-docs/migration/v4-to-v5/breaking-changes/lifecycle-hooks-document-service) | ||
* | ||
* IMPORTANT: | ||
* | ||
* Simply uncommenting this file without following the migration guide may result in unexpected behavior and inconsistencies. Ensure that you have completed the migration process before re-enabling this file. | ||
* | ||
* ============================================================ | ||
*/ | ||
|
||
export default { | ||
beforeCreate(event: Event) { | ||
const { data } = event.params; | ||
data.uuid = uuid(); | ||
}, | ||
}; | ||
// import { Event } from '@strapi/database/dist/lifecycles'; | ||
// | ||
// import { v4 as uuid } from 'uuid'; | ||
// | ||
// export default { | ||
// beforeCreate(event: Event) { | ||
// const { data } = event.params; | ||
// data.uuid = uuid(); | ||
// }, | ||
// }; | ||
// |
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 |
---|---|---|
@@ -1,12 +1,41 @@ | ||
import { Event } from '@strapi/database/dist/lifecycles'; | ||
|
||
import { v4 as uuid } from 'uuid'; | ||
|
||
export default { | ||
beforeCreate(event: Event) { | ||
const { data } = event.params; | ||
|
||
data.uuid = uuid(); | ||
}, | ||
}; | ||
/* | ||
* | ||
* ============================================================ | ||
* WARNING: THIS FILE HAS BEEN COMMENTED OUT | ||
* ============================================================ | ||
* | ||
* CONTEXT: | ||
* | ||
* The lifecycles.js file has been commented out to prevent unintended side effects when starting Strapi 5 for the first time after migrating to the document service. | ||
* | ||
* STRAPI 5 introduces a new document service that handles lifecycles differently compared to previous versions. Without migrating your lifecycles to document service middlewares, you may experience issues such as: | ||
* | ||
* - `unpublish` actions triggering `delete` lifecycles for every locale with a published entity, which differs from the expected behavior in v4. | ||
* - `discardDraft` actions triggering both `create` and `delete` lifecycles, leading to potential confusion. | ||
* | ||
* MIGRATION GUIDE: | ||
* | ||
* For a thorough guide on migrating your lifecycles to document service middlewares, please refer to the following link: | ||
* [Document Services Middlewares Migration Guide](https://docs.strapi.io/dev-docs/migration/v4-to-v5/breaking-changes/lifecycle-hooks-document-service) | ||
* | ||
* IMPORTANT: | ||
* | ||
* Simply uncommenting this file without following the migration guide may result in unexpected behavior and inconsistencies. Ensure that you have completed the migration process before re-enabling this file. | ||
* | ||
* ============================================================ | ||
*/ | ||
|
||
// import { Event } from '@strapi/database/dist/lifecycles'; | ||
// | ||
// import { v4 as uuid } from 'uuid'; | ||
// | ||
// export default { | ||
// beforeCreate(event: Event) { | ||
// const { data } = event.params; | ||
// | ||
// data.uuid = uuid(); | ||
// }, | ||
// }; | ||
// | ||
// |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// src/extensions/users-permissions/content-types/user/index.js | ||
import schema from './schema.json'; | ||
import lifecycles from './lifecycles'; | ||
// import lifecycles from './lifecycles'; | ||
|
||
export default { | ||
lifecycles, | ||
// lifecycles, | ||
schema, | ||
} |
45 changes: 37 additions & 8 deletions
45
src/extensions/users-permissions/content-types/user/lifecycles.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 |
---|---|---|
@@ -1,10 +1,39 @@ | ||
import { Event } from '@strapi/database/dist/lifecycles'; | ||
|
||
import { v4 as uuid } from 'uuid'; | ||
/* | ||
* | ||
* ============================================================ | ||
* WARNING: THIS FILE HAS BEEN COMMENTED OUT | ||
* ============================================================ | ||
* | ||
* CONTEXT: | ||
* | ||
* The lifecycles.js file has been commented out to prevent unintended side effects when starting Strapi 5 for the first time after migrating to the document service. | ||
* | ||
* STRAPI 5 introduces a new document service that handles lifecycles differently compared to previous versions. Without migrating your lifecycles to document service middlewares, you may experience issues such as: | ||
* | ||
* - `unpublish` actions triggering `delete` lifecycles for every locale with a published entity, which differs from the expected behavior in v4. | ||
* - `discardDraft` actions triggering both `create` and `delete` lifecycles, leading to potential confusion. | ||
* | ||
* MIGRATION GUIDE: | ||
* | ||
* For a thorough guide on migrating your lifecycles to document service middlewares, please refer to the following link: | ||
* [Document Services Middlewares Migration Guide](https://docs.strapi.io/dev-docs/migration/v4-to-v5/breaking-changes/lifecycle-hooks-document-service) | ||
* | ||
* IMPORTANT: | ||
* | ||
* Simply uncommenting this file without following the migration guide may result in unexpected behavior and inconsistencies. Ensure that you have completed the migration process before re-enabling this file. | ||
* | ||
* ============================================================ | ||
*/ | ||
|
||
export default { | ||
beforeCreate(event: Event) { | ||
const { data } = event.params; | ||
data.uuid = uuid(); | ||
}, | ||
}; | ||
// import { Event } from '@strapi/database/dist/lifecycles'; | ||
// | ||
// import { v4 as uuid } from 'uuid'; | ||
// | ||
// export default { | ||
// beforeCreate(event: Event) { | ||
// const { data } = event.params; | ||
// data.uuid = uuid(); | ||
// }, | ||
// }; | ||
// |
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
Oops, something went wrong.