-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #956 from metabase/activity_feed
New homepage implementation with Activity Feed + Recently Viewed
- Loading branch information
Showing
68 changed files
with
2,572 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
resources/frontend_client/app/activity/activity.services.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
|
||
var ActivityServices = angular.module('metabase.activity.services', ['ngResource', 'ngCookies']); | ||
|
||
ActivityServices.factory('Activity', ['$resource', '$cookies', function($resource, $cookies) { | ||
return $resource('/api/activity', {}, { | ||
list: { | ||
method: 'GET', | ||
isArray: true | ||
}, | ||
|
||
recent_views: { | ||
url: '/api/activity/recent_views', | ||
method: 'GET', | ||
isArray: true | ||
} | ||
}); | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
resources/frontend_client/app/components/IconBorder.react.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
'use strict'; | ||
|
||
import React, { Component } from 'react'; | ||
import cx from "classnames"; | ||
|
||
export default class IconBorder extends Component { | ||
constructor() { | ||
super(); | ||
this.state = {}; | ||
} | ||
componentDidMount() { | ||
this.setState({ | ||
childWidth: React.findDOMNode(this.refs.child).offsetWidth | ||
}); | ||
} | ||
computeSize () { | ||
let width = parseInt(this.state.childWidth, 10); | ||
return width * 2; | ||
} | ||
|
||
render() { | ||
const classes = cx({ | ||
'flex': true, | ||
'layout-centered': true | ||
}); | ||
|
||
const styles = { | ||
width: this.computeSize(), | ||
height: this.computeSize(), | ||
borderWidth: this.props.borderWidth, | ||
borderStyle: this.props.borderStyle, | ||
borderColor: this.props.borderColor, | ||
lineHeight: '1px', /* HACK this is dumb but it centers the icon in the border */ | ||
} | ||
|
||
if (this.props.borderRadius) { | ||
styles.borderRadius = this.props.borderRadius; | ||
} else if (this.props.rounded) { | ||
styles.borderRadius = "99px"; | ||
} | ||
|
||
return ( | ||
<span className={classes + ' ' + this.props.className} style={Object.assign(styles, this.props.style)}> | ||
<span ref="child">{this.props.children}</span> | ||
</span> | ||
); | ||
} | ||
} | ||
|
||
IconBorder.defaultProps = { | ||
borderWidth: '1px', | ||
borderStyle: 'solid', | ||
borderColor: 'currentcolor', | ||
rounded: true, | ||
style: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
resources/frontend_client/app/components/UserAvatar.react.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
'use strict'; | ||
|
||
import React, { Component } from 'react'; | ||
import cx from 'classnames'; | ||
|
||
export default class UserAvatar extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.styles = { | ||
fontSize: '0.85rem', | ||
borderWidth: '1px', | ||
borderStyle: 'solid', | ||
borderRadius: '99px', | ||
width: '2rem', | ||
height: '2rem', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
} | ||
} | ||
userInitials() { | ||
const { first_name, last_name } = this.props.user; | ||
|
||
let initials = '??'; | ||
|
||
if (first_name !== 'undefined') { | ||
initials = first_name.substring(0, 1); | ||
} | ||
|
||
if (last_name !== 'undefined') { | ||
initials = initials + last_name.substring(0, 1); | ||
} | ||
|
||
return initials; | ||
} | ||
|
||
render() { | ||
const { background } = this.props; | ||
const classes = { | ||
'flex': true, | ||
'align-center': true, | ||
} | ||
classes[background] = true; | ||
|
||
return ( | ||
<div className={cx(classes)} style={Object.assign(this.styles, this.props.style)}> | ||
{this.userInitials()} | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
UserAvatar.defaultProps = { | ||
background: 'bg-brand', | ||
} |
12 changes: 12 additions & 0 deletions
12
resources/frontend_client/app/components/icons/assets/header_rect.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
resources/frontend_client/app/components/icons/assets/smile.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.