Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions cms-backend/src/api/fellow/content-types/fellow/schema.json
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"
},
Comment on lines +14 to +16
Copy link
Contributor

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 name field should be marked as required and have a maximum length constraint.

 "name": {
-  "type": "string"
+  "type": "string",
+  "required": true,
+  "maxLength": 100
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": {
"type": "string"
},
"name": {
"type": "string",
"required": true,
"maxLength": 100
},

"profession": {
"type": "string"
},
"workText": {
"type": "string"
},
"arrowLinkText": {
"type": "string"
},
"reportUrl": {
"type": "string"
},
Comment on lines +26 to +28
Copy link
Contributor

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

The reportUrl field should include URL format validation.

 "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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"reportUrl": {
"type": "string"
},
"reportUrl": {
"type": "string",
"regex": "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"
},

"profilePic": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
}
Comment on lines +29 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"profilePic": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
}
"profilePic": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false,
"required": true
}

}
}
7 changes: 7 additions & 0 deletions cms-backend/src/api/fellow/controllers/fellow.ts
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');
7 changes: 7 additions & 0 deletions cms-backend/src/api/fellow/routes/fellow.ts
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');
7 changes: 7 additions & 0 deletions cms-backend/src/api/fellow/services/fellow.ts
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  1. Adding required validations for essential fields
  2. Including character limits for string fields
  3. Adding field descriptions for content editors
  4. Setting default values where appropriate

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"attributes": {
"header": {
"type": "string"
},
"subtitle": {
"type": "text"
},
"testimonialsHeader": {
"type": "string"
},
"fellowsHeader": {
"type": "string"
},
"tabName": {
"type": "string"
}
"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"
}

}
}
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');
33 changes: 33 additions & 0 deletions cms-backend/src/api/research/content-types/research/schema.json
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  1. The field attribute name is too generic - consider renaming it to something more specific (e.g., researchField or description)
  2. The url field should include pattern validation for valid URLs
  3. The icon field allows all media types but should probably be restricted to images only
  4. Consider making essential fields required
  "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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"attributes": {
"field": {
"type": "text"
},
"url": {
"type": "string"
},
"icon": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
]
}
}
"attributes": {
"researchField": {
"type": "text",
"required": true
},
"url": {
"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"
]
}
}

}
7 changes: 7 additions & 0 deletions cms-backend/src/api/research/controllers/research.ts
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');
7 changes: 7 additions & 0 deletions cms-backend/src/api/research/routes/research.ts
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');
7 changes: 7 additions & 0 deletions cms-backend/src/api/research/services/research.ts
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');
Loading