bfg-common 1.4.340 → 1.4.342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,12 @@
1
1
  <template>
2
2
  <common-layout-the-header-feedback-new
3
- v-if="isNewView"
4
- :is-show-feedback="props.isShowFeedback"
5
- :title="localization.common.sendFeedback"
3
+ v-if="props.isShowFeedback && isNewView"
4
+ v-model="feedbackForm"
6
5
  @hide="onHide"
7
6
  @submit="onSubmit"
8
7
  />
9
8
  <common-layout-the-header-feedback-old
10
- v-else
9
+ v-if="!isNewView"
11
10
  :is-show-feedback="props.isShowFeedback"
12
11
  :title="localization.common.sendFeedback"
13
12
  @show="emits('show')"
@@ -23,6 +22,7 @@ import type {
23
22
  UI_I_Localization,
24
23
  UI_I_NotifyBodyMessage,
25
24
  } from '~/lib/models/interfaces'
25
+ import { feedbackDefaultFormFunc } from '~/components/common/layout/theHeader/feedback/lib/config/sendFeedback'
26
26
 
27
27
  const props = defineProps<{
28
28
  isShowFeedback: boolean
@@ -33,12 +33,15 @@ const emits = defineEmits<{
33
33
  (event: 'hide'): void
34
34
  }>()
35
35
 
36
- const { $store }: any = useNuxtApp()
37
-
38
36
  const localization = computed<UI_I_Localization>(() => useLocal())
37
+ const { $store }: any = useNuxtApp()
39
38
 
40
39
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
41
40
 
41
+ const feedbackForm = ref<UI_I_FeedbackForm>(
42
+ useDeepCopy(feedbackDefaultFormFunc())
43
+ )
44
+
42
45
  const handleRequest = async (data: UI_I_FeedbackForm): Promise<boolean> => {
43
46
  const { error } = await useMyFetch<never, API_UI_I_Error>(
44
47
  'https://customer.aobfg.ru/api/v1/feedback',
@@ -0,0 +1,9 @@
1
+ import type { UI_I_FeedbackForm } from '~/components/common/feedback/lib/models/interfaces'
2
+ export const feedbackDefaultFormFunc = (): UI_I_FeedbackForm => {
3
+ return {
4
+ description: '',
5
+ type: 0,
6
+ email: '',
7
+ image: '', // base64
8
+ }
9
+ }
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <Teleport to="body">
3
+ <ui-modal
4
+ show
5
+ width="560px"
6
+ test-id="feedback-modal"
7
+ :title="localization.common.sendFeedback"
8
+ class="feedback"
9
+ @hide="onHideModal"
10
+ >
11
+ <template #content>
12
+ <ui-modal-block-standard>
13
+ <common-layout-the-header-feedback-new-subtitle />
14
+
15
+ <common-layout-the-header-feedback-new-tabs
16
+ v-model="selectedTab"
17
+ class="metrics-tabs"
18
+ />
19
+
20
+ <div
21
+ v-if="selectedTab === 'light-bulb'"
22
+ class="feedback__visit-portal"
23
+ >
24
+ {{ localization.common.useOurExternalIdeasPortal }}
25
+ </div>
26
+
27
+ <template v-else>
28
+ <common-layout-the-header-feedback-new-description
29
+ v-model="feedbackForm.description"
30
+ v-model:is-valid="isValidForm"
31
+ :selected-tab="selectedTab"
32
+ />
33
+
34
+ <common-layout-the-header-feedback-new-email
35
+ v-model="feedbackForm.email"
36
+ />
37
+ </template>
38
+ </ui-modal-block-standard>
39
+ </template>
40
+
41
+ <template #footerLeftContent><span /></template>
42
+
43
+ <template #footerContent>
44
+ <div class="flex gap-4">
45
+ <ui-button
46
+ v-if="selectedTab !== 'light-bulb'"
47
+ test-id="feedback-modal-hide-btn"
48
+ size="md"
49
+ variant="outline"
50
+ min-width="96px"
51
+ @click="onHideModal"
52
+ >
53
+ {{ localization.common.cancel }}
54
+ </ui-button>
55
+ <ui-button
56
+ test-id="feedback-modal-submit-btn"
57
+ size="md"
58
+ :disabled="!selectedTab"
59
+ min-width="96px"
60
+ @click="onSubmit"
61
+ >
62
+ {{ modalFooterButtonNames }}
63
+ </ui-button>
64
+ </div>
65
+ </template>
66
+ </ui-modal>
67
+ </Teleport>
68
+ </template>
69
+
70
+ <script setup lang="ts">
71
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
72
+ import type { UI_I_FeedbackForm } from '~/components/common/feedback/lib/models/interfaces'
73
+ import type { UI_T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
74
+
75
+ // const props = defineProps<{
76
+ // title: string
77
+ // }>()
78
+ // console.log(props)
79
+ const feedbackForm = defineModel<UI_I_FeedbackForm>({ required: true })
80
+ const emits = defineEmits<{
81
+ (event: 'hide'): void
82
+ }>()
83
+
84
+ const localization = computed<UI_I_Localization>(() => useLocal())
85
+
86
+ const isValidForm = ref<boolean>(true)
87
+ const selectedTab = ref<UI_T_FeedbackTab>()
88
+
89
+ const modalFooterButtonNames = computed(() => {
90
+ return selectedTab.value === 'light-bulb'
91
+ ? localization.value.common.visitIdeasPortal
92
+ : localization.value.common.send
93
+ })
94
+
95
+ const onHideModal = (): void => {
96
+ emits('hide')
97
+ }
98
+ const onSubmit = (): void => {
99
+ if (selectedTab.value === 'light-bulb') {
100
+ const targetUrl = 'https://customer.aobfg.ru/' // Ваш URL
101
+ window.open(targetUrl, '_blank')
102
+ return
103
+ }
104
+
105
+ isValidForm.value = !!feedbackForm.value.description
106
+
107
+ if (!isValidForm.value) return
108
+ }
109
+ </script>
110
+
111
+ <style lang="scss">
112
+ :root {
113
+ --description-color: #414b57;
114
+ --link-visited-color: #5659b8;
115
+ }
116
+
117
+ :root.dark-theme {
118
+ --description-color: #adbbc4;
119
+ --link-visited-color: #49afd9;
120
+ }
121
+
122
+ .feedback {
123
+ &__visit-portal {
124
+ color: #4d5d69;
125
+ font-size: 13px;
126
+ font-weight: 400;
127
+ line-height: 15.73px;
128
+ margin-top: 24px;
129
+ }
130
+ }
131
+ </style>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div class="description">
3
+ <h4 class="description__title">{{ localization.common.description }}</h4>
4
+
5
+ <ui-textarea
6
+ v-model="descriptionModelLocal"
7
+ test-id="feedback-description"
8
+ :disabled="!selectedTab"
9
+ :placeholder="descriptionTextPlaceholder"
10
+ :error="descriptionErrorText"
11
+ >
12
+ </ui-textarea>
13
+ </div>
14
+ </template>
15
+
16
+ <script lang="ts" setup>
17
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
18
+ import type { UI_T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
19
+
20
+ const props = defineProps<{
21
+ selectedTab: UI_T_FeedbackTab
22
+ }>()
23
+ const descriptionModelLocal = defineModel<string>({ required: true })
24
+ const isValidModel = defineModel<boolean>('isValid', { required: true })
25
+
26
+ const localization = computed<UI_I_Localization>(() => useLocal())
27
+
28
+ const descriptionTextPlaceholder = computed<string>(() => {
29
+ if (props.selectedTab === 'warning-outline')
30
+ return localization.value.common.whatIsTheProblemHowCan
31
+ if (props.selectedTab === 'heart-outline')
32
+ return localization.value.common.tellUsWhatYouEnjoyedSo
33
+ return localization.value.common.selectFeedbackType
34
+ })
35
+
36
+ const descriptionErrorText = computed<boolean>(() => {
37
+ return !isValidModel.value && !descriptionModelLocal.value
38
+ ? localization.value.common.fieldRequired
39
+ : ''
40
+ })
41
+ </script>
42
+
43
+ <style lang="scss" scoped>
44
+ .description {
45
+ margin-top: 32px;
46
+ &__title {
47
+ line-height: 38px;
48
+ margin-bottom: 16px;
49
+ font-size: 16px;
50
+ font-weight: 500;
51
+ color: #4d5d69;
52
+ }
53
+ :deep(.ui-main-textarea) {
54
+ resize: none;
55
+ height: 68px;
56
+ }
57
+ }
58
+ </style>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div class="email">
3
+ <h4 class="email__title">{{ localization.common.emailAddress }}</h4>
4
+
5
+ <ui-input
6
+ v-model="emailModelLocal"
7
+ type="text"
8
+ placeholder="placeholder"
9
+ test-id="feedback-email"
10
+ />
11
+ </div>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
16
+
17
+ const localization = computed<UI_I_Localization>(() => useLocal())
18
+
19
+ const emailModelLocal = defineModel<string>({ required: true })
20
+ </script>
21
+
22
+ <style scoped lang="scss">
23
+ .email {
24
+ margin-top: 32px;
25
+ &__title {
26
+ line-height: 38px;
27
+ margin-bottom: 16px;
28
+ font-size: 16px;
29
+ font-weight: 500;
30
+ color: #4d5d69;
31
+ }
32
+ }
33
+ </style>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div class="subtitle">
3
+ <span class="subtitle__label">
4
+ {{ localization.common.helpUsImprove }}
5
+ </span>
6
+ <ui-icon
7
+ id="feedback-description-info-icon"
8
+ name="info"
9
+ width="18"
10
+ height="18"
11
+ :color="isShowInfo ? '#008FD6' : '#9DA6AD'"
12
+ class="info-icon pointer"
13
+ @click="isShowInfo = !isShowInfo"
14
+ />
15
+ <ui-popup-window
16
+ v-model="isShowInfo"
17
+ width="232px"
18
+ :elem-id="'feedback-description-info-icon'"
19
+ >
20
+ <div class="common-widget-info">
21
+ <div class="headline justify-between flex-align-center">
22
+ <div class="flex-align-center">
23
+ <ui-icon-icon3 name="info-2" width="16px" height="16px" />
24
+ <span class="title">{{ localization.common.feedbackHelp }}</span>
25
+ </div>
26
+ <ui-icon
27
+ name="close"
28
+ class="pointer hide-icon"
29
+ width="16px"
30
+ height="16px"
31
+ @click="isShowInfo = false"
32
+ />
33
+ </div>
34
+
35
+ <div class="common-widget-info-description">
36
+ {{ localization.common.anyFeedbackYouProvideMay }}
37
+ </div>
38
+ </div>
39
+ </ui-popup-window>
40
+ </div>
41
+ </template>
42
+
43
+ <script lang="ts" setup>
44
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
45
+
46
+ const localization = computed<UI_I_Localization>(() => useLocal())
47
+
48
+ const isShowInfo = ref<boolean>(false)
49
+ </script>
50
+
51
+ <style lang="scss" scoped>
52
+ .subtitle {
53
+ display: flex;
54
+ justify-content: space-between;
55
+ border-bottom: 1px solid #e9ebed;
56
+ padding-bottom: 12px;
57
+
58
+ &__label {
59
+ font-size: 12px;
60
+ font-weight: 400;
61
+ line-height: 14.52px;
62
+ color: #9da6ad;
63
+ }
64
+ .common-widget-info {
65
+ padding: 16px;
66
+
67
+ .title {
68
+ font-size: 14px;
69
+ font-weight: 500;
70
+ line-height: 16.94px;
71
+ color: var(--zabbix-text-color);
72
+ margin-left: 8px;
73
+ }
74
+
75
+ .common-widget-info-description {
76
+ font-size: 13px;
77
+ line-height: 15.73px;
78
+ color: var(--zabbix-text-color);
79
+ margin-top: 12px;
80
+ }
81
+ }
82
+ }
83
+ </style>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <div class="tabs">
3
+ <h4 class="tabs__title">{{ localization.common.selectType }}</h4>
4
+
5
+ <div class="tabs__container">
6
+ <ui-block
7
+ v-for="item in tabs"
8
+ :key="item.iconName"
9
+ :class="{ selected: item.isSelected }"
10
+ @click="selectedTab = item.iconName"
11
+ >
12
+ <div class="main-info">
13
+ <ui-icon :name="item.iconName" width="18" height="18" />
14
+ <span class="main-info-label">{{ item.label }}</span>
15
+ </div>
16
+ </ui-block>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
23
+ import type { T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
24
+ // import type { I_Metric } from '~/components/layout/new/tabs/lib/models/interfaces'
25
+ import { tabsFunc } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/config/tabs'
26
+
27
+ const localization = computed<UI_I_Localization>(() => useLocal())
28
+
29
+ const selectedTab = defineModel<T_FeedbackTab>({ required: true })
30
+ const tabs = computed<any[]>(() =>
31
+ tabsFunc(localization.value, selectedTab.value)
32
+ )
33
+ </script>
34
+
35
+ <style scoped lang="scss">
36
+ .tabs {
37
+ margin-top: 16px;
38
+ &__title {
39
+ line-height: 38px;
40
+ margin-bottom: 16px;
41
+ font-size: 16px;
42
+ font-weight: 500;
43
+ color: #4d5d69;
44
+ }
45
+ &__container {
46
+ display: flex;
47
+ gap: 12px;
48
+ }
49
+
50
+ :deep(.block) {
51
+ width: max-content;
52
+ padding: 10px 12px;
53
+ color: #4d5d69;
54
+ cursor: pointer;
55
+ }
56
+ :deep(.block.selected) {
57
+ border: 1.5px solid #008fd6;
58
+ color: #008fd6;
59
+ cursor: default;
60
+
61
+ .main-info,
62
+ .main-info-label {
63
+ color: #008fd6;
64
+ }
65
+ }
66
+
67
+ .main-info {
68
+ display: flex;
69
+ align-items: center;
70
+ gap: 8px;
71
+
72
+ &-label {
73
+ font-size: 16px;
74
+ font-weight: 500;
75
+ line-height: 19.36px;
76
+ }
77
+ }
78
+ }
79
+ </style>
@@ -0,0 +1,25 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { T_FeedbackTab } from '~/components/common/layout/theHeader/feedback/new/tabs/lib/models/types'
3
+
4
+ export const tabsFunc = (
5
+ localization: UI_I_Localization,
6
+ selectedTab: T_FeedbackTab
7
+ ): any[] => {
8
+ return [
9
+ {
10
+ iconName: 'warning-outline',
11
+ label: localization.common.problem,
12
+ isSelected: selectedTab === 'warning-outline',
13
+ },
14
+ {
15
+ iconName: 'heart-outline',
16
+ label: localization.common.complement,
17
+ isSelected: selectedTab === 'heart-outline',
18
+ },
19
+ {
20
+ iconName: 'light-bulb',
21
+ label: localization.common.idea,
22
+ isSelected: selectedTab === 'light-bulb',
23
+ },
24
+ ]
25
+ }
@@ -0,0 +1,17 @@
1
+ import type {
2
+ T_MetricTab
3
+ } from '~/components/common/pages/integration/zabbix/content/hosts/details/metrics/lib/models/types'
4
+
5
+ export interface I_Metric {
6
+ iconName: T_MetricTab
7
+ label: string
8
+ isSelected: boolean
9
+ on: {
10
+ label: string
11
+ color: '#239332' | '#BDC3C7'
12
+ }
13
+ off: {
14
+ label: string
15
+ color: '#EA3223' | '#BDC3C7'
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ export type UI_T_FeedbackTab = 'warning-outline' | 'heart-outline' | 'light-bulb'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.340",
4
+ "version": "1.4.342",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,63 +0,0 @@
1
- <template>
2
- <Teleport to="body">
3
- <common-feedback
4
- width="576px"
5
- :show="props.isShowFeedback"
6
- :title="props.title"
7
- @hide="emits('hide')"
8
- @submit="emits('submit', $event)"
9
- />
10
- </Teleport>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import type { UI_I_FeedbackForm } from '~/components/common/feedback/lib/models/interfaces'
15
-
16
- const props = defineProps<{
17
- isShowFeedback: boolean
18
- title: string
19
- }>()
20
-
21
- const emits = defineEmits<{
22
- (event: 'hide'): void
23
- (event: 'submit', value: UI_I_FeedbackForm): void
24
- }>()
25
- </script>
26
-
27
- <style lang="scss">
28
- :root {
29
- --description-color: #414b57;
30
- --link-visited-color: #5659b8;
31
- }
32
-
33
- :root.dark-theme {
34
- --description-color: #adbbc4;
35
- --link-visited-color: #49afd9;
36
- }
37
-
38
- .feedback {
39
- width: 60px;
40
- height: 60px;
41
- display: flex;
42
- flex-direction: column;
43
- justify-content: center;
44
- align-items: center;
45
- fill: #fafafa;
46
-
47
- &-icon {
48
- width: 24px;
49
- height: 24px;
50
- opacity: 0.65;
51
- cursor: pointer;
52
- }
53
- &-icon:hover {
54
- opacity: 1;
55
- }
56
- }
57
- .about-vsphere-dialog-legal-section {
58
- color: var(--description-color);
59
- a {
60
- color: var(--link-visited-color);
61
- }
62
- }
63
- </style>