Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
...mapState(useUxDrawersStore, ['hiddenLeftDrawer']),
...mapState(useAccountAuthStore, ['user']),
...mapState(useUxLoadingStore, ['appLoader', 'offline']),
...mapVuexState('account', ['team', 'settings']),
...mapVuexState('account', ['settings']),
loginRequired () {
return this.$route.meta.requiresLogin !== false
},
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/DevicesBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ import { CogIcon, PlusSmIcon } from '@heroicons/vue/solid'

import { mapActions, mapState } from 'pinia'
import { markRaw } from 'vue'
import { mapGetters, mapState as mapVuexState } from 'vuex'
import { mapGetters } from 'vuex'

import deviceApi from '../api/devices.js'
import teamApi from '../api/team.js'
Expand Down Expand Up @@ -386,6 +386,7 @@ import DevicesStatusBar from './charts/DeviceStatusBar.vue'
import AddDeviceToGroupDialog from './dialogs/device-group-management/AddDeviceToGroupDialog.vue'
import RemoveDeviceFromGroupDialog from './dialogs/device-group-management/RemoveDeviceFromGroupDialog.vue'

import { useContextStore } from '@/stores/context.js'
import { useUxDialogStore } from '@/stores/ux-dialog.js'
import { useUxToursStore } from '@/stores/ux-tours.js'

Expand Down Expand Up @@ -461,7 +462,7 @@ export default {
}
},
computed: {
...mapVuexState('account', ['team', 'teamMembership']),
...mapState(useContextStore, ['team']),
...mapGetters('account', ['featuresCheck']),
...mapState(useUxDialogStore, ['dialog']),
...mapState(useUxToursStore, ['tours']),
Expand Down Expand Up @@ -615,7 +616,7 @@ export default {
if (this.deviceCountDeltaSincePageLoad !== 0) {
// Trigger a refresh of team info to resync following device
// changes
await this.$store.dispatch('account/refreshTeam')
await useContextStore().refreshTeam()
}
},
methods: {
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/components/NotificationsButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@
import { MailIcon } from '@heroicons/vue/outline'
import { mapActions, mapState } from 'pinia'
import { markRaw } from 'vue'
import { mapGetters } from 'vuex'

import NotificationsDrawer from './drawers/notifications/NotificationsDrawer.vue'

import { useAccountStore } from '@/stores/account.js'
import { useUxDrawersStore } from '@/stores/ux-drawers.js'

export default {
name: 'NotificationsButton',
components: { MailIcon },
computed: {
...mapState(useUxDrawersStore, ['rightDrawer']),
...mapGetters('account', ['hasNotifications']),
...mapGetters('account', ['unreadNotificationsCount']),
...mapState(useAccountStore, ['hasNotifications', 'unreadNotificationsCount']),
notificationsCount: function () {
// Return null if count = 0 so we don't show a 0 in the pill
if (!this.unreadNotificationsCount) {
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/PageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
import { AcademicCapIcon, AdjustmentsIcon, CogIcon, CursorClickIcon, LogoutIcon, MenuIcon, PlusIcon, QuestionMarkCircleIcon, XIcon } from '@heroicons/vue/solid'
import { mapActions, mapState } from 'pinia'
import { ref } from 'vue'
import { mapGetters, mapState as mapVuexState } from 'vuex'
import { mapGetters } from 'vuex'

import usePermissions from '../composables/Permissions.js'

Expand All @@ -120,6 +120,8 @@ import TeamSelection from './TeamSelection.vue'
import GlobalSearch from './global-search/GlobalSearch.vue'

import { useAccountAuthStore } from '@/stores/account-auth.js'
import { useAccountStore } from '@/stores/account.js'
import { useContextStore } from '@/stores/context.js'
import { useUxDrawersStore } from '@/stores/ux-drawers.js'
import { useUxToursStore } from '@/stores/ux-tours.js'

Expand All @@ -132,8 +134,9 @@ export default {
},
...mapState(useUxDrawersStore, ['leftDrawer', 'hiddenLeftDrawer']),
...mapState(useAccountAuthStore, ['user']),
...mapVuexState('account', ['team', 'teams']),
...mapGetters('account', ['notifications', 'hasAvailableTeams', 'defaultUserTeam', 'canCreateTeam', 'isTrialAccount', 'featuresCheck']),
...mapState(useContextStore, ['team']),
...mapState(useAccountStore, ['teams', 'notifications', 'hasAvailableTeams', 'defaultUserTeam']),
...mapGetters('account', ['canCreateTeam', 'featuresCheck']),
navigationOptions () {
return [
{
Expand Down
14 changes: 10 additions & 4 deletions frontend/src/components/TeamSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ import {
ListboxOption
} from '@headlessui/vue'
import { PlusIcon, UserAddIcon } from '@heroicons/vue/solid'
import { mapGetters, mapState } from 'vuex'
import { mapState } from 'pinia'
import { mapGetters, mapState as mapVuexState } from 'vuex'

import usePermissions from '../composables/Permissions.js'

import NavItem from './NavItem.vue'

import { useAccountStore } from '@/stores/account.js'
import { useContextStore } from '@/stores/context.js'

export default {
name: 'FFTeamSelection',
emits: ['option-selected'],
Expand All @@ -61,8 +65,10 @@ export default {
return { PlusIcon, UserAddIcon, hasPermission }
},
computed: {
...mapState('account', ['team', 'teams', 'settings']),
...mapGetters('account', ['hasAvailableTeams', 'canCreateTeam']),
...mapState(useContextStore, ['team']),
...mapState(useAccountStore, ['teams', 'hasAvailableTeams']),
...mapVuexState('account', ['settings']),
...mapGetters('account', ['canCreateTeam']),
teamOptions () {
return [
...this.teams.map(team => {
Expand Down Expand Up @@ -101,7 +107,7 @@ export default {
methods: {
selectTeam (team) {
if (team) {
this.$store.dispatch('account/setTeam', team.slug)
useAccountStore().setTeam(team.slug)
.then(() => this.$router.push({
name: 'Team',
params: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/TeamTypeTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

<script>
import { mapState } from 'pinia'
import { mapState as mapVuexState } from 'vuex'

import { useHubspotHelper } from '../composables/Hubspot.js'

import { useAccountAuthStore } from '@/stores/account-auth.js'
import { useAccountStore } from '@/stores/account.js'

export default {
name: 'TeamTypeTile',
Expand All @@ -59,7 +59,7 @@ export default {
return { talkToSalesCalendarModal }
},
computed: {
...mapVuexState('account', ['teams']),
...mapState(useAccountStore, ['teams']),
...mapState(useAccountAuthStore, ['user']),
pricing: function () {
const billingDescriptionKey = this.billingInterval === 'year' ? 'yrDescription' : 'description'
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/banners/FeatureUnavailableToTeam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
<script>
import { SparklesIcon } from '@heroicons/vue/outline'

import { mapState } from 'vuex'
import { mapState } from 'pinia'

import { useContextStore } from '@/stores/context.js'

export default {
name: 'FeatureUnavailableToTeam',
Expand All @@ -49,7 +51,7 @@ export default {
}
},
computed: {
...mapState('account', ['team']),
...mapState(useContextStore, ['team']),
upgradePath () {
return { name: 'TeamChangeType', params: { team_slug: this.team.slug } }
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/banners/SubscriptionExpired.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@

<script>
import { ChevronRightIcon, ExclamationCircleIcon } from '@heroicons/vue/outline'
import { mapState } from 'vuex'
import { mapState } from 'pinia'

import usePermissions from '../../composables/Permissions.js'

import { useContextStore } from '@/stores/context.js'

export default {
name: 'SubscriptionExpired',
components: {
Expand All @@ -44,7 +46,7 @@ export default {
return { hasPermission }
},
computed: {
...mapState('account', ['team']),
...mapState(useContextStore, ['team']),
billingPath () {
return '/team/' + this.team.slug + '/billing'
},
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/banners/TeamSuspended.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@

<script>
import { ExclamationCircleIcon } from '@heroicons/vue/outline'
import { mapState } from 'vuex'
import { mapState } from 'pinia'

import { useContextStore } from '@/stores/context.js'

export default {
name: 'TeamSuspended',
components: {
ExclamationCircleIcon
},
computed: {
...mapState('account', ['team'])
...mapState(useContextStore, ['team'])
}
}
</script>
6 changes: 4 additions & 2 deletions frontend/src/components/banners/TeamTrial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
<script>
import { ChevronRightIcon, ExclamationCircleIcon } from '@heroicons/vue/outline'

import { mapState } from 'vuex'
import { mapState } from 'pinia'

import usePermissions from '../../composables/Permissions.js'

import { useContextStore } from '@/stores/context.js'

export default {
name: 'TeamTrialBanner',
components: {
Expand All @@ -54,7 +56,7 @@ export default {
return { hasPermission }
},
computed: {
...mapState('account', ['team', 'teamMembership']),
...mapState(useContextStore, ['team']),
billingPath () {
return '/team/' + this.team.slug + '/settings/change-type'
},
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/blueprints/BlueprintTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
<script>
import { CheckCircleIcon, PlusIcon } from '@heroicons/vue/outline'
import { SearchIcon } from '@heroicons/vue/solid'
import { mapState } from 'pinia'
import { defineAsyncComponent } from 'vue'
import { mapState } from 'vuex'

import ProjectIcon from '../../components/icons/Projects.js'
import { useNavigationHelper } from '../../composables/NavigationHelper.js'
Expand All @@ -73,6 +73,8 @@ import FfDialog from '../../ui-components/components/DialogBox.vue'
import FormRow from '../FormRow.vue'
import AssetDetailDialog from '../dialogs/AssetDetailDialog.vue'

import { useContextStore } from '@/stores/context.js'

export default {
name: 'BlueprintTile',
components: {
Expand Down Expand Up @@ -134,7 +136,7 @@ export default {
}
},
computed: {
...mapState('account', ['team']),
...mapState(useContextStore, ['team']),
categoryClass () {
// to lower case and strip spaces
return this.blueprint?.category.toLowerCase().replace(/\s/g, '-')
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/dialogs/BlueprintSelectorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
</template>
<script>
import FlowRenderer from '@flowfuse/flow-renderer'
import { mapGetters } from 'vuex'
import { mapState } from 'pinia'

import BlueprintSelection from '../../pages/instance/Blueprints/BlueprintSelection.vue'

import { useAccountStore } from '@/stores/account.js'

export default {
name: 'BlueprintSelectorDialog',
components: { BlueprintSelection },
Expand All @@ -59,7 +61,7 @@ export default {
}
},
computed: {
...mapGetters('account', ['blueprints', 'defaultBlueprint'])
...mapState(useAccountStore, ['blueprints', 'defaultBlueprint'])
},
watch: {
currentBlueprint (val) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
</template>

<script>
import { mapState } from 'pinia'
import { defineComponent } from 'vue'
import { mapState } from 'vuex'

import teamApi from '../../api/team.js'
import { capitalize } from '../../composables/strings/String.js'
import alerts from '../../services/alerts.js'
import { RoleNames, Roles } from '../../utils/roles.js'

import { useContextStore } from '@/stores/context.js'

export default defineComponent({
name: 'EditApplicationPermissionsDialog',
emits: ['user-updated'],
Expand All @@ -38,7 +40,7 @@ export default defineComponent({
}
},
computed: {
...mapState('account', ['team']),
...mapState(useContextStore, ['team']),
options () {
return Object.keys(RoleNames)
.filter(key => key.toString() !== '99')
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/drawers/navigation/MainNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { mapGetters, mapState as mapVuexState } from 'vuex'

import NavItem from '../../NavItem.vue'

import { useContextStore } from '@/stores/context.js'
import { useUxDrawersStore } from '@/stores/ux-drawers.js'
import { useUxNavigationStore } from '@/stores/ux-navigation.js'

Expand All @@ -43,7 +44,8 @@ export default {
emits: ['option-selected'],
computed: {
...mapState(useUxNavigationStore, ['mainNav', 'mainNavContext']),
...mapVuexState('account', ['team', 'features', 'notifications']),
...mapState(useContextStore, ['team']),
...mapVuexState('account', ['features']),
...mapGetters('account', ['requiresBilling']),
nearestMetaMenu () {
if (this.$route?.meta?.menu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@

<script>
import { XIcon } from '@heroicons/vue/solid'
import { mapActions } from 'pinia'
import { mapActions, mapState } from 'pinia'
import { markRaw } from 'vue'
import { mapGetters, mapActions as mapVuexActions } from 'vuex'

import userAPI from '../../../api/user.js'

Expand All @@ -86,6 +85,7 @@ import GenericNotification from '../../notifications/Generic.vue'
import TeamInvitationAcceptedNotification from '../../notifications/invitations/Accepted.vue'
import TeamInvitationReceivedNotification from '../../notifications/invitations/Received.vue'

import { useAccountStore } from '@/stores/account.js'
import { useUxDrawersStore } from '@/stores/ux-drawers.js'

export default {
Expand All @@ -101,7 +101,7 @@ export default {
}
},
computed: {
...mapGetters('account', ['notifications']),
...mapState(useAccountStore, ['notifications']),
canSelectAll () {
return this.filteredNotifications.length !== this.selections.length
},
Expand All @@ -126,7 +126,7 @@ export default {
},
methods: {
...mapActions(useUxDrawersStore, ['closeRightDrawer']),
...mapVuexActions('account', ['setNotifications']),
...mapActions(useAccountStore, ['setNotifications']),
closeDrawer () {
this.closeRightDrawer()
},
Expand Down
Loading
Loading