WIP message-delivery-method-web-push
Main daploy / deploy (push) Successful in 1m22s

This commit is contained in:
2024-11-27 15:57:11 +02:00
parent 056247a414
commit 1c8019d41a
48 changed files with 464 additions and 128 deletions
@@ -40,7 +40,9 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, useTemplateRef, watch, nextTick } from 'vue'
import { messagesDbLocal as db, messagesDbRemote as remoteDb } from '@/api/dbs'
import { type MessageDocument } from '@/types/DBDocumentTypes'
import { type MessageDocument } from '@hereconnect/types'
import { getBrowserUuid } from '@/utils/getBrowserUuid'
import { getUserUuid } from '@/utils/getUserUuid'
const formRef = useTemplateRef('form')
const messagesContainerRef = useTemplateRef('messagesContainer')
@@ -84,9 +86,11 @@ async function sendMessage() {
type: 'message',
qr_code_uri,
chat,
created_at,
from: userRole,
body: newMessage.value.trim(),
browser_uuid: getBrowserUuid(),
user_uuid: getUserUuid(),
created_at,
}
try {
@@ -27,7 +27,7 @@
</template>
<script setup lang="ts">
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
import CreateMessageDeliveryOptionTelegram from '@/components/create/CreateMessageDeliveryOptionTelegram.vue'
import CreateMessageDeliveryOptionWebPush from '@/components/create/CreateMessageDeliveryOptionWebPush.vue'
import { ref } from 'vue'
@@ -17,7 +17,7 @@
</template>
<script setup lang="ts">
import type { QRCodeDocument } from '@/types/DBDocumentTypes'
import type { QRCodeDocument } from '@hereconnect/types'
import type { DeliveryOption } from '@/constants/deliveryOptions'
defineProps<{
@@ -9,7 +9,7 @@
</template>
<script setup lang="ts">
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
import { type DeliveryOption, DELIVERY_METHOD_TELEGRAM } from '@/constants/deliveryOptions'
import { computed } from 'vue'
@@ -42,7 +42,7 @@
</template>
<script setup lang="ts">
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
import { type DeliveryOption, DELIVERY_METHOD_WEB_PUSH } from '@/constants/deliveryOptions'
import { computed } from 'vue'
import { useQuery } from '@tanstack/vue-query'
@@ -19,7 +19,7 @@
<script setup lang="ts">
import { qrCodePlacements } from '@/constants/qrCodePlacements'
import type { QRCodeDocument } from '@/types/DBDocumentTypes'
import type { QRCodeDocument } from '@hereconnect/types'
const selectedPlacement = defineModel<null | QRCodeDocument['placement']>()
defineEmits(['nextStep'])
@@ -31,7 +31,7 @@
<script setup lang="ts">
import { nextTick, useTemplateRef, watch } from 'vue'
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
import { defaultMessages } from '@/constants/defaultMessages'
// Пропсы
@@ -14,7 +14,7 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import type { QRCodeDocument } from '@/types/DBDocumentTypes'
import type { QRCodeDocument } from '@hereconnect/types'
// Пропсы, которые будут передаваться из родительского компонента
const props = defineProps<{
@@ -14,7 +14,7 @@
</template>
<script setup lang="ts">
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
defineProps<{ buttonLabel: string }>()
const name = defineModel<QRCodeDocument['name']>('name')
const emit = defineEmits(['nextStep'])
@@ -13,7 +13,7 @@
import { computed } from 'vue'
import { VueMarkdownIt } from '@f3ve/vue-markdown-it'
import { useQuery } from '@tanstack/vue-query'
import { type QRCodeDocument } from '@/types/DBDocumentTypes'
import { type QRCodeDocument } from '@hereconnect/types'
// Импортируем все инструкции из директории
const importInstructions = import.meta.glob('/src/content/placementInstructions/*.md', {
@@ -48,7 +48,7 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import md5 from 'md5'
import type { ContactInfo } from '@/types/DBDocumentTypes'
import type { ContactInfo } from '@hereconnect/types'
import { sanitizeFileName } from '@/utils/sanitizeFileName'
const { contactInfo } = defineProps<{ contactInfo: ContactInfo }>()
@@ -45,8 +45,10 @@
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { messagesDbLocal as db } from '@/api/dbs'
import type { MessageDocument, QRCodeDocument } from '@/types/DBDocumentTypes'
import type { MessageDocument, QRCodeDocument } from '@hereconnect/types'
import { ROUTE_NAMES } from '@/constants/routes'
import { getUserUuid } from '@/utils/getUserUuid'
import { getBrowserUuid } from '@/utils/getBrowserUuid'
const { doc } = defineProps<{
doc: QRCodeDocument
@@ -76,6 +78,8 @@ async function sendMessage(content: string) {
chat,
created_at: new Date().toISOString(),
from: 'guest',
user_uuid: getUserUuid(),
browser_uuid: getBrowserUuid(),
body: content.trim(),
}