Skip to content

Commit 493a034

Browse files
authored
Version v1.1.4 (#26)
* 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
1 parent 482e210 commit 493a034

File tree

6 files changed

+59
-15
lines changed

6 files changed

+59
-15
lines changed

docs/roadmap.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
11
# Roadmap
22

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

109
### Long Term
11-
* Improve docs readability (maybe include REPL for editable examples)
10+
* Routing decorators (most likely to include `@AuthRequired`, `@DataLoaded` and `@RedirectOnAuth`)
11+
* Optional Built in Role Management
1212
* Multi-level population
1313
* Population rules suggestion/generation
1414
* Population performance measurement
15+
16+
## Pre-release Versions
17+
18+
### `v1.2.0-alpha` (released)
19+
20+
#### Breaking Changes
21+
* `profileDecorator` config option renamed to `profileFactory` for clarity
22+
* default file metadata written to database includes `downloadURL` instead of `downloadURLs` array
23+
24+
#### Enhancements
25+
* Config params type validation
26+
* `fileMetadataFactory` config option added to allow control of metadata written to database when using `uploadFile` and `uploadFiles`
27+
* docs improvements
28+
29+
### `v1.2.0-beta`
30+
31+
#### Breaking Changes
32+
*Stay Tuned*
33+
34+
#### Enhancements
35+
36+
37+
## Upcoming Minor Version (`v1.2.0`)
38+
39+
#### Breaking Changes
40+
* `profileDecorator` config option renamed to `profileFactory` for clarity
41+
* default file metadata written to database includes `downloadURL` instead of `downloadURLs` array
42+
43+
#### Enhancements
44+
* Config params type validation
45+
* `fileMetadataFactory` config option added to allow control of metadata written to database when using `uploadFile` and `uploadFiles`
46+
* docs improvements

examples/complete/material/src/containers/Home/Home.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const { isLoaded, pathToJS, dataToJS } = helpers
1919
// '/todos#populate=owner:displayNames' // for populating owner parameter from id into string loaded from /displayNames root
2020
// '/todos#populate=owner:users' // for populating owner parameter from id to user object loaded from /users root
2121
'/todos#populate=owner:users:displayName' // for populating owner parameter from id within to displayName string from user object within users root
22+
// '/todos#orderByChild=done&equalTo=false', // list only not done todos
2223
])
2324
@connect(
2425
({firebase}) => ({
2526
todos: dataToJS(firebase, 'todos'),
26-
profile: pathToJS(firebase, 'profile'),
2727
auth: pathToJS(firebase, 'auth')
2828
})
2929
)
@@ -41,8 +41,7 @@ export default class Home extends Component {
4141
}),
4242
auth: PropTypes.shape({
4343
uid: PropTypes.string
44-
}),
45-
profile: PropTypes.object
44+
})
4645
}
4746

4847
toggleDone = (todo, id) => {
@@ -73,8 +72,8 @@ export default class Home extends Component {
7372
<div className='Home-Info'>
7473
from
7574
<span className='Home-Url'>
76-
<a href='https://react-redux-firebase.firebaseio.com/'>
77-
react-redux-firebase.firebaseio.com
75+
<a href='https://redux-firebasev3.firebaseio.com/'>
76+
redux-firebasev3.firebaseio.com
7877
</a>
7978
</span>
8079
</div>

examples/complete/simple/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class App extends Component {
4545
<h4>
4646
Loaded From
4747
<span className='App-Url'>
48-
<a href='https://react-redux-firebase.firebaseio.com/'>
49-
react-redux-firebase.firebaseio.com
48+
<a href='https://redux-firebasev3.firebaseio.com/'>
49+
redux-firebasev3.firebaseio.com
5050
</a>
5151
</span>
5252
</h4>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-redux-firebase",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Redux integration for Firebase. Comes with a Higher Order Component for use with React.",
55
"main": "dist/index.js",
66
"module": "src/index.js",

src/utils/populate.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,32 @@ export const promisesForPopulate = (firebase, originalData, populates) => {
9696
getPopulateChild(
9797
firebase,
9898
p,
99-
childParam ? get(id, childParam) : id // get child parameter if [] notation
99+
childParam
100+
? get(id, childParam) // get child parameter if [] notation
101+
: id === true // handle list of keys
102+
? childKey
103+
: id
100104
)
101105
.then(pc =>
102106
!childParam
103107
? pc
104108
: ({
105-
[childKey]: set(id, childParam, Object.assign(pc, { key: get(id, childParam) }))
109+
[childKey]: set(
110+
id,
111+
childParam,
112+
Object.assign(pc, { key: get(id, childParam) })
113+
)
106114
})
107115
)
108116
)
109117
)
110118
// replace parameter with populated list
111119
.then((v) => {
112120
// reduce array of arrays if childParam exists
113-
const vObj = childParam ? reduce(v, (a, b) => Object.assign(a, b), {}) : v
121+
const vObj = childParam
122+
? reduce(v, (a, b) => Object.assign(a, b), {})
123+
: v
124+
114125
return set(originalData, `${key}.${mainChild}`, vObj)
115126
})
116127
)

src/utils/query.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export const applyParamsToQuery = (queryParams, query) => {
116116
case 'equalTo':
117117
let equalToParam = !doNotParse ? parseInt(param[1], 10) || param[1] : param[1]
118118
equalToParam = equalToParam === 'null' ? null : equalToParam
119+
equalToParam = equalToParam === 'false' ? false : equalToParam
120+
equalToParam = equalToParam === 'true' ? true : equalToParam
119121
query = param.length === 3
120122
? query.equalTo(equalToParam, param[2])
121123
: query.equalTo(equalToParam)

0 commit comments

Comments
 (0)