-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/r and d page types #44
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,40 @@ | ||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||
| "kind": "collectionType", | ||||||||||||||||||||||||||||||||||||||
| "collectionName": "fellows", | ||||||||||||||||||||||||||||||||||||||
| "info": { | ||||||||||||||||||||||||||||||||||||||
| "singularName": "fellow", | ||||||||||||||||||||||||||||||||||||||
| "pluralName": "fellows", | ||||||||||||||||||||||||||||||||||||||
| "displayName": "Fellow" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "options": { | ||||||||||||||||||||||||||||||||||||||
| "draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||
| "attributes": { | ||||||||||||||||||||||||||||||||||||||
| "name": { | ||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "profession": { | ||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "workText": { | ||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "arrowLinkText": { | ||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| "reportUrl": { | ||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+28
Contributor
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 URL validation The "reportUrl": {
- "type": "string"
+ "type": "string",
+ "regex": "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| "profilePic": { | ||||||||||||||||||||||||||||||||||||||
| "allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||
| "images", | ||||||||||||||||||||||||||||||||||||||
| "files", | ||||||||||||||||||||||||||||||||||||||
| "videos", | ||||||||||||||||||||||||||||||||||||||
| "audios" | ||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||
| "type": "media", | ||||||||||||||||||||||||||||||||||||||
| "multiple": false | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+29
to
+38
Contributor
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 profile pictures, we should only allow image uploads. Currently, it allows files, videos, and audios which aren't appropriate for profile pictures. "profilePic": {
"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 @@ | ||
| /** | ||
| * fellow controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::fellow.fellow'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * fellow router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::fellow.fellow'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * fellow service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::fellow.fellow'); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "kind": "singleType", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "collectionName": "r_and_d_page_fellowship_tab_sections", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "info": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "singularName": "r-and-d-page-fellowship-tab-section", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pluralName": "r-and-d-page-fellowship-tab-sections", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "displayName": "R&DPageFellowshipTabSection", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "options": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "attributes": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "header": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "subtitle": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "text" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testimonialsHeader": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "fellowsHeader": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "tabName": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+29
Contributor
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 field definitions with validations and descriptions. The current attribute definitions lack important constraints and documentation. Consider:
Apply these improvements: "attributes": {
"header": {
"type": "string",
+ "required": true,
+ "maxLength": 100,
+ "minLength": 3,
+ "description": "Main header for the fellowship section"
},
"subtitle": {
"type": "text",
+ "required": true,
+ "maxLength": 500,
+ "description": "Descriptive text appearing below the main header"
},
"testimonialsHeader": {
"type": "string",
+ "required": true,
+ "maxLength": 100,
+ "description": "Header for the testimonials subsection"
},
"fellowsHeader": {
"type": "string",
+ "required": true,
+ "maxLength": 100,
+ "description": "Header for the fellows subsection"
},
"tabName": {
"type": "string",
+ "required": true,
+ "maxLength": 30,
+ "description": "Name displayed on the tab in the navigation",
+ "default": "Fellowship"
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-tab-section controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::r-and-d-page-fellowship-tab-section.r-and-d-page-fellowship-tab-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-tab-section router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::r-and-d-page-fellowship-tab-section.r-and-d-page-fellowship-tab-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-tab-section service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::r-and-d-page-fellowship-tab-section.r-and-d-page-fellowship-tab-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "kind": "singleType", | ||
| "collectionName": "r_and_d_page_fellowship_waitlist_sections", | ||
| "info": { | ||
| "singularName": "r-and-d-page-fellowship-waitlist-section", | ||
| "pluralName": "r-and-d-page-fellowship-waitlist-sections", | ||
| "displayName": "R&DPageFellowshipWaitlistSection" | ||
| }, | ||
| "options": { | ||
| "draftAndPublish": true | ||
| }, | ||
| "pluginOptions": {}, | ||
| "attributes": { | ||
| "header": { | ||
| "type": "string" | ||
| }, | ||
| "applyButton": { | ||
| "type": "component", | ||
| "repeatable": false, | ||
| "component": "content.button-link" | ||
| }, | ||
| "arrowLink": { | ||
| "type": "component", | ||
| "repeatable": false, | ||
| "component": "content.button-link" | ||
| }, | ||
| "icon": { | ||
| "allowedTypes": [ | ||
| "images", | ||
| "files", | ||
| "videos", | ||
| "audios" | ||
| ], | ||
| "type": "media", | ||
| "multiple": false | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-waitlist-section controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::r-and-d-page-fellowship-waitlist-section.r-and-d-page-fellowship-waitlist-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-waitlist-section router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::r-and-d-page-fellowship-waitlist-section.r-and-d-page-fellowship-waitlist-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-fellowship-waitlist-section service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::r-and-d-page-fellowship-waitlist-section.r-and-d-page-fellowship-waitlist-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "kind": "singleType", | ||
| "collectionName": "r_and_d_page_heroes", | ||
| "info": { | ||
| "singularName": "r-and-d-page-hero", | ||
| "pluralName": "r-and-d-page-heroes", | ||
| "displayName": "R&DPageHero" | ||
| }, | ||
| "options": { | ||
| "draftAndPublish": true | ||
| }, | ||
| "pluginOptions": {}, | ||
| "attributes": { | ||
| "header": { | ||
| "type": "string" | ||
| }, | ||
| "subtitle": { | ||
| "type": "string" | ||
| }, | ||
| "buttons": { | ||
| "type": "component", | ||
| "repeatable": true, | ||
| "component": "content.button-link" | ||
| }, | ||
| "arrowLink": { | ||
| "type": "component", | ||
| "repeatable": true, | ||
| "component": "content.button-link" | ||
| }, | ||
| "background": { | ||
| "allowedTypes": [ | ||
| "images", | ||
| "files", | ||
| "videos", | ||
| "audios" | ||
| ], | ||
| "type": "media", | ||
| "multiple": false | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-hero controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::r-and-d-page-hero.r-and-d-page-hero'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-hero router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::r-and-d-page-hero.r-and-d-page-hero'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-hero service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::r-and-d-page-hero.r-and-d-page-hero'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "kind": "singleType", | ||
| "collectionName": "r_and_d_page_research_tab_sections", | ||
| "info": { | ||
| "singularName": "r-and-d-page-research-tab-section", | ||
| "pluralName": "r-and-d-page-research-tab-sections", | ||
| "displayName": "R&DPageResearchTabSection", | ||
| "description": "" | ||
| }, | ||
| "options": { | ||
| "draftAndPublish": true | ||
| }, | ||
| "pluginOptions": {}, | ||
| "attributes": { | ||
| "researchHeader": { | ||
| "type": "string" | ||
| }, | ||
| "researchSecondaryHeader": { | ||
| "type": "string" | ||
| }, | ||
| "researchParagraph": { | ||
| "type": "text" | ||
| }, | ||
| "researchCardLabel": { | ||
| "type": "string" | ||
| }, | ||
| "publicationsHeader": { | ||
| "type": "string" | ||
| }, | ||
| "publicationsTeamHeader": { | ||
| "type": "string" | ||
| }, | ||
| "publications3rdPartyHeader": { | ||
| "type": "string" | ||
| }, | ||
| "klerosBook": { | ||
| "type": "component", | ||
| "repeatable": false, | ||
| "component": "r-and-d-page.kleros-book" | ||
| }, | ||
| "tabName": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-research-tab-section controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::r-and-d-page-research-tab-section.r-and-d-page-research-tab-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-research-tab-section router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::r-and-d-page-research-tab-section.r-and-d-page-research-tab-section'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * r-and-d-page-research-tab-section service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::r-and-d-page-research-tab-section.r-and-d-page-research-tab-section'); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "kind": "collectionType", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "collectionName": "researches", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "info": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "singularName": "research", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pluralName": "researches", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "displayName": "research", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "options": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "draftAndPublish": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pluginOptions": {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "attributes": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "field": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "text" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "url": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "icon": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "media", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "multiple": false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "required": false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "allowedTypes": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "images", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "files", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "videos", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "audios" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+32
Contributor
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 Improve field definitions and add validation. The current attribute definitions need enhancement:
"attributes": {
- "field": {
- "type": "text"
+ "researchField": {
+ "type": "text",
+ "required": true
},
"url": {
- "type": "string"
+ "type": "string",
+ "required": true,
+ "regex": "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"
},
"icon": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
- "images",
- "files",
- "videos",
- "audios"
+ "images"
]
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * research controller | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi' | ||
|
|
||
| export default factories.createCoreController('api::research.research'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * research router | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::research.research'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /** | ||
| * research service | ||
| */ | ||
|
|
||
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreService('api::research.research'); |
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 validation for required fields
The
namefield should be marked as required and have a maximum length constraint."name": { - "type": "string" + "type": "string", + "required": true, + "maxLength": 100 }📝 Committable suggestion