瀏覽代碼

added admin icon and permission member definitions(role,team,user)

Patrick O'Carroll 7 年之前
父節點
當前提交
e037ef21f7

+ 5 - 2
public/app/core/components/Permissions/DisabledPermissionsListItem.tsx

@@ -13,9 +13,12 @@ export default class DisabledPermissionListItem extends Component<IProps, any> {
     return (
       <tr className="gf-form-disabled">
         <td style={{ width: '1%' }}>
-          <i className={`fa--permissions-list ${item.icon}`} />
+          <i style={{ width: '25px' }} className="gicon gicon-shield" />
+        </td>
+        <td style={{ width: '90%' }}>
+          {item.name}
+          <span className="filter-table__weak-italic"> (Role)</span>
         </td>
-        <td style={{ width: '90%' }}>{item.name}</td>
         <td />
         <td className="query-keyword">Can</td>
         <td>

+ 14 - 2
public/app/core/components/Permissions/PermissionsListItem.tsx

@@ -14,7 +14,17 @@ function ItemAvatar({ item }) {
   if (item.teamAvatarUrl) {
     return <img className="filter-table__avatar" src={item.teamAvatarUrl} />;
   }
-  return <span className={item.icon} />;
+  return <span style={{ width: '25px' }} className={item.icon} />;
+}
+
+function ItemDescription({ item }) {
+  if (item.userId) {
+    return <span className="filter-table__weak-italic">(User)</span>;
+  }
+  if (item.teamId) {
+    return <span className="filter-table__weak-italic">(Team)</span>;
+  }
+  return <span className="filter-table__weak-italic">(Role)</span>;
 }
 
 export default observer(({ item, removeItem, permissionChanged, itemIndex, folderInfo }) => {
@@ -35,7 +45,9 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
       <td style={{ width: '1%' }}>
         <ItemAvatar item={item} />
       </td>
-      <td style={{ width: '90%' }}>{item.name}</td>
+      <td style={{ width: '90%' }}>
+        {item.name} <ItemDescription item={item} />
+      </td>
       <td>
         {item.inherited &&
           folderInfo && (

+ 4 - 0
public/sass/components/_filter-table.scss

@@ -85,3 +85,7 @@
     }
   }
 }
+.filter-table__weak-italic {
+  font-style: italic;
+  color: $text-color-weak;
+}