Skip to content

Commit

Permalink
Merge branch 'main' into 4756-search-api
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Nov 14, 2024
2 parents 2cd1a36 + 0b4c35f commit fb33eea
Show file tree
Hide file tree
Showing 43 changed files with 952 additions and 747 deletions.
28 changes: 15 additions & 13 deletions forge/comms/v2AuthRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,22 @@ module.exports = async function (app) {
if (app.license.active()) {
const parts = request.body.username.split('@')
const user = await app.db.models.TeamBrokerClient.byUsername(parts[0], parts[1])
const acls = JSON.parse(user.acls)
for (const acl in acls) {
if (request.body.action === 'subscribe') {
if (mqttMatch(acls[acl].pattern, request.body.topic)) {
if (acls[acl].action === 'both' || acls[acl].action === 'subscribe') {
reply.send({ result: 'allow' })
return
if (user) {
const acls = JSON.parse(user.acls)
for (const acl in acls) {
if (request.body.action === 'subscribe') {
if (mqttMatch(acls[acl].pattern, request.body.topic)) {
if (acls[acl].action === 'both' || acls[acl].action === 'subscribe') {
reply.send({ result: 'allow' })
return
}
}
}
} else {
if (mqttMatch(acls[acl].pattern, request.body.topic)) {
if (acls[acl].action === 'both' || acls[acl].action === 'publish') {
reply.send({ result: 'allow' })
return
} else {
if (mqttMatch(acls[acl].pattern, request.body.topic)) {
if (acls[acl].action === 'both' || acls[acl].action === 'publish') {
reply.send({ result: 'allow' })
return
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div id="ff-app" class="min-h-screen flex flex-col">
<div id="ff-app" class="flex flex-col" :class="{'hidden-left-drawer': hiddenLeftDrawer}">
<template v-if="offline">
<main class="ff-bg-dark flex-grow flex flex-col">
<div class="w-full max-w-screen-2xl mx-auto my-2 sm:my-8 flex-grow flex flex-col">
Expand Down Expand Up @@ -57,7 +57,7 @@
</template>

<script>
import { mapState } from 'vuex'
import { mapGetters, mapState } from 'vuex'
import Loading from './components/Loading.vue'
import Offline from './components/Offline.vue'
Expand Down Expand Up @@ -88,6 +88,8 @@ export default {
},
computed: {
...mapState('account', ['pending', 'user', 'team', 'offline', 'settings']),
...mapState('ux', ['leftDrawer']),
...mapGetters('ux', ['hiddenLeftDrawer']),
loginRequired () {
return this.$route.meta.requiresLogin !== false
},
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/components/PageHeader.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<template>
<div class="ff-header" data-sentry-unmask>
<!-- Mobile: Toggle(Team & Team Admin Options) -->
<i v-if="shouldDisplayMenuToggle" class="ff-header--mobile-toggle" :class="{'active': mobileMenuOpen}">
<MenuIcon class="ff-avatar" @click="$emit('menu-toggle')" />
<i v-if="!hiddenLeftDrawer" class="ff-header--mobile-toggle">
<transition name="mobile-menu-fade" mode="out-in">
<MenuIcon v-if="!leftDrawer.state" class="ff-avatar cursor-pointer" @click="toggleLeftDrawer" />
<XIcon v-else class="ff-avatar cursor-pointer" @click="toggleLeftDrawer" />
</transition>
</i>
<!-- FlowFuse Logo -->
<img class="ff-logo" src="/ff-logo--wordmark-caps--dark.png" @click="home()">
Expand Down Expand Up @@ -69,7 +72,7 @@
</div>
</template>
<script>
import { AcademicCapIcon, AdjustmentsIcon, CogIcon, LogoutIcon, MenuIcon, PlusIcon, QuestionMarkCircleIcon, UserAddIcon } from '@heroicons/vue/solid'
import { AcademicCapIcon, AdjustmentsIcon, CogIcon, LogoutIcon, MenuIcon, PlusIcon, QuestionMarkCircleIcon, UserAddIcon, XIcon } from '@heroicons/vue/solid'
import { ref } from 'vue'
import { mapActions, mapGetters, mapState } from 'vuex'
Expand All @@ -84,17 +87,12 @@ import TeamSelection from './TeamSelection.vue'
export default {
name: 'NavBar',
props: {
mobileMenuOpen: {
type: Boolean
}
},
emits: ['menu-toggle'],
mixins: [navigationMixin, permissionsMixin],
computed: {
...mapState('account', ['user', 'team', 'teams']),
...mapState('ux', ['leftDrawer']),
...mapGetters('account', ['notifications', 'hasAvailableTeams', 'defaultUserTeam', 'canCreateTeam', 'isTrialAccount']),
...mapGetters('ux', ['shouldShowLeftMenu']),
...mapGetters('ux', ['hiddenLeftDrawer']),
navigationOptions () {
return [
{
Expand Down Expand Up @@ -137,10 +135,7 @@ export default {
].filter(option => option !== undefined)
},
showInviteButton () {
return this.team && this.hasPermission('team:user:invite') && this.$route.name !== 'TeamMembers'
},
shouldDisplayMenuToggle () {
return this.shouldShowLeftMenu(this.$route)
return this.team && this.hasPermission('team:user:invite') && this.$route.name !== 'team-members-members'
}
},
watch: {
Expand All @@ -155,6 +150,7 @@ export default {
NavItem,
'ff-team-selection': TeamSelection,
MenuIcon,
XIcon,
UserAddIcon,
NotificationsButton
},
Expand All @@ -172,6 +168,7 @@ export default {
}
},
methods: {
...mapActions('ux', ['toggleLeftDrawer']),
to (route) {
window.open(route.url, '_blank')
},
Expand Down
19 changes: 0 additions & 19 deletions frontend/src/components/SideNavigation.vue

This file was deleted.

232 changes: 0 additions & 232 deletions frontend/src/components/SideNavigationTeamOptions.vue

This file was deleted.

Loading

0 comments on commit fb33eea

Please sign in to comment.