Commit 8b076d92 by Patrick O'Carroll

fixes for avatar on adding permission and size for gicon

parent 32264c61
...@@ -39,7 +39,7 @@ class AddPermissions extends Component<IProps, any> { ...@@ -39,7 +39,7 @@ class AddPermissions extends Component<IProps, any> {
permissions.newItem.setUser(null, null); permissions.newItem.setUser(null, null);
return; return;
} }
return permissions.newItem.setUser(user.id, user.login); return permissions.newItem.setUser(user.id, user.login, user.avatarUrl);
} }
teamPicked(team: Team) { teamPicked(team: Team) {
......
...@@ -13,7 +13,7 @@ export default class DisabledPermissionListItem extends Component<IProps, any> { ...@@ -13,7 +13,7 @@ export default class DisabledPermissionListItem extends Component<IProps, any> {
return ( return (
<tr className="gf-form-disabled"> <tr className="gf-form-disabled">
<td style={{ width: '1%' }}> <td style={{ width: '1%' }}>
<i style={{ width: '25px' }} className="gicon gicon-shield" /> <i style={{ width: '25px', fontSize: '1.5rem' }} className="gicon gicon-shield" />
</td> </td>
<td style={{ width: '90%' }}> <td style={{ width: '90%' }}>
{item.name} {item.name}
......
...@@ -28,6 +28,7 @@ function ItemDescription({ item }) { ...@@ -28,6 +28,7 @@ function ItemDescription({ item }) {
} }
export default observer(({ item, removeItem, permissionChanged, itemIndex, folderInfo }) => { export default observer(({ item, removeItem, permissionChanged, itemIndex, folderInfo }) => {
console.log(item);
const handleRemoveItem = evt => { const handleRemoveItem = evt => {
evt.preventDefault(); evt.preventDefault();
removeItem(itemIndex); removeItem(itemIndex);
...@@ -38,7 +39,6 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde ...@@ -38,7 +39,6 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
}; };
const inheritedFromRoot = item.dashboardId === -1 && folderInfo && folderInfo.id === 0; const inheritedFromRoot = item.dashboardId === -1 && folderInfo && folderInfo.id === 0;
console.log(item.name);
return ( return (
<tr className={setClassNameHelper(item.inherited)}> <tr className={setClassNameHelper(item.inherited)}>
......
...@@ -30,6 +30,7 @@ export const NewPermissionsItem = types ...@@ -30,6 +30,7 @@ export const NewPermissionsItem = types
), ),
userId: types.maybe(types.number), userId: types.maybe(types.number),
userLogin: types.maybe(types.string), userLogin: types.maybe(types.string),
userAvatarUrl: types.maybe(types.string),
teamId: types.maybe(types.number), teamId: types.maybe(types.number),
team: types.maybe(types.string), team: types.maybe(types.string),
permission: types.optional(types.number, 1), permission: types.optional(types.number, 1),
...@@ -50,9 +51,10 @@ export const NewPermissionsItem = types ...@@ -50,9 +51,10 @@ export const NewPermissionsItem = types
}, },
})) }))
.actions(self => ({ .actions(self => ({
setUser(userId: number, userLogin: string) { setUser(userId: number, userLogin: string, userAvatarUrl: string) {
self.userId = userId; self.userId = userId;
self.userLogin = userLogin; self.userLogin = userLogin;
self.userAvatarUrl = userAvatarUrl;
self.teamId = null; self.teamId = null;
self.team = null; self.team = null;
}, },
...@@ -121,6 +123,7 @@ export const PermissionsStore = types ...@@ -121,6 +123,7 @@ export const PermissionsStore = types
teamId: undefined, teamId: undefined,
userLogin: undefined, userLogin: undefined,
userId: undefined, userId: undefined,
userAvatarUrl: undefined,
role: undefined, role: undefined,
}; };
switch (self.newItem.type) { switch (self.newItem.type) {
...@@ -131,6 +134,7 @@ export const PermissionsStore = types ...@@ -131,6 +134,7 @@ export const PermissionsStore = types
case aclTypeValues.USER.value: case aclTypeValues.USER.value:
item.userLogin = self.newItem.userLogin; item.userLogin = self.newItem.userLogin;
item.userId = self.newItem.userId; item.userId = self.newItem.userId;
item.userAvatarUrl = self.newItem.userAvatarUrl;
break; break;
case aclTypeValues.VIEWER.value: case aclTypeValues.VIEWER.value:
case aclTypeValues.EDITOR.value: case aclTypeValues.EDITOR.value:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment