@apptegy/nuxt-navigation 0.1.92 → 0.1.95

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "@apptegy/nuxt-navigation",
7
- "version": "0.1.92",
7
+ "version": "0.1.95",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.1",
10
10
  "unbuild": "unknown"
@@ -6,7 +6,7 @@
6
6
  <NuxtLink
7
7
  v-if="!collapsed"
8
8
  class="a-nav-section--link"
9
- :to="active ? '' : application.url"
9
+ :to="applicationUrl"
10
10
  :aria-label="appText"
11
11
  >
12
12
  <span v-if="expanded">{{ appText }}</span>
@@ -31,25 +31,36 @@
31
31
 
32
32
  <script setup>
33
33
  import { useSidebar, computed, ref, useNuxtApp } from "#imports";
34
- const ENGAGE_APP_ID = 12;
34
+ const ENGAGE_APP_TEXT = "engage";
35
35
  const props = defineProps({
36
36
  application: { type: Object, required: true },
37
37
  active: { type: Boolean, required: true },
38
38
  collapsed: { type: Boolean, required: true }
39
39
  });
40
40
  const { $ld } = useNuxtApp();
41
+ const { state: expanded } = useSidebar();
42
+ const isOpen = ref(true);
41
43
  const isEngageRenameEnabled = computed(() => {
42
44
  return Boolean($ld?.flags?.engageToNewslettersNameChange);
43
45
  });
46
+ const isNewslettersUrlEnabled = computed(() => {
47
+ return Boolean($ld?.flags?.engageToNewslettersUrlChange);
48
+ });
44
49
  const appText = computed(() => {
45
- const { id, text } = props.application || {};
46
- if (id === ENGAGE_APP_ID && isEngageRenameEnabled.value) {
50
+ const { text } = props.application || {};
51
+ if (text.toLowerCase() === ENGAGE_APP_TEXT && isEngageRenameEnabled.value) {
47
52
  return "Newsletters";
48
53
  }
49
54
  return text.replace("_", " ");
50
55
  });
51
- const { state: expanded } = useSidebar();
52
- const isOpen = ref(true);
56
+ const applicationUrl = computed(() => {
57
+ const { text, url } = props.application || {};
58
+ if (props.active) return "";
59
+ if (text.toLowerCase() === ENGAGE_APP_TEXT && isNewslettersUrlEnabled.value) {
60
+ return url.replace("engage", "newsletters");
61
+ }
62
+ return url;
63
+ });
53
64
  </script>
54
65
 
55
66
  <style scoped>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.92",
3
+ "version": "0.1.95",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -46,5 +46,5 @@
46
46
  "vue": "^3.5.13",
47
47
  "vue-tsc": "^3.0.3"
48
48
  },
49
- "gitHead": "d3176046978ece23e48bb836a7ea1ce4c453b2f8"
49
+ "gitHead": "439650c9b42abbd3cecbecbf3006bd6d0b079542"
50
50
  }