Skip to content

Commit

Permalink
Version v1.1.4 (#26)
Browse files Browse the repository at this point in the history
* UID Lists with value `true` now supported (from #23):
  ```js
  {
    'absdfTGTdd-kV': true,
    'absdfTGTdd-kX': true
  }
  ```
* Handle `equalTo` query with `true` and `false` (fixes #25)
* Roadmap updated
  • Loading branch information
prescottprue committed Jan 7, 2017
1 parent 482e210 commit 493a034
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 15 deletions.
40 changes: 36 additions & 4 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
# Roadmap

### Short Term
## Short Term
* List Population within user profile parameter (only single parameter currently supported)
* Implement [`firebase-server`](https://github.com/urish/firebase-server) for tests instead of using demo firebase instance
* `firebase-admin` integration
* Huge App Example with passing of props to child routes
* AuthRequired Decorator (redirect if not logged in)
* Loading Decorator (with custom loading indicator config)

### Long Term
* Improve docs readability (maybe include REPL for editable examples)
* Routing decorators (most likely to include `@AuthRequired`, `@DataLoaded` and `@RedirectOnAuth`)
* Optional Built in Role Management
* Multi-level population
* Population rules suggestion/generation
* Population performance measurement

## Pre-release Versions

### `v1.2.0-alpha` (released)

#### Breaking Changes
* `profileDecorator` config option renamed to `profileFactory` for clarity
* default file metadata written to database includes `downloadURL` instead of `downloadURLs` array

#### Enhancements
* Config params type validation
* `fileMetadataFactory` config option added to allow control of metadata written to database when using `uploadFile` and `uploadFiles`
* docs improvements

### `v1.2.0-beta`

#### Breaking Changes
*Stay Tuned*

#### Enhancements


## Upcoming Minor Version (`v1.2.0`)

#### Breaking Changes
* `profileDecorator` config option renamed to `profileFactory` for clarity
* default file metadata written to database includes `downloadURL` instead of `downloadURLs` array

#### Enhancements
* Config params type validation
* `fileMetadataFactory` config option added to allow control of metadata written to database when using `uploadFile` and `uploadFiles`
* docs improvements
9 changes: 4 additions & 5 deletions examples/complete/material/src/containers/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ const { isLoaded, pathToJS, dataToJS } = helpers
// '/todos#populate=owner:displayNames' // for populating owner parameter from id into string loaded from /displayNames root
// '/todos#populate=owner:users' // for populating owner parameter from id to user object loaded from /users root
'/todos#populate=owner:users:displayName' // for populating owner parameter from id within to displayName string from user object within users root
// '/todos#orderByChild=done&equalTo=false', // list only not done todos
])
@connect(
({firebase}) => ({
todos: dataToJS(firebase, 'todos'),
profile: pathToJS(firebase, 'profile'),
auth: pathToJS(firebase, 'auth')
})
)
Expand All @@ -41,8 +41,7 @@ export default class Home extends Component {
}),
auth: PropTypes.shape({
uid: PropTypes.string
}),
profile: PropTypes.object
})
}

toggleDone = (todo, id) => {
Expand Down Expand Up @@ -73,8 +72,8 @@ export default class Home extends Component {
<div className='Home-Info'>
from
<span className='Home-Url'>
<a href='https://react-redux-firebase.firebaseio.com/'>
react-redux-firebase.firebaseio.com
<a href='https://redux-firebasev3.firebaseio.com/'>
redux-firebasev3.firebaseio.com
</a>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/simple/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class App extends Component {
<h4>
Loaded From
<span className='App-Url'>
<a href='https://react-redux-firebase.firebaseio.com/'>
react-redux-firebase.firebaseio.com
<a href='https://redux-firebasev3.firebaseio.com/'>
redux-firebasev3.firebaseio.com
</a>
</span>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-redux-firebase",
"version": "1.1.3",
"version": "1.1.4",
"description": "Redux integration for Firebase. Comes with a Higher Order Component for use with React.",
"main": "dist/index.js",
"module": "src/index.js",
Expand Down
17 changes: 14 additions & 3 deletions src/utils/populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,32 @@ export const promisesForPopulate = (firebase, originalData, populates) => {
getPopulateChild(
firebase,
p,
childParam ? get(id, childParam) : id // get child parameter if [] notation
childParam
? get(id, childParam) // get child parameter if [] notation
: id === true // handle list of keys
? childKey
: id
)
.then(pc =>
!childParam
? pc
: ({
[childKey]: set(id, childParam, Object.assign(pc, { key: get(id, childParam) }))
[childKey]: set(
id,
childParam,
Object.assign(pc, { key: get(id, childParam) })
)
})
)
)
)
// replace parameter with populated list
.then((v) => {
// reduce array of arrays if childParam exists
const vObj = childParam ? reduce(v, (a, b) => Object.assign(a, b), {}) : v
const vObj = childParam
? reduce(v, (a, b) => Object.assign(a, b), {})
: v

return set(originalData, `${key}.${mainChild}`, vObj)
})
)
Expand Down
2 changes: 2 additions & 0 deletions src/utils/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export const applyParamsToQuery = (queryParams, query) => {
case 'equalTo':
let equalToParam = !doNotParse ? parseInt(param[1], 10) || param[1] : param[1]
equalToParam = equalToParam === 'null' ? null : equalToParam
equalToParam = equalToParam === 'false' ? false : equalToParam
equalToParam = equalToParam === 'true' ? true : equalToParam
query = param.length === 3
? query.equalTo(equalToParam, param[2])
: query.equalTo(equalToParam)
Expand Down

0 comments on commit 493a034

Please sign in to comment.