From 9efe7569a7e6b91f4bc884c9a264d966476297b2 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 30 Sep 2020 14:17:40 +0530 Subject: [PATCH 1/9] chore: update logos --- frappe/public/icons/social/frappe.svg | 16 +++++-- frappe/public/icons/social/office365.svg | 53 ----------------------- frappe/public/icons/social/office_365.svg | 53 +++++++++++++++++++++++ frappe/public/scss/login.scss | 12 ++--- 4 files changed, 72 insertions(+), 62 deletions(-) delete mode 100644 frappe/public/icons/social/office365.svg create mode 100644 frappe/public/icons/social/office_365.svg diff --git a/frappe/public/icons/social/frappe.svg b/frappe/public/icons/social/frappe.svg index 533f3ba759..9fcb3c8242 100644 --- a/frappe/public/icons/social/frappe.svg +++ b/frappe/public/icons/social/frappe.svg @@ -1,4 +1,12 @@ - - - - + + + + Artboard + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/frappe/public/icons/social/office365.svg b/frappe/public/icons/social/office365.svg deleted file mode 100644 index aecaa0f618..0000000000 --- a/frappe/public/icons/social/office365.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - office365 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/frappe/public/icons/social/office_365.svg b/frappe/public/icons/social/office_365.svg new file mode 100644 index 0000000000..d93167741d --- /dev/null +++ b/frappe/public/icons/social/office_365.svg @@ -0,0 +1,53 @@ + + + + Artboard + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frappe/public/scss/login.scss b/frappe/public/scss/login.scss index 75b7d75371..198b432719 100644 --- a/frappe/public/scss/login.scss +++ b/frappe/public/scss/login.scss @@ -38,11 +38,13 @@ display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: var(--padding-sm); - } - .btn-social { - box-shadow: none; - .provider-icon { - margin-right: var(--padding-xs); + + .btn-social { + font-size: var(--text-sm); + box-shadow: none; + .provider-icon { + margin-right: var(--padding-xs); + } } } } From 0bd1fa1b22169e4a3113322fee0d43c1d36be477 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 30 Sep 2020 14:33:44 +0530 Subject: [PATCH 2/9] feat: add icons for salesforce and fairlogin --- .../doctype/social_login_key/social_login_key.py | 4 +++- frappe/public/icons/social/fair.svg | 11 +++++++++++ frappe/public/icons/social/salesforce.svg | 11 +++++++++++ frappe/public/scss/login.scss | 7 +++++++ frappe/www/login.py | 4 ++-- 5 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 frappe/public/icons/social/fair.svg create mode 100644 frappe/public/icons/social/salesforce.svg diff --git a/frappe/integrations/doctype/social_login_key/social_login_key.py b/frappe/integrations/doctype/social_login_key/social_login_key.py index 92d245bffb..1092c3240e 100644 --- a/frappe/integrations/doctype/social_login_key/social_login_key.py +++ b/frappe/integrations/doctype/social_login_key/social_login_key.py @@ -40,7 +40,9 @@ class SocialLoginKey(Document): "Frappe": "frappe.svg", "Facebook": "facebook.svg", "Office 365": "office_365.svg", - "GitHub": "github.svg" + "GitHub": "github.svg", + "Salesforce": "salesforce.svg", + "fairlogin": "fair.svg" } if self.provider_name in icon_map: diff --git a/frappe/public/icons/social/fair.svg b/frappe/public/icons/social/fair.svg new file mode 100644 index 0000000000..a56fa68cc8 --- /dev/null +++ b/frappe/public/icons/social/fair.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/frappe/public/icons/social/salesforce.svg b/frappe/public/icons/social/salesforce.svg new file mode 100644 index 0000000000..5ebec613aa --- /dev/null +++ b/frappe/public/icons/social/salesforce.svg @@ -0,0 +1,11 @@ + + + + Artboard + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/frappe/public/scss/login.scss b/frappe/public/scss/login.scss index 198b432719..dd29c638f8 100644 --- a/frappe/public/scss/login.scss +++ b/frappe/public/scss/login.scss @@ -42,6 +42,13 @@ .btn-social { font-size: var(--text-sm); box-shadow: none; + + &.btn-salesforce { + i { + color: var(--blue-400); + } + } + .provider-icon { margin-right: var(--padding-xs); } diff --git a/frappe/www/login.py b/frappe/www/login.py index 7b0972235c..c7ba2d85be 100644 --- a/frappe/www/login.py +++ b/frappe/www/login.py @@ -36,13 +36,13 @@ def get_context(context): context["disable_signup"] = frappe.utils.cint(frappe.db.get_value("Website Settings", "Website Settings", "disable_signup")) context["logo"] = frappe.get_hooks("app_logo_url")[-1] # context["app_title"] = frappe.get_hooks("app_title")[-1] - providers = [i.name for i in frappe.get_all("Social Login Key", filters={"enable_social_login":1})] + providers = [i.name for i in frappe.get_all("Social Login Key", filters={"enable_social_login":1}, order_by="name")] for provider in providers: client_id, base_url = frappe.get_value("Social Login Key", provider, ["client_id", "base_url"]) client_secret = get_decrypted_password("Social Login Key", provider, "client_secret") provider_name = frappe.get_value("Social Login Key", provider, "provider_name") - if provider_name in ["Google", "Facebook", "Frappe", "GitHub", "Office 365"]: + if provider_name in ["Google", "Facebook", "Frappe", "GitHub", "Office 365", "Salesforce", "fairlogin"]: icon_url = frappe.get_value("Social Login Key", provider, "icon") icon = "{1}".format(icon_url, provider_name) else: From b232dcc8f2d8c0e5d174738ee60c6fd4765b6b31 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 30 Sep 2020 14:37:40 +0530 Subject: [PATCH 3/9] feat: default icons for all --- .../doctype/social_login_key/social_login_key.json | 4 ++-- frappe/www/login.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/integrations/doctype/social_login_key/social_login_key.json b/frappe/integrations/doctype/social_login_key/social_login_key.json index 33c8ca873d..bb97d8f625 100644 --- a/frappe/integrations/doctype/social_login_key/social_login_key.json +++ b/frappe/integrations/doctype/social_login_key/social_login_key.json @@ -83,7 +83,7 @@ "label": "Identity Details" }, { - "depends_on": "eval:!['Facebook', 'Frappe', 'Github', 'Google', 'Office 365'].includes(doc.social_login_provider)", + "depends_on": "eval:doc.social_login_provider==\"Custom\"", "fieldname": "icon", "fieldtype": "Data", "label": "Icon" @@ -161,7 +161,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2020-09-30 13:40:57.597276", + "modified": "2020-09-30 14:37:13.616002", "modified_by": "Administrator", "module": "Integrations", "name": "Social Login Key", diff --git a/frappe/www/login.py b/frappe/www/login.py index c7ba2d85be..f59a6e5fff 100644 --- a/frappe/www/login.py +++ b/frappe/www/login.py @@ -42,7 +42,7 @@ def get_context(context): client_secret = get_decrypted_password("Social Login Key", provider, "client_secret") provider_name = frappe.get_value("Social Login Key", provider, "provider_name") - if provider_name in ["Google", "Facebook", "Frappe", "GitHub", "Office 365", "Salesforce", "fairlogin"]: + if provider_name != "Custom": icon_url = frappe.get_value("Social Login Key", provider, "icon") icon = "{1}".format(icon_url, provider_name) else: From d19327b61158f6e11029d7cb48b701feaafce121 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 30 Sep 2020 14:39:27 +0530 Subject: [PATCH 4/9] feat: add app_name field --- .../system_settings/system_settings.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/system_settings/system_settings.json b/frappe/core/doctype/system_settings/system_settings.json index 819bb89e72..e8a8164a51 100644 --- a/frappe/core/doctype/system_settings/system_settings.json +++ b/frappe/core/doctype/system_settings/system_settings.json @@ -6,6 +6,7 @@ "engine": "InnoDB", "field_order": [ "localization", + "app_name", "country", "language", "column_break_3", @@ -40,6 +41,7 @@ "password_settings", "logout_on_password_reset", "force_user_to_reset_password", + "password_reset_limit", "column_break_31", "enable_password_policy", "minimum_password_score", @@ -452,12 +454,25 @@ "fieldname": "prepared_report_section", "fieldtype": "Section Break", "label": "Prepared Report" + }, + { + "default": "Frappe", + "fieldname": "app_name", + "fieldtype": "Data", + "label": "App Name" + }, + { + "default": "3", + "description": "Hourly rate limit for generating password reset links", + "fieldname": "password_reset_limit", + "fieldtype": "Int", + "label": "Password Reset Link Generation Limit" } ], "icon": "fa fa-cog", "issingle": 1, "links": [], - "modified": "2020-08-12 14:35:45.214327", + "modified": "2020-09-30 14:38:58.886100", "modified_by": "Administrator", "module": "Core", "name": "System Settings", From 38e88e14d54f1012e7832dec3379dc93b3d14002 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 30 Sep 2020 14:40:55 +0530 Subject: [PATCH 5/9] feat: show app name on login --- frappe/www/login.html | 2 +- frappe/www/login.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/www/login.html b/frappe/www/login.html index 9490442278..29f16f1659 100644 --- a/frappe/www/login.html +++ b/frappe/www/login.html @@ -15,7 +15,7 @@