-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathUpdateCypressModal.vue
57 lines (50 loc) · 1.54 KB
/
UpdateCypressModal.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
<StandardModal
class="transition duration-200 transition-all w-680px"
variant="bare"
:title="title"
:model-value="show"
@update:model-value="emits('close')"
>
<div class="p-24px text-gray-700">
<p class="mb-16px">
<i18n-t
scope="global"
keypath="topNav.updateCypress.currentlyRunning"
>
{{ installedVersion }}
</i18n-t>
<i18n-t
scope="global"
:keypath="props.projectName ? 'topNav.updateCypress.pasteToUpgradeProject' : 'topNav.updateCypress.pasteToUpgradeGlobal'"
>
<span class="font-bold">{{ t('topNav.updateCypress.rememberToCloseInsert') }}</span>
</i18n-t>
</p>
<TerminalPrompt
:command="installCommand + 'cypress@' + latestVersion"
:project-folder-name="projectName"
/>
</div>
</StandardModal>
</template>
<script setup lang="ts">
import StandardModal from '../../components/StandardModal.vue'
import TerminalPrompt from '../../components/TerminalPrompt.vue'
import { useI18n } from '@cy/i18n'
const { t } = useI18n()
const props = withDefaults(defineProps<{
installCommand?: string
installedVersion: string
latestVersion: string
projectName?: string
show: boolean
}>(), {
installCommand: 'npm install --save-dev ',
projectName: '', // in global mode, project won't be populated so an empty string is fine
})
const title = `${t('topNav.updateCypress.title')} ${props.latestVersion}`
const emits = defineEmits<{
(eventName: 'close'): void
}>()
</script>