@planningcenter/topbar 12.8.2 → 12.8.3-rc.2

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.
@@ -1187,20 +1187,21 @@ function getAppsSwitchProductPath(productName) {
1187
1187
  return `${basePath}?${params.toString()}`;
1188
1188
  }
1189
1189
 
1190
+ const GROUPED_SEPARATELY = ["Accounts", "Church Center", "Home"];
1190
1191
  function groupApps(apps) {
1191
1192
  return {
1192
1193
  accountsProduct: apps.find(({
1193
1194
  name
1194
1195
  }) => name === "Accounts"),
1195
- hasChurchCenter: apps.some(({
1196
+ churchCenterProduct: apps.find(({
1196
1197
  name
1197
- }) => name === "Publishing"),
1198
+ }) => name === "Church Center"),
1198
1199
  homeProduct: apps.find(({
1199
1200
  name
1200
1201
  }) => name === "Home"),
1201
1202
  restProducts: [...apps].filter(({
1202
1203
  name
1203
- }) => name !== "Home" && name !== "Accounts").sort((a, b) => a.name.localeCompare(b.name))
1204
+ }) => !GROUPED_SEPARATELY.includes(name)).sort((a, b) => a.name.localeCompare(b.name))
1204
1205
  };
1205
1206
  }
1206
1207
 
@@ -1862,11 +1863,11 @@ const AppsMenu = ({
1862
1863
  }) => {
1863
1864
  const {
1864
1865
  accountsProduct,
1865
- hasChurchCenter,
1866
+ churchCenterProduct,
1866
1867
  homeProduct,
1867
1868
  restProducts
1868
1869
  } = groupApps(apps);
1869
- const showChurchCenter = churchCenterEnabled && hasChurchCenter;
1870
+ const showChurchCenter = churchCenterEnabled && !!churchCenterProduct;
1870
1871
  const renderProductLink = name => {
1871
1872
  const isCurrent = name === appName;
1872
1873
  return /*#__PURE__*/React__default.createElement("li", {
@@ -1918,7 +1919,7 @@ const AppsMenu = ({
1918
1919
  className: classnames(styles$n.link, styles$n["accounts-link"]),
1919
1920
  "data-pendo": "app-switcher--change-app--ChurchCenter",
1920
1921
  "data-turbolinks": false,
1921
- href: `${pcoUrl$1(env)("publishing")}/dashboard`
1922
+ href: `${pcoUrl$1(env)("publishing")}/church-center`
1922
1923
  }, /*#__PURE__*/React__default.createElement(AppRow, {
1923
1924
  appName: "Church Center"
1924
1925
  }))))))));
@@ -1971,7 +1972,7 @@ function hasFeature(features, flag) {
1971
1972
  }
1972
1973
 
1973
1974
  const sortByAttribute = attr => arr => arr.slice().sort((a, b) => a[attr].localeCompare(b[attr]));
1974
- const appsMenuFormatter = apps => sortByAttribute("name")(apps).reduce((acc, item) => (item.name || "") === "Church Center" || (item.name || "") === "API" ? acc : item.name === "Home" ? [item, ...acc] : [...acc, item], []);
1975
+ const appsMenuFormatter = apps => sortByAttribute("name")(apps).reduce((acc, item) => (item.name || "") === "API" ? acc : item.name === "Home" ? [item, ...acc] : [...acc, item], []);
1975
1976
  const connectedPeopleMenuFormatter = connectedPeople => connectedPeople.slice().sort((a, b) => a.attributes["organization_name"].localeCompare(b.attributes["organization_name"]));
1976
1977
 
1977
1978
  function useFeature(flag, features) {
@@ -6709,11 +6710,11 @@ const AppsSwitcher = ({
6709
6710
  }) => {
6710
6711
  const {
6711
6712
  accountsProduct,
6712
- hasChurchCenter,
6713
+ churchCenterProduct,
6713
6714
  homeProduct,
6714
6715
  restProducts
6715
6716
  } = groupApps(apps);
6716
- const showChurchCenter = churchCenterEnabled && hasChurchCenter;
6717
+ const showChurchCenter = churchCenterEnabled && !!churchCenterProduct;
6717
6718
  const {
6718
6719
  containerRef,
6719
6720
  handleKeyDown
@@ -6794,7 +6795,7 @@ const AppsSwitcher = ({
6794
6795
  className: classnames(styles$7.link, styles$7["accounts-link"]),
6795
6796
  "data-pendo": "app-switcher--change-app--ChurchCenter",
6796
6797
  "data-turbolinks": false,
6797
- href: `${pcoUrl$1(env)("publishing")}/dashboard`
6798
+ href: `${pcoUrl$1(env)("publishing")}/church-center`
6798
6799
  }, /*#__PURE__*/React__default.createElement(AppRow, {
6799
6800
  appName: "Church Center"
6800
6801
  }))))))), document.body));