@@ -9,10 +9,8 @@ import { TooltipArrow } from 'radix-vue'
99import { ref } from ' vue'
1010
1111import type { TranslatedString } from ' @/lib/i18nString'
12- import usePersistentRef from ' @/lib/usePersistentRef'
1312
1413import CmkDialog from ' @/components/CmkDialog.vue'
15- import CmkIcon from ' @/components/CmkIcon'
1614import CmkSlideInDialog from ' @/components/CmkSlideInDialog.vue'
1715import CmkTooltip , {
1816 CmkTooltipContent ,
@@ -23,13 +21,12 @@ import CmkTooltip, {
2321import AgentSlideOutContent from ' @/mode-host/agent-connection-test/components/AgentSlideOutContent.vue'
2422
2523interface Props {
26- userId: string
2724 dialogTitle: TranslatedString
2825 dialogMessage: TranslatedString
29- dialogCloseIconTitle: TranslatedString
3026 slideInTitle: TranslatedString
3127 slideInButtonTitle: TranslatedString
32- hideButtonTitle: TranslatedString
28+ docsButtonTitle: TranslatedString
29+ docsUrl: string
3330 closeButtonTitle: TranslatedString
3431 agentSlideout: AgentSlideout
3532 isNotRegistered: boolean
@@ -41,10 +38,11 @@ const props = defineProps<Props>()
4138
4239const slideInOpen = ref (false )
4340
44- const localStorageKey = ` service-discovery-${ props . userId }-${ props . agentSlideout . host_name }-hidden `
45- const tooltipHidden = usePersistentRef ( localStorageKey , false , ( v ) => v as boolean )
46- const tooltipClosed = ref ( false )
41+ const openDocs = () => {
42+ window . open ( props . docsUrl , ' _blank ' )
43+ }
4744
45+ const tooltipOpen = ref (true )
4846// The rescan button always contains the current js call with all needed
4947// params. Solution is not the best but without VUE on the setup page we have
5048// limited options to solve this.
@@ -58,7 +56,7 @@ const triggerRescan = () => {
5856
5957<template >
6058 <CmkTooltipProvider >
61- <CmkTooltip :open =" !tooltipHidden && !tooltipClosed " class =" tooltip" >
59+ <CmkTooltip :open =" tooltipOpen " class =" tooltip" >
6260 <CmkTooltipTrigger as =" span" ></CmkTooltipTrigger >
6361 <CmkTooltipContent
6462 align =" center"
@@ -72,13 +70,7 @@ const triggerRescan = () => {
7270 :height =" 6"
7371 />
7472 <!-- eslint-disable-next-line vue/no-bare-strings-in-template -->
75- <CmkIcon
76- :title =" dialogCloseIconTitle"
77- class =" tooltip-close"
78- name =" close"
79- size =" small"
80- @click.stop =" tooltipClosed = true"
81- ></CmkIcon >
73+ <button class =" tooltip-close" @click.prevent =" tooltipOpen = false" >×</button >
8274 <CmkDialog
8375 :title =" dialogTitle"
8476 :message =" dialogMessage"
@@ -91,9 +83,9 @@ const triggerRescan = () => {
9183 variant: 'info'
9284 },
9385 {
94- title: hideButtonTitle ,
86+ title: docsButtonTitle ,
9587 onclick: () => {
96- tooltipHidden = true
88+ openDocs()
9789 },
9890 variant: 'optional'
9991 }
@@ -123,7 +115,7 @@ const triggerRescan = () => {
123115 :setup-error =" false"
124116 :agent-installed =" isNotRegistered"
125117 :is-push-mode =" false"
126- @close =" ((slideInOpen = false), (tooltipHidden = true ), triggerRescan())"
118+ @close =" ((slideInOpen = false), (tooltipOpen = false ), triggerRescan())"
127119 />
128120 </CmkSlideInDialog >
129121</template >
0 commit comments