Skip to content

Commit

Permalink
feat: removed facebook login references
Browse files Browse the repository at this point in the history
  • Loading branch information
Slicit committed Apr 20, 2021
1 parent 324d7c5 commit 919cc1a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 74 deletions.
12 changes: 9 additions & 3 deletions ionic/www/dist/lazy/picker/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,12 @@
var year = this.format.year ?
this.date.getFullYear() : (new Date()).getFullYear();
var dayOfWeek = (new Date(year+ '-' + month + '-' + textContent)).getDay();
if (this.options.showWeekDays) {
if (this.options.showWeekDays &&
this.options.weekDays.hasOwnProperty(dayOfWeek)) {
textContent = this.options.weekDays[dayOfWeek] + ' ' + textContent;
}
if (this.options.showWeekDaysShort) {
if (this.options.showWeekDaysShort &&
this.options.weekDaysShort.hasOwnProperty(dayOfWeek)) {
textContent = this.options.weekDaysShort[dayOfWeek] + ' ' + textContent;
}
}
Expand Down Expand Up @@ -1107,6 +1109,10 @@

addClass(picker, CLASS_OPENED);

// Prevent today to not be disbled!
this.nextDay();
this.prevDay();

if (immediate) {
done();
} else {
Expand Down Expand Up @@ -1902,4 +1908,4 @@

return Picker;

}));
}));
14 changes: 1 addition & 13 deletions ionic/www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ var App = angular.module('starter', ['ionic', 'lodash', 'ngRoute', 'ngCordova',
.run(function ($injector, $ionicConfig, $ionicHistory, $ionicNavBarDelegate, $ionicPlatform, $ionicPopup,
$ionicScrollDelegate, $ionicSlideBoxDelegate, $location, $log, $ocLazyLoad, $pwaRequest, $q,
$rootScope, $session, $state, $templateCache, $timeout, $translate, $window, AdmobService,
Analytics, Application, Customer, Codescan, Dialog, Facebook, FacebookConnect, Padlock,
Analytics, Application, Customer, Codescan, Dialog, Padlock,
Pages, Push, PushService, SB, InAppLinks) {

// $rootScope object!
Expand Down Expand Up @@ -294,14 +294,8 @@ var App = angular.module('starter', ['ionic', 'lodash', 'ngRoute', 'ngCordova',
$ionicConfig.backButton.icon('none');

Customer.populate(data.loadBlock.customer);
Customer.setFacebookLogin(data.loadBlock.application.facebook);
Pages.populate(data.featureBlock);

// Login Facebook HTML5!
if (LOGIN_FB) {
Customer.loginWithFacebook(fbtoken);
}

var HomepageLayout = $injector.get('HomepageLayout');

// Append custom CSS/SCSS to the page!
Expand Down Expand Up @@ -417,12 +411,6 @@ var App = angular.module('starter', ['ionic', 'lodash', 'ngRoute', 'ngCordova',
window.updateStatusBar($window.colors.header.statusBarColor);
}

if (load.application.facebook.id) {
FacebookConnect.permissions = (!Array.isArray(load.application.facebook.scope)) ?
[load.application.facebook.scope] : load.application.facebook.scope;
FacebookConnect.app_id = load.application.facebook.id;
}

try {
AdmobService.init(load.application.admob);
} catch (error) {
Expand Down
9 changes: 1 addition & 8 deletions ionic/www/js/controllers/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ angular
.module('starter')
.controller('CustomerController', function ($state, $ionicHistory, $cordovaCamera, $ionicActionSheet, Loader,
$ionicPopup, Customer, $ionicScrollDelegate, $rootScope, $scope, $timeout,
$translate, $session, Application, Dialog, FacebookConnect,
$translate, $session, Application, Dialog,
HomepageLayout, Modal, Picture, CropImage, Pages, Push, PushService) {

/**
Expand All @@ -31,7 +31,6 @@ angular
display_login_form: (!$scope.is_logged_in) && (!Customer.display_account_form),
display_account_form: ($scope.is_logged_in || Customer.display_account_form),
display_settings: false,
can_connect_with_facebook: !!Customer.can_connect_with_facebook,
privacy_policy: Application.privacyPolicy.text,
privacy_policy_gdpr: Application.privacyPolicy.gdpr,
gdpr: {
Expand All @@ -40,7 +39,6 @@ angular
myAccount: {
title: $translate.instant('My account', 'customer'),
settings: {
enable_facebook_login: true,
enable_registration: true,
enable_commercial_agreement: true,
enable_commercial_agreement_label: $translate.instant("I'd like to hear about offers & services", 'customer'),
Expand Down Expand Up @@ -287,10 +285,6 @@ angular
Customer.requestToken();
};

$scope.loginFacebook = function () {
FacebookConnect.login();
};

$scope.avatarUrl = function () {
// Means the customer image was edited!
if ($scope.customer.image &&
Expand Down Expand Up @@ -403,7 +397,6 @@ angular
.logout()
.then(function (data) {
if (data.success) {
FacebookConnect.logout();
Customer.hideModal();

// Reset!
Expand Down
36 changes: 0 additions & 36 deletions ionic/www/js/factory/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ angular
display_account_form: false,
login_modal_hidden_subscriber: null,
is_logged_in: false,
facebook_login_enabled: false,
loginScope: null
};

Expand All @@ -30,7 +29,6 @@ angular
factory.is_logged_in = customer.isLoggedIn;
factory.id = customer.id;
factory.can_access_locked_features = customer.can_access_locked_features;
factory.can_connect_with_facebook = customer.can_connect_with_facebook;

if (factory.is_logged_in) {
$rootScope.$broadcast(SB.EVENTS.AUTH.loginSuccess);
Expand All @@ -39,15 +37,6 @@ angular
factory.saveCredentials(customer.token);
};

/**
* Disable facebook login if no API is set.
*
* @param facebook
*/
factory.setFacebookLogin = function (facebook) {
factory.facebook_login_enabled = !(facebook.id === null || facebook.id === '');
};

/**
*
*/
Expand Down Expand Up @@ -165,31 +154,6 @@ angular
return promise;
};

factory.loginWithFacebook = function (token) {
var data = {
device_uid: device.uuid,
token: token
};

var promise = $pwaRequest.post('customer/mobile_account_login/loginwithfacebook', {
data: data,
cache: false
});

promise
.then(function (result) {
factory.populate(result.customer);

return result;
}, function (error) {
Dialog.alert('Error', error.message, 'OK', -1);

return error;
});

return promise;
};

factory.register = function (customer) {
var localCustomer = angular.extend({}, customer, {
device_uid: $session.getDeviceUid()
Expand Down
14 changes: 0 additions & 14 deletions ionic/www/templates/customer/account/l1/login-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@
<div class="list"
ng-class="{'card': card_design}">

<div class="item item-text-wrap item-icon-left item-custom"
ng-click="loginFacebook()"
ng-if="!customer.is_logged_in && myAccount.settings.enable_facebook_login"
ng-show="_facebook_enabled">
<i class="icon ion-social-facebook-outline"></i>
{{ ::'Log in with Facebook' | translate:'customer' }}
</div>

<div class="item item-divider item-divider-custom text-center"
ng-if="!customer.is_logged_in && myAccount.settings.enable_facebook_login"
ng-show="_facebook_enabled">
<p>{{ ::'Or with your account' | translate:'customer' }}</p>
</div>

<label class="item item-input item-custom">
<i class="icon ion-ios-person"></i>
<input type="email"
Expand Down

0 comments on commit 919cc1a

Please sign in to comment.