Skip to content

Commit

Permalink
Merge pull request #192 from mageplaza/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
haitv282 authored Jun 29, 2020
2 parents dc976d6 + 9b7b6a1 commit 08c8325
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 62 deletions.
2 changes: 1 addition & 1 deletion Controller/Social/AbstractSocial.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected function _loginPostRedirect()
}
}

$object = ObjectManager::getInstance()->create(DataObject::class, ['url' => $url]);
$object = new DataObject(['url' => $url]);
$this->_eventManager->dispatch(
'social_manager_get_login_redirect',
[
Expand Down
6 changes: 1 addition & 5 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public function captchaResolve(RequestInterface $request, $formId)
*/
public function canSendPassword($storeId = null)
{
return !in_array(
'password',
explode(',', $this->getFieldCanShow()),
true
) && $this->getConfigGeneral('send_password', $storeId);
return $this->getConfigGeneral('send_password', $storeId);
}

/**
Expand Down
31 changes: 0 additions & 31 deletions Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,44 +75,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
'Is Send Password Email'
)
->addColumn('type', Table::TYPE_TEXT, 255, ['default' => ''], 'Type')
->addColumn(
'social_created_at',
Table::TYPE_TIMESTAMP,
'Social Created At'
)
->addColumn(
'user_id',
Table::TYPE_INTEGER,
10,
[
'nullable' => true,
'unsigned' => true,
],
'User Id'
)
->addColumn(
'status',
Table::TYPE_TEXT,
255,
[
'nullable' => true,
],
'Status'
)
->addForeignKey(
$installer->getFkName('mageplaza_social_customer', 'customer_id', 'customer_entity', 'entity_id'),
'customer_id',
$installer->getTable('customer_entity'),
'entity_id',
Table::ACTION_CASCADE
)
->addForeignKey(
$installer->getFkName('mageplaza_social_customer', 'user_id', 'admin_user', 'user_id'),
'user_id',
$installer->getTable('admin_user'),
'user_id',
Table::ACTION_CASCADE
)
->setComment('Social Customer Table');

$installer->getConnection()->createTable($table);
Expand Down
55 changes: 43 additions & 12 deletions Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,50 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
$installer->startSetup();
$connection = $installer->getConnection();
$tableName = $setup->getTable('mageplaza_social_customer');
if (version_compare($context->getVersion(), '1.1.0', '<')
&& $connection->tableColumnExists($tableName, 'social_created_at') === false
) {
$connection->addColumn(
$tableName,
'social_created_at',
[
'type' => Table::TYPE_TIMESTAMP,
'comment' => 'Social Created At',
]
);
if (version_compare($context->getVersion(), '1.2.0', '<')) {
if ($connection->tableColumnExists($tableName, 'social_created_at') === false) {
$connection->addColumn(
$tableName,
'social_created_at',
[
'type' => Table::TYPE_TIMESTAMP,
'comment' => 'Social Created At',
]
);
}
if ($connection->tableColumnExists($tableName, 'user_id') === false) {
$connection->addColumn(
$tableName,
'user_id',
[
'type' => Table::TYPE_INTEGER,
'nullable' => true,
'unsigned' => true,
'comment' => 'User Id',
]
);
$connection->addForeignKey(
$installer->getFkName('mageplaza_social_customer', 'user_id', 'admin_user', 'user_id'),
$tableName,
'user_id',
$installer->getTable('admin_user'),
'user_id',
Table::ACTION_CASCADE
);
}
if ($connection->tableColumnExists($tableName, 'status') === false) {
$connection->addColumn(
$tableName,
'status',
[
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Status',
]
);
}
}

$installer->endSetup();
}
}
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
"mageplaza/module-smtp": "^1.2.6",
"mageplaza/module-google-recaptcha": "^1.0.2",
"hybridauth/hybridauth": "^2.14.0"
}
,
},
"require-dev": {
"roave/security-advisories": "dev-master"
},
"type": "magento2-module",
"version": "2.8.2",
"version": "2.8.3",
"license": "proprietary",
"authors": [
{
Expand Down
3 changes: 3 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<label>Require More Info.</label>
<source_model>Mageplaza\SocialLogin\Model\System\Config\Source\RequestInfo</source_model>
<comment>Request the customer to enter information when creating an account.</comment>
<depends>
<field id="popup_login" separator=",">quick_login,popup_login,popup_slide</field>
</depends>
</field>
<field id="information_require" translate="label comment" type="multiselect" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Information Required</label>
Expand Down
13 changes: 6 additions & 7 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@
</module>
<general>
<enabled>0</enabled>
<link_trigger>.header.links, .section-item-content .header.links</link_trigger>
<link_trigger>.header.links, .section-item-content .header.links, .authorization-link</link_trigger>
<send_password>1</send_password>
<social_display>1,2,3,4</social_display>
<popup_login>popup_slide</popup_login>
<authentication_popup>1</authentication_popup>
<authentication_popup>0</authentication_popup>
<popup_effect>mfp-move-from-top</popup_effect>
<style_management>#6e716e</style_management>
<require_more_info>2</require_more_info>
<information_require>email,name,password</information_require>
<custom_css>
#bnt-social-login-fake-email {
#bnt-social-login-fake-email {
background-color: grey !important;
border: grey !important;
}
}

#request-popup .social-login-title {
#request-popup .social-login-title {
background-color: grey !important;
}
}
</custom_css>
</general>
<facebook>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mageplaza_SocialLogin" setup_version="1.1.0">
<module name="Mageplaza_SocialLogin" setup_version="1.2.0">
<sequence>
<module name="Mageplaza_Core"/>
</sequence>
Expand Down
4 changes: 4 additions & 0 deletions view/frontend/web/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
margin-bottom: unset !important;
}

.btn-authentication-pop {
width: 175px;
}


.social-login-authentication-channel .actions-toolbar.social-btn > .primary .action {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ define(
*/
showEmail: function () {
var wrapper = $('#request-popup'),
actions = ['customer_account_login', 'customer_account_create'];
actions = ['customer_account_login', 'customer_account_create', 'multishipping_checkout_login'];

if (this.options.popupLogin !== 'popup_login') {
if (this.options.popupLogin === 'popup_slide') {
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/template/social-buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="block social-login-authentication-popup col-mp">
<div class="block-content" data-bind="foreach: socials()">
<div class="actions-toolbar social-btn" data-bind="css: key + '-login'">
<a class="btn btn-block btn-social"
<a class="btn btn-block btn-social btn-authentication-pop"
data-bind="css: 'btn-' + btn_key, socialButton: $parent.isActive, url: url">
<span class="fa" data-bind="css: 'fa-' + btn_key"></span>
<p style="padding: 0px 20px;" data-bind="text: 'Sign in with ' + label"></p>
Expand Down

0 comments on commit 08c8325

Please sign in to comment.