Sfoglia il codice sorgente

dashfolders: remove inline styles

Daniel Lee 8 anni fa
parent
commit
4bc5945c17

+ 2 - 8
public/app/core/components/Picker/DescriptionOption.tsx

@@ -41,18 +41,12 @@ class DescriptionOption extends Component<IProps, any> {
         onMouseEnter={this.handleMouseEnter}
         onMouseMove={this.handleMouseMove}
         title={option.title}
-        className={`user-picker-option__button btn btn-link ${className} width-19`}
-        style={{
-          whiteSpace: 'normal',
-          // height: '55px',
-        }}
+        className={`description-picker-option__button btn btn-link ${className} width-19`}
       >
         <div className="gf-form">{children}</div>
         <div className="gf-form">
           <div className="muted width-17">{option.description}</div>
-          {className.indexOf('is-selected') > -1 && (
-            <i style={{ paddingLeft: '2px' }} className="fa fa-check" aria-hidden="true" />
-          )}
+          {className.indexOf('is-selected') > -1 && <i className="fa fa-check" aria-hidden="true" />}
         </div>
       </button>
     );

+ 0 - 4
public/app/stores/PermissionsStore/PermissionsStore.ts

@@ -130,20 +130,16 @@ const prepareItem = (item, dashboardId: number, isFolder: boolean) => {
   item.sortRank = 0;
   if (item.userId > 0) {
     item.icon = 'fa fa-fw fa-user';
-    // TODO: Check what sce.trustAsHtml did
-    //   item.nameHtml = this.$sce.trustAsHtml(item.userLogin);
     item.nameHtml = item.userLogin;
     item.sortName = item.userLogin;
     item.sortRank = 10;
   } else if (item.teamId > 0) {
     item.icon = 'fa fa-fw fa-users';
-    //   item.nameHtml = this.$sce.trustAsHtml(item.team);
     item.nameHtml = item.team;
     item.sortName = item.team;
     item.sortRank = 20;
   } else if (item.role) {
     item.icon = 'fa fa-fw fa-street-view';
-    //   item.nameHtml = this.$sce.trustAsHtml(`Everyone with <span class="query-keyword">${item.role}</span> Role`);
     item.nameHtml = `Everyone with <span class="query-keyword">${item.role}</span> Role`;
     item.sortName = item.role;
     item.sortRank = 30;

+ 1 - 0
public/sass/_grafana.scss

@@ -91,6 +91,7 @@
 @import 'components/popper';
 @import 'components/form_select_box';
 @import 'components/user-picker';
+@import 'components/description-picker';
 
 // PAGES
 @import 'pages/login';

+ 11 - 0
public/sass/components/_description-picker.scss

@@ -0,0 +1,11 @@
+.description-picker-option__button {
+  position: relative;
+  text-align: left;
+  width: 100%;
+  display: block;
+  border-radius: 0;
+  white-space: normal;
+  i.fa-check {
+    padding-left: 2px;
+  }
+}