@planningcenter/topbar 12.8.3-rc.1 → 12.8.3

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/dist/topbar.js CHANGED
@@ -1212,20 +1212,21 @@ function getAppsSwitchProductPath(productName) {
1212
1212
  return `${basePath}?${params.toString()}`;
1213
1213
  }
1214
1214
 
1215
+ const GROUPED_SEPARATELY = ["Accounts", "Church Center", "Home"];
1215
1216
  function groupApps(apps) {
1216
1217
  return {
1217
1218
  accountsProduct: apps.find(({
1218
1219
  name
1219
1220
  }) => name === "Accounts"),
1220
- hasChurchCenter: apps.some(({
1221
+ churchCenterProduct: apps.find(({
1221
1222
  name
1222
- }) => name === "Publishing"),
1223
+ }) => name === "Church Center"),
1223
1224
  homeProduct: apps.find(({
1224
1225
  name
1225
1226
  }) => name === "Home"),
1226
1227
  restProducts: [...apps].filter(({
1227
1228
  name
1228
- }) => name !== "Home" && name !== "Accounts").sort((a, b) => a.name.localeCompare(b.name))
1229
+ }) => !GROUPED_SEPARATELY.includes(name)).sort((a, b) => a.name.localeCompare(b.name))
1229
1230
  };
1230
1231
  }
1231
1232
 
@@ -1887,11 +1888,11 @@ const AppsMenu = ({
1887
1888
  }) => {
1888
1889
  const {
1889
1890
  accountsProduct,
1890
- hasChurchCenter,
1891
+ churchCenterProduct,
1891
1892
  homeProduct,
1892
1893
  restProducts
1893
1894
  } = groupApps(apps);
1894
- const showChurchCenter = churchCenterEnabled && hasChurchCenter;
1895
+ const showChurchCenter = churchCenterEnabled && !!churchCenterProduct;
1895
1896
  const renderProductLink = name => {
1896
1897
  const isCurrent = name === appName;
1897
1898
  return /*#__PURE__*/React.createElement("li", {
@@ -1943,7 +1944,7 @@ const AppsMenu = ({
1943
1944
  className: classnames(styles$n.link, styles$n["accounts-link"]),
1944
1945
  "data-pendo": "app-switcher--change-app--ChurchCenter",
1945
1946
  "data-turbolinks": false,
1946
- href: `${pcoUrl$1(env)("publishing")}/dashboard`
1947
+ href: `${pcoUrl$1(env)("publishing")}/church-center`
1947
1948
  }, /*#__PURE__*/React.createElement(AppRow, {
1948
1949
  appName: "Church Center"
1949
1950
  }))))))));
@@ -1996,7 +1997,7 @@ function hasFeature(features, flag) {
1996
1997
  }
1997
1998
 
1998
1999
  const sortByAttribute = attr => arr => arr.slice().sort((a, b) => a[attr].localeCompare(b[attr]));
1999
- const appsMenuFormatter = apps => sortByAttribute("name")(apps).reduce((acc, item) => (item.name || "") === "Church Center" || (item.name || "") === "API" ? acc : item.name === "Home" ? [item, ...acc] : [...acc, item], []);
2000
+ const appsMenuFormatter = apps => sortByAttribute("name")(apps).reduce((acc, item) => (item.name || "") === "API" ? acc : item.name === "Home" ? [item, ...acc] : [...acc, item], []);
2000
2001
  const connectedPeopleMenuFormatter = connectedPeople => connectedPeople.slice().sort((a, b) => a.attributes["organization_name"].localeCompare(b.attributes["organization_name"]));
2001
2002
 
2002
2003
  function useFeature(flag, features) {
@@ -6734,11 +6735,11 @@ const AppsSwitcher = ({
6734
6735
  }) => {
6735
6736
  const {
6736
6737
  accountsProduct,
6737
- hasChurchCenter,
6738
+ churchCenterProduct,
6738
6739
  homeProduct,
6739
6740
  restProducts
6740
6741
  } = groupApps(apps);
6741
- const showChurchCenter = churchCenterEnabled && hasChurchCenter;
6742
+ const showChurchCenter = churchCenterEnabled && !!churchCenterProduct;
6742
6743
  const {
6743
6744
  containerRef,
6744
6745
  handleKeyDown
@@ -6819,7 +6820,7 @@ const AppsSwitcher = ({
6819
6820
  className: classnames(styles$7.link, styles$7["accounts-link"]),
6820
6821
  "data-pendo": "app-switcher--change-app--ChurchCenter",
6821
6822
  "data-turbolinks": false,
6822
- href: `${pcoUrl$1(env)("publishing")}/dashboard`
6823
+ href: `${pcoUrl$1(env)("publishing")}/church-center`
6823
6824
  }, /*#__PURE__*/React.createElement(AppRow, {
6824
6825
  appName: "Church Center"
6825
6826
  }))))))), document.body));