Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix device groups layout #4817

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 7 additions & 3 deletions frontend/src/pages/application/DeviceGroup/Settings/index.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<template>
<div class="mb-3">
<SectionTopMenu hero="Device Group Settings" info="" />
</div>
<div class="flex flex-col sm:flex-row">
<SectionSideMenu :options="sideNavigation" />
<div class="flex-grow">
Expand All @@ -12,13 +15,14 @@ import { useRouter } from 'vue-router'
import { mapState } from 'vuex'

import SectionSideMenu from '../../../../components/SectionSideMenu.vue'
import SectionTopMenu from '../../../../components/SectionTopMenu.vue'

import permissionsMixin from '../../../../mixins/Permissions.js'

export default {
name: 'DeviceGroupSettings',
components: {
SectionSideMenu
SectionSideMenu, SectionTopMenu
},
mixins: [permissionsMixin],
props: {
Expand Down Expand Up @@ -55,8 +59,8 @@ export default {
return false
}
this.sideNavigation = [
{ name: 'General', path: './general' },
{ name: 'Environment', path: './environment' }
{ name: 'General', path: { name: 'ApplicationDeviceGroupSettingsGeneral' } },
{ name: 'Environment', path: { name: 'ApplicationDeviceGroupSettingsEnvironment' } }
]
return true
},
Expand Down
30 changes: 16 additions & 14 deletions frontend/src/pages/application/DeviceGroup/devices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
<ff-loading message="Loading Device Group..." />
</main>
<div v-else class="w-full">
<FormHeading class="mb-3">
<div class="flex justify-between items-center">
<div class="min-w-0 truncate mr-2">Device Group Membership</div>
<div v-if="!editMode && !hasChanges" class="flex flex-wrap justify-end items-end gap-x-2 gap-y-2 mt-0 mb-1">
<ff-button kind="primary" size="small" class="w-24 whitespace-nowrap" @click="editMode = true">Edit</ff-button>
</div>
<div v-else class="flex flex-wrap justify-end items-end gap-x-2 gap-y-2 mt-0 mb-1">
<ff-button kind="secondary" size="small" class="w-24 whitespace-nowrap" @click="cancelChanges">Cancel</ff-button>
<ff-button kind="primary" size="small" :disabled="!hasChanges" class="w-24 whitespace-nowrap" @click="saveChanges">Save Changes</ff-button>
</div>
</div>
</FormHeading>
<div class="mb-3">
<SectionTopMenu hero="Device Group Membership" info="">
<template #tools>
<div v-if="!editMode && !hasChanges" class="flex flex-wrap justify-end items-end gap-x-2 gap-y-2 mt-0 mb-1">
<ff-button kind="primary" size="small" class="w-24 whitespace-nowrap" @click="editMode = true">Edit</ff-button>
</div>
<div v-else class="flex flex-wrap justify-end items-end gap-x-2 gap-y-2 mt-0 mb-1">
<ff-button kind="secondary" size="small" class="w-24 whitespace-nowrap" @click="cancelChanges">Cancel</ff-button>
<ff-button kind="primary" size="small" :disabled="!hasChanges" class="w-24 whitespace-nowrap" @click="saveChanges">Save Changes</ff-button>
</div>
</template>
</SectionTopMenu>
</div>

<div class="flex flex-col sm:flex-row">
<div v-if="editMode" class="w-full sm:w-1/2 order-3 sm:order-1">
Expand Down Expand Up @@ -81,7 +82,8 @@
import { mapState } from 'vuex'

import ApplicationApi from '../../../api/application.js'
import FormHeading from '../../../components/FormHeading.vue'
import SectionTopMenu from '../../../components/SectionTopMenu.vue'

import Alerts from '../../../services/alerts.js'
import Dialog from '../../../services/dialog.js'

Expand All @@ -93,7 +95,7 @@ export default {
name: 'DeviceGroupDevices',
components: {
ActiveSnapshotCell,
FormHeading
SectionTopMenu
},
inheritAttrs: false,
props: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/application/DeviceGroup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
{
label: 'Settings',
to: {
name: 'ApplicationDeviceGroupSettingsGeneral',
name: 'ApplicationDeviceGroupSettings',
params: {
applicationId: this.application?.id,
deviceGroupId: this.deviceGroup?.id
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/application/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ export default [
meta: {
title: 'Application - Device Group - Settings'
},
redirect: to => {
return `/application/${to.params.applicationId}/device-group/${to.params.deviceGroupId}/settings/general`
redirect: {
name: 'ApplicationDeviceGroupSettingsGeneral'
},
children: [
{
Expand Down
Loading