Skip to content

Commit

Permalink
Merge d01ef80 into f97b4f6
Browse files Browse the repository at this point in the history
  • Loading branch information
srowhani committed Jan 24, 2017
2 parents f97b4f6 + d01ef80 commit 9e77cc4
Show file tree
Hide file tree
Showing 30 changed files with 164 additions and 145 deletions.
7 changes: 5 additions & 2 deletions addon/components/nav-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ export default Component.extend(PropTypeMixin, {
// == State properties ======================================================

propTypes: {
item: PropTypes.object.isRequired
item: PropTypes.object.isRequired,
hook: PropTypes.string
},
getDefaultProps () {
return {
item: {
pack: 'frost'
}
},
hook: 'nav-action'
}
},
// == Computed Properties ===================================================

// == Actions ===============================================================

Expand Down
12 changes: 8 additions & 4 deletions addon/components/nav-category.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Ember from 'ember'
import layout from '../templates/components/nav-category'
import computed from 'ember-computed-decorators'
import PropTypesMixin, { PropTypes } from 'ember-prop-types'
import SpreadMixin from 'ember-spread'

const {
Component,
typeOf,
Expand All @@ -15,7 +17,7 @@ const {
set
} = Ember

export default Component.extend(PropTypesMixin, {
export default Component.extend(SpreadMixin, PropTypesMixin, {
// == Services ==============================================================

frostNavigation: service(),
Expand All @@ -30,12 +32,14 @@ export default Component.extend(PropTypesMixin, {

propTypes: {
icon: PropTypes.string,
name: PropTypes.string.isRequired,
pack: PropTypes.string
name: PropTypes.string,
pack: PropTypes.string,
hook: PropTypes.string
},
getDefaultProps () {
return {
pack: 'frost'
pack: 'frost',
hook: 'nav-category'
}
},

Expand Down
7 changes: 5 additions & 2 deletions addon/components/nav-route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Ember from 'ember'
import layout from '../templates/components/nav-route'

import PropTypesMixin, { PropTypes } from 'ember-prop-types'
import SpreadMixin from 'ember-spread'

const {
Component,
Expand All @@ -10,7 +12,7 @@ const {
get
} = Ember

export default Component.extend(PropTypesMixin, {
export default Component.extend(SpreadMixin, PropTypesMixin, {
// == Services ==============================================================

frostNavigation: service(),
Expand All @@ -23,7 +25,7 @@ export default Component.extend(PropTypesMixin, {
// == State properties ======================================================

propTypes: {
name: PropTypes.string.isRequired,
name: PropTypes.string,
description: PropTypes.string,
route: PropTypes.string,
icon: PropTypes.string,
Expand All @@ -35,6 +37,7 @@ export default Component.extend(PropTypesMixin, {
pack: 'frost'
}
},
// == Computed Properties ===================================================

// == Actions ===============================================================

Expand Down
14 changes: 8 additions & 6 deletions addon/styles/addon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ $z-index-application-bar: 3 !default;
$z-index-modal: 2 !default;
$z-index-modal-hidden: -1 !default;

$frost-navigation-bar-height: 50px !default;
$frost-navigation-bar-bg-color: $frost-color-night-2 !default;

.frost-application-bar {
display: flex;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 50px;
background-color: $frost-color-night-2;
height: inherit;
background-color: $frost-navigation-bar-bg-color;
z-index: $z-index-application-bar;

.branding {
Expand Down Expand Up @@ -49,6 +52,7 @@ $z-index-modal-hidden: -1 !default;
// import from frost-css patterns modal.scss
.nav-modal-outlet {
position: fixed;
top: 0;
width: 100%;

&.liquid-container {
Expand All @@ -59,7 +63,7 @@ $z-index-modal-hidden: -1 !default;
.nav-modal {
display: flex;
position: fixed;
top: 50px;
top: $frost-navigation-bar-height;
left: 0;
flex-direction: row;
width: 100%;
Expand Down Expand Up @@ -272,6 +276,7 @@ $z-index-modal-hidden: -1 !default;
.frost-navigation {
display: flex;
flex-direction: row;
height: $frost-navigation-bar-height;

& > div {
&:first-of-type {
Expand All @@ -293,9 +298,6 @@ $z-index-modal-hidden: -1 !default;
transition: background .5s ease;
border-right: 1px solid $nav-category-border-right;
cursor: pointer;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;

.nav-category-icon {
Expand Down
13 changes: 7 additions & 6 deletions addon/templates/components/frost-navigation.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<div class='frost-application-bar'>
<!-- Logo -->
{{component logo}}
{{component logo
hook=(concat hook '-logo')
}}

{{#each categories as |category index|}}
{{nav-category
isVisible=category.isVisible
icon=category.icon
name=category.name
pack=category.pack
options=category
hook=(concat hook '-category-' index)
}}
{{/each}}
<!-- More Content -->
{{yield}}
<!-- User Menu -->
{{component menu}}
{{component menu
hook=(concat hook '-menu')
}}
</div>
{{to-elsewhere
named='navigation'
Expand Down
7 changes: 5 additions & 2 deletions addon/templates/components/nav-action.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{{#frost-link route disabled=true hook=(concat hook '-link')}}
{{#link-to route
class='frost-link'
}}
<div class='content'>
<div class='nav-route-icon'>
{{#if item.icon}}
{{frost-icon
hook=(concat hook '-icon')
pack=item.pack
icon=item.icon
}}
Expand All @@ -17,4 +20,4 @@
</div>
</div>
</div>
{{/frost-link}}
{{/link-to}}
1 change: 1 addition & 0 deletions addon/templates/components/nav-category.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class='nav-category-icon'>
{{#if icon}}
{{frost-icon
hook=(concat hook '-icon')
pack=pack
icon=icon
}}
Expand Down
11 changes: 8 additions & 3 deletions addon/templates/components/nav-route.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{{#if route}}
{{#frost-link
route
(hash isQueryParams=true values=params)
hook=(concat hook '-link')
hook=(concat hook '-link')
options=(hash
route=route
routeModels=routeModels
routeQueryParams=routeQueryParams
)
}}
<div class='content'>
<div class='nav-route-icon'>
{{#if icon}}
{{frost-icon
hook=(concat hook '-link-icon')
pack=pack
icon=icon
}}
Expand All @@ -33,6 +37,7 @@
<div class='nav-route-icon'>
{{#if icon}}
{{frost-icon
hook=(concat hook '-link-icon')
pack=pack
icon=icon
}}
Expand Down
1 change: 1 addition & 0 deletions addon/templates/components/nav-section-actions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class='pointer'>
<div style={{colorBinding}}>
{{frost-icon
hook=(concat hook '-actions-icon')
class="actions-icon"
icon='chevron'
}}
Expand Down
11 changes: 2 additions & 9 deletions addon/templates/components/nav-section.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class='nav-section-actions' {{action setView section}}>
<div class='sub'>Actions</div>
{{frost-icon
hook=(concat hook '-section-actions-icon')
class='actions-icon flip'
icon='chevron'
}}
Expand All @@ -19,15 +20,7 @@
}}
{{else}}
{{nav-route
description=item.description
icon=item.icon
pack=item.pack
name=item.name
route=item.route
params=item.params
url=item.url
tabbed=item.tabbed
isVisible=item.isVisible
options=item
hook=(concat hook '-route-' index)
}}
{{/if}}
Expand Down
1 change: 0 additions & 1 deletion addon/utils/asserts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export default {
ACTION: `${title}action must be nested within this.section or this.column`,
ACTION_CONFIG: `${title}Configuration object requires property as an action`,
ROUTE: `${title}'config.route must be defined'`,
PACKAGE: `${title}config.package must be defined`,
DEPRECATE_ACTION: `${title}Action should exist within the 'actions' hook`
}
44 changes: 12 additions & 32 deletions addon/utils/bind-dsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const {
APP,
ROUTE,
ENGINE,
PACKAGE,
ACTION,
ACTION_CONFIG,
LINK
Expand Down Expand Up @@ -53,25 +52,13 @@ export default {
name,
config
}
if (name !== 'application') {
self.route(name, config, function () {
callback.call({
category: obj.category.bind({
top: parent,
parent,
DSL: this
})
})
})
} else {
callback.call({
category: obj.category.bind({
top: parent,
parent,
DSL: self
})
callback.call({
category: obj.category.bind({
top: parent,
parent,
DSL: self
})
}
})
})(args.string, args.object, args.function)
}
/**
Expand Down Expand Up @@ -202,19 +189,16 @@ export default {
assert(APP, self.parent.type === 'section' || self.parent.type === 'column')
;(function (name, config = {}, callback = function () {}) {
assert(ROUTE, config.route)
self.DSL.route(config.route, config)

let e = self.parent.type === 'section' ? self.element.routes : self.element[0].routes
let route = self.top.name !== 'application'
? `${self.top.name}.${config.route}`
: config.route
e.push({
name,
description: config.description,
icon: config.icon,
pack: config.pack || 'frost',
route,
params: config.params,
route: config.route,
routeQueryParams: config.routeQueryParams,
routeModels: config.routeModels,
isVisible: config.isVisible !== false
})
callback.call({
Expand All @@ -240,21 +224,17 @@ export default {
let self = this
assert(ENGINE, self.parent.type === 'section' || self.parent.type === 'column')
;(function (name, config = {}, callback = function () {}) {
assert(PACKAGE, config.package)
assert(ROUTE, config.route)
config.as = config.as || config.route
self.DSL.mount(config.package, config)
let e = self.parent.type === 'section' ? self.element.routes : self.element[0].routes
let route = self.top.name !== 'application'
? `${self.top.name}.${config.route}`
: config.route
e.push({
name,
description: config.description,
icon: config.icon,
pack: config.pack || 'frost',
route,
params: config.params,
route: config.route,
routeQueryParams: config.routeQueryParams,
routeModels: config.routeModels,
isVisible: config.isVisible !== false
})
callback.call({
Expand Down
7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"name": "ember-frost-navigation",
"dependencies": {
"ember": "~2.8.0",
"ember": "~2.11.0",
"ember-cli-shims": "0.1.0",
"ember-inflector": "1.3.1",
"ember-mocha": "~0.8.11",
"ember-mocha-adapter": "~0.3.1",
"Faker": "3.0.1",
"lodash": "^4.15.0",
"pretender": "~0.12.0",
"sinonjs": "1.17.1",
"font-awesome": "^4.6.3"
"sinonjs": "1.17.1"
},
"resolutions": {
"ember": "~2.8.0"
"ember": "~2.11.0"
}
}
2 changes: 1 addition & 1 deletion config/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (deployTarget) {
// include other plugin configuration that applies to all deploy targets here
}
ENV['gh-pages'] = {
force: process.env.gitForcePush,
force: true,
slack: {
webhookURL: process.env.webhookURL,
options: {
Expand Down
Loading

0 comments on commit 9e77cc4

Please sign in to comment.