@apptegy/nuxt-navigation 0.1.57 → 0.1.59

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
3
  "configKey": "@apptegy/nuxt-navigation",
4
- "version": "0.1.57",
4
+ "version": "0.1.59",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "unknown"
@@ -14,7 +14,11 @@
14
14
  <button
15
15
  v-if="showHelpArticles"
16
16
  :id="!isDropdown && 'help-btn'"
17
- :class="['help-articles-btn', !isDropdown && 'help-btn']"
17
+ :class="[
18
+ 'help-articles-btn',
19
+ !isDropdown && 'help-btn',
20
+ isRoomsUser && `help-btn-${userRoomsRole}`
21
+ ]"
18
22
  :aria-label="isDropdown ? $t('navigation.helpCenter') : $t('navigation.helpArticles')"
19
23
  @click="expandDropdown"
20
24
  >
@@ -38,7 +42,7 @@
38
42
  </template>
39
43
 
40
44
  <script setup lang="ts">
41
- import { useSidebar, navigateTo } from "#imports";
45
+ import { useSidebar, navigateTo, useAuth } from "#imports";
42
46
  import { ref, computed, onMounted } from 'vue'
43
47
 
44
48
  interface IHelpArticlesProps {
@@ -48,6 +52,7 @@ interface IHelpArticlesProps {
48
52
  showHelpArticles: boolean;
49
53
  };
50
54
 
55
+ const { userProfile } = useAuth();
51
56
  const props = withDefaults(defineProps<IHelpArticlesProps>(), {
52
57
  helpArticleOptions: () => [],
53
58
  settingsRoute: '',
@@ -62,6 +67,14 @@ const helpBtnActions = ref();
62
67
  const dropdownScrollHeight = ref(0);
63
68
  const isDropdown = ref(false);
64
69
 
70
+ const isRoomsUser = computed(() => {
71
+ return !!userProfile.value?.roles?.rooms
72
+ });
73
+
74
+ const userRoomsRole = computed(() => {
75
+ return userProfile.value?.roles?.rooms
76
+ });
77
+
65
78
  const hasArticles = computed(() => !!props.helpArticleOptions?.values?.length)
66
79
 
67
80
  onMounted(() => {
@@ -77,10 +77,12 @@
77
77
  </template>
78
78
 
79
79
  <script setup lang="ts">
80
- import { useSidebar, useBranding, ref, watch } from '#imports';
80
+ import { useSidebar, useBranding, useNuxtApp, ref, watch } from '#imports';
81
81
  import type { IApplication, IUser } from "../../types";
82
82
  import ApptegyLogo from './Icons/ApptegyLogo.vue';
83
83
 
84
+ const { $t } = useNuxtApp();
85
+
84
86
  interface ILogo {
85
87
  alt: string;
86
88
  src: string;
package/locale/en.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "navigation": {
3
+ "logout": "Logout",
4
+ "accountSettings": "Account settings",
5
+ "helpCenter": "Help center",
6
+ "helpArticles": "Help articles",
7
+ "impersonating": "Impersonating",
8
+ "clientName": "Client name",
9
+ "authenticatedAs": "Authenticated as",
10
+ "skipToContent": "Skip to content",
11
+ "orgDropdown": "Organization options",
12
+ "orgPlaceholder": "Start typing to search",
13
+ "orgBadge": "Intranet",
14
+ "sidebarToggle": "Menu",
15
+ "userDropdown": "User settings",
16
+ "logoAlt": "Thrillshare - Return Home",
17
+ "brandLogoAlt": "Logo",
18
+ "website": "School Website"
19
+ }
20
+ }
@@ -0,0 +1,7 @@
1
+ import navigationLocale from './en.json';
2
+
3
+ export default {
4
+ dscl: {
5
+ ...navigationLocale
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/types.d.ts",
8
8
  "import": "./dist/module.mjs",
9
9
  "require": "./dist/module.cjs"
10
- }
10
+ },
11
+ "./locale/*": "./locale/*"
11
12
  },
12
13
  "main": "./dist/module.cjs",
13
14
  "types": "./dist/types.d.ts",
14
15
  "files": [
15
- "dist"
16
+ "dist",
17
+ "locale"
16
18
  ],
17
19
  "scripts": {
18
20
  "prepack": "nuxt-module-build build",