-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update package.json with version 0.19.0 * added body class for current route based on theme and routeName * PR #1655 re-merge (#1658) * Variants without media to inherit media from their parents (#1664) * optimised method by setting/getting session * fixed import order * React no-ui Slider implementation * React MultiSelect component implementation * add admin settings translation for templates (#1661) * React MultiSelect component implementation (#1681) * React no-ui Slider implementation (#1680) * Route theme body class (#1672) * added body class for current route based on theme and routeName * optimised method by setting/getting session * fixed import order * get Registry for Current route for enabled package only * Moving toolbars Moved Admin toolbar (vertical one) to the left Moved DashboardHeader template region to top Moved ProductDetailsSimple toolbar into own component ( ProductToolbar ) Moved ProductToolbar to DashboardHeader template region in registry * Adding react switch control Updating button component to allow for better toggling Update product toolbar and publish bar * Improve layout and styles for switch component * Clean up styles related to publish bar * Toolbar reorg (#1713) * Move dashboard to admin controls drawer * admin links in account dropdown to open action view * Added navigation stack to action view Added back button to settings panel * Added package list component for dashboard package list Added List and ListItem components * Code cleanup Added basic styles for lists * Adding react ActionView component * Variable cleanup (#1712) * removed old unused styles * updated brand color hex: 1c98d5 -> 1999dd * killed @brand-muted-color (for now, as it's currently unused) * update font to Source Sans Pro in emails * update search variables * variables.less cleanup * bright colors for secondary, accent, vivid color for easy visibility * Added blaze react package Fixing imports for actionView * Added admin context provider AdminContextProvider provides context props to all components wrapped as Admin() components. * CSS-IN-JS styles for admin view header with animations * Added add product button Added icon button with Reaction logo to open actionView * Package list re-org * Filter entries with a template * Update package.json * Added detail view to action view * cleanup
- Loading branch information
1 parent
f799a20
commit 6abf924
Showing
71 changed files
with
1,808 additions
and
292 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,3 +95,4 @@ johanbrook:publication-collector | |
|
||
|
||
# Custom Packages | ||
gadicc:blaze-react-component |
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
227 changes: 227 additions & 0 deletions
227
imports/plugins/core/dashboard/client/components/actionView.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,227 @@ | ||
import React, { Component, PropTypes } from "react"; | ||
import classnames from "classnames"; | ||
import Blaze from "meteor/gadicc:blaze-react-component"; | ||
import { | ||
IconButton, | ||
Translation | ||
} from "/imports/plugins/core/ui/client/components"; | ||
import { Admin } from "/imports/plugins/core/ui/client/providers"; | ||
import Radium from "radium"; | ||
import Velocity from "velocity-animate"; | ||
import "velocity-animate/velocity.ui"; | ||
import { VelocityTransitionGroup } from "velocity-react"; | ||
|
||
const getStyles = (props) => { | ||
let viewSize = 400; | ||
// if (props.actionView && props.actionView.priority === 1 && props.actionView.provides === "dashboard") { | ||
if (props.actionView && props.actionView.provides === "dashboard") { | ||
viewSize = "90vw"; | ||
} | ||
|
||
return { | ||
base: { | ||
display: "flex", | ||
flexDirection: "column", | ||
height: "100vh", | ||
position: "relative", | ||
width: viewSize | ||
}, | ||
header: { | ||
display: "flex", | ||
alignItems: "center", | ||
position: "relative", | ||
height: "56px", | ||
padding: "0 20px", | ||
margin: 0 | ||
}, | ||
heading: { | ||
display: "flex", | ||
alignItems: "center", | ||
flex: "1 1 auto", | ||
position: "relative", | ||
margin: 0, | ||
height: "100%" | ||
}, | ||
body: { | ||
display: "flex", | ||
webkitOverflowScrolling: "touch" | ||
}, | ||
masterView: { | ||
flex: "1 1 auto", | ||
height: "100%", | ||
overflow: "auto", | ||
webkitOverflowScrolling: "touch" | ||
}, | ||
detailView: { | ||
width: "400px", | ||
height: "100%", | ||
overflow: "auto", | ||
webkitOverflowScrolling: "touch" | ||
}, | ||
title: { | ||
margin: 0, | ||
transition: "200ms all" | ||
}, | ||
titleWithBackButton: { | ||
paddingLeft: 40 | ||
}, | ||
backButton: { | ||
height: "100%", | ||
position: "absolute", | ||
top: 0, | ||
zIndex: 1 | ||
}, | ||
backButtonContainers: { | ||
display: "flex", | ||
alignItems: "center", | ||
height: "100%" | ||
} | ||
}; | ||
}; | ||
|
||
class ActionView extends Component { | ||
static propTypes = { | ||
actionView: PropTypes.object, | ||
actionViewIsOpen: PropTypes.bool, | ||
buttons: PropTypes.array, | ||
isActionViewAtRootView: PropTypes.bool | ||
} | ||
|
||
renderControlComponent() { | ||
if (this.props.actionView && typeof this.props.actionView.template === "string") { | ||
return ( | ||
<div style={this.styles.masterView} className="master"> | ||
<Blaze | ||
template={this.props.actionView.template} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
renderDetailComponent() { | ||
if (this.props.detailView && typeof this.props.detailView.template === "string") { | ||
return ( | ||
<div style={this.styles.detailView} className="detail"> | ||
<Blaze | ||
template={this.props.detailView.template} | ||
data={this.props.detailView.data} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
renderFooter() { | ||
// if (this.props.footerTemplate) { | ||
// return ( | ||
// <Blaze template={this.props.footerTemplate} /> | ||
// ); | ||
// } | ||
} | ||
|
||
renderBackButton() { | ||
if (this.props.isActionViewAtRootView === false) { | ||
return ( | ||
<div style={this.styles.backButton}> | ||
<div style={this.styles.backButtonContainers}> | ||
<IconButton | ||
icon="fa fa-arrow-left" | ||
onClick={this.props.handleActionViewBack} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
get styles() { | ||
return getStyles(this.props); | ||
} | ||
|
||
get backButtonEnterAnimation() { | ||
return { | ||
animation: { | ||
display: "flex", | ||
position: "absolute", | ||
left: 20, | ||
opaticy: 1 | ||
}, | ||
duration: 200 | ||
}; | ||
} | ||
|
||
get backButtonLeaveAnimaton() { | ||
return { | ||
animation: { | ||
display: "flex", | ||
position: "absolute", | ||
left: -30, | ||
opaticy: 0 | ||
}, | ||
duration: 200 | ||
|
||
}; | ||
} | ||
|
||
render() { | ||
const { actionView } = this.props; | ||
const baseClassName = classnames({ | ||
"admin-controls": true, | ||
"show-settings": this.props.actionViewIsOpen | ||
}); | ||
|
||
|
||
return ( | ||
<div style={this.styles.base} className={baseClassName}> | ||
<div style={this.styles.header} className="admin-controls-heading--"> | ||
<VelocityTransitionGroup | ||
enter={this.backButtonEnterAnimation} | ||
leave={this.backButtonLeaveAnimaton} | ||
> | ||
{this.renderBackButton()} | ||
</VelocityTransitionGroup> | ||
|
||
<div style={this.styles.heading} className="nav-settings-heading--"> | ||
<h3 | ||
className="nav-settings-title--" | ||
style={[ | ||
this.styles.title, | ||
!this.props.isActionViewAtRootView ? this.styles.titleWithBackButton : {} | ||
]} | ||
> | ||
<Translation | ||
defaultValue={actionView.label || "Dashboard"} | ||
i18nKey={actionView.i18nKeyLabel || "dashboard.coreTitle"} | ||
/> | ||
</h3> | ||
</div> | ||
|
||
<div className="nav-settings-controls--"> | ||
<IconButton | ||
icon="fa fa-times" | ||
onClick={this.props.handleActionViewClose} | ||
/> | ||
</div> | ||
</div> | ||
<div style={this.styles.body} className="admin-controls-content action-view-body"> | ||
|
||
{this.renderControlComponent()} | ||
{this.renderDetailComponent()} | ||
</div> | ||
<div className="admin-controls-footer"> | ||
<div className="admin-controls-container"> | ||
{this.renderFooter()} | ||
</div> | ||
</div> | ||
|
||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Admin()(Radium(ActionView)); |
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,2 @@ | ||
export { default as ActionView } from "./actionView"; | ||
export { default as PackageList } from "./packageList"; |
Oops, something went wrong.