@planningcenter/topbar 8.2.0-rc.1 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [8.2.0] - 2021-05-11
8
+ ## [8.2.0] - 2021-05-23
9
9
 
10
10
  ### Added
11
11
 
@@ -15,14 +15,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
 
16
16
  - Add more info regarding troubleshooting `yalc` issues to the README
17
17
  - Send a `fetchAuthTokenFn` to `jolt-client` instead of `authToken`. Over time, the auth token can get stale. Sending a function instead of a value allows the client to refresh itself when required.
18
+ - Instead of fetching the WSS URLs for authorization from an api endpoint, hard-code them instead. After the change adding `fetchAuthTokenFn`, this change reduces required API calls by 1.
18
19
 
19
- ## [8.1.1] - 2021-04-11
20
+ ### Fixed
21
+
22
+ - fix: hook into `pco-page-expired` to `disconnect` jolt instance when session is changed
23
+
24
+ ## [8.1.1] - 2022-04-11
20
25
 
21
26
  ### Changed
22
27
 
23
28
  - fix: don't send a `timeZone` key to `@churchcenter/datetime-fmt` if it doesn't have a value
24
29
 
25
- ## [8.1.0] - 2021-04-11
30
+ ## [8.1.0] - 2022-04-11
26
31
 
27
32
  ### Changed
28
33
 
@@ -33,14 +38,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
38
  - Fix dark mode text styles in notifications inbox
34
39
  - Fix notification date timezone not displaying in the org's time zone
35
40
 
36
- ## [8.0.1] - 2021-03-29
41
+ ## [8.0.1] - 2022-03-29
37
42
 
38
43
  ### Changed
39
44
 
40
45
  - Correct the capitalization of "Check-Ins" in order to set the correct color for notifications
41
46
  - Bring back the `notifications` prop for topbars so that if notifications are not enabled, it will render the `notifications` prop instead
42
47
 
43
- ## [8.0.0] - 2021-03-24
48
+ ## [8.0.0] - 2022-03-24
44
49
 
45
50
  ### Added
46
51
 
@@ -148,6 +153,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
148
153
 
149
154
  Versions entries to this changelog weren't tracked very well and were presented in a less organized style (more like a README or upgrade guide). If you are interested in that, you can read about the changes in [README-pre-4.9.0].
150
155
 
156
+ [8.2.0]: https://github.com/ministrycentered/topbar/compare/v8.1.1..v8.2.0
151
157
  [8.1.1]: https://github.com/ministrycentered/topbar/compare/v8.1.0..v8.1.1
152
158
  [8.1.0]: https://github.com/ministrycentered/topbar/compare/v8.0.1..v8.1.0
153
159
  [8.0.1]: https://github.com/ministrycentered/topbar/compare/v8.0.0..v8.0.1
package/README.md CHANGED
@@ -34,6 +34,11 @@ If a Jolt connection is not shared with topbar, it will gladly initiate its own
34
34
  To reuse your app's Jolt connection, topbar requires a Promise that resolves into a [Jolt client](https://github.com/ministrycentered/jolt-client/) connection.
35
35
  If nothing is passed—or if a Promise is passed that resolves to `undefined` or `void`—topbar will initiate its own connection.
36
36
 
37
+ Topbar hooks into `pco-page-expired` and will `disconnect` when the session is invalidated (i.e. logged out in a different tab).
38
+ This occurs for `topbar`-created jolt instances as well as jolt instances provided to `topbar` via the `joltPromise` prop.
39
+ CSRF tokens are invalidated when the session is invalidated.
40
+ Non-GET APIv2 requests (i.e. auth/subscribe) require a valid CSRF token and will never succeed in that state.
41
+
37
42
  #### Example
38
43
 
39
44
  As an example, we'll use what Services has done for the v7.3 alpha.
@@ -52,14 +57,12 @@ As a layout partial, they attach two Jolt-related things to `window`:
52
57
  In their Topbar implementation component, they then create the function that provides topbar the required Promise...
53
58
 
54
59
  ```jsx
55
- const waitForWindowJolt = async () => {
56
- const listener = Promise.resolve(window.joltListenerPromise)
57
- return listener.then((listener) => {
60
+ const waitForWindowJolt = async () =>
61
+ window.joltListenerPromise.then(listener => {
58
62
  if (listener && listener.jolt) {
59
63
  return listener.jolt
60
64
  }
61
65
  })
62
- }
63
66
  ```
64
67
 
65
68
  ...and passes that function in for the `JoltPromise` prop to topbar.