-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cms): pnk-token-page-types #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
"kind": "collectionType", | ||||||||||||||||||||||||||||||||||||||
"collectionName": "exchanges", | ||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||
"singularName": "exchange", | ||||||||||||||||||||||||||||||||||||||
"pluralName": "exchanges", | ||||||||||||||||||||||||||||||||||||||
"displayName": "Exchange" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"options": { | ||||||||||||||||||||||||||||||||||||||
"draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||
"url": { | ||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"icon": { | ||||||||||||||||||||||||||||||||||||||
"allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||
"images", | ||||||||||||||||||||||||||||||||||||||
"files", | ||||||||||||||||||||||||||||||||||||||
"videos", | ||||||||||||||||||||||||||||||||||||||
"audios" | ||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||
"type": "media", | ||||||||||||||||||||||||||||||||||||||
"multiple": false | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+17
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Restrict media types to images only. Since this is for exchange icons, we should restrict the allowed types to images only. Additionally, consider adding size and dimension constraints. "icon": {
"allowedTypes": [
- "images",
- "files",
- "videos",
- "audios"
+ "images"
],
"type": "media",
- "multiple": false
+ "multiple": false,
+ "required": true
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* exchange controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::exchange.exchange'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* exchange router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::exchange.exchange'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* exchange service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::exchange.exchange'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"kind": "singleType", | ||
"collectionName": "pnk_token_page_buy_sections", | ||
"info": { | ||
"singularName": "pnk-token-page-buy-section", | ||
"pluralName": "pnk-token-page-buy-sections", | ||
"displayName": "PNKTokenPageBuySection", | ||
"description": "" | ||
}, | ||
"options": { | ||
"draftAndPublish": true | ||
}, | ||
"pluginOptions": {}, | ||
"attributes": { | ||
"header": { | ||
"type": "string" | ||
}, | ||
"buyCards": { | ||
"type": "component", | ||
"repeatable": true, | ||
"component": "pnk-token-page.buy-card" | ||
}, | ||
"exchanges": { | ||
"type": "relation", | ||
"relation": "oneToMany", | ||
"target": "api::exchange.exchange" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-buy-section controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::pnk-token-page-buy-section.pnk-token-page-buy-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-buy-section router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::pnk-token-page-buy-section.pnk-token-page-buy-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-buy-section service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::pnk-token-page-buy-section.pnk-token-page-buy-section'); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,42 @@ | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
"kind": "singleType", | ||||||||||||||||||||||||||||||||||||||
"collectionName": "pnk_token_page_heroes", | ||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||
"singularName": "pnk-token-page-hero", | ||||||||||||||||||||||||||||||||||||||
"pluralName": "pnk-token-page-heroes", | ||||||||||||||||||||||||||||||||||||||
"displayName": "PNKTokenPageHero", | ||||||||||||||||||||||||||||||||||||||
"description": "" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"options": { | ||||||||||||||||||||||||||||||||||||||
"draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||
"header": { | ||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"subtitle": { | ||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+15
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add field validations for text content The header and subtitle fields should have proper validations to ensure content quality. "header": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "maxLength": 100,
+ "minLength": 3
},
"subtitle": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "maxLength": 200,
+ "minLength": 10
}, 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
"buyButton": { | ||||||||||||||||||||||||||||||||||||||
"type": "component", | ||||||||||||||||||||||||||||||||||||||
"repeatable": false, | ||||||||||||||||||||||||||||||||||||||
"component": "content.button-link" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"socials": { | ||||||||||||||||||||||||||||||||||||||
"type": "relation", | ||||||||||||||||||||||||||||||||||||||
"relation": "oneToMany", | ||||||||||||||||||||||||||||||||||||||
"target": "api::social.social" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"background": { | ||||||||||||||||||||||||||||||||||||||
"allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||
"images", | ||||||||||||||||||||||||||||||||||||||
"files", | ||||||||||||||||||||||||||||||||||||||
"videos", | ||||||||||||||||||||||||||||||||||||||
"audios" | ||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||
"type": "media", | ||||||||||||||||||||||||||||||||||||||
"multiple": false | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-hero controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::pnk-token-page-hero.pnk-token-page-hero'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-hero router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::pnk-token-page-hero.pnk-token-page-hero'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-hero service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::pnk-token-page-hero.pnk-token-page-hero'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"kind": "singleType", | ||
"collectionName": "pnk_token_page_need_sections", | ||
"info": { | ||
"singularName": "pnk-token-page-need-section", | ||
"pluralName": "pnk-token-page-need-sections", | ||
"displayName": "PNKTokenPageNeedSection" | ||
}, | ||
"options": { | ||
"draftAndPublish": true | ||
}, | ||
"pluginOptions": {}, | ||
"attributes": { | ||
"header": { | ||
"type": "string" | ||
}, | ||
"subtitle": { | ||
"type": "string" | ||
}, | ||
"card": { | ||
"type": "component", | ||
"repeatable": true, | ||
"component": "content.cta-card" | ||
}, | ||
"arrowLink": { | ||
"type": "component", | ||
"repeatable": true, | ||
"component": "content.button-link" | ||
} | ||
Comment on lines
+25
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The Based on the codebase analysis, the
🔗 Analysis chainVerify the button-link component implementation The Let me check how the button-link component is used in other sections to make a more informed decision. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if the referenced component exists and examine its structure
fd --type f "button-link.json" --exec cat {}
# Look for other usages of this component to verify if it's typically repeatable
rg -l "content.button-link"
Length of output: 1625 Script: #!/bin/bash
# Check the usage pattern of button-link in other schemas
fd --type f schema.json --exec rg -A 3 "content.button-link" {}
# Also check component usage in CTA sections specifically
fd --type f "cta" --exec cat {}
Length of output: 2116 |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-need-section controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::pnk-token-page-need-section.pnk-token-page-need-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-need-section router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::pnk-token-page-need-section.pnk-token-page-need-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-need-section service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::pnk-token-page-need-section.pnk-token-page-need-section'); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"kind": "singleType", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"collectionName": "pnk_token_page_tokenomics_sections", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"singularName": "pnk-token-page-tokenomics-section", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"pluralName": "pnk-token-page-tokenomics-sections", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"displayName": "PNKTokenPageTokenomicsSection", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"description": "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"options": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"header": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"subtitle": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"arrowLink": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "component", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"repeatable": false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"component": "content.button-link" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"tokenStatDisplay": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "component", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"repeatable": false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"component": "pnk-token-page.token-stat-display" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+14
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance schema with validations and descriptions The schema needs better field constraints and documentation for content editors. "attributes": {
"header": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "description": "Main heading for the tokenomics section",
+ "minLength": 1,
+ "maxLength": 100
},
"subtitle": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "description": "Explanatory text below the header",
+ "minLength": 1,
+ "maxLength": 200
},
"arrowLink": {
"type": "component",
"repeatable": false,
- "component": "content.button-link"
+ "component": "content.button-link",
+ "required": true,
+ "description": "Call-to-action button/link for the tokenomics section"
},
"tokenStatDisplay": {
"type": "component",
"repeatable": false,
- "component": "pnk-token-page.token-stat-display"
+ "component": "pnk-token-page.token-stat-display",
+ "required": true,
+ "description": "Token statistics display component for this section"
}
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-tokenomics-section controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::pnk-token-page-tokenomics-section.pnk-token-page-tokenomics-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-tokenomics-section router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::pnk-token-page-tokenomics-section.pnk-token-page-tokenomics-section'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* pnk-token-page-tokenomics-section service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::pnk-token-page-tokenomics-section.pnk-token-page-tokenomics-section'); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"kind": "collectionType", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"collectionName": "token_stats", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"singularName": "token-stat", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"pluralName": "token-stats", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"displayName": "TokenStat" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"options": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"key": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"primaryValue": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"secondaryValue": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+13
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add field validations and descriptions for better data integrity The schema fields lack important constraints and documentation. Consider adding:
"attributes": {
"key": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "description": "Identifier/label for the token statistic (e.g., 'Market Cap', 'Total Supply')",
+ "minLength": 1,
+ "maxLength": 50
},
"primaryValue": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "description": "Main value to display (e.g., '$1.2M', '1,000,000 PNK')",
+ "minLength": 1
},
"secondaryValue": {
- "type": "string"
+ "type": "string",
+ "description": "Optional secondary/supplementary value"
}
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* token-stat controller | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi' | ||
|
||
export default factories.createCoreController('api::token-stat.token-stat'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* token-stat router | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreRouter('api::token-stat.token-stat'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* token-stat service | ||
*/ | ||
|
||
import { factories } from '@strapi/strapi'; | ||
|
||
export default factories.createCoreService('api::token-stat.token-stat'); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
"collectionName": "components_pnk_token_page_buy_cards", | ||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||
"displayName": "buy-card", | ||||||||||||||||||||||||||||||||||||||
"description": "" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
"options": {}, | ||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||
"title": { | ||||||||||||||||||||||||||||||||||||||
"type": "string" | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add required constraint to title field. The title field should be marked as required since it's essential for the buy card display. "title": {
- "type": "string"
+ "type": "string",
+ "required": true
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
"icon": { | ||||||||||||||||||||||||||||||||||||||
"allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||
"images", | ||||||||||||||||||||||||||||||||||||||
"files", | ||||||||||||||||||||||||||||||||||||||
"videos", | ||||||||||||||||||||||||||||||||||||||
"audios" | ||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||
"type": "media", | ||||||||||||||||||||||||||||||||||||||
"multiple": true | ||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+12
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Revise icon field configuration. The current configuration allows multiple icons and various media types, which seems unnecessary for a card icon. "icon": {
"allowedTypes": [
- "images",
- "files",
- "videos",
- "audios"
+ "images"
],
"type": "media",
- "multiple": true
+ "multiple": false,
+ "required": true
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
"link": { | ||||||||||||||||||||||||||||||||||||||
"type": "relation", | ||||||||||||||||||||||||||||||||||||||
"relation": "oneToOne", | ||||||||||||||||||||||||||||||||||||||
"target": "api::link.link" | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||
"collectionName": "components_pnk_token_page_token_stat_displays", | ||||||||||||||||||||||||||||||||||||||||
"info": { | ||||||||||||||||||||||||||||||||||||||||
"displayName": "TokenStatDisplay" | ||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||
"options": {}, | ||||||||||||||||||||||||||||||||||||||||
"attributes": { | ||||||||||||||||||||||||||||||||||||||||
"icon": { | ||||||||||||||||||||||||||||||||||||||||
"allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||||
"images", | ||||||||||||||||||||||||||||||||||||||||
"files", | ||||||||||||||||||||||||||||||||||||||||
"videos", | ||||||||||||||||||||||||||||||||||||||||
"audios" | ||||||||||||||||||||||||||||||||||||||||
], | ||||||||||||||||||||||||||||||||||||||||
"type": "media", | ||||||||||||||||||||||||||||||||||||||||
"multiple": false | ||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+8
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Restrict icon media types to images only The icon field currently allows unnecessary media types (files, videos, audios) which could lead to incorrect usage. Since this is for displaying statistics, only images should be allowed. "icon": {
"allowedTypes": [
- "images",
- "files",
- "videos",
- "audios"
+ "images"
],
"type": "media",
- "multiple": false
+ "multiple": false,
+ "required": true,
+ "description": "Visual icon representing the statistic (use SVG or PNG)"
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
"stats": { | ||||||||||||||||||||||||||||||||||||||||
"type": "relation", | ||||||||||||||||||||||||||||||||||||||||
"relation": "oneToMany", | ||||||||||||||||||||||||||||||||||||||||
"target": "api::token-stat.token-stat" | ||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+18
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation for stats relationship The stats relationship should be required and documented. "stats": {
"type": "relation",
"relation": "oneToMany",
- "target": "api::token-stat.token-stat"
+ "target": "api::token-stat.token-stat",
+ "required": true,
+ "description": "Token statistics to display in this section"
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add URL validation and required constraint.
The URL field should include validation to ensure proper URL format and should be marked as required since it's essential for an exchange entry.
📝 Committable suggestion