Skip to content

Commit

Permalink
Merge pull request #3 from magento/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tzyganu authored Oct 20, 2017
2 parents 3391728 + e7c5bb5 commit 4f82d60
Show file tree
Hide file tree
Showing 10,614 changed files with 143,755 additions and 121,727 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .github/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order deny,allow
Deny from all
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.metadata
/.project
/.settings
/.vscode
atlassian*
/nbproject
/robots.txt
Expand Down
4 changes: 0 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@
order allow,deny
deny from all
</Files>
<Files CONTRIBUTING.md>
order allow,deny
deny from all
</Files>
<Files COPYING.txt>
order allow,deny
deny from all
Expand Down
4 changes: 0 additions & 4 deletions .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@
order allow,deny
deny from all
</Files>
<Files CONTRIBUTING.md>
order allow,deny
deny from all
</Files>
<Files COPYING.txt>
order allow,deny
deny from all
Expand Down
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ env:
- TEST_SUITE=integration INTEGRATION_INDEX=1
- TEST_SUITE=integration INTEGRATION_INDEX=2
- TEST_SUITE=integration INTEGRATION_INDEX=3
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
- TEST_SUITE=functional
matrix:
exclude:
- php: 7.0
Expand All @@ -40,9 +39,7 @@ matrix:
- php: 7.0
env: TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
- php: 7.0
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
env: TEST_SUITE=functional
cache:
apt: true
directories:
Expand All @@ -51,13 +48,13 @@ cache:
- $HOME/node_modules
- $HOME/yarn.lock
before_install: ./dev/travis/before_install.sh
install: composer install --no-interaction --prefer-dist
install: composer install --no-interaction
before_script: ./dev/travis/before_script.sh
script:
# Set arguments for variants of phpunit based tests; '|| true' prevents failing script when leading test fails
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
6 changes: 3 additions & 3 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@

date_default_timezone_set('UTC');

/* Adjustment of precision value for several versions of PHP */
ini_set('precision', 17);
ini_set('serialize_precision', 17);
/* For data consistency between displaying (printing) and serialization a float number */
ini_set('precision', 14);
ini_set('serialize_precision', 14);
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Backend\Block\Widget\Grid\Container
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class UnreadMessagePopup extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/ToolbarEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @api
* @author Magento Core Team <[email protected]>
* @since 100.0.2
*/
class ToolbarEntry extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Window extends \Magento\Backend\Block\Template
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
abstract class Notification extends \Magento\Backend\App\AbstractAction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;

use Magento\Backend\App\Action;
use Magento\Framework\Controller\ResultFactory;

class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
{
/**
* @var \Magento\AdminNotification\Model\NotificationService
*/
private $notificationService;

/**
* @param Action\Context $context
* @param \Magento\AdminNotification\Model\NotificationService|null $notificationService
* @throws \RuntimeException
*/
public function __construct(
Action\Context $context,
\Magento\AdminNotification\Model\NotificationService $notificationService = null
) {
parent::__construct($context);
$this->notificationService = $notificationService?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\AdminNotification\Model\NotificationService::class);
}

/**
* Mark notification as read (AJAX action)
*
* @return void
* @return \Magento\Framework\Controller\Result\Json|void
* @throws \InvalidArgumentException
*/
public function execute()
{
Expand All @@ -21,17 +44,15 @@ public function execute()
$notificationId = (int)$this->getRequest()->getPost('id');
$responseData = [];
try {
$this->_objectManager->create(
\Magento\AdminNotification\Model\NotificationService::class
)->markAsRead(
$notificationId
);
$this->notificationService->markAsRead($notificationId);
$responseData['success'] = true;
} catch (\Exception $e) {
$responseData['success'] = false;
}
$this->getResponse()->representJson(
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
);

/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($responseData);
return $resultJson;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

class ListAction extends \Magento\Backend\App\AbstractAction
{
/**
* Authorization level of a basic admin session
*/
const ADMIN_RESOURCE = 'Magento_AdminNotification::show_list';

/**
* @var \Magento\Framework\Json\Helper\Data
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Frequency implements \Magento\Framework\Option\ArrayInterface
{
Expand Down
18 changes: 15 additions & 3 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* @author Magento Core Team <[email protected]>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @api
* @since 100.0.2
*/
class Feed extends \Magento\Framework\Model\AbstractModel
{
Expand Down Expand Up @@ -147,9 +148,9 @@ public function checkUpdate()
$feedData[] = [
'severity' => (int)$item->severity,
'date_added' => date('Y-m-d H:i:s', $itemPublicationDate),
'title' => (string)$item->title,
'description' => (string)$item->description,
'url' => (string)$item->link,
'title' => $this->escapeString($item->title),
'description' => $this->escapeString($item->description),
'url' => $this->escapeString($item->link),
];
}
}
Expand Down Expand Up @@ -245,4 +246,15 @@ public function getFeedXml()

return $xml;
}

/**
* Converts incoming data to string format and escapes special characters.
*
* @param \SimpleXMLElement $data
* @return string
*/
private function escapeString(\SimpleXMLElement $data)
{
return htmlspecialchars((string)$data);
}
}
3 changes: 1 addition & 2 deletions app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* AdminNotification Inbox model
*
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox _getResource()
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox getResource()
* @method int getSeverity()
* @method \Magento\AdminNotification\Model\Inbox setSeverity(int $value)
* @method string getDateAdded()
Expand All @@ -30,6 +28,7 @@
* @method \Magento\AdminNotification\Model\Inbox setIsRemove(int $value)
*
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface, InboxInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @author Magento Core Team <[email protected]>
* @api
* @since 100.0.2
*/
interface InboxInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @author Magento Core Team <[email protected]>
* @api
* @since 100.0.2
*/
class NotificationService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @api
* @author Magento Core Team <[email protected]>
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Critical extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

/**
* @api
* @since 100.0.2
*/
class Unread extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* @api
* @since 100.0.2
*/
class Synchronized extends \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Store\Model\Store;

/**
* @deprecated
* @deprecated 100.1.0
*/
class Baseurl implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Loading

0 comments on commit 4f82d60

Please sign in to comment.