-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV-1390] Add Product schema and productsShowcase component to homep…
…age in Strapi CMS (#631) * Add Product schema, controller, routes and service di Strapi CMS * Add productsShowcase component to Strapi CMS * Fix linting in controller autogenerated file * Add changeset * Update .changeset/sweet-planets-change.md Co-authored-by: Marco Comi <[email protected]> * Add @strapi/provider-upload-aws-s3 and plugins.ts configuration file * Update .env.default file --------- Co-authored-by: Marco Comi <[email protected]> Co-authored-by: AF <[email protected]> Co-authored-by: AF <[email protected]> Co-authored-by: Marco Ponchia <[email protected]>
- Loading branch information
1 parent
7ca58a0
commit 68ac9bc
Showing
11 changed files
with
1,288 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"strapi-cms": minor | ||
--- | ||
|
||
Add Product schema and productsShowcase component to homepage in Strapi CMS |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export default ({ env }: any) => ({ | ||
upload: { | ||
config: { | ||
provider: env('UPLOAD_PLUGIN_PROVIDER', 'aws-s3'), | ||
providerOptions: { | ||
baseUrl: env('CDN_URL'), | ||
s3Options: { | ||
accessKeyId: env('AWS_ACCESS_KEY_ID'), | ||
secretAccessKey: env('AWS_ACCESS_SECRET'), | ||
endpoint: env('AWS_BUCKET_ENDPOINT'), | ||
params: { | ||
ACL: 'private', | ||
signedUrlExpires: 15 * 60, | ||
Bucket: env('AWS_BUCKET_NAME'), | ||
}, | ||
} | ||
}, | ||
}, | ||
}, | ||
}); |
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
61 changes: 61 additions & 0 deletions
61
apps/strapi-cms/src/api/product/content-types/product/schema.json
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,61 @@ | ||
{ | ||
"kind": "collectionType", | ||
"collectionName": "products", | ||
"info": { | ||
"singularName": "product", | ||
"pluralName": "products", | ||
"displayName": "Product", | ||
"description": "" | ||
}, | ||
"options": { | ||
"draftAndPublish": true | ||
}, | ||
"pluginOptions": { | ||
"i18n": { | ||
"localized": true | ||
} | ||
}, | ||
"attributes": { | ||
"name": { | ||
"pluginOptions": { | ||
"i18n": { | ||
"localized": true | ||
} | ||
}, | ||
"type": "string", | ||
"required": true, | ||
"unique": true | ||
}, | ||
"description": { | ||
"pluginOptions": { | ||
"i18n": { | ||
"localized": true | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"logo": { | ||
"type": "media", | ||
"multiple": false, | ||
"required": false, | ||
"allowedTypes": [ | ||
"images" | ||
], | ||
"pluginOptions": { | ||
"i18n": { | ||
"localized": false | ||
} | ||
} | ||
}, | ||
"slug": { | ||
"pluginOptions": { | ||
"i18n": { | ||
"localized": true | ||
} | ||
}, | ||
"type": "string", | ||
"required": true, | ||
"unique": true | ||
} | ||
} | ||
} |
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,7 @@ | ||
/** | ||
* product controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreController('api::product.product'); |
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,7 @@ | ||
/** | ||
* product router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::product.product'); |
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,7 @@ | ||
/** | ||
* product service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::product.product'); |
19 changes: 19 additions & 0 deletions
19
apps/strapi-cms/src/components/products/products-showcase.json
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,19 @@ | ||
{ | ||
"collectionName": "components_products_products_showcases", | ||
"info": { | ||
"displayName": "ProductsShowcase", | ||
"icon": "oneToMany" | ||
}, | ||
"options": {}, | ||
"attributes": { | ||
"title": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"products": { | ||
"type": "relation", | ||
"relation": "oneToMany", | ||
"target": "api::product.product" | ||
} | ||
} | ||
} |
Oops, something went wrong.