From 473cb160932defa07b08fd4f8b9c54155400e78a Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Mon, 8 Feb 2021 12:05:37 +0530 Subject: [PATCH] fix: Miscellaneous changes (#12343) --- .codacy.yml | 2 - .deepsource.toml | 17 ------ .eslintignore | 3 +- frappe/.stylelintrc => .stylelintrc | 0 ci/fix-mariadb.sh | 11 ---- ci/my_config.h.patch | 22 -------- .../user_profile/user_profile_controller.js | 52 +++++++++---------- frappe/public/scss/desk/css_variables.scss | 3 +- frappe/public/scss/desk/form.scss | 4 +- frappe/public/scss/desk/global_search.scss | 8 +-- 10 files changed, 32 insertions(+), 90 deletions(-) delete mode 100644 .codacy.yml delete mode 100644 .deepsource.toml rename frappe/.stylelintrc => .stylelintrc (100%) delete mode 100755 ci/fix-mariadb.sh delete mode 100644 ci/my_config.h.patch diff --git a/.codacy.yml b/.codacy.yml deleted file mode 100644 index 4754a63e7e..0000000000 --- a/.codacy.yml +++ /dev/null @@ -1,2 +0,0 @@ -exclude_paths: - - '**.sql' \ No newline at end of file diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index f5edb47a13..0000000000 --- a/.deepsource.toml +++ /dev/null @@ -1,17 +0,0 @@ -version = 1 - -test_patterns = [ - "**/test_*.py" -] - -exclude_patterns = [ - "frappe/patches/**", - "*.min.js" -] - -[[analyzers]] -name = "python" -enabled = true - - [analyzers.meta] - runtime_version = "3.x.x" diff --git a/.eslintignore b/.eslintignore index 2fd65d307d..baf9bb2cc5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,5 +5,4 @@ frappe/core/doctype/doctype/boilerplate/* frappe/core/doctype/report/boilerplate/* frappe/public/js/frappe/class.js frappe/templates/includes/* -frappe/tests/testcafe/* -frappe/www/website_script.js \ No newline at end of file +frappe/www/website_script.js diff --git a/frappe/.stylelintrc b/.stylelintrc similarity index 100% rename from frappe/.stylelintrc rename to .stylelintrc diff --git a/ci/fix-mariadb.sh b/ci/fix-mariadb.sh deleted file mode 100755 index 886ec5e0d0..0000000000 --- a/ci/fix-mariadb.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# stolen from http://cgit.drupalcode.org/octopus/commit/?id=db4f837 -includedir=`mysql_config --variable=pkgincludedir` -thiscwd=`pwd` -_THIS_DB_VERSION=`mysql -V 2>&1 | tr -d "\n" | cut -d" " -f6 | awk '{ print $1}' | cut -d"-" -f1 | awk '{ print $1}' | sed "s/[\,']//g"` -if [ "$_THIS_DB_VERSION" = "5.5.40" ] && [ ! -e "$includedir-$_THIS_DB_VERSION-fixed.log" ] ; then - cd $includedir - sudo patch -p1 < $thiscwd/ci/my_config.h.patch &> /dev/null - sudo touch $includedir-$_THIS_DB_VERSION-fixed.log -fi diff --git a/ci/my_config.h.patch b/ci/my_config.h.patch deleted file mode 100644 index 5247b5b39b..0000000000 --- a/ci/my_config.h.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -burp a/my_config.h b/my_config.h ---- a/my_config.h 2014-10-09 19:32:46.000000000 -0400 -+++ b/my_config.h 2014-10-09 19:35:12.000000000 -0400 -@@ -641,17 +641,4 @@ - #define SIZEOF_TIME_T 8 - /* #undef TIME_T_UNSIGNED */ - --/* -- stat structure (from ) is conditionally defined -- to have different layout and size depending on the defined macros. -- The correct macro is defined in my_config.h, which means it MUST be -- included first (or at least before - so, practically, -- before including any system headers). -- -- __GLIBC__ is defined in --*/ --#ifdef __GLIBC__ --#error MUST be included first! --#endif -- - #endif - diff --git a/frappe/desk/page/user_profile/user_profile_controller.js b/frappe/desk/page/user_profile/user_profile_controller.js index 61f8ec3c06..c1a89f316e 100644 --- a/frappe/desk/page/user_profile/user_profile_controller.js +++ b/frappe/desk/page/user_profile/user_profile_controller.js @@ -151,32 +151,30 @@ class UserProfile { // eslint-disable-next-line no-unused-vars render_percentage_chart(field, title) { - // REDESIGN-TODO: chart seems to be broken. Enable this once fixed. - this.wrapper.find('.percentage-chart-container').hide(); - // frappe.xcall('frappe.desk.page.user_profile.user_profile.get_energy_points_percentage_chart_data', { - // user: this.user_id, - // field: field - // }).then(chart => { - // if (chart.labels.length) { - // this.percentage_chart = new frappe.Chart('.performance-percentage-chart', { - // type: 'percentage', - // data: { - // labels: chart.labels, - // datasets: chart.datasets - // }, - // truncateLegends: 1, - // barOptions: { - // height: 11, - // depth: 1 - // }, - // height: 200, - // maxSlices: 8, - // colors: ['purple', 'blue', 'cyan', 'teal', 'pink', 'red', 'orange', 'yellow'], - // }); - // } else { - // this.wrapper.find('.percentage-chart-container').hide(); - // } - // }); + frappe.xcall('frappe.desk.page.user_profile.user_profile.get_energy_points_percentage_chart_data', { + user: this.user_id, + field: field + }).then(chart => { + if (chart.labels.length) { + this.percentage_chart = new frappe.Chart('.performance-percentage-chart', { + type: 'percentage', + data: { + labels: chart.labels, + datasets: chart.datasets + }, + truncateLegends: 1, + barOptions: { + height: 11, + depth: 1 + }, + height: 200, + maxSlices: 8, + colors: ['purple', 'blue', 'cyan', 'teal', 'pink', 'red', 'orange', 'yellow'], + }); + } else { + this.wrapper.find('.percentage-chart-container').hide(); + } + }); } create_line_chart_filters() { @@ -452,4 +450,4 @@ class UserProfileTimeline extends BaseTimeline { } frappe.provide('frappe.ui'); -frappe.ui.UserProfile = UserProfile; \ No newline at end of file +frappe.ui.UserProfile = UserProfile; diff --git a/frappe/public/scss/desk/css_variables.scss b/frappe/public/scss/desk/css_variables.scss index ed389227fe..2b98c858c4 100644 --- a/frappe/public/scss/desk/css_variables.scss +++ b/frappe/public/scss/desk/css_variables.scss @@ -24,6 +24,7 @@ $input-height: 28px !default; --fg-hover-color: var(--gray-100); --card-bg: var(--fg-color); --disabled-text-color: var(--gray-700); + --disabled-control-bg: var(--gray-50); --control-bg: var(--gray-100); --control-bg-on-gray: var(--gray-200); --awesomebar-focus-bg: var(--fg-color); @@ -56,4 +57,4 @@ $input-height: 28px !default; --timeline-item-bottom-margin: var(--margin-sm); --timeline-content-max-width: 700px; --timeline-left-padding: calc(var(--padding-xl) + var(--timeline-item-icon-size) / 2); -} \ No newline at end of file +} diff --git a/frappe/public/scss/desk/form.scss b/frappe/public/scss/desk/form.scss index 79cb84e9a2..1a6ce49b5e 100644 --- a/frappe/public/scss/desk/form.scss +++ b/frappe/public/scss/desk/form.scss @@ -91,7 +91,7 @@ padding: 8px 12px; cursor: default; color: var(--disabled-text-color); - background-color: var(--control-bg); + background-color: var(--disabled-control-bg); } .form-control:disabled, .form-control[readonly] { @@ -297,4 +297,4 @@ font-feature-settings: "tnum" 1; margin-top: 0px; } -} \ No newline at end of file +} diff --git a/frappe/public/scss/desk/global_search.scss b/frappe/public/scss/desk/global_search.scss index cffccc1128..396b685d30 100644 --- a/frappe/public/scss/desk/global_search.scss +++ b/frappe/public/scss/desk/global_search.scss @@ -89,16 +89,12 @@ .result { @include flex(flex, null, center, null); padding: 8px 0; - color: var(--gray-800); + color: var(--text-light); .result-image { margin-right: var(--margin-sm); } - a { - color: var(--gray-800); - } - mark { display: inline-flex; padding: 0; @@ -121,4 +117,4 @@ padding-bottom: var(--padding-xs); } } -} \ No newline at end of file +}