+
@@ -50,6 +51,7 @@
import AzionMobileLogo from '@assets/svg/mobile-logo'
import SidebarBlock from '@templates/sidebar-block'
import Create from './create'
+ import FeedbackFish from './feedback-fish'
import Help from './help'
import SwitchAccount from './switch-account'
import ProfileBlock from '@templates/profile-block'
diff --git a/src/templates/profile-block/index.vue b/src/templates/profile-block/index.vue
index 718dfabda..22f6a2f4c 100644
--- a/src/templates/profile-block/index.vue
+++ b/src/templates/profile-block/index.vue
@@ -199,6 +199,7 @@
@@ -175,6 +201,7 @@
:editEdgeApplicationService="edgeApplicationServices.editEdgeApplication"
:edgeApplication="edgeApplication"
:updatedRedirect="edgeApplicationServices.updatedRedirect"
+ :isTab="true"
@updatedApplication="updatedApplication"
:contactSalesEdgeApplicationService="
edgeApplicationServices.contactSalesEdgeApplicationService
diff --git a/src/views/EdgeFirewall/TabsView.vue b/src/views/EdgeFirewall/TabsView.vue
index 9aa03e7d8..968e87f55 100644
--- a/src/views/EdgeFirewall/TabsView.vue
+++ b/src/views/EdgeFirewall/TabsView.vue
@@ -8,7 +8,7 @@
import EdgeFirewallRulesEngineListView from '@/views/EdgeFirewallRulesEngine/ListView'
import { useToast } from 'primevue/usetoast'
- import { computed, onMounted, ref } from 'vue'
+ import { computed, ref, watch, provide, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
defineOptions({ name: 'tabs-edge-firewall' })
@@ -34,6 +34,9 @@
const edgeFirewallId = ref(route.params.id)
const edgeFirewall = ref()
+ const tabHasUpdate = reactive({ oldTab: null, nextTab: 0, updated: true })
+ const formHasUpdated = ref(false)
+
const loaderEdgeFirewall = async () => {
try {
return await props.edgeFirewallServices.loadEdgeFirewallService({
@@ -57,17 +60,7 @@
}
const changeRouteByClickingOnTab = ({ index = 0 }) => {
- verifyTab(edgeFirewall.value)
- const tab = getTabFromValue(index)
- activeTab.value = index
- const params = {
- id: edgeFirewallId.value,
- tab
- }
- router.push({
- name: 'edit-edge-firewall',
- params
- })
+ changeTab(index)
}
const verifyTab = ({ edgeFunctionsEnabled }) => {
@@ -122,6 +115,39 @@
onMounted(() => {
renderTabCurrentRouter()
})
+
+ const changeTab = (index) => {
+ verifyTab(edgeFirewall.value)
+ const tab = getTabFromValue(index)
+ activeTab.value = index
+ const params = {
+ id: edgeFirewallId.value,
+ tab
+ }
+ router.push({
+ name: 'edit-edge-firewall',
+ params
+ })
+ }
+
+ const visibleOnSaved = ref(false)
+
+ provide('unsaved', {
+ changeTab,
+ tabHasUpdate,
+ formHasUpdated,
+ visibleOnSaved
+ })
+
+ watch(activeTab, (newValue, oldValue) => {
+ if (visibleOnSaved.value) {
+ return
+ } else {
+ tabHasUpdate.oldTab = oldValue
+ tabHasUpdate.nextTab = newValue
+ tabHasUpdate.updated = Math.random()
+ }
+ })
@@ -143,6 +169,7 @@
:edgeFirewall="edgeFirewall"
:loadDomains="props.listDomainsService"
:updatedRedirect="edgeFirewallServices.updatedRedirect"
+ :isTab="true"
@updatedFirewall="updatedFirewall"
/>
diff --git a/src/views/EdgeFirewallFunctions/Drawer/index.vue b/src/views/EdgeFirewallFunctions/Drawer/index.vue
index 8c8b8ade2..a198d3623 100644
--- a/src/views/EdgeFirewallFunctions/Drawer/index.vue
+++ b/src/views/EdgeFirewallFunctions/Drawer/index.vue
@@ -35,7 +35,7 @@
import { ref, onMounted, computed } from 'vue'
import * as yup from 'yup'
import CreateDrawerBlock from '@templates/create-drawer-block'
- import FormFieldsDrawerFunction from '@/views/EdgeApplicationsFunctions/FormFields/FormFieldsEdgeApplicationsFunctions'
+ import FormFieldsDrawerFunction from '@/views/EdgeFirewallFunctions/FormFields/FormFieldsEdgeApplicationsFunctions'
import EditDrawerBlock from '@templates/edit-drawer-block'
import { refDebounced } from '@vueuse/core'
diff --git a/src/views/EdgeFirewallRulesEngine/FormFields/FormFieldsEdgeFirewallRulesEngine.vue b/src/views/EdgeFirewallRulesEngine/FormFields/FormFieldsEdgeFirewallRulesEngine.vue
index fdf48ff80..703e04545 100644
--- a/src/views/EdgeFirewallRulesEngine/FormFields/FormFieldsEdgeFirewallRulesEngine.vue
+++ b/src/views/EdgeFirewallRulesEngine/FormFields/FormFieldsEdgeFirewallRulesEngine.vue
@@ -1,12 +1,12 @@
@@ -62,16 +95,18 @@
>
{
const { resources } = route.params
activeTab.value = resources ? 1 : 0
}
const changeRouteByClickingOnTab = (event) => {
+ changeTab(event.index)
+ }
+
+ const changeTab = (index) => {
const { id } = route.params
- const isResourcesTab = event.index === 1
+ const isResourcesTab = index === 1
activeTab.value = isResourcesTab ? 1 : 0
const params = {
id,
@@ -45,6 +59,25 @@
})
}
+ const visibleOnSaved = ref(false)
+
+ provide('unsaved', {
+ changeTab,
+ tabHasUpdate,
+ formHasUpdated,
+ visibleOnSaved
+ })
+
+ watch(activeTab, (newValue, oldValue) => {
+ if (visibleOnSaved.value) {
+ return
+ } else {
+ tabHasUpdate.oldTab = oldValue
+ tabHasUpdate.nextTab = newValue
+ tabHasUpdate.updated = Math.random()
+ }
+ })
+
renderTabCurrentRouter()
@@ -61,15 +94,17 @@
>
-
+
@@ -10,6 +13,10 @@
resetPasswordService: {
type: Function,
required: true
+ },
+ passwordSettingService: {
+ type: Function,
+ required: true
}
})
diff --git a/src/views/WafRules/FormFields/FormFieldsWafRules.vue b/src/views/WafRules/FormFields/FormFieldsWafRules.vue
index b25c3a00d..f59f411ef 100644
--- a/src/views/WafRules/FormFields/FormFieldsWafRules.vue
+++ b/src/views/WafRules/FormFields/FormFieldsWafRules.vue
@@ -67,7 +67,7 @@
>
-
+
diff --git a/yarn.lock b/yarn.lock
index 1fbdf449f..19f79946e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -700,6 +700,11 @@
resolved "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz"
integrity sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==
+"@feedback-fish/vue@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@feedback-fish/vue/-/vue-1.0.1.tgz#27ab8b04591dcd347b35411ed03616e7e833ad76"
+ integrity sha512-j50djPdr8pUuiQDSgzSpSZGFHcGBYL0pMvipuRsMjN7/tm57mE477N4TRRFvsU09F1mvOlmUGcVm124j7e/3IA==
+
"@guolao/vue-monaco-editor@^1.3.0":
version "1.3.0"
resolved "https://registry.npmjs.org/@guolao/vue-monaco-editor/-/vue-monaco-editor-1.3.0.tgz"