-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New homepage implementation with Activity Feed + Recently Viewed #956
Changes from 111 commits
4aad54c
f4c5ed1
551f78f
d7a0bcf
ec58c55
582bdf0
b05bbda
fb500ee
a1a3b68
fda305f
63929d6
d510770
dd30e8d
1e71883
33f85b7
342f629
9cc37e0
0ecf31a
e29fc8a
e6997ec
beb30f2
6e35ae3
02df710
a89b486
a72992e
05c92b5
ef459af
aa1a654
60bc65a
42e7f90
84864b5
7919ddd
e0cc0a7
f8833aa
1692e55
e01a1a1
70e50f4
8e73309
37d12fd
091e777
8b9f1ca
3b599f0
3db5789
7a8a802
a1756a2
9e82da2
42bf1a3
95ee911
1373971
c989519
7a4d3f2
3ef37fa
2506b0c
57df401
26095ff
4172022
2cbd105
b47b7b7
d99bd3e
85987bc
fe18caa
653c8f2
9e3ac99
cf5e2b0
fb11722
e29c8e9
f384e18
2e9b330
dca2324
cfd3d44
b2bc8e4
59409e6
1a5e9d4
40eac5f
ccf36a5
6281eee
fbb2f0f
407119e
75815c1
18c93e8
528b3d3
0a48766
f30336f
71cca1b
3ad9e83
a30d783
e42cd3c
5f28e8f
c2306db
0ff9831
5d53bea
02fd1bc
844dc65
5e53d45
48a5fac
8e808c2
3b1e2f3
2c94a24
be26ecb
a40e56d
d10775e
56a8524
d92057b
545c4b1
06712b7
90da941
fd7cf2b
e42d43c
f792239
5b80579
0444395
e8a1ef7
bd23dc9
1607574
1a1da21
c39688e
c77d106
0105484
8e350cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
} | ||
}); | ||
}]); |
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 | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
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: {}, | ||
} |
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
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', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,17 +50,6 @@ | |
transition: background .2s linear; | ||
} | ||
|
||
.UserNick { | ||
border-width: 1px; | ||
border-style: solid; | ||
border-radius: 99px; | ||
width: 2rem; | ||
height: 2rem; /* set an explicit height since we want it to be square */ | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.AdminNav .UserNick { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this declaration can be killed as well not that all user avatar stuff is internalized in its own component |
||
color: #fff; | ||
border-color: #fff; | ||
|
@@ -72,13 +61,6 @@ | |
color: #fff; | ||
} | ||
|
||
.UserInitials, | ||
.UserInitials:hover { | ||
font-size: 0.85rem; | ||
color: currentColor; | ||
cursor: pointer; | ||
} | ||
|
||
.Actions { | ||
background-color: rgba(243,243,243,0.46); | ||
border: 1px solid #E0E0E0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a semicolon here