Skip to content

Commit

Permalink
fix: sider issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anupamvs committed Apr 14, 2021
1 parent 8fef290 commit cb7c908
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
10 changes: 5 additions & 5 deletions erpnext/crm/doctype/linkedin_settings/linkedin_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// For license information, please see license.txt

frappe.ui.form.on('LinkedIn Settings', {
onload: function(frm){
if (frm.doc.session_status == 'Expired' && frm.doc.consumer_key && frm.doc.consumer_secret){
onload: function(frm) {
if (frm.doc.session_status == 'Expired' && frm.doc.consumer_key && frm.doc.consumer_secret) {
frappe.confirm(
__('Session not valid, Do you want to login?'),
function(){
Expand All @@ -16,7 +16,7 @@ frappe.ui.form.on('LinkedIn Settings', {
}
frm.dashboard.set_headline(__("For more information, {0}.", [`<a target='_blank' href='https://docs.erpnext.com/docs/user/manual/en/CRM/linkedin-settings'>${__('Click here')}</a>`]));
},
refresh: function(frm){
refresh: function(frm) {
if (frm.doc.session_status=="Expired"){
let msg = __("Session Not Active. Save doc to login.");
frm.dashboard.set_headline_alert(
Expand Down Expand Up @@ -54,7 +54,7 @@ frappe.ui.form.on('LinkedIn Settings', {
);
}
},
login: function(frm){
login: function(frm) {
if (frm.doc.consumer_key && frm.doc.consumer_secret){
frappe.dom.freeze();
frappe.call({
Expand All @@ -68,7 +68,7 @@ frappe.ui.form.on('LinkedIn Settings', {
});
}
},
after_save: function(frm){
after_save: function(frm) {
frm.trigger("login");
}
});
5 changes: 3 additions & 2 deletions erpnext/crm/doctype/linkedin_settings/linkedin_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# For license information, please see license.txt

from __future__ import unicode_literals
import frappe, requests
import frappe
import requests
from frappe import _
from frappe.utils import get_site_url, get_url_to_form
from frappe.utils import get_url_to_form
from frappe.model.document import Document
from frappe.utils.file_manager import get_file_path
from six.moves.urllib.parse import urlencode
Expand Down
18 changes: 9 additions & 9 deletions erpnext/crm/doctype/social_media_post/social_media_post_list.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
frappe.listview_settings['Social Media Post'] = {
add_fields: ["status","post_status"],
get_indicator: function(doc) {
return [__(doc.post_status), {
"Scheduled": "orange",
"Posted": "green",
"Error": "red",
"Deleted": "red"
}[doc.post_status]];
}
add_fields: ["status","post_status"],
get_indicator: function(doc) {
return [__(doc.post_status), {
"Scheduled": "orange",
"Posted": "green",
"Error": "red",
"Deleted": "red"
}[doc.post_status]];
}
}
12 changes: 6 additions & 6 deletions erpnext/crm/doctype/twitter_settings/twitter_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// For license information, please see license.txt

frappe.ui.form.on('Twitter Settings', {
onload: function(frm){
onload: function(frm) {
if (frm.doc.session_status == 'Expired' && frm.doc.consumer_key && frm.doc.consumer_secret){
frappe.confirm(
__('Session not valid, Do you want to login?'),
Expand All @@ -16,9 +16,9 @@ frappe.ui.form.on('Twitter Settings', {
}
frm.dashboard.set_headline(__("For more information, {0}.", [`<a target='_blank' href='https://docs.erpnext.com/docs/user/manual/en/CRM/twitter-settings'>${__('Click here')}</a>`]));
},
refresh: function(frm){
refresh: function(frm) {
let msg, color, flag=false;
if (frm.doc.session_status == "Active"){
if (frm.doc.session_status == "Active") {
msg = __("Session Active");
color = 'green';
flag = true;
Expand All @@ -29,7 +29,7 @@ frappe.ui.form.on('Twitter Settings', {
flag = true;
}

if (flag){
if (flag) {
frm.dashboard.set_headline_alert(
`<div class="row">
<div class="col-xs-12">
Expand All @@ -39,7 +39,7 @@ frappe.ui.form.on('Twitter Settings', {
);
}
},
login: function(frm){
login: function(frm) {
if (frm.doc.consumer_key && frm.doc.consumer_secret){
frappe.dom.freeze();
frappe.call({
Expand All @@ -53,7 +53,7 @@ frappe.ui.form.on('Twitter Settings', {
});
}
},
after_save: function(frm){
after_save: function(frm) {
frm.trigger("login");
}
});

0 comments on commit cb7c908

Please sign in to comment.