Skip to content
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

Merged
merged 119 commits into from
Sep 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
4aad54c
add core.async
agilliland Aug 27, 2015
f4c5ed1
basic pub/sub framework using core.async
agilliland Aug 28, 2015
551f78f
rounding out a few things. now have all persistent functions for car…
agilliland Aug 28, 2015
d7a0bcf
streamlining more of the event bus and activity stuff and rounding th…
agilliland Aug 28, 2015
ec58c55
start writing our activity events to the db!
agilliland Aug 29, 2015
582bdf0
couple more bits of cleanup to ensure we are publishing the right eve…
agilliland Aug 31, 2015
b05bbda
create a new GET /api/activity endpoint for listing activity items.
agilliland Aug 31, 2015
fb500ee
track user-login events.
agilliland Sep 1, 2015
a1a3b68
publish and :install event and listen for it in our activity feed so …
agilliland Sep 1, 2015
fda305f
update the database sync event publication so that we can actually tr…
agilliland Sep 1, 2015
63929d6
be consistent about using :custom_id instead of :tracking-hash or oth…
agilliland Sep 1, 2015
d510770
begin processing dashboard events for activity feed.
agilliland Sep 1, 2015
dd30e8d
finish off the handling of dashboard events which feed into the activ…
agilliland Sep 1, 2015
1e71883
finish off card activity handling by adding in ability to track the d…
agilliland Sep 1, 2015
33f85b7
hydrate :table and :database in activity api api responses.
agilliland Sep 1, 2015
342f629
basic scaffolding for new homepage implementation using redux + react.
agilliland Sep 2, 2015
9cc37e0
update migration to account for the fact that we merged in an existin…
agilliland Sep 3, 2015
0ecf31a
do a quick reshuffling of the events lifecycle functions so that we c…
agilliland Sep 3, 2015
e29fc8a
getting the layout more nailed down and flushing out the saved cards …
agilliland Sep 4, 2015
e6997ec
finish off the layout for the greeting and tabs so that everything li…
agilliland Sep 4, 2015
beb30f2
publish events for :dashboard-read and :card-read
agilliland Sep 4, 2015
6e35ae3
include :display_name in the set of hydrated fields on a table for Ac…
agilliland Sep 5, 2015
02df710
add missing import
agilliland Sep 5, 2015
a89b486
put some formatting into the activity tab layout.
agilliland Sep 6, 2015
a72992e
get all of the card filtering by Table stuff working. formatting is …
agilliland Sep 7, 2015
05c92b5
start to flush out recent views stuff a little bit formatting wise.
agilliland Sep 7, 2015
ef459af
cleanup the way the ActivityDescription is rendered and use a small r…
agilliland Sep 8, 2015
aa1a654
add `clock` icon path.
agilliland Sep 8, 2015
60bc65a
adding in the new view tracking code so that we can have an accurate …
agilliland Sep 9, 2015
42e7f90
try to get the smiley face working, but something not right :(
agilliland Sep 9, 2015
84864b5
put in the user initials on the activity item.
agilliland Sep 9, 2015
7919ddd
do a little cleanup work on our event processors to make them more ro…
agilliland Sep 9, 2015
e0cc0a7
filter out views of items that don't hydrate properly (likely because…
agilliland Sep 9, 2015
f8833aa
when recording a database-sync activity set the database_id value as …
agilliland Sep 9, 2015
1692e55
get colors and a couple more things working with activity user initia…
agilliland Sep 9, 2015
e01a1a1
report the users name as "You" when it's an activity they did themsel…
agilliland Sep 9, 2015
70e50f4
make the new question navbar button white.
agilliland Sep 9, 2015
8e73309
if a User happens to be deleted then cascade deletes to their Activit…
agilliland Sep 9, 2015
37d12fd
update unit test to account for the fact that we changed the query pa…
agilliland Sep 9, 2015
091e777
strip out old activity unit tests which are not relevant any more.
agilliland Sep 9, 2015
8b9f1ca
fix bikeshed lint error.
agilliland Sep 9, 2015
3b599f0
Merge branch 'master' into activity_feed
agilliland Sep 9, 2015
3db5789
add css background color options for purple and green and update our …
agilliland Sep 9, 2015
7a8a802
provide an empty state view for recent views.
agilliland Sep 9, 2015
a1756a2
fix smile
kdoh Sep 9, 2015
9e82da2
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
kdoh Sep 9, 2015
42bf1a3
bump up the font size on the sidebar headings.
agilliland Sep 9, 2015
95ee911
encapsulate all of the logic for rendering the ActivityDescription in…
agilliland Sep 9, 2015
1373971
tweak the coloring on the Metabase user initials on activity feed.
agilliland Sep 9, 2015
c989519
tweak the spacing on the tabs so that they align exactly with the act…
agilliland Sep 9, 2015
7a4d3f2
little more alignment tweaking.
agilliland Sep 9, 2015
3ef37fa
close the accordion when you click on it if it's already open.
agilliland Sep 9, 2015
2506b0c
support more card filtering options such as by database, plus make it…
agilliland Sep 9, 2015
57df401
remove stray logging.
agilliland Sep 9, 2015
26095ff
a little more work to get color assignment working in the case where …
agilliland Sep 9, 2015
4172022
fix issue where previous table listing was being displayed momentaril…
agilliland Sep 9, 2015
2cbd105
fix card sorting so it actually sorts by created_at
agilliland Sep 10, 2015
b47b7b7
provide separate routes for each homepage tab.
agilliland Sep 10, 2015
d99bd3e
full height sidebar and activity item refactor
kdoh Sep 10, 2015
85987bc
merge
kdoh Sep 10, 2015
fe18caa
fix imports
kdoh Sep 10, 2015
653c8f2
we don't need the old angular homepage template anymore.
agilliland Sep 10, 2015
9e3ac99
reintroduce our new user onboarding modal into the new homepage imple…
agilliland Sep 10, 2015
cf5e2b0
purge old angular code for rendering homepage modal which has been re…
agilliland Sep 10, 2015
fb11722
removing a bit more old angular homepage code that's not relevant any…
agilliland Sep 10, 2015
e29c8e9
reorganize things a little and simplify the rendering code a bit wher…
agilliland Sep 10, 2015
f384e18
tidy up a bit more angular code we don't need any more.
agilliland Sep 10, 2015
2e9b330
more work to streamline the activity feed display.
agilliland Sep 10, 2015
dca2324
use `cursor-pointer` on the CardFilters sidebar.
agilliland Sep 10, 2015
cfd3d44
indicate if the model object of an activity feed item is still in the…
agilliland Sep 10, 2015
b2bc8e4
add in missing border line on card filters accordion.
agilliland Sep 10, 2015
59409e6
remove the normalizr stuff since we weren't actually using it for any…
agilliland Sep 10, 2015
1a5e9d4
include a :card-create event in our view logging because realisticall…
agilliland Sep 10, 2015
40eac5f
remove old angular test which is no longer relevant and hasn't been o…
agilliland Sep 10, 2015
ccf36a5
use null instead of empty array as default state for cards and activi…
agilliland Sep 10, 2015
6281eee
new question button
kdoh Sep 10, 2015
fbb2f0f
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
kdoh Sep 10, 2015
407119e
fix formatting on api/routes.clj which got lost in a previous commit.
agilliland Sep 10, 2015
75815c1
one more formatting tweak.
agilliland Sep 10, 2015
18c93e8
add sync icon
kdoh Sep 10, 2015
528b3d3
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
kdoh Sep 10, 2015
0a48766
avatar border width
kdoh Sep 10, 2015
f30336f
fix recent wrapping alignment
kdoh Sep 10, 2015
71cca1b
add a very simply unit test of our publisher/subscriber system in met…
agilliland Sep 10, 2015
3ad9e83
full height fix
kdoh Sep 10, 2015
a30d783
user avatar component and activity styling
kdoh Sep 10, 2015
e42cd3c
tweak user avatr in nav
kdoh Sep 10, 2015
5f28e8f
actually add avatar component and align tabs
kdoh Sep 10, 2015
c2306db
tweak sidebar borders
kdoh Sep 10, 2015
0ff9831
set the :model to "install" when doing :install activity. set the :m…
agilliland Sep 10, 2015
5d53bea
imports cleanup.
agilliland Sep 10, 2015
02fd1bc
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
agilliland Sep 10, 2015
844dc65
clean up saved questions
kdoh Sep 10, 2015
5e53d45
unit tests for our activity feed processing functions.
agilliland Sep 11, 2015
48a5fac
first stab at responsive refactor
kdoh Sep 11, 2015
8e808c2
more unit testing. this time for the view_log event processing code.
agilliland Sep 11, 2015
3b1e2f3
new nav tweaks
kdoh Sep 11, 2015
2c94a24
check bg
kdoh Sep 11, 2015
be26ecb
cleanup and more subtle color
kdoh Sep 11, 2015
a40e56d
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
agilliland Sep 11, 2015
d10775e
fix bug where it was giving every activity item the user name "You".
agilliland Sep 11, 2015
56a8524
Update the messaging on the cards listing page when there are no card…
agilliland Sep 11, 2015
d92057b
unit tests for /api/activity endpoints.
agilliland Sep 11, 2015
545c4b1
limit recent views to 10 and activity to 40 for now.
agilliland Sep 11, 2015
06712b7
cascade delete of user should include ViewLog entries.
agilliland Sep 11, 2015
90da941
small unit test fix to ensure we clear out existing activity entries …
agilliland Sep 11, 2015
fd7cf2b
tab spacing
kdoh Sep 11, 2015
e42d43c
better spacing on empty state
kdoh Sep 11, 2015
f792239
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
kdoh Sep 11, 2015
5b80579
font size tweaks
kdoh Sep 11, 2015
0444395
move icon border to components dir
kdoh Sep 11, 2015
e8a1ef7
non proptype code review
kdoh Sep 11, 2015
bd23dc9
code review - add some proptypes cause types are neat.
kdoh Sep 11, 2015
1607574
add title attribute
kdoh Sep 11, 2015
1a1da21
code review: - remove unnecessary else condition
kdoh Sep 11, 2015
c39688e
fix react key warning on recent views
kdoh Sep 11, 2015
c77d106
be consistent about setting propTypes on all of our new react compone…
agilliland Sep 11, 2015
0105484
Merge branch 'activity_feed' of github.com:metabase/metabase-init int…
agilliland Sep 11, 2015
8e350cb
small test for unit test.
agilliland Sep 11, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:aliases {"test" ["with-profile" "+expectations" "expectations"]
"generate-sample-dataset" ["with-profile" "+generate-sample-dataset" "run"]}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[org.clojure/core.logic "0.8.10"]
[org.clojure/core.match "0.3.0-alpha4"] ; optimized pattern matching library for Clojure
[org.clojure/core.memoize "0.5.7"] ; needed by core.match; has useful FIFO, LRU, etc. caching mechanisms
Expand Down
19 changes: 19 additions & 0 deletions resources/frontend_client/app/activity/activity.services.js
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
}
});
}]);
1 change: 1 addition & 0 deletions resources/frontend_client/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var Metabase = angular.module('metabase', [
'ngRoute',
'ngCookies',
'ui.bootstrap', // bootstrap LIKE widgets via angular directives
'metabase.activity.services',
'metabase.auth',
'metabase.filters',
'metabase.directives',
Expand Down
2 changes: 1 addition & 1 deletion resources/frontend_client/app/card/card.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var CardServices = angular.module('metabase.card.services', ['ngResource', 'ngCo
CardServices.factory('Card', ['$resource', '$cookies', function($resource, $cookies) {
return $resource('/api/card/:cardId', {}, {
list: {
url: '/api/card/?org=:orgId&f=:filterMode',
url: '/api/card/?f=:filterMode',
method: 'GET',
isArray: true
},
Expand Down
56 changes: 56 additions & 0 deletions resources/frontend_client/app/components/IconBorder.react.js
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: {},
}
21 changes: 3 additions & 18 deletions resources/frontend_client/app/components/ProfileLink.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { Component, PropTypes } from 'react';
import OnClickOut from 'react-onclickout';
import cx from 'classnames';

import UserAvatar from './UserAvatar.react';
import Icon from './Icon.react';

export default class ProfileLink extends Component {
Expand All @@ -22,39 +23,23 @@ export default class ProfileLink extends Component {
this.setState({ dropdownOpen: false });
}

displayInitials() {
let initials = '??';
const { user } = this.props;

if (user.first_name !== 'undefined') {
initials = user.first_name.substring(0, 1);
}

if (user.last_name !== 'undefined') {
initials = initials + user.last_name.substring(0, 1);
}
return initials;
}

render() {
const { user, context } = this.props;

let dropDownClasses = cx({
'NavDropdown': true,
'inline-block': true,
'cursor-pointer': true,
'open': this.state.dropdownOpen,
})


return (
<OnClickOut onClickOut={this.closeDropdown}>
<div className={dropDownClasses}>
<a className="NavDropdown-button NavItem flex align-center p2" onClick={this.toggleDropdown}>
<div className="NavDropdown-button-layer">
<div className="flex align-center">
<span className="UserNick">
<span className="UserInitials NavItem-text">{this.displayInitials()}</span>
</span>
<UserAvatar user={user} style={{backgroundColor: 'transparent'}}/>
<Icon name="chevrondown" className="Dropdown-chevron ml1" width="8px" height="8px" />
</div>
</div>
Expand Down
55 changes: 55 additions & 0 deletions resources/frontend_client/app/components/UserAvatar.react.js
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',
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions resources/frontend_client/app/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@ MetabaseControllers.controller('Metabase', ['$scope', '$location', 'MetabaseCore
}]);


MetabaseControllers.controller('Homepage', ['$scope', '$location', 'ipCookie', 'AppState',
function($scope, $location, ipCookie, AppState) {

// At this point in time we don't actually have any kind of content to show for a homepage, so we just use this
// as a simple routing controller which sends users somewhere relevant
if (AppState.model.currentUser) {
$location.path('/dash/');
} else {
// User is not logged-in, so always send them to login page
$location.path('/auth/login');
}

}
]);


MetabaseControllers.controller('Unauthorized', ['$scope', '$location', function($scope, $location) {

}]);
Expand Down
25 changes: 0 additions & 25 deletions resources/frontend_client/app/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,10 @@
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 {
color: #fff;
border-color: #fff;
background-color: #fff;
background-color: rgba(255, 255, 255, 0.3);
}

.AdminNav .Dropdown-chevron {
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;
Expand Down
2 changes: 2 additions & 0 deletions resources/frontend_client/app/css/core/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
}

.bg-gold { background-color: var(--gold-color); }
.bg-purple { background-color: var(--purple-color); }
.bg-green { background-color: var(--green-color); }

/* alt */
.bg-alt { background-color: var(--alt-color); }
Expand Down
10 changes: 5 additions & 5 deletions resources/frontend_client/app/css/core/hide.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.hide { display: none !important; }
.show { display: block; }
.show { display: inheirt; }

.sm-show,
.md-show,
Expand All @@ -12,7 +12,7 @@
.sm-hide { display: none !important; }
}
@media screen and (--breakpoint-min-sm) {
.sm-show { display: block !important; }
.sm-show { display: inherit !important; }
}

/* medium */
Expand All @@ -21,21 +21,21 @@
.md-hide { display: none !important; }
}
@media screen and (--breakpoint-min-md) {
.md-show { display: block !important; }
.md-show { display: inherit !important; }
}
/* large */

@media screen and (--breakpoint-min-lg) {
.lg-hide { display: none !important; }
}
@media screen and (--breakpoint-min-lg) {
.lg-show { display: block !important; }
.lg-show { display: inherit !important; }
}

/* xl */
@media screen and (--breakpoint-min-xl) h{
.xl-hide { display: none !important; }
}
@media screen and (--breakpoint-min-xl) {
.xl-show { display: block !important; }
.xl-show { display: inherit !important; }
}
2 changes: 0 additions & 2 deletions resources/frontend_client/app/css/core/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
.wrapper {
width: 100%;
margin: 0 auto;
padding-left: 1.5em;
padding-right: 1.5em;
}

@media screen and (--breakpoint-min-sm) {
Expand Down