-
Notifications
You must be signed in to change notification settings - Fork 99
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
J4x #151
base: master
Are you sure you want to change the base?
J4x #151
Changes from all commits
f21f7d0
7f03d3f
37245e0
7e5af12
16a8b8f
c872bf9
7042d40
0c85b39
e1e49cc
57c7a8d
be1b3b4
0d3b65d
97784df
e500724
ba275da
6e73e08
ce2e52d
8c573df
e1b7da1
fb62b30
279d432
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,74 @@ | ||
language: "en" | ||
|
||
early_access: false | ||
|
||
reviews: | ||
request_changes_workflow: true | ||
high_level_summary: true | ||
poem: false | ||
review_status: true | ||
collapse_walkthrough: false | ||
path_filters: | ||
# Exclude XML files for manifest and configuration | ||
- "!**/*.xml" | ||
# Exclude language files (translations) | ||
- "!**/language/**/*.ini" | ||
# Exclude asset files that don’t need review | ||
- "!**/*.svg" | ||
- "!**/*.png" | ||
- "!**/*.jpg" | ||
- "!**/*.jpeg" | ||
- "!**/*.gif" | ||
- "!**/*.ico" | ||
# Exclude compiled and minified files | ||
- "!**/*.min.js" | ||
- "!**/*.min.css" | ||
# Exclude SCSS files if they are intermediate and do not need review | ||
- "!**/templates/**/*.scss" | ||
# Exclude libraries and vendor code (third-party dependencies) | ||
- "!**/node_modules/**" | ||
- "!**/vendor/**" | ||
# Exclude build files | ||
- "!**/build/**" | ||
# Exclude configuration files that are environment-specific | ||
- "!**/configuration.php" | ||
path_instructions: | ||
# JavaScript files: front-end interactivity and functionality | ||
- path: "**/*.js" | ||
instructions: | | ||
"Review JavaScript code to ensure: | ||
- Adherence to Google JavaScript style guide. | ||
- Efficient DOM manipulation suitable for Joomla’s frontend. | ||
- Use of Joomla’s core JavaScript libraries where applicable (e.g., jQuery compatibility). | ||
- Best practices for asynchronous requests if AJAX is used." | ||
- path: "**/*.php" | ||
instructions: | | ||
"Review the PHP code for Joomla coding standards compliance, ensuring: | ||
- Code follows Joomla's coding standards, validated using PHPCS with the Joomla standard. | ||
- Adherence to Joomla’s MVC structure for extensions. | ||
- Proper use of Joomla’s built-in functions (e.g., Input, Factory). | ||
- SQL queries use Joomla’s database API to prevent SQL injection. | ||
- Code is well-documented, with clear function and class descriptions." | ||
- path: "**/*.ts" | ||
instructions: | | ||
"Review the JavaScript code for conformity with the Google JavaScript style guide, highlighting any deviations. Ensure that: | ||
- The code adheres to best practices associated with nodejs. | ||
- The code adheres to best practices associated with nestjs framework. | ||
- The code adheres to best practices recommended for performance. | ||
- The code adheres to similar naming conventions for controllers, models, services, methods, variables." | ||
auto_review: | ||
enabled: true | ||
ignore_title_keywords: | ||
- "WIP" | ||
- "DO NOT MERGE" | ||
drafts: false | ||
base_branches: | ||
- "master" | ||
- "dev" | ||
- "j4x" | ||
- "feat/*" | ||
- "feat-*" | ||
- "release-*" | ||
|
||
chat: | ||
auto_reply: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Changelog | ||
|
||
#### Legend | ||
|
||
- Bug Fix (-) | ||
- Feature Addition (+) | ||
|
||
### com_api v4.0.0 | ||
|
||
##### - Bug fixes: | ||
- #194540 - API Rate Limit Exceeded,403 - Issue #122 | ||
- Drop support to accept token as 'Key' parameter from GET/POST request - Tokens should not be accepted via request variables | ||
|
||
|
||
##### + Features Added: | ||
- #175851 - Joomla 4 & PHP 8.0 compatible | ||
- #194541 - Added IP based restrictions to access the APIs, Issue #63 |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,6 +12,7 @@ | |||||||||||||||||||||||||||
use Joomla\CMS\MVC\Controller\AdminController; | ||||||||||||||||||||||||||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel; | ||||||||||||||||||||||||||||
use Joomla\CMS\Factory; | ||||||||||||||||||||||||||||
use Joomla\Utilities\ArrayHelper; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||
* Keys list controller class. | ||||||||||||||||||||||||||||
|
@@ -30,7 +31,7 @@ class ApiControllerKeys extends AdminController | |||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||
* @since 3.0 | ||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||
public function getModel($name = 'key', $prefix = 'ApiModel') | ||||||||||||||||||||||||||||
public function getModel($name = 'key', $prefix = 'ApiModel', $config = array()) | ||||||||||||||||||||||||||||
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 Update method documentation to match new signature The DocBlock needs to be updated to:
Apply this diff to update the documentation: /**
* Method to get a model object, loading it if required.
*
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
+ * @param array $config Configuration array for model. Optional.
*
- * @return \BaseDatabaseModel|boolean Model object on success; otherwise false on failure.
+ * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel|boolean Model object on success; otherwise false on failure.
*
* @since 3.0
*/ 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true)); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -52,8 +53,8 @@ public function saveOrderAjax() | |||||||||||||||||||||||||||
$order = $input->post->get('order', array(), 'array'); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Sanitize the input | ||||||||||||||||||||||||||||
JArrayHelper::toInteger($pks); | ||||||||||||||||||||||||||||
JArrayHelper::toInteger($order); | ||||||||||||||||||||||||||||
ArrayHelper::toInteger($pks); | ||||||||||||||||||||||||||||
ArrayHelper::toInteger($order); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Get the model | ||||||||||||||||||||||||||||
$model = $this->getModel(); | ||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
*/ | ||
|
||
defined('JPATH_BASE') or die(); | ||
|
||
use Joomla\CMS\Form\FormField; | ||
use Joomla\CMS\Factory; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
use Joomla\CMS\Form\Form; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\Toolbar\ToolbarHelper; | ||
|
||
|
||
/** | ||
* View class key form. | ||
|
@@ -95,11 +97,11 @@ protected function addToolbar() | |
|
||
if (JVERSION >= '3.0') | ||
{ | ||
JToolBarHelper::title($viewTitle, 'pencil-2'); | ||
ToolBarHelper::title($viewTitle, 'pencil-2'); | ||
} | ||
else | ||
{ | ||
JToolBarHelper::title($viewTitle, 'key.png'); | ||
ToolBarHelper::title($viewTitle, 'key.png'); | ||
Comment on lines
99
to
+104
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 Modernize toolbar implementation Several improvements can be made to align with current Joomla 4.x practices:
Apply these changes: - if (JVERSION >= '3.0')
- {
- ToolBarHelper::title($viewTitle, 'pencil-2');
- }
- else
- {
- ToolBarHelper::title($viewTitle, 'key.png');
- }
+ ToolBarHelper::title($viewTitle, 'icon-pencil-2');
// ... other code ...
- ToolBarHelper::custom('key.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ ToolBarHelper::custom('key.save2new', 'icon-save-new', '', 'JTOOLBAR_SAVE_AND_NEW', false);
- ToolBarHelper::custom('key.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ ToolBarHelper::custom('key.save2copy', 'icon-save-copy', '', 'JTOOLBAR_SAVE_AS_COPY', false); Also applies to: 121-122, 127-127, 133-133, 138-138, 142-142 |
||
} | ||
|
||
if (isset($this->item->checked_out)) | ||
|
@@ -116,28 +118,28 @@ protected function addToolbar() | |
// If not checked out, can save the item. | ||
if (! $checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.create')))) | ||
{ | ||
JToolBarHelper::apply('key.apply', 'JTOOLBAR_APPLY'); | ||
JToolBarHelper::save('key.save', 'JTOOLBAR_SAVE'); | ||
ToolBarHelper::apply('key.apply', 'JTOOLBAR_APPLY'); | ||
ToolBarHelper::save('key.save', 'JTOOLBAR_SAVE'); | ||
} | ||
|
||
if (! $checkedOut && ($canDo->get('core.create'))) | ||
{ | ||
JToolBarHelper::custom('key.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); | ||
ToolBarHelper::custom('key.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); | ||
} | ||
|
||
// If an existing item, can save to a copy. | ||
if (! $isNew && $canDo->get('core.create')) | ||
{ | ||
JToolBarHelper::custom('key.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); | ||
ToolBarHelper::custom('key.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); | ||
} | ||
|
||
if (empty($this->item->id)) | ||
{ | ||
JToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CANCEL'); | ||
ToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CANCEL'); | ||
} | ||
else | ||
{ | ||
JToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CLOSE'); | ||
ToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CLOSE'); | ||
} | ||
} | ||
} |
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
Consider adding security-focused review guidelines.
While the current instructions are comprehensive for code quality, consider adding explicit security-focused review points, especially for JavaScript and TypeScript files.
📝 Committable suggestion